a zip code crypto-currency system good for red ONLY

vendor.js 4.4MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010560115601256013560145601556016560175601856019560205602156022560235602456025560265602756028560295603056031560325603356034560355603656037560385603956040560415604256043560445604556046560475604856049560505605156052560535605456055560565605756058560595606056061560625606356064560655606656067560685606956070560715607256073560745607556076560775607856079560805608156082560835608456085560865608756088560895609056091560925609356094560955609656097560985609956100561015610256103561045610556106561075610856109561105611156112561135611456115561165611756118561195612056121561225612356124561255612656127561285612956130561315613256133561345613556136561375613856139561405614156142561435614456145561465614756148561495615056151561525615356154561555615656157561585615956160561615616256163561645616556166561675616856169561705617156172561735617456175561765617756178561795618056181561825618356184561855618656187561885618956190561915619256193561945619556196561975619856199562005620156202562035620456205562065620756208562095621056211562125621356214562155621656217562185621956220562215622256223562245622556226562275622856229562305623156232562335623456235562365623756238562395624056241562425624356244562455624656247562485624956250562515625256253562545625556256562575625856259562605626156262562635626456265562665626756268562695627056271562725627356274562755627656277562785627956280562815628256283562845628556286562875628856289562905629156292562935629456295562965629756298562995630056301563025630356304563055630656307563085630956310563115631256313563145631556316563175631856319563205632156322563235632456325563265632756328563295633056331563325633356334563355633656337563385633956340563415634256343563445634556346563475634856349563505635156352563535635456355563565635756358563595636056361563625636356364563655636656367563685636956370563715637256373563745637556376563775637856379563805638156382563835638456385563865638756388563895639056391563925639356394563955639656397563985639956400564015640256403564045640556406564075640856409564105641156412564135641456415564165641756418564195642056421564225642356424564255642656427564285642956430564315643256433564345643556436564375643856439564405644156442564435644456445564465644756448564495645056451564525645356454564555645656457564585645956460564615646256463564645646556466564675646856469564705647156472564735647456475564765647756478564795648056481564825648356484564855648656487564885648956490564915649256493564945649556496564975649856499565005650156502565035650456505565065650756508565095651056511565125651356514565155651656517565185651956520565215652256523565245652556526565275652856529565305653156532565335653456535565365653756538565395654056541565425654356544565455654656547565485654956550565515655256553565545655556556565575655856559565605656156562565635656456565565665656756568565695657056571565725657356574565755657656577565785657956580565815658256583565845658556586565875658856589565905659156592565935659456595565965659756598565995660056601566025660356604566055660656607566085660956610566115661256613566145661556616566175661856619566205662156622566235662456625566265662756628566295663056631566325663356634566355663656637566385663956640566415664256643566445664556646566475664856649566505665156652566535665456655566565665756658566595666056661566625666356664566655666656667566685666956670566715667256673566745667556676566775667856679566805668156682566835668456685566865668756688566895669056691566925669356694566955669656697566985669956700567015670256703567045670556706567075670856709567105671156712567135671456715567165671756718567195672056721567225672356724567255672656727567285672956730567315673256733567345673556736567375673856739567405674156742567435674456745567465674756748567495675056751567525675356754567555675656757567585675956760567615676256763567645676556766567675676856769567705677156772567735677456775567765677756778567795678056781567825678356784567855678656787567885678956790567915679256793567945679556796567975679856799568005680156802568035680456805568065680756808568095681056811568125681356814568155681656817568185681956820568215682256823568245682556826568275682856829568305683156832568335683456835568365683756838568395684056841568425684356844568455684656847568485684956850568515685256853568545685556856568575685856859568605686156862568635686456865568665686756868568695687056871568725687356874568755687656877568785687956880568815688256883568845688556886568875688856889568905689156892568935689456895568965689756898568995690056901569025690356904569055690656907569085690956910569115691256913569145691556916569175691856919569205692156922569235692456925569265692756928569295693056931569325693356934569355693656937569385693956940569415694256943569445694556946569475694856949569505695156952569535695456955569565695756958569595696056961569625696356964569655696656967569685696956970569715697256973569745697556976569775697856979569805698156982569835698456985569865698756988569895699056991569925699356994569955699656997569985699957000570015700257003570045700557006570075700857009570105701157012570135701457015570165701757018570195702057021570225702357024570255702657027570285702957030570315703257033570345703557036570375703857039570405704157042570435704457045570465704757048570495705057051570525705357054570555705657057570585705957060570615706257063570645706557066570675706857069570705707157072570735707457075570765707757078570795708057081570825708357084570855708657087570885708957090570915709257093570945709557096570975709857099571005710157102571035710457105571065710757108571095711057111571125711357114571155711657117571185711957120571215712257123571245712557126571275712857129571305713157132571335713457135571365713757138571395714057141571425714357144571455714657147571485714957150571515715257153571545715557156571575715857159571605716157162571635716457165571665716757168571695717057171571725717357174571755717657177571785717957180571815718257183571845718557186571875718857189571905719157192571935719457195571965719757198571995720057201572025720357204572055720657207572085720957210572115721257213572145721557216572175721857219572205722157222572235722457225572265722757228572295723057231572325723357234572355723657237572385723957240572415724257243572445724557246572475724857249572505725157252572535725457255572565725757258572595726057261572625726357264572655726657267572685726957270572715727257273572745727557276572775727857279572805728157282572835728457285572865728757288572895729057291572925729357294572955729657297572985729957300573015730257303573045730557306573075730857309573105731157312573135731457315573165731757318573195732057321573225732357324573255732657327573285732957330573315733257333573345733557336573375733857339573405734157342573435734457345573465734757348573495735057351573525735357354573555735657357573585735957360573615736257363573645736557366573675736857369573705737157372573735737457375573765737757378573795738057381573825738357384573855738657387573885738957390573915739257393573945739557396573975739857399574005740157402574035740457405574065740757408574095741057411574125741357414574155741657417574185741957420574215742257423574245742557426574275742857429574305743157432574335743457435574365743757438574395744057441574425744357444574455744657447574485744957450574515745257453574545745557456574575745857459574605746157462574635746457465574665746757468574695747057471574725747357474574755747657477574785747957480574815748257483574845748557486574875748857489574905749157492574935749457495574965749757498574995750057501575025750357504575055750657507575085750957510575115751257513575145751557516575175751857519575205752157522575235752457525575265752757528575295753057531575325753357534575355753657537575385753957540575415754257543575445754557546575475754857549575505755157552575535755457555575565755757558575595756057561575625756357564575655756657567575685756957570575715757257573575745757557576575775757857579575805758157582575835758457585575865758757588575895759057591575925759357594575955759657597575985759957600576015760257603576045760557606576075760857609576105761157612576135761457615576165761757618576195762057621576225762357624576255762657627576285762957630576315763257633576345763557636576375763857639576405764157642576435764457645576465764757648576495765057651576525765357654576555765657657576585765957660576615766257663576645766557666576675766857669576705767157672576735767457675576765767757678576795768057681576825768357684576855768657687576885768957690576915769257693576945769557696576975769857699577005770157702577035770457705577065770757708577095771057711577125771357714577155771657717577185771957720577215772257723577245772557726577275772857729577305773157732577335773457735577365773757738577395774057741577425774357744577455774657747577485774957750577515775257753577545775557756577575775857759577605776157762577635776457765577665776757768577695777057771577725777357774577755777657777577785777957780577815778257783577845778557786577875778857789577905779157792577935779457795577965779757798577995780057801578025780357804578055780657807578085780957810578115781257813578145781557816578175781857819578205782157822578235782457825578265782757828578295783057831578325783357834578355783657837578385783957840578415784257843578445784557846578475784857849578505785157852578535785457855578565785757858578595786057861578625786357864578655786657867578685786957870578715787257873578745787557876578775787857879578805788157882578835788457885578865788757888578895789057891578925789357894578955789657897578985789957900579015790257903579045790557906579075790857909579105791157912579135791457915579165791757918579195792057921579225792357924579255792657927579285792957930579315793257933579345793557936579375793857939579405794157942579435794457945579465794757948579495795057951579525795357954579555795657957579585795957960579615796257963579645796557966579675796857969579705797157972579735797457975579765797757978579795798057981579825798357984579855798657987579885798957990579915799257993579945799557996579975799857999580005800158002580035800458005580065800758008580095801058011580125801358014580155801658017580185801958020580215802258023580245802558026580275802858029580305803158032580335803458035580365803758038580395804058041580425804358044580455804658047580485804958050580515805258053580545805558056580575805858059580605806158062580635806458065580665806758068580695807058071580725807358074580755807658077580785807958080580815808258083580845808558086580875808858089580905809158092580935809458095580965809758098580995810058101581025810358104581055810658107581085810958110581115811258113581145811558116581175811858119581205812158122581235812458125581265812758128581295813058131581325813358134581355813658137581385813958140581415814258143581445814558146581475814858149581505815158152581535815458155581565815758158581595816058161581625816358164581655816658167581685816958170581715817258173581745817558176581775817858179581805818158182581835818458185581865818758188581895819058191581925819358194581955819658197581985819958200582015820258203582045820558206582075820858209582105821158212582135821458215582165821758218582195822058221582225822358224582255822658227582285822958230582315823258233582345823558236582375823858239582405824158242582435824458245582465824758248582495825058251582525825358254582555825658257582585825958260582615826258263582645826558266582675826858269582705827158272582735827458275582765827758278582795828058281582825828358284582855828658287582885828958290582915829258293582945829558296582975829858299583005830158302583035830458305583065830758308583095831058311583125831358314583155831658317583185831958320583215832258323583245832558326583275832858329583305833158332583335833458335583365833758338583395834058341583425834358344583455834658347583485834958350583515835258353583545835558356583575835858359583605836158362583635836458365583665836758368583695837058371583725837358374583755837658377583785837958380583815838258383583845838558386583875838858389583905839158392583935839458395583965839758398583995840058401584025840358404584055840658407584085840958410584115841258413584145841558416584175841858419584205842158422584235842458425584265842758428584295843058431584325843358434584355843658437584385843958440584415844258443584445844558446584475844858449584505845158452584535845458455584565845758458584595846058461584625846358464584655846658467584685846958470584715847258473584745847558476584775847858479584805848158482584835848458485584865848758488584895849058491584925849358494584955849658497584985849958500585015850258503585045850558506585075850858509585105851158512585135851458515585165851758518585195852058521585225852358524585255852658527585285852958530585315853258533585345853558536585375853858539585405854158542585435854458545585465854758548585495855058551585525855358554585555855658557585585855958560585615856258563585645856558566585675856858569585705857158572585735857458575585765857758578585795858058581585825858358584585855858658587585885858958590585915859258593585945859558596585975859858599586005860158602586035860458605586065860758608586095861058611586125861358614586155861658617586185861958620586215862258623586245862558626586275862858629586305863158632586335863458635586365863758638586395864058641586425864358644586455864658647586485864958650586515865258653586545865558656586575865858659586605866158662586635866458665586665866758668586695867058671586725867358674586755867658677586785867958680586815868258683586845868558686586875868858689586905869158692586935869458695586965869758698586995870058701587025870358704587055870658707587085870958710587115871258713587145871558716587175871858719587205872158722587235872458725587265872758728587295873058731587325873358734587355873658737587385873958740587415874258743587445874558746587475874858749587505875158752587535875458755587565875758758587595876058761587625876358764587655876658767587685876958770587715877258773587745877558776587775877858779587805878158782587835878458785587865878758788587895879058791587925879358794587955879658797587985879958800588015880258803588045880558806588075880858809588105881158812588135881458815588165881758818588195882058821588225882358824588255882658827588285882958830588315883258833588345883558836588375883858839588405884158842588435884458845588465884758848588495885058851588525885358854588555885658857588585885958860588615886258863588645886558866588675886858869588705887158872588735887458875588765887758878588795888058881588825888358884588855888658887588885888958890588915889258893588945889558896588975889858899589005890158902589035890458905589065890758908589095891058911589125891358914589155891658917589185891958920589215892258923589245892558926589275892858929589305893158932589335893458935589365893758938589395894058941589425894358944589455894658947589485894958950589515895258953589545895558956589575895858959589605896158962589635896458965589665896758968589695897058971589725897358974589755897658977589785897958980589815898258983589845898558986589875898858989589905899158992589935899458995589965899758998589995900059001590025900359004590055900659007590085900959010590115901259013590145901559016590175901859019590205902159022590235902459025590265902759028590295903059031590325903359034590355903659037590385903959040590415904259043590445904559046590475904859049590505905159052590535905459055590565905759058590595906059061590625906359064590655906659067590685906959070590715907259073590745907559076590775907859079590805908159082590835908459085590865908759088590895909059091590925909359094590955909659097590985909959100591015910259103591045910559106591075910859109591105911159112591135911459115591165911759118591195912059121591225912359124591255912659127591285912959130591315913259133591345913559136591375913859139591405914159142591435914459145591465914759148591495915059151591525915359154591555915659157591585915959160591615916259163591645916559166591675916859169591705917159172591735917459175591765917759178591795918059181591825918359184591855918659187591885918959190591915919259193591945919559196591975919859199592005920159202592035920459205592065920759208592095921059211592125921359214592155921659217592185921959220592215922259223592245922559226592275922859229592305923159232592335923459235592365923759238592395924059241592425924359244592455924659247592485924959250592515925259253592545925559256592575925859259592605926159262592635926459265592665926759268592695927059271592725927359274592755927659277592785927959280592815928259283592845928559286592875928859289592905929159292592935929459295592965929759298592995930059301593025930359304593055930659307593085930959310593115931259313593145931559316593175931859319593205932159322593235932459325593265932759328593295933059331593325933359334593355933659337593385933959340593415934259343593445934559346593475934859349593505935159352593535935459355593565935759358593595936059361593625936359364593655936659367593685936959370593715937259373593745937559376593775937859379593805938159382593835938459385593865938759388593895939059391593925939359394593955939659397593985939959400594015940259403594045940559406594075940859409594105941159412594135941459415594165941759418594195942059421594225942359424594255942659427594285942959430594315943259433594345943559436594375943859439594405944159442594435944459445594465944759448594495945059451594525945359454594555945659457594585945959460594615946259463594645946559466594675946859469594705947159472594735947459475594765947759478594795948059481594825948359484594855948659487594885948959490594915949259493594945949559496594975949859499595005950159502595035950459505595065950759508595095951059511595125951359514595155951659517595185951959520595215952259523595245952559526595275952859529595305953159532595335953459535595365953759538595395954059541595425954359544595455954659547595485954959550595515955259553595545955559556595575955859559595605956159562595635956459565595665956759568595695957059571595725957359574595755957659577595785957959580595815958259583595845958559586595875958859589595905959159592595935959459595595965959759598595995960059601596025960359604596055960659607596085960959610596115961259613596145961559616596175961859619596205962159622596235962459625596265962759628596295963059631596325963359634596355963659637596385963959640596415964259643596445964559646596475964859649596505965159652596535965459655596565965759658596595966059661596625966359664596655966659667596685966959670596715967259673596745967559676596775967859679596805968159682596835968459685596865968759688596895969059691596925969359694596955969659697596985969959700597015970259703597045970559706597075970859709597105971159712597135971459715597165971759718597195972059721597225972359724597255972659727597285972959730597315973259733597345973559736597375973859739597405974159742597435974459745597465974759748597495975059751597525975359754597555975659757597585975959760597615976259763597645976559766597675976859769597705977159772597735977459775597765977759778597795978059781597825978359784597855978659787597885978959790597915979259793597945979559796597975979859799598005980159802598035980459805598065980759808598095981059811598125981359814598155981659817598185981959820598215982259823598245982559826598275982859829598305983159832598335983459835598365983759838598395984059841598425984359844598455984659847598485984959850598515985259853598545985559856598575985859859598605986159862598635986459865598665986759868598695987059871598725987359874598755987659877598785987959880598815988259883598845988559886598875988859889598905989159892598935989459895598965989759898598995990059901599025990359904599055990659907599085990959910599115991259913599145991559916599175991859919599205992159922599235992459925599265992759928599295993059931599325993359934599355993659937599385993959940599415994259943599445994559946599475994859949599505995159952599535995459955599565995759958599595996059961599625996359964599655996659967599685996959970599715997259973599745997559976599775997859979599805998159982599835998459985599865998759988599895999059991599925999359994599955999659997599985999960000600016000260003600046000560006600076000860009600106001160012600136001460015600166001760018600196002060021600226002360024600256002660027600286002960030600316003260033600346003560036600376003860039600406004160042600436004460045600466004760048600496005060051600526005360054600556005660057600586005960060600616006260063600646006560066600676006860069600706007160072600736007460075600766007760078600796008060081600826008360084600856008660087600886008960090600916009260093600946009560096600976009860099601006010160102601036010460105601066010760108601096011060111601126011360114601156011660117601186011960120601216012260123601246012560126601276012860129601306013160132601336013460135601366013760138601396014060141601426014360144601456014660147601486014960150601516015260153601546015560156601576015860159601606016160162601636016460165601666016760168601696017060171601726017360174601756017660177601786017960180601816018260183601846018560186601876018860189601906019160192601936019460195601966019760198601996020060201602026020360204602056020660207602086020960210602116021260213602146021560216602176021860219602206022160222602236022460225602266022760228602296023060231602326023360234602356023660237602386023960240602416024260243602446024560246602476024860249602506025160252602536025460255602566025760258602596026060261602626026360264602656026660267602686026960270602716027260273602746027560276602776027860279602806028160282602836028460285602866028760288602896029060291602926029360294602956029660297602986029960300603016030260303603046030560306603076030860309603106031160312603136031460315603166031760318603196032060321603226032360324603256032660327603286032960330603316033260333603346033560336603376033860339603406034160342603436034460345603466034760348603496035060351603526035360354603556035660357603586035960360603616036260363603646036560366603676036860369603706037160372603736037460375603766037760378603796038060381603826038360384603856038660387603886038960390603916039260393603946039560396603976039860399604006040160402604036040460405604066040760408604096041060411604126041360414604156041660417604186041960420604216042260423604246042560426604276042860429604306043160432604336043460435604366043760438604396044060441604426044360444604456044660447604486044960450604516045260453604546045560456604576045860459604606046160462604636046460465604666046760468604696047060471604726047360474604756047660477604786047960480604816048260483604846048560486604876048860489604906049160492604936049460495604966049760498604996050060501605026050360504605056050660507605086050960510605116051260513605146051560516605176051860519605206052160522605236052460525605266052760528605296053060531605326053360534605356053660537605386053960540605416054260543605446054560546605476054860549605506055160552605536055460555605566055760558605596056060561605626056360564605656056660567605686056960570605716057260573605746057560576605776057860579605806058160582605836058460585605866058760588605896059060591605926059360594605956059660597605986059960600606016060260603606046060560606606076060860609606106061160612606136061460615606166061760618606196062060621606226062360624606256062660627606286062960630606316063260633606346063560636606376063860639606406064160642606436064460645606466064760648606496065060651606526065360654606556065660657606586065960660606616066260663606646066560666606676066860669606706067160672606736067460675606766067760678606796068060681606826068360684606856068660687606886068960690606916069260693606946069560696606976069860699607006070160702607036070460705607066070760708607096071060711607126071360714607156071660717607186071960720607216072260723607246072560726607276072860729607306073160732607336073460735607366073760738607396074060741607426074360744607456074660747607486074960750607516075260753607546075560756607576075860759607606076160762607636076460765607666076760768607696077060771607726077360774607756077660777607786077960780607816078260783607846078560786607876078860789607906079160792607936079460795607966079760798607996080060801608026080360804608056080660807608086080960810608116081260813608146081560816608176081860819608206082160822608236082460825608266082760828608296083060831608326083360834608356083660837608386083960840608416084260843608446084560846608476084860849608506085160852608536085460855608566085760858608596086060861608626086360864608656086660867608686086960870608716087260873608746087560876608776087860879608806088160882608836088460885608866088760888608896089060891608926089360894608956089660897608986089960900609016090260903609046090560906609076090860909609106091160912609136091460915609166091760918609196092060921609226092360924609256092660927609286092960930609316093260933609346093560936609376093860939609406094160942609436094460945609466094760948609496095060951609526095360954609556095660957609586095960960609616096260963609646096560966609676096860969609706097160972609736097460975609766097760978609796098060981609826098360984609856098660987609886098960990609916099260993609946099560996609976099860999610006100161002610036100461005610066100761008610096101061011610126101361014610156101661017610186101961020610216102261023610246102561026610276102861029610306103161032610336103461035610366103761038610396104061041610426104361044610456104661047610486104961050610516105261053610546105561056610576105861059610606106161062610636106461065610666106761068610696107061071610726107361074610756107661077610786107961080610816108261083610846108561086610876108861089610906109161092610936109461095610966109761098610996110061101611026110361104611056110661107611086110961110611116111261113611146111561116611176111861119611206112161122611236112461125611266112761128611296113061131611326113361134611356113661137611386113961140611416114261143611446114561146611476114861149611506115161152611536115461155611566115761158611596116061161611626116361164611656116661167611686116961170611716117261173611746117561176611776117861179611806118161182611836118461185611866118761188611896119061191611926119361194611956119661197611986119961200612016120261203612046120561206612076120861209612106121161212612136121461215612166121761218612196122061221612226122361224612256122661227612286122961230612316123261233612346123561236612376123861239612406124161242612436124461245612466124761248612496125061251612526125361254612556125661257612586125961260612616126261263612646126561266612676126861269612706127161272612736127461275612766127761278612796128061281612826128361284612856128661287612886128961290612916129261293612946129561296612976129861299613006130161302613036130461305613066130761308613096131061311613126131361314613156131661317613186131961320613216132261323613246132561326613276132861329613306133161332613336133461335613366133761338613396134061341613426134361344613456134661347613486134961350613516135261353613546135561356613576135861359613606136161362613636136461365613666136761368613696137061371613726137361374613756137661377613786137961380613816138261383613846138561386613876138861389613906139161392613936139461395613966139761398613996140061401614026140361404614056140661407614086140961410614116141261413614146141561416614176141861419614206142161422614236142461425614266142761428614296143061431614326143361434614356143661437614386143961440614416144261443614446144561446614476144861449614506145161452614536145461455614566145761458614596146061461614626146361464614656146661467614686146961470614716147261473614746147561476614776147861479614806148161482614836148461485614866148761488614896149061491614926149361494614956149661497614986149961500615016150261503615046150561506615076150861509615106151161512615136151461515615166151761518615196152061521615226152361524615256152661527615286152961530615316153261533615346153561536615376153861539615406154161542615436154461545615466154761548615496155061551615526155361554615556155661557615586155961560615616156261563615646156561566615676156861569615706157161572615736157461575615766157761578615796158061581615826158361584615856158661587615886158961590615916159261593615946159561596615976159861599616006160161602616036160461605616066160761608616096161061611616126161361614616156161661617616186161961620616216162261623616246162561626616276162861629616306163161632616336163461635616366163761638616396164061641616426164361644616456164661647616486164961650616516165261653616546165561656616576165861659616606166161662616636166461665616666166761668616696167061671616726167361674616756167661677616786167961680616816168261683616846168561686616876168861689616906169161692616936169461695616966169761698616996170061701617026170361704617056170661707617086170961710617116171261713617146171561716617176171861719617206172161722617236172461725617266172761728617296173061731617326173361734617356173661737617386173961740617416174261743617446174561746617476174861749617506175161752617536175461755617566175761758617596176061761617626176361764617656176661767617686176961770617716177261773617746177561776617776177861779617806178161782617836178461785617866178761788617896179061791617926179361794617956179661797617986179961800618016180261803618046180561806618076180861809618106181161812618136181461815618166181761818618196182061821618226182361824618256182661827618286182961830618316183261833618346183561836618376183861839618406184161842618436184461845618466184761848618496185061851618526185361854618556185661857618586185961860618616186261863618646186561866618676186861869618706187161872618736187461875618766187761878618796188061881618826188361884618856188661887618886188961890618916189261893618946189561896618976189861899619006190161902619036190461905619066190761908619096191061911619126191361914619156191661917619186191961920619216192261923619246192561926619276192861929619306193161932619336193461935619366193761938619396194061941619426194361944619456194661947619486194961950619516195261953619546195561956619576195861959619606196161962619636196461965619666196761968619696197061971619726197361974619756197661977619786197961980619816198261983619846198561986619876198861989619906199161992619936199461995619966199761998619996200062001620026200362004620056200662007620086200962010620116201262013620146201562016620176201862019620206202162022620236202462025620266202762028620296203062031620326203362034620356203662037620386203962040620416204262043620446204562046620476204862049620506205162052620536205462055620566205762058620596206062061620626206362064620656206662067620686206962070620716207262073620746207562076620776207862079620806208162082620836208462085620866208762088620896209062091620926209362094620956209662097620986209962100621016210262103621046210562106621076210862109621106211162112621136211462115621166211762118621196212062121621226212362124621256212662127621286212962130621316213262133621346213562136621376213862139621406214162142621436214462145621466214762148621496215062151621526215362154621556215662157621586215962160621616216262163621646216562166621676216862169621706217162172621736217462175621766217762178621796218062181621826218362184621856218662187621886218962190621916219262193621946219562196621976219862199622006220162202622036220462205622066220762208622096221062211622126221362214622156221662217622186221962220622216222262223622246222562226622276222862229622306223162232622336223462235622366223762238622396224062241622426224362244622456224662247622486224962250622516225262253622546225562256622576225862259622606226162262622636226462265622666226762268622696227062271622726227362274622756227662277622786227962280622816228262283622846228562286622876228862289622906229162292622936229462295622966229762298622996230062301623026230362304623056230662307623086230962310623116231262313623146231562316623176231862319623206232162322623236232462325623266232762328623296233062331623326233362334623356233662337623386233962340623416234262343623446234562346623476234862349623506235162352623536235462355623566235762358623596236062361623626236362364623656236662367623686236962370623716237262373623746237562376623776237862379623806238162382623836238462385623866238762388623896239062391623926239362394623956239662397623986239962400624016240262403624046240562406624076240862409624106241162412624136241462415624166241762418624196242062421624226242362424624256242662427624286242962430624316243262433624346243562436624376243862439624406244162442624436244462445624466244762448624496245062451624526245362454624556245662457624586245962460624616246262463624646246562466624676246862469624706247162472624736247462475624766247762478624796248062481624826248362484624856248662487624886248962490624916249262493624946249562496624976249862499625006250162502625036250462505625066250762508625096251062511625126251362514625156251662517625186251962520625216252262523625246252562526625276252862529625306253162532625336253462535625366253762538625396254062541625426254362544625456254662547625486254962550625516255262553625546255562556625576255862559625606256162562625636256462565625666256762568625696257062571625726257362574625756257662577625786257962580625816258262583625846258562586625876258862589625906259162592625936259462595625966259762598625996260062601626026260362604626056260662607626086260962610626116261262613626146261562616626176261862619626206262162622626236262462625626266262762628626296263062631626326263362634626356263662637626386263962640626416264262643626446264562646626476264862649626506265162652626536265462655626566265762658626596266062661626626266362664626656266662667626686266962670626716267262673626746267562676626776267862679626806268162682626836268462685626866268762688626896269062691626926269362694626956269662697626986269962700627016270262703627046270562706627076270862709627106271162712627136271462715627166271762718627196272062721627226272362724627256272662727627286272962730627316273262733627346273562736627376273862739627406274162742627436274462745627466274762748627496275062751627526275362754627556275662757627586275962760627616276262763627646276562766627676276862769627706277162772627736277462775627766277762778627796278062781627826278362784627856278662787627886278962790627916279262793627946279562796627976279862799628006280162802628036280462805628066280762808628096281062811628126281362814628156281662817628186281962820628216282262823628246282562826628276282862829628306283162832628336283462835628366283762838628396284062841628426284362844628456284662847628486284962850628516285262853628546285562856628576285862859628606286162862628636286462865628666286762868628696287062871628726287362874628756287662877628786287962880628816288262883628846288562886628876288862889628906289162892628936289462895628966289762898628996290062901629026290362904629056290662907629086290962910629116291262913629146291562916629176291862919629206292162922629236292462925629266292762928629296293062931629326293362934629356293662937629386293962940629416294262943629446294562946629476294862949629506295162952629536295462955629566295762958629596296062961629626296362964629656296662967629686296962970629716297262973629746297562976629776297862979629806298162982629836298462985629866298762988629896299062991629926299362994629956299662997629986299963000630016300263003630046300563006630076300863009630106301163012630136301463015630166301763018630196302063021630226302363024630256302663027630286302963030630316303263033630346303563036630376303863039630406304163042630436304463045630466304763048630496305063051630526305363054630556305663057630586305963060630616306263063630646306563066630676306863069630706307163072630736307463075630766307763078630796308063081630826308363084630856308663087630886308963090630916309263093630946309563096630976309863099631006310163102631036310463105631066310763108631096311063111631126311363114631156311663117631186311963120631216312263123631246312563126631276312863129631306313163132631336313463135631366313763138631396314063141631426314363144631456314663147631486314963150631516315263153631546315563156631576315863159631606316163162631636316463165631666316763168631696317063171631726317363174631756317663177631786317963180631816318263183631846318563186631876318863189631906319163192631936319463195631966319763198631996320063201632026320363204632056320663207632086320963210632116321263213632146321563216632176321863219632206322163222632236322463225632266322763228632296323063231632326323363234632356323663237632386323963240632416324263243632446324563246632476324863249632506325163252632536325463255632566325763258632596326063261632626326363264632656326663267632686326963270632716327263273632746327563276632776327863279632806328163282632836328463285632866328763288632896329063291632926329363294632956329663297632986329963300633016330263303633046330563306633076330863309633106331163312633136331463315633166331763318633196332063321633226332363324633256332663327633286332963330633316333263333633346333563336633376333863339633406334163342633436334463345633466334763348633496335063351633526335363354633556335663357633586335963360633616336263363633646336563366633676336863369633706337163372633736337463375633766337763378633796338063381633826338363384633856338663387633886338963390633916339263393633946339563396633976339863399634006340163402634036340463405634066340763408634096341063411634126341363414634156341663417634186341963420634216342263423634246342563426634276342863429634306343163432634336343463435634366343763438634396344063441634426344363444634456344663447634486344963450634516345263453634546345563456634576345863459634606346163462634636346463465634666346763468634696347063471634726347363474634756347663477634786347963480634816348263483634846348563486634876348863489634906349163492634936349463495634966349763498634996350063501635026350363504635056350663507635086350963510635116351263513635146351563516635176351863519635206352163522635236352463525635266352763528635296353063531635326353363534635356353663537635386353963540635416354263543635446354563546635476354863549635506355163552635536355463555635566355763558635596356063561635626356363564635656356663567635686356963570635716357263573635746357563576635776357863579635806358163582635836358463585635866358763588635896359063591635926359363594635956359663597635986359963600636016360263603636046360563606636076360863609636106361163612636136361463615636166361763618636196362063621636226362363624636256362663627636286362963630636316363263633636346363563636636376363863639636406364163642636436364463645636466364763648636496365063651636526365363654636556365663657636586365963660636616366263663636646366563666636676366863669636706367163672636736367463675636766367763678636796368063681636826368363684636856368663687636886368963690636916369263693636946369563696636976369863699637006370163702637036370463705637066370763708637096371063711637126371363714637156371663717637186371963720637216372263723637246372563726637276372863729637306373163732637336373463735637366373763738637396374063741637426374363744637456374663747637486374963750637516375263753637546375563756637576375863759637606376163762637636376463765637666376763768637696377063771637726377363774637756377663777637786377963780637816378263783637846378563786637876378863789637906379163792637936379463795637966379763798637996380063801638026380363804638056380663807638086380963810638116381263813638146381563816638176381863819638206382163822638236382463825638266382763828638296383063831638326383363834638356383663837638386383963840638416384263843638446384563846638476384863849638506385163852638536385463855638566385763858638596386063861638626386363864638656386663867638686386963870638716387263873638746387563876638776387863879638806388163882638836388463885638866388763888638896389063891638926389363894638956389663897638986389963900639016390263903639046390563906639076390863909639106391163912639136391463915639166391763918639196392063921639226392363924639256392663927639286392963930639316393263933639346393563936639376393863939639406394163942639436394463945639466394763948639496395063951639526395363954639556395663957639586395963960639616396263963639646396563966639676396863969639706397163972639736397463975639766397763978639796398063981639826398363984639856398663987639886398963990639916399263993639946399563996639976399863999640006400164002640036400464005640066400764008640096401064011640126401364014640156401664017640186401964020640216402264023640246402564026640276402864029640306403164032640336403464035640366403764038640396404064041640426404364044640456404664047640486404964050640516405264053640546405564056640576405864059640606406164062640636406464065640666406764068640696407064071640726407364074640756407664077640786407964080640816408264083640846408564086640876408864089640906409164092640936409464095640966409764098640996410064101641026410364104641056410664107641086410964110641116411264113641146411564116641176411864119641206412164122641236412464125641266412764128641296413064131641326413364134641356413664137641386413964140641416414264143641446414564146641476414864149641506415164152641536415464155641566415764158641596416064161641626416364164641656416664167641686416964170641716417264173641746417564176641776417864179641806418164182641836418464185641866418764188641896419064191641926419364194641956419664197641986419964200642016420264203642046420564206642076420864209642106421164212642136421464215642166421764218642196422064221642226422364224642256422664227642286422964230642316423264233642346423564236642376423864239642406424164242642436424464245642466424764248642496425064251642526425364254642556425664257642586425964260642616426264263642646426564266642676426864269642706427164272642736427464275642766427764278642796428064281642826428364284642856428664287642886428964290642916429264293642946429564296642976429864299643006430164302643036430464305643066430764308643096431064311643126431364314643156431664317643186431964320643216432264323643246432564326643276432864329643306433164332643336433464335643366433764338643396434064341643426434364344643456434664347643486434964350643516435264353643546435564356643576435864359643606436164362643636436464365643666436764368643696437064371643726437364374643756437664377643786437964380643816438264383643846438564386643876438864389643906439164392643936439464395643966439764398643996440064401644026440364404644056440664407644086440964410644116441264413644146441564416644176441864419644206442164422644236442464425644266442764428644296443064431644326443364434644356443664437644386443964440644416444264443644446444564446644476444864449644506445164452644536445464455644566445764458644596446064461644626446364464644656446664467644686446964470644716447264473644746447564476644776447864479644806448164482644836448464485644866448764488644896449064491644926449364494644956449664497644986449964500645016450264503645046450564506645076450864509645106451164512645136451464515645166451764518645196452064521645226452364524645256452664527645286452964530645316453264533645346453564536645376453864539645406454164542645436454464545645466454764548645496455064551645526455364554645556455664557645586455964560645616456264563645646456564566645676456864569645706457164572645736457464575645766457764578645796458064581645826458364584645856458664587645886458964590645916459264593645946459564596645976459864599646006460164602646036460464605646066460764608646096461064611646126461364614646156461664617646186461964620646216462264623646246462564626646276462864629646306463164632646336463464635646366463764638646396464064641646426464364644646456464664647646486464964650646516465264653646546465564656646576465864659646606466164662646636466464665646666466764668646696467064671646726467364674646756467664677646786467964680646816468264683646846468564686646876468864689646906469164692646936469464695646966469764698646996470064701647026470364704647056470664707647086470964710647116471264713647146471564716647176471864719647206472164722647236472464725647266472764728647296473064731647326473364734647356473664737647386473964740647416474264743647446474564746647476474864749647506475164752647536475464755647566475764758647596476064761647626476364764647656476664767647686476964770647716477264773647746477564776647776477864779647806478164782647836478464785647866478764788647896479064791647926479364794647956479664797647986479964800648016480264803648046480564806648076480864809648106481164812648136481464815648166481764818648196482064821648226482364824648256482664827648286482964830648316483264833648346483564836648376483864839648406484164842648436484464845648466484764848648496485064851648526485364854648556485664857648586485964860648616486264863648646486564866648676486864869648706487164872648736487464875648766487764878648796488064881648826488364884648856488664887648886488964890648916489264893648946489564896648976489864899649006490164902649036490464905649066490764908649096491064911649126491364914649156491664917649186491964920649216492264923649246492564926649276492864929649306493164932649336493464935649366493764938649396494064941649426494364944649456494664947649486494964950649516495264953649546495564956649576495864959649606496164962649636496464965649666496764968649696497064971649726497364974649756497664977649786497964980649816498264983649846498564986649876498864989649906499164992649936499464995649966499764998649996500065001650026500365004650056500665007650086500965010650116501265013650146501565016650176501865019650206502165022650236502465025650266502765028650296503065031650326503365034650356503665037650386503965040650416504265043650446504565046650476504865049650506505165052650536505465055650566505765058650596506065061650626506365064650656506665067650686506965070650716507265073650746507565076650776507865079650806508165082650836508465085650866508765088650896509065091650926509365094650956509665097650986509965100651016510265103651046510565106651076510865109651106511165112651136511465115651166511765118651196512065121651226512365124651256512665127651286512965130651316513265133651346513565136651376513865139651406514165142651436514465145651466514765148651496515065151651526515365154651556515665157651586515965160651616516265163651646516565166651676516865169651706517165172651736517465175651766517765178651796518065181651826518365184651856518665187651886518965190651916519265193651946519565196651976519865199652006520165202652036520465205652066520765208652096521065211652126521365214652156521665217652186521965220652216522265223652246522565226652276522865229652306523165232652336523465235652366523765238652396524065241652426524365244652456524665247652486524965250652516525265253652546525565256652576525865259652606526165262652636526465265652666526765268652696527065271652726527365274652756527665277652786527965280652816528265283652846528565286652876528865289652906529165292652936529465295652966529765298652996530065301653026530365304653056530665307653086530965310653116531265313653146531565316653176531865319653206532165322653236532465325653266532765328653296533065331653326533365334653356533665337653386533965340653416534265343653446534565346653476534865349653506535165352653536535465355653566535765358653596536065361653626536365364653656536665367653686536965370653716537265373653746537565376653776537865379653806538165382653836538465385653866538765388653896539065391653926539365394653956539665397653986539965400654016540265403654046540565406654076540865409654106541165412654136541465415654166541765418654196542065421654226542365424654256542665427654286542965430654316543265433654346543565436654376543865439654406544165442654436544465445654466544765448654496545065451654526545365454654556545665457654586545965460654616546265463654646546565466654676546865469654706547165472654736547465475654766547765478654796548065481654826548365484654856548665487654886548965490654916549265493654946549565496654976549865499655006550165502655036550465505655066550765508655096551065511655126551365514655156551665517655186551965520655216552265523655246552565526655276552865529655306553165532655336553465535655366553765538655396554065541655426554365544655456554665547655486554965550655516555265553655546555565556655576555865559655606556165562655636556465565655666556765568655696557065571655726557365574655756557665577655786557965580655816558265583655846558565586655876558865589655906559165592655936559465595655966559765598655996560065601656026560365604656056560665607656086560965610656116561265613656146561565616656176561865619656206562165622656236562465625656266562765628656296563065631656326563365634656356563665637656386563965640656416564265643656446564565646656476564865649656506565165652656536565465655656566565765658656596566065661656626566365664656656566665667656686566965670656716567265673656746567565676656776567865679656806568165682656836568465685656866568765688656896569065691656926569365694656956569665697656986569965700657016570265703657046570565706657076570865709657106571165712657136571465715657166571765718657196572065721657226572365724657256572665727657286572965730657316573265733657346573565736657376573865739657406574165742657436574465745657466574765748657496575065751657526575365754657556575665757657586575965760657616576265763657646576565766657676576865769657706577165772657736577465775657766577765778657796578065781657826578365784657856578665787657886578965790657916579265793657946579565796657976579865799658006580165802658036580465805658066580765808658096581065811658126581365814658156581665817658186581965820658216582265823658246582565826658276582865829658306583165832658336583465835658366583765838658396584065841658426584365844658456584665847658486584965850658516585265853658546585565856658576585865859658606586165862658636586465865658666586765868658696587065871658726587365874658756587665877658786587965880658816588265883658846588565886658876588865889658906589165892658936589465895658966589765898658996590065901659026590365904659056590665907659086590965910659116591265913659146591565916659176591865919659206592165922659236592465925659266592765928659296593065931659326593365934659356593665937659386593965940659416594265943659446594565946659476594865949659506595165952659536595465955659566595765958659596596065961659626596365964659656596665967659686596965970659716597265973659746597565976659776597865979659806598165982659836598465985659866598765988659896599065991659926599365994659956599665997659986599966000660016600266003660046600566006660076600866009660106601166012660136601466015660166601766018660196602066021660226602366024660256602666027660286602966030660316603266033660346603566036660376603866039660406604166042660436604466045660466604766048660496605066051660526605366054660556605666057660586605966060660616606266063660646606566066660676606866069660706607166072660736607466075660766607766078660796608066081660826608366084660856608666087660886608966090660916609266093660946609566096660976609866099661006610166102661036610466105661066610766108661096611066111661126611366114661156611666117661186611966120661216612266123661246612566126661276612866129661306613166132661336613466135661366613766138661396614066141661426614366144661456614666147661486614966150661516615266153661546615566156661576615866159661606616166162661636616466165661666616766168661696617066171661726617366174661756617666177661786617966180661816618266183661846618566186661876618866189661906619166192661936619466195661966619766198661996620066201662026620366204662056620666207662086620966210662116621266213662146621566216662176621866219662206622166222662236622466225662266622766228662296623066231662326623366234662356623666237662386623966240662416624266243662446624566246662476624866249662506625166252662536625466255662566625766258662596626066261662626626366264662656626666267662686626966270662716627266273662746627566276662776627866279662806628166282662836628466285662866628766288662896629066291662926629366294662956629666297662986629966300663016630266303663046630566306663076630866309663106631166312663136631466315663166631766318663196632066321663226632366324663256632666327663286632966330663316633266333663346633566336663376633866339663406634166342663436634466345663466634766348663496635066351663526635366354663556635666357663586635966360663616636266363663646636566366663676636866369663706637166372663736637466375663766637766378663796638066381663826638366384663856638666387663886638966390663916639266393663946639566396663976639866399664006640166402664036640466405664066640766408664096641066411664126641366414664156641666417664186641966420664216642266423664246642566426664276642866429664306643166432664336643466435664366643766438664396644066441664426644366444664456644666447664486644966450664516645266453664546645566456664576645866459664606646166462664636646466465664666646766468664696647066471664726647366474664756647666477664786647966480664816648266483664846648566486664876648866489664906649166492664936649466495664966649766498664996650066501665026650366504665056650666507665086650966510665116651266513665146651566516665176651866519665206652166522665236652466525665266652766528665296653066531665326653366534665356653666537665386653966540665416654266543665446654566546665476654866549665506655166552665536655466555665566655766558665596656066561665626656366564665656656666567665686656966570665716657266573665746657566576665776657866579665806658166582665836658466585665866658766588665896659066591665926659366594665956659666597665986659966600666016660266603666046660566606666076660866609666106661166612666136661466615666166661766618666196662066621666226662366624666256662666627666286662966630666316663266633666346663566636666376663866639666406664166642666436664466645666466664766648666496665066651666526665366654666556665666657666586665966660666616666266663666646666566666666676666866669666706667166672666736667466675666766667766678666796668066681666826668366684666856668666687666886668966690666916669266693666946669566696666976669866699667006670166702667036670466705667066670766708667096671066711667126671366714667156671666717667186671966720667216672266723667246672566726667276672866729667306673166732667336673466735667366673766738667396674066741667426674366744667456674666747667486674966750667516675266753667546675566756667576675866759667606676166762667636676466765667666676766768667696677066771667726677366774667756677666777667786677966780667816678266783667846678566786667876678866789667906679166792667936679466795667966679766798667996680066801668026680366804668056680666807668086680966810668116681266813668146681566816668176681866819668206682166822668236682466825668266682766828668296683066831668326683366834668356683666837668386683966840668416684266843668446684566846668476684866849668506685166852668536685466855668566685766858668596686066861668626686366864668656686666867668686686966870668716687266873668746687566876668776687866879668806688166882668836688466885668866688766888668896689066891668926689366894668956689666897668986689966900669016690266903669046690566906669076690866909669106691166912669136691466915669166691766918669196692066921669226692366924669256692666927669286692966930669316693266933669346693566936669376693866939669406694166942669436694466945669466694766948669496695066951669526695366954669556695666957669586695966960669616696266963669646696566966669676696866969669706697166972669736697466975669766697766978669796698066981669826698366984669856698666987669886698966990669916699266993669946699566996669976699866999670006700167002670036700467005670066700767008670096701067011670126701367014670156701667017670186701967020670216702267023670246702567026670276702867029670306703167032670336703467035670366703767038670396704067041670426704367044670456704667047670486704967050670516705267053670546705567056670576705867059670606706167062670636706467065670666706767068670696707067071670726707367074670756707667077670786707967080670816708267083670846708567086670876708867089670906709167092670936709467095670966709767098670996710067101671026710367104671056710667107671086710967110671116711267113671146711567116671176711867119671206712167122671236712467125671266712767128671296713067131671326713367134671356713667137671386713967140671416714267143671446714567146671476714867149671506715167152671536715467155671566715767158671596716067161671626716367164671656716667167671686716967170671716717267173671746717567176671776717867179671806718167182671836718467185671866718767188671896719067191671926719367194671956719667197671986719967200672016720267203672046720567206672076720867209672106721167212672136721467215672166721767218672196722067221672226722367224672256722667227672286722967230672316723267233672346723567236672376723867239672406724167242672436724467245672466724767248672496725067251672526725367254672556725667257672586725967260672616726267263672646726567266672676726867269672706727167272672736727467275672766727767278672796728067281672826728367284672856728667287672886728967290672916729267293672946729567296672976729867299673006730167302673036730467305673066730767308673096731067311673126731367314673156731667317673186731967320673216732267323673246732567326673276732867329673306733167332673336733467335673366733767338673396734067341673426734367344673456734667347673486734967350673516735267353673546735567356673576735867359673606736167362673636736467365673666736767368673696737067371673726737367374673756737667377673786737967380673816738267383673846738567386673876738867389673906739167392673936739467395673966739767398673996740067401674026740367404674056740667407674086740967410674116741267413674146741567416674176741867419674206742167422674236742467425674266742767428674296743067431674326743367434674356743667437674386743967440674416744267443674446744567446674476744867449674506745167452674536745467455674566745767458674596746067461674626746367464674656746667467674686746967470674716747267473674746747567476674776747867479674806748167482674836748467485674866748767488674896749067491674926749367494674956749667497674986749967500675016750267503675046750567506675076750867509675106751167512675136751467515675166751767518675196752067521675226752367524675256752667527675286752967530675316753267533675346753567536675376753867539675406754167542675436754467545675466754767548675496755067551675526755367554675556755667557675586755967560675616756267563675646756567566675676756867569675706757167572675736757467575675766757767578675796758067581675826758367584675856758667587675886758967590675916759267593675946759567596675976759867599676006760167602676036760467605676066760767608676096761067611676126761367614676156761667617676186761967620676216762267623676246762567626676276762867629676306763167632676336763467635676366763767638676396764067641676426764367644676456764667647676486764967650676516765267653676546765567656676576765867659676606766167662676636766467665676666766767668676696767067671676726767367674676756767667677676786767967680676816768267683676846768567686676876768867689676906769167692676936769467695676966769767698676996770067701677026770367704677056770667707677086770967710677116771267713677146771567716677176771867719677206772167722677236772467725677266772767728677296773067731677326773367734677356773667737677386773967740677416774267743677446774567746677476774867749677506775167752677536775467755677566775767758677596776067761677626776367764677656776667767677686776967770677716777267773677746777567776677776777867779677806778167782677836778467785677866778767788677896779067791677926779367794677956779667797677986779967800678016780267803678046780567806678076780867809678106781167812678136781467815678166781767818678196782067821678226782367824678256782667827678286782967830678316783267833678346783567836678376783867839678406784167842678436784467845678466784767848678496785067851678526785367854678556785667857678586785967860678616786267863678646786567866678676786867869678706787167872678736787467875678766787767878678796788067881678826788367884678856788667887678886788967890678916789267893678946789567896678976789867899679006790167902679036790467905679066790767908679096791067911679126791367914679156791667917679186791967920679216792267923679246792567926679276792867929679306793167932679336793467935679366793767938679396794067941679426794367944679456794667947679486794967950679516795267953679546795567956679576795867959679606796167962679636796467965679666796767968679696797067971679726797367974679756797667977679786797967980679816798267983679846798567986679876798867989679906799167992679936799467995679966799767998679996800068001680026800368004680056800668007680086800968010680116801268013680146801568016680176801868019680206802168022680236802468025680266802768028680296803068031680326803368034680356803668037680386803968040680416804268043680446804568046680476804868049680506805168052680536805468055680566805768058680596806068061680626806368064680656806668067680686806968070680716807268073680746807568076680776807868079680806808168082680836808468085680866808768088680896809068091680926809368094680956809668097680986809968100681016810268103681046810568106681076810868109681106811168112681136811468115681166811768118681196812068121681226812368124681256812668127681286812968130681316813268133681346813568136681376813868139681406814168142681436814468145681466814768148681496815068151681526815368154681556815668157681586815968160681616816268163681646816568166681676816868169681706817168172681736817468175681766817768178681796818068181681826818368184681856818668187681886818968190681916819268193681946819568196681976819868199682006820168202682036820468205682066820768208682096821068211682126821368214682156821668217682186821968220682216822268223682246822568226682276822868229682306823168232682336823468235682366823768238682396824068241682426824368244682456824668247682486824968250682516825268253682546825568256682576825868259682606826168262682636826468265682666826768268682696827068271682726827368274682756827668277682786827968280682816828268283682846828568286682876828868289682906829168292682936829468295682966829768298682996830068301683026830368304683056830668307683086830968310683116831268313683146831568316683176831868319683206832168322683236832468325683266832768328683296833068331683326833368334683356833668337683386833968340683416834268343683446834568346683476834868349683506835168352683536835468355683566835768358683596836068361683626836368364683656836668367683686836968370683716837268373683746837568376683776837868379683806838168382683836838468385683866838768388683896839068391683926839368394683956839668397683986839968400684016840268403684046840568406684076840868409684106841168412684136841468415684166841768418684196842068421684226842368424684256842668427684286842968430684316843268433684346843568436684376843868439684406844168442684436844468445684466844768448684496845068451684526845368454684556845668457684586845968460684616846268463684646846568466684676846868469684706847168472684736847468475684766847768478684796848068481684826848368484684856848668487684886848968490684916849268493684946849568496684976849868499685006850168502685036850468505685066850768508685096851068511685126851368514685156851668517685186851968520685216852268523685246852568526685276852868529685306853168532685336853468535685366853768538685396854068541685426854368544685456854668547685486854968550685516855268553685546855568556685576855868559685606856168562685636856468565685666856768568685696857068571685726857368574685756857668577685786857968580685816858268583685846858568586685876858868589685906859168592685936859468595685966859768598685996860068601686026860368604686056860668607686086860968610686116861268613686146861568616686176861868619686206862168622686236862468625686266862768628686296863068631686326863368634686356863668637686386863968640686416864268643686446864568646686476864868649686506865168652686536865468655686566865768658686596866068661686626866368664686656866668667686686866968670686716867268673686746867568676686776867868679686806868168682686836868468685686866868768688686896869068691686926869368694686956869668697686986869968700687016870268703687046870568706687076870868709687106871168712687136871468715687166871768718687196872068721687226872368724687256872668727687286872968730687316873268733687346873568736687376873868739687406874168742687436874468745687466874768748687496875068751687526875368754687556875668757687586875968760687616876268763687646876568766687676876868769687706877168772687736877468775687766877768778687796878068781687826878368784687856878668787687886878968790687916879268793687946879568796687976879868799688006880168802688036880468805688066880768808688096881068811688126881368814688156881668817688186881968820688216882268823688246882568826688276882868829688306883168832688336883468835688366883768838688396884068841688426884368844688456884668847688486884968850688516885268853688546885568856688576885868859688606886168862688636886468865688666886768868688696887068871688726887368874688756887668877688786887968880688816888268883688846888568886688876888868889688906889168892688936889468895688966889768898688996890068901689026890368904689056890668907689086890968910689116891268913689146891568916689176891868919689206892168922689236892468925689266892768928689296893068931689326893368934689356893668937689386893968940689416894268943689446894568946689476894868949689506895168952689536895468955689566895768958689596896068961689626896368964689656896668967689686896968970689716897268973689746897568976689776897868979689806898168982689836898468985689866898768988689896899068991689926899368994689956899668997689986899969000690016900269003690046900569006690076900869009690106901169012690136901469015690166901769018690196902069021690226902369024690256902669027690286902969030690316903269033690346903569036690376903869039690406904169042690436904469045690466904769048690496905069051690526905369054690556905669057690586905969060690616906269063690646906569066690676906869069690706907169072690736907469075690766907769078690796908069081690826908369084690856908669087690886908969090690916909269093690946909569096690976909869099691006910169102691036910469105691066910769108691096911069111691126911369114691156911669117691186911969120691216912269123691246912569126691276912869129691306913169132691336913469135691366913769138691396914069141691426914369144691456914669147691486914969150691516915269153691546915569156691576915869159691606916169162691636916469165691666916769168691696917069171691726917369174691756917669177691786917969180691816918269183691846918569186691876918869189691906919169192691936919469195691966919769198691996920069201692026920369204692056920669207692086920969210692116921269213692146921569216692176921869219692206922169222692236922469225692266922769228692296923069231692326923369234692356923669237692386923969240692416924269243692446924569246692476924869249692506925169252692536925469255692566925769258692596926069261692626926369264692656926669267692686926969270692716927269273692746927569276692776927869279692806928169282692836928469285692866928769288692896929069291692926929369294692956929669297692986929969300693016930269303693046930569306693076930869309693106931169312693136931469315693166931769318693196932069321693226932369324693256932669327693286932969330693316933269333693346933569336693376933869339693406934169342693436934469345693466934769348693496935069351693526935369354693556935669357693586935969360693616936269363693646936569366693676936869369693706937169372693736937469375693766937769378693796938069381693826938369384693856938669387693886938969390693916939269393693946939569396693976939869399694006940169402694036940469405694066940769408694096941069411694126941369414694156941669417694186941969420694216942269423694246942569426694276942869429694306943169432694336943469435694366943769438694396944069441694426944369444694456944669447694486944969450694516945269453694546945569456694576945869459694606946169462694636946469465694666946769468694696947069471694726947369474694756947669477694786947969480694816948269483694846948569486694876948869489694906949169492694936949469495694966949769498694996950069501695026950369504695056950669507695086950969510695116951269513695146951569516695176951869519695206952169522695236952469525695266952769528695296953069531695326953369534695356953669537695386953969540695416954269543695446954569546695476954869549695506955169552695536955469555695566955769558695596956069561695626956369564695656956669567695686956969570695716957269573695746957569576695776957869579695806958169582695836958469585695866958769588695896959069591695926959369594695956959669597695986959969600696016960269603696046960569606696076960869609696106961169612696136961469615696166961769618696196962069621696226962369624696256962669627696286962969630696316963269633696346963569636696376963869639696406964169642696436964469645696466964769648696496965069651696526965369654696556965669657696586965969660696616966269663696646966569666696676966869669696706967169672696736967469675696766967769678696796968069681696826968369684696856968669687696886968969690696916969269693696946969569696696976969869699697006970169702697036970469705697066970769708697096971069711697126971369714697156971669717697186971969720697216972269723697246972569726697276972869729697306973169732697336973469735697366973769738697396974069741697426974369744697456974669747697486974969750697516975269753697546975569756697576975869759697606976169762697636976469765697666976769768697696977069771697726977369774697756977669777697786977969780697816978269783697846978569786697876978869789697906979169792697936979469795697966979769798697996980069801698026980369804698056980669807698086980969810698116981269813698146981569816698176981869819698206982169822698236982469825698266982769828698296983069831698326983369834698356983669837698386983969840698416984269843698446984569846698476984869849698506985169852698536985469855698566985769858698596986069861698626986369864698656986669867698686986969870698716987269873698746987569876698776987869879698806988169882698836988469885698866988769888698896989069891698926989369894698956989669897698986989969900699016990269903699046990569906699076990869909699106991169912699136991469915699166991769918699196992069921699226992369924699256992669927699286992969930699316993269933699346993569936699376993869939699406994169942699436994469945699466994769948699496995069951699526995369954699556995669957699586995969960699616996269963699646996569966699676996869969699706997169972699736997469975699766997769978699796998069981699826998369984699856998669987699886998969990699916999269993699946999569996699976999869999700007000170002700037000470005700067000770008700097001070011700127001370014700157001670017700187001970020700217002270023700247002570026700277002870029700307003170032700337003470035700367003770038700397004070041700427004370044700457004670047700487004970050700517005270053700547005570056700577005870059700607006170062700637006470065700667006770068700697007070071700727007370074700757007670077700787007970080700817008270083700847008570086700877008870089700907009170092700937009470095700967009770098700997010070101701027010370104701057010670107701087010970110701117011270113701147011570116701177011870119701207012170122701237012470125701267012770128701297013070131701327013370134701357013670137701387013970140701417014270143701447014570146701477014870149701507015170152701537015470155701567015770158701597016070161701627016370164701657016670167701687016970170701717017270173701747017570176701777017870179701807018170182701837018470185701867018770188701897019070191701927019370194701957019670197701987019970200702017020270203702047020570206702077020870209702107021170212702137021470215702167021770218702197022070221702227022370224702257022670227702287022970230702317023270233702347023570236702377023870239702407024170242702437024470245702467024770248702497025070251702527025370254702557025670257702587025970260702617026270263702647026570266702677026870269702707027170272702737027470275702767027770278702797028070281702827028370284702857028670287702887028970290702917029270293702947029570296702977029870299703007030170302703037030470305703067030770308703097031070311703127031370314703157031670317703187031970320703217032270323703247032570326703277032870329703307033170332703337033470335703367033770338703397034070341703427034370344703457034670347703487034970350703517035270353703547035570356703577035870359703607036170362703637036470365703667036770368703697037070371703727037370374703757037670377703787037970380703817038270383703847038570386703877038870389703907039170392703937039470395703967039770398703997040070401704027040370404704057040670407704087040970410704117041270413704147041570416704177041870419704207042170422704237042470425704267042770428704297043070431704327043370434704357043670437704387043970440704417044270443704447044570446704477044870449704507045170452704537045470455704567045770458704597046070461704627046370464704657046670467704687046970470704717047270473704747047570476704777047870479704807048170482704837048470485704867048770488704897049070491704927049370494704957049670497704987049970500705017050270503705047050570506705077050870509705107051170512705137051470515705167051770518705197052070521705227052370524705257052670527705287052970530705317053270533705347053570536705377053870539705407054170542705437054470545705467054770548705497055070551705527055370554705557055670557705587055970560705617056270563705647056570566705677056870569705707057170572705737057470575705767057770578705797058070581705827058370584705857058670587705887058970590705917059270593705947059570596705977059870599706007060170602706037060470605706067060770608706097061070611706127061370614706157061670617706187061970620706217062270623706247062570626706277062870629706307063170632706337063470635706367063770638706397064070641706427064370644706457064670647706487064970650706517065270653706547065570656706577065870659706607066170662706637066470665706667066770668706697067070671706727067370674706757067670677706787067970680706817068270683706847068570686706877068870689706907069170692706937069470695706967069770698706997070070701707027070370704707057070670707707087070970710707117071270713707147071570716707177071870719707207072170722707237072470725707267072770728707297073070731707327073370734707357073670737707387073970740707417074270743707447074570746707477074870749707507075170752707537075470755707567075770758707597076070761707627076370764707657076670767707687076970770707717077270773707747077570776707777077870779707807078170782707837078470785707867078770788707897079070791707927079370794707957079670797707987079970800708017080270803708047080570806708077080870809708107081170812708137081470815708167081770818708197082070821708227082370824708257082670827708287082970830708317083270833708347083570836708377083870839708407084170842708437084470845708467084770848708497085070851708527085370854708557085670857708587085970860708617086270863708647086570866708677086870869708707087170872708737087470875708767087770878708797088070881708827088370884708857088670887708887088970890708917089270893708947089570896708977089870899709007090170902709037090470905709067090770908709097091070911709127091370914709157091670917709187091970920709217092270923709247092570926709277092870929709307093170932709337093470935709367093770938709397094070941709427094370944709457094670947709487094970950709517095270953709547095570956709577095870959709607096170962709637096470965709667096770968709697097070971709727097370974709757097670977709787097970980709817098270983709847098570986709877098870989709907099170992709937099470995709967099770998709997100071001710027100371004710057100671007710087100971010710117101271013710147101571016710177101871019710207102171022710237102471025710267102771028710297103071031710327103371034710357103671037710387103971040710417104271043710447104571046710477104871049710507105171052710537105471055710567105771058710597106071061710627106371064710657106671067710687106971070710717107271073710747107571076710777107871079710807108171082710837108471085710867108771088710897109071091710927109371094710957109671097710987109971100711017110271103711047110571106711077110871109711107111171112711137111471115711167111771118711197112071121711227112371124711257112671127711287112971130711317113271133711347113571136711377113871139711407114171142711437114471145711467114771148711497115071151711527115371154711557115671157711587115971160711617116271163711647116571166711677116871169711707117171172711737117471175711767117771178711797118071181711827118371184711857118671187711887118971190711917119271193711947119571196711977119871199712007120171202712037120471205712067120771208712097121071211712127121371214712157121671217712187121971220712217122271223712247122571226712277122871229712307123171232712337123471235712367123771238712397124071241712427124371244712457124671247712487124971250712517125271253712547125571256712577125871259712607126171262712637126471265712667126771268712697127071271712727127371274712757127671277712787127971280712817128271283712847128571286712877128871289712907129171292712937129471295712967129771298712997130071301713027130371304713057130671307713087130971310713117131271313713147131571316713177131871319713207132171322713237132471325713267132771328713297133071331713327133371334713357133671337713387133971340713417134271343713447134571346713477134871349713507135171352713537135471355713567135771358713597136071361713627136371364713657136671367713687136971370713717137271373713747137571376713777137871379713807138171382713837138471385713867138771388713897139071391713927139371394713957139671397713987139971400714017140271403714047140571406714077140871409714107141171412714137141471415714167141771418714197142071421714227142371424714257142671427714287142971430714317143271433714347143571436714377143871439714407144171442714437144471445714467144771448714497145071451714527145371454714557145671457714587145971460714617146271463714647146571466714677146871469714707147171472714737147471475714767147771478714797148071481714827148371484714857148671487714887148971490714917149271493714947149571496714977149871499715007150171502715037150471505715067150771508715097151071511715127151371514715157151671517715187151971520715217152271523715247152571526715277152871529715307153171532715337153471535715367153771538715397154071541715427154371544715457154671547715487154971550715517155271553715547155571556715577155871559715607156171562715637156471565715667156771568715697157071571715727157371574715757157671577715787157971580715817158271583715847158571586715877158871589715907159171592715937159471595715967159771598715997160071601716027160371604716057160671607716087160971610716117161271613716147161571616716177161871619716207162171622716237162471625716267162771628716297163071631716327163371634716357163671637716387163971640716417164271643716447164571646716477164871649716507165171652716537165471655716567165771658716597166071661716627166371664716657166671667716687166971670716717167271673716747167571676716777167871679716807168171682716837168471685716867168771688716897169071691716927169371694716957169671697716987169971700717017170271703717047170571706717077170871709717107171171712717137171471715717167171771718717197172071721717227172371724717257172671727717287172971730717317173271733717347173571736717377173871739717407174171742717437174471745717467174771748717497175071751717527175371754717557175671757717587175971760717617176271763717647176571766717677176871769717707177171772717737177471775717767177771778717797178071781717827178371784717857178671787717887178971790717917179271793717947179571796717977179871799718007180171802718037180471805718067180771808718097181071811718127181371814718157181671817718187181971820718217182271823718247182571826718277182871829718307183171832718337183471835718367183771838718397184071841718427184371844718457184671847718487184971850718517185271853718547185571856718577185871859718607186171862718637186471865718667186771868718697187071871718727187371874718757187671877718787187971880718817188271883718847188571886718877188871889718907189171892718937189471895718967189771898718997190071901719027190371904719057190671907719087190971910719117191271913719147191571916719177191871919719207192171922719237192471925719267192771928719297193071931719327193371934719357193671937719387193971940719417194271943719447194571946719477194871949719507195171952719537195471955719567195771958719597196071961719627196371964719657196671967719687196971970719717197271973719747197571976719777197871979719807198171982719837198471985719867198771988719897199071991719927199371994719957199671997719987199972000720017200272003720047200572006720077200872009720107201172012720137201472015720167201772018720197202072021720227202372024720257202672027720287202972030720317203272033720347203572036720377203872039720407204172042720437204472045720467204772048720497205072051720527205372054720557205672057720587205972060720617206272063720647206572066720677206872069720707207172072720737207472075720767207772078720797208072081720827208372084720857208672087720887208972090720917209272093720947209572096720977209872099721007210172102721037210472105721067210772108721097211072111721127211372114721157211672117721187211972120721217212272123721247212572126721277212872129721307213172132721337213472135721367213772138721397214072141721427214372144721457214672147721487214972150721517215272153721547215572156721577215872159721607216172162721637216472165721667216772168721697217072171721727217372174721757217672177721787217972180721817218272183721847218572186721877218872189721907219172192721937219472195721967219772198721997220072201722027220372204722057220672207722087220972210722117221272213722147221572216722177221872219722207222172222722237222472225722267222772228722297223072231722327223372234722357223672237722387223972240722417224272243722447224572246722477224872249722507225172252722537225472255722567225772258722597226072261722627226372264722657226672267722687226972270722717227272273722747227572276722777227872279722807228172282722837228472285722867228772288722897229072291722927229372294722957229672297722987229972300723017230272303723047230572306723077230872309723107231172312723137231472315723167231772318723197232072321723227232372324723257232672327723287232972330723317233272333723347233572336723377233872339723407234172342723437234472345723467234772348723497235072351723527235372354723557235672357723587235972360723617236272363723647236572366723677236872369723707237172372723737237472375723767237772378723797238072381723827238372384723857238672387723887238972390723917239272393723947239572396723977239872399724007240172402724037240472405724067240772408724097241072411724127241372414724157241672417724187241972420724217242272423724247242572426724277242872429724307243172432724337243472435724367243772438724397244072441724427244372444724457244672447724487244972450724517245272453724547245572456724577245872459724607246172462724637246472465724667246772468724697247072471724727247372474724757247672477724787247972480724817248272483724847248572486724877248872489724907249172492724937249472495724967249772498724997250072501725027250372504725057250672507725087250972510725117251272513725147251572516725177251872519725207252172522725237252472525725267252772528725297253072531725327253372534725357253672537725387253972540725417254272543725447254572546725477254872549725507255172552725537255472555725567255772558725597256072561725627256372564725657256672567725687256972570725717257272573725747257572576725777257872579725807258172582725837258472585725867258772588725897259072591725927259372594725957259672597725987259972600726017260272603726047260572606726077260872609726107261172612726137261472615726167261772618726197262072621726227262372624726257262672627726287262972630726317263272633726347263572636726377263872639726407264172642726437264472645726467264772648726497265072651726527265372654726557265672657726587265972660726617266272663726647266572666726677266872669726707267172672726737267472675726767267772678726797268072681726827268372684726857268672687726887268972690726917269272693726947269572696726977269872699727007270172702727037270472705727067270772708727097271072711727127271372714727157271672717727187271972720727217272272723727247272572726727277272872729727307273172732727337273472735727367273772738727397274072741727427274372744727457274672747727487274972750727517275272753727547275572756727577275872759727607276172762727637276472765727667276772768727697277072771727727277372774727757277672777727787277972780727817278272783727847278572786727877278872789727907279172792727937279472795727967279772798727997280072801728027280372804728057280672807728087280972810728117281272813728147281572816728177281872819728207282172822728237282472825728267282772828728297283072831728327283372834728357283672837728387283972840728417284272843728447284572846728477284872849728507285172852728537285472855728567285772858728597286072861728627286372864728657286672867728687286972870728717287272873728747287572876728777287872879728807288172882728837288472885728867288772888728897289072891728927289372894728957289672897728987289972900729017290272903729047290572906729077290872909729107291172912729137291472915729167291772918729197292072921729227292372924729257292672927729287292972930729317293272933729347293572936729377293872939729407294172942729437294472945729467294772948729497295072951729527295372954729557295672957729587295972960729617296272963729647296572966729677296872969729707297172972729737297472975729767297772978729797298072981729827298372984729857298672987729887298972990729917299272993729947299572996729977299872999730007300173002730037300473005730067300773008730097301073011730127301373014730157301673017730187301973020730217302273023730247302573026730277302873029730307303173032730337303473035730367303773038730397304073041730427304373044730457304673047730487304973050730517305273053730547305573056730577305873059730607306173062730637306473065730667306773068730697307073071730727307373074730757307673077730787307973080730817308273083730847308573086730877308873089730907309173092730937309473095730967309773098730997310073101731027310373104731057310673107731087310973110731117311273113731147311573116731177311873119731207312173122731237312473125731267312773128731297313073131731327313373134731357313673137731387313973140731417314273143731447314573146731477314873149731507315173152731537315473155731567315773158731597316073161731627316373164731657316673167731687316973170731717317273173731747317573176731777317873179731807318173182731837318473185731867318773188731897319073191731927319373194731957319673197731987319973200732017320273203732047320573206732077320873209732107321173212732137321473215732167321773218732197322073221732227322373224732257322673227732287322973230732317323273233732347323573236732377323873239732407324173242732437324473245732467324773248732497325073251732527325373254732557325673257732587325973260732617326273263732647326573266732677326873269732707327173272732737327473275732767327773278732797328073281732827328373284732857328673287732887328973290732917329273293732947329573296732977329873299733007330173302733037330473305733067330773308733097331073311733127331373314733157331673317733187331973320733217332273323733247332573326733277332873329733307333173332733337333473335733367333773338733397334073341733427334373344733457334673347733487334973350733517335273353733547335573356733577335873359733607336173362733637336473365733667336773368733697337073371733727337373374733757337673377733787337973380733817338273383733847338573386733877338873389733907339173392733937339473395733967339773398733997340073401734027340373404734057340673407734087340973410734117341273413734147341573416734177341873419734207342173422734237342473425734267342773428734297343073431734327343373434734357343673437734387343973440734417344273443734447344573446734477344873449734507345173452734537345473455734567345773458734597346073461734627346373464734657346673467734687346973470734717347273473734747347573476734777347873479734807348173482734837348473485734867348773488734897349073491734927349373494734957349673497734987349973500735017350273503735047350573506735077350873509735107351173512735137351473515735167351773518735197352073521735227352373524735257352673527735287352973530735317353273533735347353573536735377353873539735407354173542735437354473545735467354773548735497355073551735527355373554735557355673557735587355973560735617356273563735647356573566735677356873569735707357173572735737357473575735767357773578735797358073581735827358373584735857358673587735887358973590735917359273593735947359573596735977359873599736007360173602736037360473605736067360773608736097361073611736127361373614736157361673617736187361973620736217362273623736247362573626736277362873629736307363173632736337363473635736367363773638736397364073641736427364373644736457364673647736487364973650736517365273653736547365573656736577365873659736607366173662736637366473665736667366773668736697367073671736727367373674736757367673677736787367973680736817368273683736847368573686736877368873689736907369173692736937369473695736967369773698736997370073701737027370373704737057370673707737087370973710737117371273713737147371573716737177371873719737207372173722737237372473725737267372773728737297373073731737327373373734737357373673737737387373973740737417374273743737447374573746737477374873749737507375173752737537375473755737567375773758737597376073761737627376373764737657376673767737687376973770737717377273773737747377573776737777377873779737807378173782737837378473785737867378773788737897379073791737927379373794737957379673797737987379973800738017380273803738047380573806738077380873809738107381173812738137381473815738167381773818738197382073821738227382373824738257382673827738287382973830738317383273833738347383573836738377383873839738407384173842738437384473845738467384773848738497385073851738527385373854738557385673857738587385973860738617386273863738647386573866738677386873869738707387173872738737387473875738767387773878738797388073881738827388373884738857388673887738887388973890738917389273893738947389573896738977389873899739007390173902739037390473905739067390773908739097391073911739127391373914739157391673917739187391973920739217392273923739247392573926739277392873929739307393173932739337393473935739367393773938739397394073941739427394373944739457394673947739487394973950739517395273953739547395573956739577395873959739607396173962739637396473965739667396773968739697397073971739727397373974739757397673977739787397973980739817398273983739847398573986739877398873989739907399173992739937399473995739967399773998739997400074001740027400374004740057400674007740087400974010740117401274013740147401574016740177401874019740207402174022740237402474025740267402774028740297403074031740327403374034740357403674037740387403974040740417404274043740447404574046740477404874049740507405174052740537405474055740567405774058740597406074061740627406374064740657406674067740687406974070740717407274073740747407574076740777407874079740807408174082740837408474085740867408774088740897409074091740927409374094740957409674097740987409974100741017410274103741047410574106741077410874109741107411174112741137411474115741167411774118741197412074121741227412374124741257412674127741287412974130741317413274133741347413574136741377413874139741407414174142741437414474145741467414774148741497415074151741527415374154741557415674157741587415974160741617416274163741647416574166741677416874169741707417174172741737417474175741767417774178741797418074181741827418374184741857418674187741887418974190741917419274193741947419574196741977419874199742007420174202742037420474205742067420774208742097421074211742127421374214742157421674217742187421974220742217422274223742247422574226742277422874229742307423174232742337423474235742367423774238742397424074241742427424374244742457424674247742487424974250742517425274253742547425574256742577425874259742607426174262742637426474265742667426774268742697427074271742727427374274742757427674277742787427974280742817428274283742847428574286742877428874289742907429174292742937429474295742967429774298742997430074301743027430374304743057430674307743087430974310743117431274313743147431574316743177431874319743207432174322743237432474325743267432774328743297433074331743327433374334743357433674337743387433974340743417434274343743447434574346743477434874349743507435174352743537435474355743567435774358743597436074361743627436374364743657436674367743687436974370743717437274373743747437574376743777437874379743807438174382743837438474385743867438774388743897439074391743927439374394743957439674397743987439974400744017440274403744047440574406744077440874409744107441174412744137441474415744167441774418744197442074421744227442374424744257442674427744287442974430744317443274433744347443574436744377443874439744407444174442744437444474445744467444774448744497445074451744527445374454744557445674457744587445974460744617446274463744647446574466744677446874469744707447174472744737447474475744767447774478744797448074481744827448374484744857448674487744887448974490744917449274493744947449574496744977449874499745007450174502745037450474505745067450774508745097451074511745127451374514745157451674517745187451974520745217452274523745247452574526745277452874529745307453174532745337453474535745367453774538745397454074541745427454374544745457454674547745487454974550745517455274553745547455574556745577455874559745607456174562745637456474565745667456774568745697457074571745727457374574745757457674577745787457974580745817458274583745847458574586745877458874589745907459174592745937459474595745967459774598745997460074601746027460374604746057460674607746087460974610746117461274613746147461574616746177461874619746207462174622746237462474625746267462774628746297463074631746327463374634746357463674637746387463974640746417464274643746447464574646746477464874649746507465174652746537465474655746567465774658746597466074661746627466374664746657466674667746687466974670746717467274673746747467574676746777467874679746807468174682746837468474685746867468774688746897469074691746927469374694746957469674697746987469974700747017470274703747047470574706747077470874709747107471174712747137471474715747167471774718747197472074721747227472374724747257472674727747287472974730747317473274733747347473574736747377473874739747407474174742747437474474745747467474774748747497475074751747527475374754747557475674757747587475974760747617476274763747647476574766747677476874769747707477174772747737477474775747767477774778747797478074781747827478374784747857478674787747887478974790747917479274793747947479574796747977479874799748007480174802748037480474805748067480774808748097481074811748127481374814748157481674817748187481974820748217482274823748247482574826748277482874829748307483174832748337483474835748367483774838748397484074841748427484374844748457484674847748487484974850748517485274853748547485574856748577485874859748607486174862748637486474865748667486774868748697487074871748727487374874748757487674877748787487974880748817488274883748847488574886748877488874889748907489174892748937489474895748967489774898748997490074901749027490374904749057490674907749087490974910749117491274913749147491574916749177491874919749207492174922749237492474925749267492774928749297493074931749327493374934749357493674937749387493974940749417494274943749447494574946749477494874949749507495174952749537495474955749567495774958749597496074961749627496374964749657496674967749687496974970749717497274973749747497574976749777497874979749807498174982749837498474985749867498774988749897499074991749927499374994749957499674997749987499975000750017500275003750047500575006750077500875009750107501175012750137501475015750167501775018750197502075021750227502375024750257502675027750287502975030750317503275033750347503575036750377503875039750407504175042750437504475045750467504775048750497505075051750527505375054750557505675057750587505975060750617506275063750647506575066750677506875069750707507175072750737507475075750767507775078750797508075081750827508375084750857508675087750887508975090750917509275093750947509575096750977509875099751007510175102751037510475105751067510775108751097511075111751127511375114751157511675117751187511975120751217512275123751247512575126751277512875129751307513175132751337513475135751367513775138751397514075141751427514375144751457514675147751487514975150751517515275153751547515575156751577515875159751607516175162751637516475165751667516775168751697517075171751727517375174751757517675177751787517975180751817518275183751847518575186751877518875189751907519175192751937519475195751967519775198751997520075201752027520375204752057520675207752087520975210752117521275213752147521575216752177521875219752207522175222752237522475225752267522775228752297523075231752327523375234752357523675237752387523975240752417524275243752447524575246752477524875249752507525175252752537525475255752567525775258752597526075261752627526375264752657526675267752687526975270752717527275273752747527575276752777527875279752807528175282752837528475285752867528775288752897529075291752927529375294752957529675297752987529975300753017530275303753047530575306753077530875309753107531175312753137531475315753167531775318753197532075321753227532375324753257532675327753287532975330753317533275333753347533575336753377533875339753407534175342753437534475345753467534775348753497535075351753527535375354753557535675357753587535975360753617536275363753647536575366753677536875369753707537175372753737537475375753767537775378753797538075381753827538375384753857538675387753887538975390753917539275393753947539575396753977539875399754007540175402754037540475405754067540775408754097541075411754127541375414754157541675417754187541975420754217542275423754247542575426754277542875429754307543175432754337543475435754367543775438754397544075441754427544375444754457544675447754487544975450754517545275453754547545575456754577545875459754607546175462754637546475465754667546775468754697547075471754727547375474754757547675477754787547975480754817548275483754847548575486754877548875489754907549175492754937549475495754967549775498754997550075501755027550375504755057550675507755087550975510755117551275513755147551575516755177551875519755207552175522755237552475525755267552775528755297553075531755327553375534755357553675537755387553975540755417554275543755447554575546755477554875549755507555175552755537555475555755567555775558755597556075561755627556375564755657556675567755687556975570755717557275573755747557575576755777557875579755807558175582755837558475585755867558775588755897559075591755927559375594755957559675597755987559975600756017560275603756047560575606756077560875609756107561175612756137561475615756167561775618756197562075621756227562375624756257562675627756287562975630756317563275633756347563575636756377563875639756407564175642756437564475645756467564775648756497565075651756527565375654756557565675657756587565975660756617566275663756647566575666756677566875669756707567175672756737567475675756767567775678756797568075681756827568375684756857568675687756887568975690756917569275693756947569575696756977569875699757007570175702757037570475705757067570775708757097571075711757127571375714757157571675717757187571975720757217572275723757247572575726757277572875729757307573175732757337573475735757367573775738757397574075741757427574375744757457574675747757487574975750757517575275753757547575575756757577575875759757607576175762757637576475765757667576775768757697577075771757727577375774757757577675777757787577975780757817578275783757847578575786757877578875789757907579175792757937579475795757967579775798757997580075801758027580375804758057580675807758087580975810758117581275813758147581575816758177581875819758207582175822758237582475825758267582775828758297583075831758327583375834758357583675837758387583975840758417584275843758447584575846758477584875849758507585175852758537585475855758567585775858758597586075861758627586375864758657586675867758687586975870758717587275873758747587575876758777587875879758807588175882758837588475885758867588775888758897589075891758927589375894758957589675897758987589975900759017590275903759047590575906759077590875909759107591175912759137591475915759167591775918759197592075921759227592375924759257592675927759287592975930759317593275933759347593575936759377593875939759407594175942759437594475945759467594775948759497595075951759527595375954759557595675957759587595975960759617596275963759647596575966759677596875969759707597175972759737597475975759767597775978759797598075981759827598375984759857598675987759887598975990759917599275993759947599575996759977599875999760007600176002760037600476005760067600776008760097601076011760127601376014760157601676017760187601976020760217602276023760247602576026760277602876029760307603176032760337603476035760367603776038760397604076041760427604376044760457604676047760487604976050760517605276053760547605576056760577605876059760607606176062760637606476065760667606776068760697607076071760727607376074760757607676077760787607976080760817608276083760847608576086760877608876089760907609176092760937609476095760967609776098760997610076101761027610376104761057610676107761087610976110761117611276113761147611576116761177611876119761207612176122761237612476125761267612776128761297613076131761327613376134761357613676137761387613976140761417614276143761447614576146761477614876149761507615176152761537615476155761567615776158761597616076161761627616376164761657616676167761687616976170761717617276173761747617576176761777617876179761807618176182761837618476185761867618776188761897619076191761927619376194761957619676197761987619976200762017620276203762047620576206762077620876209762107621176212762137621476215762167621776218762197622076221762227622376224762257622676227762287622976230762317623276233762347623576236762377623876239762407624176242762437624476245762467624776248762497625076251762527625376254762557625676257762587625976260762617626276263762647626576266762677626876269762707627176272762737627476275762767627776278762797628076281762827628376284762857628676287762887628976290762917629276293762947629576296762977629876299763007630176302763037630476305763067630776308763097631076311763127631376314763157631676317763187631976320763217632276323763247632576326763277632876329763307633176332763337633476335763367633776338763397634076341763427634376344763457634676347763487634976350763517635276353763547635576356763577635876359763607636176362763637636476365763667636776368763697637076371763727637376374763757637676377763787637976380763817638276383763847638576386763877638876389763907639176392763937639476395763967639776398763997640076401764027640376404764057640676407764087640976410764117641276413764147641576416764177641876419764207642176422764237642476425764267642776428764297643076431764327643376434764357643676437764387643976440764417644276443764447644576446764477644876449764507645176452764537645476455764567645776458764597646076461764627646376464764657646676467764687646976470764717647276473764747647576476764777647876479764807648176482764837648476485764867648776488764897649076491764927649376494764957649676497764987649976500765017650276503765047650576506765077650876509765107651176512765137651476515765167651776518765197652076521765227652376524765257652676527765287652976530765317653276533765347653576536765377653876539765407654176542765437654476545765467654776548765497655076551765527655376554765557655676557765587655976560765617656276563765647656576566765677656876569765707657176572765737657476575765767657776578765797658076581765827658376584765857658676587765887658976590765917659276593765947659576596765977659876599766007660176602766037660476605766067660776608766097661076611766127661376614766157661676617766187661976620766217662276623766247662576626766277662876629766307663176632766337663476635766367663776638766397664076641766427664376644766457664676647766487664976650766517665276653766547665576656766577665876659766607666176662766637666476665766667666776668766697667076671766727667376674766757667676677766787667976680766817668276683766847668576686766877668876689766907669176692766937669476695766967669776698766997670076701767027670376704767057670676707767087670976710767117671276713767147671576716767177671876719767207672176722767237672476725767267672776728767297673076731767327673376734767357673676737767387673976740767417674276743767447674576746767477674876749767507675176752767537675476755767567675776758767597676076761767627676376764767657676676767767687676976770767717677276773767747677576776767777677876779767807678176782767837678476785767867678776788767897679076791767927679376794767957679676797767987679976800768017680276803768047680576806768077680876809768107681176812768137681476815768167681776818768197682076821768227682376824768257682676827768287682976830768317683276833768347683576836768377683876839768407684176842768437684476845768467684776848768497685076851768527685376854768557685676857768587685976860768617686276863768647686576866768677686876869768707687176872768737687476875768767687776878768797688076881768827688376884768857688676887768887688976890768917689276893768947689576896768977689876899769007690176902769037690476905769067690776908769097691076911769127691376914769157691676917769187691976920769217692276923769247692576926769277692876929769307693176932769337693476935769367693776938769397694076941769427694376944769457694676947769487694976950769517695276953769547695576956769577695876959769607696176962769637696476965769667696776968769697697076971769727697376974769757697676977769787697976980769817698276983769847698576986769877698876989769907699176992769937699476995769967699776998769997700077001770027700377004770057700677007770087700977010770117701277013770147701577016770177701877019770207702177022770237702477025770267702777028770297703077031770327703377034770357703677037770387703977040770417704277043770447704577046770477704877049770507705177052770537705477055770567705777058770597706077061770627706377064770657706677067770687706977070770717707277073770747707577076770777707877079770807708177082770837708477085770867708777088770897709077091770927709377094770957709677097770987709977100771017710277103771047710577106771077710877109771107711177112771137711477115771167711777118771197712077121771227712377124771257712677127771287712977130771317713277133771347713577136771377713877139771407714177142771437714477145771467714777148771497715077151771527715377154771557715677157771587715977160771617716277163771647716577166771677716877169771707717177172771737717477175771767717777178771797718077181771827718377184771857718677187771887718977190771917719277193771947719577196771977719877199772007720177202772037720477205772067720777208772097721077211772127721377214772157721677217772187721977220772217722277223772247722577226772277722877229772307723177232772337723477235772367723777238772397724077241772427724377244772457724677247772487724977250772517725277253772547725577256772577725877259772607726177262772637726477265772667726777268772697727077271772727727377274772757727677277772787727977280772817728277283772847728577286772877728877289772907729177292772937729477295772967729777298772997730077301773027730377304773057730677307773087730977310773117731277313773147731577316773177731877319773207732177322773237732477325773267732777328773297733077331773327733377334773357733677337773387733977340773417734277343773447734577346773477734877349773507735177352773537735477355773567735777358773597736077361773627736377364773657736677367773687736977370773717737277373773747737577376773777737877379773807738177382773837738477385773867738777388773897739077391773927739377394773957739677397773987739977400774017740277403774047740577406774077740877409774107741177412774137741477415774167741777418774197742077421774227742377424774257742677427774287742977430774317743277433774347743577436774377743877439774407744177442774437744477445774467744777448774497745077451774527745377454774557745677457774587745977460774617746277463774647746577466774677746877469774707747177472774737747477475774767747777478774797748077481774827748377484774857748677487774887748977490774917749277493774947749577496774977749877499775007750177502775037750477505775067750777508775097751077511775127751377514775157751677517775187751977520775217752277523775247752577526775277752877529775307753177532775337753477535775367753777538775397754077541775427754377544775457754677547775487754977550775517755277553775547755577556775577755877559775607756177562775637756477565775667756777568775697757077571775727757377574775757757677577775787757977580775817758277583775847758577586775877758877589775907759177592775937759477595775967759777598775997760077601776027760377604776057760677607776087760977610776117761277613776147761577616776177761877619776207762177622776237762477625776267762777628776297763077631776327763377634776357763677637776387763977640776417764277643776447764577646776477764877649776507765177652776537765477655776567765777658776597766077661776627766377664776657766677667776687766977670776717767277673776747767577676776777767877679776807768177682776837768477685776867768777688776897769077691776927769377694776957769677697776987769977700777017770277703777047770577706777077770877709777107771177712777137771477715777167771777718777197772077721777227772377724777257772677727777287772977730777317773277733777347773577736777377773877739777407774177742777437774477745777467774777748777497775077751777527775377754777557775677757777587775977760777617776277763777647776577766777677776877769777707777177772777737777477775777767777777778777797778077781777827778377784777857778677787777887778977790777917779277793777947779577796777977779877799778007780177802778037780477805778067780777808778097781077811778127781377814778157781677817778187781977820778217782277823778247782577826778277782877829778307783177832778337783477835778367783777838778397784077841778427784377844778457784677847778487784977850778517785277853778547785577856778577785877859778607786177862778637786477865778667786777868778697787077871778727787377874778757787677877778787787977880778817788277883778847788577886778877788877889778907789177892778937789477895778967789777898778997790077901779027790377904779057790677907779087790977910779117791277913779147791577916779177791877919779207792177922779237792477925779267792777928779297793077931779327793377934779357793677937779387793977940779417794277943779447794577946779477794877949779507795177952779537795477955779567795777958779597796077961779627796377964779657796677967779687796977970779717797277973779747797577976779777797877979779807798177982779837798477985779867798777988779897799077991779927799377994779957799677997779987799978000780017800278003780047800578006780077800878009780107801178012780137801478015780167801778018780197802078021780227802378024780257802678027780287802978030780317803278033780347803578036780377803878039780407804178042780437804478045780467804778048780497805078051780527805378054780557805678057780587805978060780617806278063780647806578066780677806878069780707807178072780737807478075780767807778078780797808078081780827808378084780857808678087780887808978090780917809278093780947809578096780977809878099781007810178102781037810478105781067810778108781097811078111781127811378114781157811678117781187811978120781217812278123781247812578126781277812878129781307813178132781337813478135781367813778138781397814078141781427814378144781457814678147781487814978150781517815278153781547815578156781577815878159781607816178162781637816478165781667816778168781697817078171781727817378174781757817678177781787817978180781817818278183781847818578186781877818878189781907819178192781937819478195781967819778198781997820078201782027820378204782057820678207782087820978210782117821278213782147821578216782177821878219782207822178222782237822478225782267822778228782297823078231782327823378234782357823678237782387823978240782417824278243782447824578246782477824878249782507825178252782537825478255782567825778258782597826078261782627826378264782657826678267782687826978270782717827278273782747827578276782777827878279782807828178282782837828478285782867828778288782897829078291782927829378294782957829678297782987829978300783017830278303783047830578306783077830878309783107831178312783137831478315783167831778318783197832078321783227832378324783257832678327783287832978330783317833278333783347833578336783377833878339783407834178342783437834478345783467834778348783497835078351783527835378354783557835678357783587835978360783617836278363783647836578366783677836878369783707837178372783737837478375783767837778378783797838078381783827838378384783857838678387783887838978390783917839278393783947839578396783977839878399784007840178402784037840478405784067840778408784097841078411784127841378414784157841678417784187841978420784217842278423784247842578426784277842878429784307843178432784337843478435784367843778438784397844078441784427844378444784457844678447784487844978450784517845278453784547845578456784577845878459784607846178462784637846478465784667846778468784697847078471784727847378474784757847678477784787847978480784817848278483784847848578486784877848878489784907849178492784937849478495784967849778498784997850078501785027850378504785057850678507785087850978510785117851278513785147851578516785177851878519785207852178522785237852478525785267852778528785297853078531785327853378534785357853678537785387853978540785417854278543785447854578546785477854878549785507855178552785537855478555785567855778558785597856078561785627856378564785657856678567785687856978570785717857278573785747857578576785777857878579785807858178582785837858478585785867858778588785897859078591785927859378594785957859678597785987859978600786017860278603786047860578606786077860878609786107861178612786137861478615786167861778618786197862078621786227862378624786257862678627786287862978630786317863278633786347863578636786377863878639786407864178642786437864478645786467864778648786497865078651786527865378654786557865678657786587865978660786617866278663786647866578666786677866878669786707867178672786737867478675786767867778678786797868078681786827868378684786857868678687786887868978690786917869278693786947869578696786977869878699787007870178702787037870478705787067870778708787097871078711787127871378714787157871678717787187871978720787217872278723787247872578726787277872878729787307873178732787337873478735787367873778738787397874078741787427874378744787457874678747787487874978750787517875278753787547875578756787577875878759787607876178762787637876478765787667876778768787697877078771787727877378774787757877678777787787877978780787817878278783787847878578786787877878878789787907879178792787937879478795787967879778798787997880078801788027880378804788057880678807788087880978810788117881278813788147881578816788177881878819788207882178822788237882478825788267882778828788297883078831788327883378834788357883678837788387883978840788417884278843788447884578846788477884878849788507885178852788537885478855788567885778858788597886078861788627886378864788657886678867788687886978870788717887278873788747887578876788777887878879788807888178882788837888478885788867888778888788897889078891788927889378894788957889678897788987889978900789017890278903789047890578906789077890878909789107891178912789137891478915789167891778918789197892078921789227892378924789257892678927789287892978930789317893278933789347893578936789377893878939789407894178942789437894478945789467894778948789497895078951789527895378954789557895678957789587895978960789617896278963789647896578966789677896878969789707897178972789737897478975789767897778978789797898078981789827898378984789857898678987789887898978990789917899278993789947899578996789977899878999790007900179002790037900479005790067900779008790097901079011790127901379014790157901679017790187901979020790217902279023790247902579026790277902879029790307903179032790337903479035790367903779038790397904079041790427904379044790457904679047790487904979050790517905279053790547905579056790577905879059790607906179062790637906479065790667906779068790697907079071790727907379074790757907679077790787907979080790817908279083790847908579086790877908879089790907909179092790937909479095790967909779098790997910079101791027910379104791057910679107791087910979110791117911279113791147911579116791177911879119791207912179122791237912479125791267912779128791297913079131791327913379134791357913679137791387913979140791417914279143791447914579146791477914879149791507915179152791537915479155791567915779158791597916079161791627916379164791657916679167791687916979170791717917279173791747917579176791777917879179791807918179182791837918479185791867918779188791897919079191791927919379194791957919679197791987919979200792017920279203792047920579206792077920879209792107921179212792137921479215792167921779218792197922079221792227922379224792257922679227792287922979230792317923279233792347923579236792377923879239792407924179242792437924479245792467924779248792497925079251792527925379254792557925679257792587925979260792617926279263792647926579266792677926879269792707927179272792737927479275792767927779278792797928079281792827928379284792857928679287792887928979290792917929279293792947929579296792977929879299793007930179302793037930479305793067930779308793097931079311793127931379314793157931679317793187931979320793217932279323793247932579326793277932879329793307933179332793337933479335793367933779338793397934079341793427934379344793457934679347793487934979350793517935279353793547935579356793577935879359793607936179362793637936479365793667936779368793697937079371793727937379374793757937679377793787937979380793817938279383793847938579386793877938879389793907939179392793937939479395793967939779398793997940079401794027940379404794057940679407794087940979410794117941279413794147941579416794177941879419794207942179422794237942479425794267942779428794297943079431794327943379434794357943679437794387943979440794417944279443794447944579446794477944879449794507945179452794537945479455794567945779458794597946079461794627946379464794657946679467794687946979470794717947279473794747947579476794777947879479794807948179482794837948479485794867948779488794897949079491794927949379494794957949679497794987949979500795017950279503795047950579506795077950879509795107951179512795137951479515795167951779518795197952079521795227952379524795257952679527795287952979530795317953279533795347953579536795377953879539795407954179542795437954479545795467954779548795497955079551795527955379554795557955679557795587955979560795617956279563795647956579566795677956879569795707957179572795737957479575795767957779578795797958079581795827958379584795857958679587795887958979590795917959279593795947959579596795977959879599796007960179602796037960479605796067960779608796097961079611796127961379614796157961679617796187961979620796217962279623796247962579626796277962879629796307963179632796337963479635796367963779638796397964079641796427964379644796457964679647796487964979650796517965279653796547965579656796577965879659796607966179662796637966479665796667966779668796697967079671796727967379674796757967679677796787967979680796817968279683796847968579686796877968879689796907969179692796937969479695796967969779698796997970079701797027970379704797057970679707797087970979710797117971279713797147971579716797177971879719797207972179722797237972479725797267972779728797297973079731797327973379734797357973679737797387973979740797417974279743797447974579746797477974879749797507975179752797537975479755797567975779758797597976079761797627976379764797657976679767797687976979770797717977279773797747977579776797777977879779797807978179782797837978479785797867978779788797897979079791797927979379794797957979679797797987979979800798017980279803798047980579806798077980879809798107981179812798137981479815798167981779818798197982079821798227982379824798257982679827798287982979830798317983279833798347983579836798377983879839798407984179842798437984479845798467984779848798497985079851798527985379854798557985679857798587985979860798617986279863798647986579866798677986879869798707987179872798737987479875798767987779878798797988079881798827988379884798857988679887798887988979890798917989279893798947989579896798977989879899799007990179902799037990479905799067990779908799097991079911799127991379914799157991679917799187991979920799217992279923799247992579926799277992879929799307993179932799337993479935799367993779938799397994079941799427994379944799457994679947799487994979950799517995279953799547995579956799577995879959799607996179962799637996479965799667996779968799697997079971799727997379974799757997679977799787997979980799817998279983799847998579986799877998879989799907999179992799937999479995799967999779998799998000080001800028000380004800058000680007800088000980010800118001280013800148001580016800178001880019800208002180022800238002480025800268002780028800298003080031800328003380034800358003680037800388003980040800418004280043800448004580046800478004880049800508005180052800538005480055800568005780058800598006080061800628006380064800658006680067800688006980070800718007280073800748007580076800778007880079800808008180082800838008480085800868008780088800898009080091800928009380094800958009680097800988009980100801018010280103801048010580106801078010880109801108011180112801138011480115801168011780118801198012080121801228012380124801258012680127801288012980130801318013280133801348013580136801378013880139801408014180142801438014480145801468014780148801498015080151801528015380154801558015680157801588015980160801618016280163801648016580166801678016880169801708017180172801738017480175801768017780178801798018080181801828018380184801858018680187801888018980190801918019280193801948019580196801978019880199802008020180202802038020480205802068020780208802098021080211802128021380214802158021680217802188021980220802218022280223802248022580226802278022880229802308023180232802338023480235802368023780238802398024080241802428024380244802458024680247802488024980250802518025280253802548025580256802578025880259802608026180262802638026480265802668026780268802698027080271802728027380274802758027680277802788027980280802818028280283802848028580286802878028880289802908029180292802938029480295802968029780298802998030080301803028030380304803058030680307803088030980310803118031280313803148031580316803178031880319803208032180322803238032480325803268032780328803298033080331803328033380334803358033680337803388033980340803418034280343803448034580346803478034880349803508035180352803538035480355803568035780358803598036080361803628036380364803658036680367803688036980370803718037280373803748037580376803778037880379803808038180382803838038480385803868038780388803898039080391803928039380394803958039680397803988039980400804018040280403804048040580406804078040880409804108041180412804138041480415804168041780418804198042080421804228042380424804258042680427804288042980430804318043280433804348043580436804378043880439804408044180442804438044480445804468044780448804498045080451804528045380454804558045680457804588045980460804618046280463804648046580466804678046880469804708047180472804738047480475804768047780478804798048080481804828048380484804858048680487804888048980490804918049280493804948049580496804978049880499805008050180502805038050480505805068050780508805098051080511805128051380514805158051680517805188051980520805218052280523805248052580526805278052880529805308053180532805338053480535805368053780538805398054080541805428054380544805458054680547805488054980550805518055280553805548055580556805578055880559805608056180562805638056480565805668056780568805698057080571805728057380574805758057680577805788057980580805818058280583805848058580586805878058880589805908059180592805938059480595805968059780598805998060080601806028060380604806058060680607806088060980610806118061280613806148061580616806178061880619806208062180622806238062480625806268062780628806298063080631806328063380634806358063680637806388063980640806418064280643806448064580646806478064880649806508065180652806538065480655806568065780658806598066080661806628066380664806658066680667806688066980670806718067280673806748067580676806778067880679806808068180682806838068480685806868068780688806898069080691806928069380694806958069680697806988069980700807018070280703807048070580706807078070880709807108071180712807138071480715807168071780718807198072080721807228072380724807258072680727807288072980730807318073280733807348073580736807378073880739807408074180742807438074480745807468074780748807498075080751807528075380754807558075680757807588075980760807618076280763807648076580766807678076880769807708077180772807738077480775807768077780778807798078080781807828078380784807858078680787807888078980790807918079280793807948079580796807978079880799808008080180802808038080480805808068080780808808098081080811808128081380814808158081680817808188081980820808218082280823808248082580826808278082880829808308083180832808338083480835808368083780838808398084080841808428084380844808458084680847808488084980850808518085280853808548085580856808578085880859808608086180862808638086480865808668086780868808698087080871808728087380874808758087680877808788087980880808818088280883808848088580886808878088880889808908089180892808938089480895808968089780898808998090080901809028090380904809058090680907809088090980910809118091280913809148091580916809178091880919809208092180922809238092480925809268092780928809298093080931809328093380934809358093680937809388093980940809418094280943809448094580946809478094880949809508095180952809538095480955809568095780958809598096080961809628096380964809658096680967809688096980970809718097280973809748097580976809778097880979809808098180982809838098480985809868098780988809898099080991809928099380994809958099680997809988099981000810018100281003810048100581006810078100881009810108101181012810138101481015810168101781018810198102081021810228102381024810258102681027810288102981030810318103281033810348103581036810378103881039810408104181042810438104481045810468104781048810498105081051810528105381054810558105681057810588105981060810618106281063810648106581066810678106881069810708107181072810738107481075810768107781078810798108081081810828108381084810858108681087810888108981090810918109281093810948109581096810978109881099811008110181102811038110481105811068110781108811098111081111811128111381114811158111681117811188111981120811218112281123811248112581126811278112881129811308113181132811338113481135811368113781138811398114081141811428114381144811458114681147811488114981150811518115281153811548115581156811578115881159811608116181162811638116481165811668116781168811698117081171811728117381174811758117681177811788117981180811818118281183811848118581186811878118881189811908119181192811938119481195811968119781198811998120081201812028120381204812058120681207812088120981210812118121281213812148121581216812178121881219812208122181222812238122481225812268122781228812298123081231812328123381234812358123681237812388123981240812418124281243812448124581246812478124881249812508125181252812538125481255812568125781258812598126081261812628126381264812658126681267812688126981270812718127281273812748127581276812778127881279812808128181282812838128481285812868128781288812898129081291812928129381294812958129681297812988129981300813018130281303813048130581306813078130881309813108131181312813138131481315813168131781318813198132081321813228132381324813258132681327813288132981330813318133281333813348133581336813378133881339813408134181342813438134481345813468134781348813498135081351813528135381354813558135681357813588135981360813618136281363813648136581366813678136881369813708137181372813738137481375813768137781378813798138081381813828138381384813858138681387813888138981390813918139281393813948139581396813978139881399814008140181402814038140481405814068140781408814098141081411814128141381414814158141681417814188141981420814218142281423814248142581426814278142881429814308143181432814338143481435814368143781438814398144081441814428144381444814458144681447814488144981450814518145281453814548145581456814578145881459814608146181462814638146481465814668146781468814698147081471814728147381474814758147681477814788147981480814818148281483814848148581486814878148881489814908149181492814938149481495814968149781498814998150081501815028150381504815058150681507815088150981510815118151281513815148151581516815178151881519815208152181522815238152481525815268152781528815298153081531815328153381534815358153681537815388153981540815418154281543815448154581546815478154881549815508155181552815538155481555815568155781558815598156081561815628156381564815658156681567815688156981570815718157281573815748157581576815778157881579815808158181582815838158481585815868158781588815898159081591815928159381594815958159681597815988159981600816018160281603816048160581606816078160881609816108161181612816138161481615816168161781618816198162081621816228162381624816258162681627816288162981630816318163281633816348163581636816378163881639816408164181642816438164481645816468164781648816498165081651816528165381654816558165681657816588165981660816618166281663816648166581666816678166881669816708167181672816738167481675816768167781678816798168081681816828168381684816858168681687816888168981690816918169281693816948169581696816978169881699817008170181702817038170481705817068170781708817098171081711817128171381714817158171681717817188171981720817218172281723817248172581726817278172881729817308173181732817338173481735817368173781738817398174081741817428174381744817458174681747817488174981750817518175281753817548175581756817578175881759817608176181762817638176481765817668176781768817698177081771817728177381774817758177681777817788177981780817818178281783817848178581786817878178881789817908179181792817938179481795817968179781798817998180081801818028180381804818058180681807818088180981810818118181281813818148181581816818178181881819818208182181822818238182481825818268182781828818298183081831818328183381834818358183681837818388183981840818418184281843818448184581846818478184881849818508185181852818538185481855818568185781858818598186081861818628186381864818658186681867818688186981870818718187281873818748187581876818778187881879818808188181882818838188481885818868188781888818898189081891818928189381894818958189681897818988189981900819018190281903819048190581906819078190881909819108191181912819138191481915819168191781918819198192081921819228192381924819258192681927819288192981930819318193281933819348193581936819378193881939819408194181942819438194481945819468194781948819498195081951819528195381954819558195681957819588195981960819618196281963819648196581966819678196881969819708197181972819738197481975819768197781978819798198081981819828198381984819858198681987819888198981990819918199281993819948199581996819978199881999820008200182002820038200482005820068200782008820098201082011820128201382014820158201682017820188201982020820218202282023820248202582026820278202882029820308203182032820338203482035820368203782038820398204082041820428204382044820458204682047820488204982050820518205282053820548205582056820578205882059820608206182062820638206482065820668206782068820698207082071820728207382074820758207682077820788207982080820818208282083820848208582086820878208882089820908209182092820938209482095820968209782098820998210082101821028210382104821058210682107821088210982110821118211282113821148211582116821178211882119821208212182122821238212482125821268212782128821298213082131821328213382134821358213682137821388213982140821418214282143821448214582146821478214882149821508215182152821538215482155821568215782158821598216082161821628216382164821658216682167821688216982170821718217282173821748217582176821778217882179821808218182182821838218482185821868218782188821898219082191821928219382194821958219682197821988219982200822018220282203822048220582206822078220882209822108221182212822138221482215822168221782218822198222082221822228222382224822258222682227822288222982230822318223282233822348223582236822378223882239822408224182242822438224482245822468224782248822498225082251822528225382254822558225682257822588225982260822618226282263822648226582266822678226882269822708227182272822738227482275822768227782278822798228082281822828228382284822858228682287822888228982290822918229282293822948229582296822978229882299823008230182302823038230482305823068230782308823098231082311823128231382314823158231682317823188231982320823218232282323823248232582326823278232882329823308233182332823338233482335823368233782338823398234082341823428234382344823458234682347823488234982350823518235282353823548235582356823578235882359823608236182362823638236482365823668236782368823698237082371823728237382374823758237682377823788237982380823818238282383823848238582386823878238882389823908239182392823938239482395823968239782398823998240082401824028240382404824058240682407824088240982410824118241282413824148241582416824178241882419824208242182422824238242482425824268242782428824298243082431824328243382434824358243682437824388243982440824418244282443824448244582446824478244882449824508245182452824538245482455824568245782458824598246082461824628246382464824658246682467824688246982470824718247282473824748247582476824778247882479824808248182482824838248482485824868248782488824898249082491824928249382494824958249682497824988249982500825018250282503825048250582506825078250882509825108251182512825138251482515825168251782518825198252082521825228252382524825258252682527825288252982530825318253282533825348253582536825378253882539825408254182542825438254482545825468254782548825498255082551825528255382554825558255682557825588255982560825618256282563825648256582566825678256882569825708257182572825738257482575825768257782578825798258082581825828258382584825858258682587825888258982590825918259282593825948259582596825978259882599826008260182602826038260482605826068260782608826098261082611826128261382614826158261682617826188261982620826218262282623826248262582626826278262882629826308263182632826338263482635826368263782638826398264082641826428264382644826458264682647826488264982650826518265282653826548265582656826578265882659826608266182662826638266482665826668266782668826698267082671826728267382674826758267682677826788267982680826818268282683826848268582686826878268882689826908269182692826938269482695826968269782698826998270082701827028270382704827058270682707827088270982710827118271282713827148271582716827178271882719827208272182722827238272482725827268272782728827298273082731827328273382734827358273682737827388273982740827418274282743827448274582746827478274882749827508275182752827538275482755827568275782758827598276082761827628276382764827658276682767827688276982770827718277282773827748277582776827778277882779827808278182782827838278482785827868278782788827898279082791827928279382794827958279682797827988279982800828018280282803828048280582806828078280882809828108281182812828138281482815828168281782818828198282082821828228282382824828258282682827828288282982830828318283282833828348283582836828378283882839828408284182842828438284482845828468284782848828498285082851828528285382854828558285682857828588285982860828618286282863828648286582866828678286882869828708287182872828738287482875828768287782878828798288082881828828288382884828858288682887828888288982890828918289282893828948289582896828978289882899829008290182902829038290482905829068290782908829098291082911829128291382914829158291682917829188291982920829218292282923829248292582926829278292882929829308293182932829338293482935829368293782938829398294082941829428294382944829458294682947829488294982950829518295282953829548295582956829578295882959829608296182962829638296482965829668296782968829698297082971829728297382974829758297682977829788297982980829818298282983829848298582986829878298882989829908299182992829938299482995829968299782998829998300083001830028300383004830058300683007830088300983010830118301283013830148301583016830178301883019830208302183022830238302483025830268302783028830298303083031830328303383034830358303683037830388303983040830418304283043830448304583046830478304883049830508305183052830538305483055830568305783058830598306083061830628306383064830658306683067830688306983070830718307283073830748307583076830778307883079830808308183082830838308483085830868308783088830898309083091830928309383094830958309683097830988309983100831018310283103831048310583106831078310883109831108311183112831138311483115831168311783118831198312083121831228312383124831258312683127831288312983130831318313283133831348313583136831378313883139831408314183142831438314483145831468314783148831498315083151831528315383154831558315683157831588315983160831618316283163831648316583166831678316883169831708317183172831738317483175831768317783178831798318083181831828318383184831858318683187831888318983190831918319283193831948319583196831978319883199832008320183202832038320483205832068320783208832098321083211832128321383214832158321683217832188321983220832218322283223832248322583226832278322883229832308323183232832338323483235832368323783238832398324083241832428324383244832458324683247832488324983250832518325283253832548325583256832578325883259832608326183262832638326483265832668326783268832698327083271832728327383274832758327683277832788327983280832818328283283832848328583286832878328883289832908329183292832938329483295832968329783298832998330083301833028330383304833058330683307833088330983310833118331283313833148331583316833178331883319833208332183322833238332483325833268332783328833298333083331833328333383334833358333683337833388333983340833418334283343833448334583346833478334883349833508335183352833538335483355833568335783358833598336083361833628336383364833658336683367833688336983370833718337283373833748337583376833778337883379833808338183382833838338483385833868338783388833898339083391833928339383394833958339683397833988339983400834018340283403834048340583406834078340883409834108341183412834138341483415834168341783418834198342083421834228342383424834258342683427834288342983430834318343283433834348343583436834378343883439834408344183442834438344483445834468344783448834498345083451834528345383454834558345683457834588345983460834618346283463834648346583466834678346883469834708347183472834738347483475834768347783478834798348083481834828348383484834858348683487834888348983490834918349283493834948349583496834978349883499835008350183502835038350483505835068350783508835098351083511835128351383514835158351683517835188351983520835218352283523835248352583526835278352883529835308353183532835338353483535835368353783538835398354083541835428354383544835458354683547835488354983550835518355283553835548355583556835578355883559835608356183562835638356483565835668356783568835698357083571835728357383574835758357683577835788357983580835818358283583835848358583586835878358883589835908359183592835938359483595835968359783598835998360083601836028360383604836058360683607836088360983610836118361283613836148361583616836178361883619836208362183622836238362483625836268362783628836298363083631836328363383634836358363683637836388363983640836418364283643836448364583646836478364883649836508365183652836538365483655836568365783658836598366083661836628366383664836658366683667836688366983670836718367283673836748367583676836778367883679836808368183682836838368483685836868368783688836898369083691836928369383694836958369683697836988369983700837018370283703837048370583706837078370883709837108371183712837138371483715837168371783718837198372083721837228372383724837258372683727837288372983730837318373283733837348373583736837378373883739837408374183742837438374483745837468374783748837498375083751837528375383754837558375683757837588375983760837618376283763837648376583766837678376883769837708377183772837738377483775837768377783778837798378083781837828378383784837858378683787837888378983790837918379283793837948379583796837978379883799838008380183802838038380483805838068380783808838098381083811838128381383814838158381683817838188381983820838218382283823838248382583826838278382883829838308383183832838338383483835838368383783838838398384083841838428384383844838458384683847838488384983850838518385283853838548385583856838578385883859838608386183862838638386483865838668386783868838698387083871838728387383874838758387683877838788387983880838818388283883838848388583886838878388883889838908389183892838938389483895838968389783898838998390083901839028390383904839058390683907839088390983910839118391283913839148391583916839178391883919839208392183922839238392483925839268392783928839298393083931839328393383934839358393683937839388393983940839418394283943839448394583946839478394883949839508395183952839538395483955839568395783958839598396083961839628396383964839658396683967839688396983970839718397283973839748397583976839778397883979839808398183982839838398483985839868398783988839898399083991839928399383994839958399683997839988399984000840018400284003840048400584006840078400884009840108401184012840138401484015840168401784018840198402084021840228402384024840258402684027840288402984030840318403284033840348403584036840378403884039840408404184042840438404484045840468404784048840498405084051840528405384054840558405684057840588405984060840618406284063840648406584066840678406884069840708407184072840738407484075840768407784078840798408084081840828408384084840858408684087840888408984090840918409284093840948409584096840978409884099841008410184102841038410484105841068410784108841098411084111841128411384114841158411684117841188411984120841218412284123841248412584126841278412884129841308413184132841338413484135841368413784138841398414084141841428414384144841458414684147841488414984150841518415284153841548415584156841578415884159841608416184162841638416484165841668416784168841698417084171841728417384174841758417684177841788417984180841818418284183841848418584186841878418884189841908419184192841938419484195841968419784198841998420084201842028420384204842058420684207842088420984210842118421284213842148421584216842178421884219842208422184222842238422484225842268422784228842298423084231842328423384234842358423684237842388423984240842418424284243842448424584246842478424884249842508425184252842538425484255842568425784258842598426084261842628426384264842658426684267842688426984270842718427284273842748427584276842778427884279842808428184282842838428484285842868428784288842898429084291842928429384294842958429684297842988429984300843018430284303843048430584306843078430884309843108431184312843138431484315843168431784318843198432084321843228432384324843258432684327843288432984330843318433284333843348433584336843378433884339843408434184342843438434484345843468434784348843498435084351843528435384354843558435684357843588435984360843618436284363843648436584366843678436884369843708437184372843738437484375843768437784378843798438084381843828438384384843858438684387843888438984390843918439284393843948439584396843978439884399844008440184402844038440484405844068440784408844098441084411844128441384414844158441684417844188441984420844218442284423844248442584426844278442884429844308443184432844338443484435844368443784438844398444084441844428444384444844458444684447844488444984450844518445284453844548445584456844578445884459844608446184462844638446484465844668446784468844698447084471844728447384474844758447684477844788447984480844818448284483844848448584486844878448884489844908449184492844938449484495844968449784498844998450084501845028450384504845058450684507845088450984510845118451284513845148451584516845178451884519845208452184522845238452484525845268452784528845298453084531845328453384534845358453684537845388453984540845418454284543845448454584546845478454884549845508455184552845538455484555845568455784558845598456084561845628456384564845658456684567845688456984570845718457284573845748457584576845778457884579845808458184582845838458484585845868458784588845898459084591845928459384594845958459684597845988459984600846018460284603846048460584606846078460884609846108461184612846138461484615846168461784618846198462084621846228462384624846258462684627846288462984630846318463284633846348463584636846378463884639846408464184642846438464484645846468464784648846498465084651846528465384654846558465684657846588465984660846618466284663846648466584666846678466884669846708467184672846738467484675846768467784678846798468084681846828468384684846858468684687846888468984690846918469284693846948469584696846978469884699847008470184702847038470484705847068470784708847098471084711847128471384714847158471684717847188471984720847218472284723847248472584726847278472884729847308473184732847338473484735847368473784738847398474084741847428474384744847458474684747847488474984750847518475284753847548475584756847578475884759847608476184762847638476484765847668476784768847698477084771847728477384774847758477684777847788477984780847818478284783847848478584786847878478884789847908479184792847938479484795847968479784798847998480084801848028480384804848058480684807848088480984810848118481284813848148481584816848178481884819848208482184822848238482484825848268482784828848298483084831848328483384834848358483684837848388483984840848418484284843848448484584846848478484884849848508485184852848538485484855848568485784858848598486084861848628486384864848658486684867848688486984870848718487284873848748487584876848778487884879848808488184882848838488484885848868488784888848898489084891848928489384894848958489684897848988489984900849018490284903849048490584906849078490884909849108491184912849138491484915849168491784918849198492084921849228492384924849258492684927849288492984930849318493284933849348493584936849378493884939849408494184942849438494484945849468494784948849498495084951849528495384954849558495684957849588495984960849618496284963849648496584966849678496884969849708497184972849738497484975849768497784978849798498084981849828498384984849858498684987849888498984990849918499284993849948499584996849978499884999850008500185002850038500485005850068500785008850098501085011850128501385014850158501685017850188501985020850218502285023850248502585026850278502885029850308503185032850338503485035850368503785038850398504085041850428504385044850458504685047850488504985050850518505285053850548505585056850578505885059850608506185062850638506485065850668506785068850698507085071850728507385074850758507685077850788507985080850818508285083850848508585086850878508885089850908509185092850938509485095850968509785098850998510085101851028510385104851058510685107851088510985110851118511285113851148511585116851178511885119851208512185122851238512485125851268512785128851298513085131851328513385134851358513685137851388513985140851418514285143851448514585146851478514885149851508515185152851538515485155851568515785158851598516085161851628516385164851658516685167851688516985170851718517285173851748517585176851778517885179851808518185182851838518485185851868518785188851898519085191851928519385194851958519685197851988519985200852018520285203852048520585206852078520885209852108521185212852138521485215852168521785218852198522085221852228522385224852258522685227852288522985230852318523285233852348523585236852378523885239852408524185242852438524485245852468524785248852498525085251852528525385254852558525685257852588525985260852618526285263852648526585266852678526885269852708527185272852738527485275852768527785278852798528085281852828528385284852858528685287852888528985290852918529285293852948529585296852978529885299853008530185302853038530485305853068530785308853098531085311853128531385314853158531685317853188531985320853218532285323853248532585326853278532885329853308533185332853338533485335853368533785338853398534085341853428534385344853458534685347853488534985350853518535285353853548535585356853578535885359853608536185362853638536485365853668536785368853698537085371853728537385374853758537685377853788537985380853818538285383853848538585386853878538885389853908539185392853938539485395853968539785398853998540085401854028540385404854058540685407854088540985410854118541285413854148541585416854178541885419854208542185422854238542485425854268542785428854298543085431854328543385434854358543685437854388543985440854418544285443854448544585446854478544885449854508545185452854538545485455854568545785458854598546085461854628546385464854658546685467854688546985470854718547285473854748547585476854778547885479854808548185482854838548485485854868548785488854898549085491854928549385494854958549685497854988549985500855018550285503855048550585506855078550885509855108551185512855138551485515855168551785518855198552085521855228552385524855258552685527855288552985530855318553285533855348553585536855378553885539855408554185542855438554485545855468554785548855498555085551855528555385554855558555685557855588555985560855618556285563855648556585566855678556885569855708557185572855738557485575855768557785578855798558085581855828558385584855858558685587855888558985590855918559285593855948559585596855978559885599856008560185602856038560485605856068560785608856098561085611856128561385614856158561685617856188561985620856218562285623856248562585626856278562885629856308563185632856338563485635856368563785638856398564085641856428564385644856458564685647856488564985650856518565285653856548565585656856578565885659856608566185662856638566485665856668566785668856698567085671856728567385674856758567685677856788567985680856818568285683856848568585686856878568885689856908569185692856938569485695856968569785698856998570085701857028570385704857058570685707857088570985710857118571285713857148571585716857178571885719857208572185722857238572485725857268572785728857298573085731857328573385734857358573685737857388573985740857418574285743857448574585746857478574885749857508575185752857538575485755857568575785758857598576085761857628576385764857658576685767857688576985770857718577285773857748577585776857778577885779857808578185782857838578485785857868578785788857898579085791857928579385794857958579685797857988579985800858018580285803858048580585806858078580885809858108581185812858138581485815858168581785818858198582085821858228582385824858258582685827858288582985830858318583285833858348583585836858378583885839858408584185842858438584485845858468584785848858498585085851858528585385854858558585685857858588585985860858618586285863858648586585866858678586885869858708587185872858738587485875858768587785878858798588085881858828588385884858858588685887858888588985890858918589285893858948589585896858978589885899859008590185902859038590485905859068590785908859098591085911859128591385914859158591685917859188591985920859218592285923859248592585926859278592885929859308593185932859338593485935859368593785938859398594085941859428594385944859458594685947859488594985950859518595285953859548595585956859578595885959859608596185962859638596485965859668596785968859698597085971859728597385974859758597685977859788597985980859818598285983859848598585986859878598885989859908599185992859938599485995859968599785998859998600086001860028600386004860058600686007860088600986010860118601286013860148601586016860178601886019860208602186022860238602486025860268602786028860298603086031860328603386034860358603686037860388603986040860418604286043860448604586046860478604886049860508605186052860538605486055860568605786058860598606086061860628606386064860658606686067860688606986070860718607286073860748607586076860778607886079860808608186082860838608486085860868608786088860898609086091860928609386094860958609686097860988609986100861018610286103861048610586106861078610886109861108611186112861138611486115861168611786118861198612086121861228612386124861258612686127861288612986130861318613286133861348613586136861378613886139861408614186142861438614486145861468614786148861498615086151861528615386154861558615686157861588615986160861618616286163861648616586166861678616886169861708617186172861738617486175861768617786178861798618086181861828618386184861858618686187861888618986190861918619286193861948619586196861978619886199862008620186202862038620486205862068620786208862098621086211862128621386214862158621686217862188621986220862218622286223862248622586226862278622886229862308623186232862338623486235862368623786238862398624086241862428624386244862458624686247862488624986250862518625286253862548625586256862578625886259862608626186262862638626486265862668626786268862698627086271862728627386274862758627686277862788627986280862818628286283862848628586286862878628886289862908629186292862938629486295862968629786298862998630086301863028630386304863058630686307863088630986310863118631286313863148631586316863178631886319863208632186322863238632486325863268632786328863298633086331863328633386334863358633686337863388633986340863418634286343863448634586346863478634886349863508635186352863538635486355863568635786358863598636086361863628636386364863658636686367863688636986370863718637286373863748637586376863778637886379863808638186382863838638486385863868638786388863898639086391863928639386394863958639686397863988639986400864018640286403864048640586406864078640886409864108641186412864138641486415864168641786418864198642086421864228642386424864258642686427864288642986430864318643286433864348643586436864378643886439864408644186442864438644486445864468644786448864498645086451864528645386454864558645686457864588645986460864618646286463864648646586466864678646886469864708647186472864738647486475864768647786478864798648086481864828648386484864858648686487864888648986490864918649286493864948649586496864978649886499865008650186502865038650486505865068650786508865098651086511865128651386514865158651686517865188651986520865218652286523865248652586526865278652886529865308653186532865338653486535865368653786538865398654086541865428654386544865458654686547865488654986550865518655286553865548655586556865578655886559865608656186562865638656486565865668656786568865698657086571865728657386574865758657686577865788657986580865818658286583865848658586586865878658886589865908659186592865938659486595865968659786598865998660086601866028660386604866058660686607866088660986610866118661286613866148661586616866178661886619866208662186622866238662486625866268662786628866298663086631866328663386634866358663686637866388663986640866418664286643866448664586646866478664886649866508665186652866538665486655866568665786658866598666086661866628666386664866658666686667866688666986670866718667286673866748667586676866778667886679866808668186682866838668486685866868668786688866898669086691866928669386694866958669686697866988669986700867018670286703867048670586706867078670886709867108671186712867138671486715867168671786718867198672086721867228672386724867258672686727867288672986730867318673286733867348673586736867378673886739867408674186742867438674486745867468674786748867498675086751867528675386754867558675686757867588675986760867618676286763867648676586766867678676886769867708677186772867738677486775867768677786778867798678086781867828678386784867858678686787867888678986790867918679286793867948679586796867978679886799868008680186802868038680486805868068680786808868098681086811868128681386814868158681686817868188681986820868218682286823868248682586826868278682886829868308683186832868338683486835868368683786838868398684086841868428684386844868458684686847868488684986850868518685286853868548685586856868578685886859868608686186862868638686486865868668686786868868698687086871868728687386874868758687686877868788687986880868818688286883868848688586886868878688886889868908689186892868938689486895868968689786898868998690086901869028690386904869058690686907869088690986910869118691286913869148691586916869178691886919869208692186922869238692486925869268692786928869298693086931869328693386934869358693686937869388693986940869418694286943869448694586946869478694886949869508695186952869538695486955869568695786958869598696086961869628696386964869658696686967869688696986970869718697286973869748697586976869778697886979869808698186982869838698486985869868698786988869898699086991869928699386994869958699686997869988699987000870018700287003870048700587006870078700887009870108701187012870138701487015870168701787018870198702087021870228702387024870258702687027870288702987030870318703287033870348703587036870378703887039870408704187042870438704487045870468704787048870498705087051870528705387054870558705687057870588705987060870618706287063870648706587066870678706887069870708707187072870738707487075870768707787078870798708087081870828708387084870858708687087870888708987090870918709287093870948709587096870978709887099871008710187102871038710487105871068710787108871098711087111871128711387114871158711687117871188711987120871218712287123871248712587126871278712887129871308713187132871338713487135871368713787138871398714087141871428714387144871458714687147871488714987150871518715287153871548715587156871578715887159871608716187162871638716487165871668716787168871698717087171871728717387174871758717687177871788717987180871818718287183871848718587186871878718887189871908719187192871938719487195871968719787198871998720087201872028720387204872058720687207872088720987210872118721287213872148721587216872178721887219872208722187222872238722487225872268722787228872298723087231872328723387234872358723687237872388723987240872418724287243872448724587246872478724887249872508725187252872538725487255872568725787258872598726087261872628726387264872658726687267872688726987270872718727287273872748727587276872778727887279872808728187282872838728487285872868728787288872898729087291872928729387294872958729687297872988729987300873018730287303873048730587306873078730887309873108731187312873138731487315873168731787318873198732087321873228732387324873258732687327873288732987330873318733287333873348733587336873378733887339873408734187342873438734487345873468734787348873498735087351873528735387354873558735687357873588735987360873618736287363873648736587366873678736887369873708737187372873738737487375873768737787378873798738087381873828738387384873858738687387873888738987390873918739287393873948739587396873978739887399874008740187402874038740487405874068740787408874098741087411874128741387414874158741687417874188741987420874218742287423874248742587426874278742887429874308743187432874338743487435874368743787438874398744087441874428744387444874458744687447874488744987450874518745287453874548745587456874578745887459874608746187462874638746487465874668746787468874698747087471874728747387474874758747687477874788747987480874818748287483874848748587486874878748887489874908749187492874938749487495874968749787498874998750087501875028750387504875058750687507875088750987510875118751287513875148751587516875178751887519875208752187522875238752487525875268752787528875298753087531875328753387534875358753687537875388753987540875418754287543875448754587546875478754887549875508755187552875538755487555875568755787558875598756087561875628756387564875658756687567875688756987570875718757287573875748757587576875778757887579875808758187582875838758487585875868758787588875898759087591875928759387594875958759687597875988759987600876018760287603876048760587606876078760887609876108761187612876138761487615876168761787618876198762087621876228762387624876258762687627876288762987630876318763287633876348763587636876378763887639876408764187642876438764487645876468764787648876498765087651876528765387654876558765687657876588765987660876618766287663876648766587666876678766887669876708767187672876738767487675876768767787678876798768087681876828768387684876858768687687876888768987690876918769287693876948769587696876978769887699877008770187702877038770487705877068770787708877098771087711877128771387714877158771687717877188771987720877218772287723877248772587726877278772887729877308773187732877338773487735877368773787738877398774087741877428774387744877458774687747877488774987750877518775287753877548775587756877578775887759877608776187762877638776487765877668776787768877698777087771877728777387774877758777687777877788777987780877818778287783877848778587786877878778887789877908779187792877938779487795877968779787798877998780087801878028780387804878058780687807878088780987810878118781287813878148781587816878178781887819878208782187822878238782487825878268782787828878298783087831878328783387834878358783687837878388783987840878418784287843878448784587846878478784887849878508785187852878538785487855878568785787858878598786087861878628786387864878658786687867878688786987870878718787287873878748787587876878778787887879878808788187882878838788487885878868788787888878898789087891878928789387894878958789687897878988789987900879018790287903879048790587906879078790887909879108791187912879138791487915879168791787918879198792087921879228792387924879258792687927879288792987930879318793287933879348793587936879378793887939879408794187942879438794487945879468794787948879498795087951879528795387954879558795687957879588795987960879618796287963879648796587966879678796887969879708797187972879738797487975879768797787978879798798087981879828798387984879858798687987879888798987990879918799287993879948799587996879978799887999880008800188002880038800488005880068800788008880098801088011880128801388014880158801688017880188801988020880218802288023880248802588026880278802888029880308803188032880338803488035880368803788038880398804088041880428804388044880458804688047880488804988050880518805288053880548805588056880578805888059880608806188062880638806488065880668806788068880698807088071880728807388074880758807688077880788807988080880818808288083880848808588086880878808888089880908809188092880938809488095880968809788098880998810088101881028810388104881058810688107881088810988110881118811288113881148811588116881178811888119881208812188122881238812488125881268812788128881298813088131881328813388134881358813688137881388813988140881418814288143881448814588146881478814888149881508815188152881538815488155881568815788158881598816088161881628816388164881658816688167881688816988170881718817288173881748817588176881778817888179881808818188182881838818488185881868818788188881898819088191881928819388194881958819688197881988819988200882018820288203882048820588206882078820888209882108821188212882138821488215882168821788218882198822088221882228822388224882258822688227882288822988230882318823288233882348823588236882378823888239882408824188242882438824488245882468824788248882498825088251882528825388254882558825688257882588825988260882618826288263882648826588266882678826888269882708827188272882738827488275882768827788278882798828088281882828828388284882858828688287882888828988290882918829288293882948829588296882978829888299883008830188302883038830488305883068830788308883098831088311883128831388314883158831688317883188831988320883218832288323883248832588326883278832888329883308833188332883338833488335883368833788338883398834088341883428834388344883458834688347883488834988350883518835288353883548835588356883578835888359883608836188362883638836488365883668836788368883698837088371883728837388374883758837688377883788837988380883818838288383883848838588386883878838888389883908839188392883938839488395883968839788398883998840088401884028840388404884058840688407884088840988410884118841288413884148841588416884178841888419884208842188422884238842488425884268842788428884298843088431884328843388434884358843688437884388843988440884418844288443884448844588446884478844888449884508845188452884538845488455884568845788458884598846088461884628846388464884658846688467884688846988470884718847288473884748847588476884778847888479884808848188482884838848488485884868848788488884898849088491884928849388494884958849688497884988849988500885018850288503885048850588506885078850888509885108851188512885138851488515885168851788518885198852088521885228852388524885258852688527885288852988530885318853288533885348853588536885378853888539885408854188542885438854488545885468854788548885498855088551885528855388554885558855688557885588855988560885618856288563885648856588566885678856888569885708857188572885738857488575885768857788578885798858088581885828858388584885858858688587885888858988590885918859288593885948859588596885978859888599886008860188602886038860488605886068860788608886098861088611886128861388614886158861688617886188861988620886218862288623886248862588626886278862888629886308863188632886338863488635886368863788638886398864088641886428864388644886458864688647886488864988650886518865288653886548865588656886578865888659886608866188662886638866488665886668866788668886698867088671886728867388674886758867688677886788867988680886818868288683886848868588686886878868888689886908869188692886938869488695886968869788698886998870088701887028870388704887058870688707887088870988710887118871288713887148871588716887178871888719887208872188722887238872488725887268872788728887298873088731887328873388734887358873688737887388873988740887418874288743887448874588746887478874888749887508875188752887538875488755887568875788758887598876088761887628876388764887658876688767887688876988770887718877288773887748877588776887778877888779887808878188782887838878488785887868878788788887898879088791887928879388794887958879688797887988879988800888018880288803888048880588806888078880888809888108881188812888138881488815888168881788818888198882088821888228882388824888258882688827888288882988830888318883288833888348883588836888378883888839888408884188842888438884488845888468884788848888498885088851888528885388854888558885688857888588885988860888618886288863888648886588866888678886888869888708887188872888738887488875888768887788878888798888088881888828888388884888858888688887888888888988890888918889288893888948889588896888978889888899889008890188902889038890488905889068890788908889098891088911889128891388914889158891688917889188891988920889218892288923889248892588926889278892888929889308893188932889338893488935889368893788938889398894088941889428894388944889458894688947889488894988950889518895288953889548895588956889578895888959889608896188962889638896488965889668896788968889698897088971889728897388974889758897688977889788897988980889818898288983889848898588986889878898888989889908899188992889938899488995889968899788998889998900089001890028900389004890058900689007890088900989010890118901289013890148901589016890178901889019890208902189022890238902489025890268902789028890298903089031890328903389034890358903689037890388903989040890418904289043890448904589046890478904889049890508905189052890538905489055890568905789058890598906089061890628906389064890658906689067890688906989070890718907289073890748907589076890778907889079890808908189082890838908489085890868908789088890898909089091890928909389094890958909689097890988909989100891018910289103891048910589106891078910889109891108911189112891138911489115891168911789118891198912089121891228912389124891258912689127891288912989130891318913289133891348913589136891378913889139891408914189142891438914489145891468914789148891498915089151891528915389154891558915689157891588915989160891618916289163891648916589166891678916889169891708917189172891738917489175891768917789178891798918089181891828918389184891858918689187891888918989190891918919289193891948919589196891978919889199892008920189202892038920489205892068920789208892098921089211892128921389214892158921689217892188921989220892218922289223892248922589226892278922889229892308923189232892338923489235892368923789238892398924089241892428924389244892458924689247892488924989250892518925289253892548925589256892578925889259892608926189262892638926489265892668926789268892698927089271892728927389274892758927689277892788927989280892818928289283892848928589286892878928889289892908929189292892938929489295892968929789298892998930089301893028930389304893058930689307893088930989310893118931289313893148931589316893178931889319893208932189322893238932489325893268932789328893298933089331893328933389334893358933689337893388933989340893418934289343893448934589346893478934889349893508935189352893538935489355893568935789358893598936089361893628936389364893658936689367893688936989370893718937289373893748937589376893778937889379893808938189382893838938489385893868938789388893898939089391893928939389394893958939689397893988939989400894018940289403894048940589406894078940889409894108941189412894138941489415894168941789418894198942089421894228942389424894258942689427894288942989430894318943289433894348943589436894378943889439894408944189442894438944489445894468944789448894498945089451894528945389454894558945689457894588945989460894618946289463894648946589466894678946889469894708947189472894738947489475894768947789478894798948089481894828948389484894858948689487894888948989490894918949289493894948949589496894978949889499895008950189502895038950489505895068950789508895098951089511895128951389514895158951689517895188951989520895218952289523895248952589526895278952889529895308953189532895338953489535895368953789538895398954089541895428954389544895458954689547895488954989550895518955289553895548955589556895578955889559895608956189562895638956489565895668956789568895698957089571895728957389574895758957689577895788957989580895818958289583895848958589586895878958889589895908959189592895938959489595895968959789598895998960089601896028960389604896058960689607896088960989610896118961289613896148961589616896178961889619896208962189622896238962489625896268962789628896298963089631896328963389634896358963689637896388963989640896418964289643896448964589646896478964889649896508965189652896538965489655896568965789658896598966089661896628966389664896658966689667896688966989670896718967289673896748967589676896778967889679896808968189682896838968489685896868968789688896898969089691896928969389694896958969689697896988969989700897018970289703897048970589706897078970889709897108971189712897138971489715897168971789718897198972089721897228972389724897258972689727897288972989730897318973289733897348973589736897378973889739897408974189742897438974489745897468974789748897498975089751897528975389754897558975689757897588975989760897618976289763897648976589766897678976889769897708977189772897738977489775897768977789778897798978089781897828978389784897858978689787897888978989790897918979289793897948979589796897978979889799898008980189802898038980489805898068980789808898098981089811898128981389814898158981689817898188981989820898218982289823898248982589826898278982889829898308983189832898338983489835898368983789838898398984089841898428984389844898458984689847898488984989850898518985289853898548985589856898578985889859898608986189862898638986489865898668986789868898698987089871898728987389874898758987689877898788987989880898818988289883898848988589886898878988889889898908989189892898938989489895898968989789898898998990089901899028990389904899058990689907899088990989910899118991289913899148991589916899178991889919899208992189922899238992489925899268992789928899298993089931899328993389934899358993689937899388993989940899418994289943899448994589946899478994889949899508995189952899538995489955899568995789958899598996089961899628996389964899658996689967899688996989970899718997289973899748997589976899778997889979899808998189982899838998489985899868998789988899898999089991899928999389994899958999689997899988999990000900019000290003900049000590006900079000890009900109001190012900139001490015900169001790018900199002090021900229002390024900259002690027900289002990030900319003290033900349003590036900379003890039900409004190042900439004490045900469004790048900499005090051900529005390054900559005690057900589005990060900619006290063900649006590066900679006890069900709007190072900739007490075900769007790078900799008090081900829008390084900859008690087900889008990090900919009290093900949009590096900979009890099901009010190102901039010490105901069010790108901099011090111901129011390114901159011690117901189011990120901219012290123901249012590126901279012890129901309013190132901339013490135901369013790138901399014090141901429014390144901459014690147901489014990150901519015290153901549015590156901579015890159901609016190162901639016490165901669016790168901699017090171901729017390174901759017690177901789017990180901819018290183901849018590186901879018890189901909019190192901939019490195901969019790198901999020090201902029020390204902059020690207902089020990210902119021290213902149021590216902179021890219902209022190222902239022490225902269022790228902299023090231902329023390234902359023690237902389023990240902419024290243902449024590246902479024890249902509025190252902539025490255902569025790258902599026090261902629026390264902659026690267902689026990270902719027290273902749027590276902779027890279902809028190282902839028490285902869028790288902899029090291902929029390294902959029690297902989029990300903019030290303903049030590306903079030890309903109031190312903139031490315903169031790318903199032090321903229032390324903259032690327903289032990330903319033290333903349033590336903379033890339903409034190342903439034490345903469034790348903499035090351903529035390354903559035690357903589035990360903619036290363903649036590366903679036890369903709037190372903739037490375903769037790378903799038090381903829038390384903859038690387903889038990390903919039290393903949039590396903979039890399904009040190402904039040490405904069040790408904099041090411904129041390414904159041690417904189041990420904219042290423904249042590426904279042890429904309043190432904339043490435904369043790438904399044090441904429044390444904459044690447904489044990450904519045290453904549045590456904579045890459904609046190462904639046490465904669046790468904699047090471904729047390474904759047690477904789047990480904819048290483904849048590486904879048890489904909049190492904939049490495904969049790498904999050090501905029050390504905059050690507905089050990510905119051290513905149051590516905179051890519905209052190522905239052490525905269052790528905299053090531905329053390534905359053690537905389053990540905419054290543905449054590546905479054890549905509055190552905539055490555905569055790558905599056090561905629056390564905659056690567905689056990570905719057290573905749057590576905779057890579905809058190582905839058490585905869058790588905899059090591905929059390594905959059690597905989059990600906019060290603906049060590606906079060890609906109061190612906139061490615906169061790618906199062090621906229062390624906259062690627906289062990630906319063290633906349063590636906379063890639906409064190642906439064490645906469064790648906499065090651906529065390654906559065690657906589065990660906619066290663906649066590666906679066890669906709067190672906739067490675906769067790678906799068090681906829068390684906859068690687906889068990690906919069290693906949069590696906979069890699907009070190702907039070490705907069070790708907099071090711907129071390714907159071690717907189071990720907219072290723907249072590726907279072890729907309073190732907339073490735907369073790738907399074090741907429074390744907459074690747907489074990750907519075290753907549075590756907579075890759907609076190762907639076490765907669076790768907699077090771907729077390774907759077690777907789077990780907819078290783907849078590786907879078890789907909079190792907939079490795907969079790798907999080090801908029080390804908059080690807908089080990810908119081290813908149081590816908179081890819908209082190822908239082490825908269082790828908299083090831908329083390834908359083690837908389083990840908419084290843908449084590846908479084890849908509085190852908539085490855908569085790858908599086090861908629086390864908659086690867908689086990870908719087290873908749087590876908779087890879908809088190882908839088490885908869088790888908899089090891908929089390894908959089690897908989089990900909019090290903909049090590906909079090890909909109091190912909139091490915909169091790918909199092090921909229092390924909259092690927909289092990930909319093290933909349093590936909379093890939909409094190942909439094490945909469094790948909499095090951909529095390954909559095690957909589095990960909619096290963909649096590966909679096890969909709097190972909739097490975909769097790978909799098090981909829098390984909859098690987909889098990990909919099290993909949099590996909979099890999910009100191002910039100491005910069100791008910099101091011910129101391014910159101691017910189101991020910219102291023910249102591026910279102891029910309103191032910339103491035910369103791038910399104091041910429104391044910459104691047910489104991050910519105291053910549105591056910579105891059910609106191062910639106491065910669106791068910699107091071910729107391074910759107691077910789107991080910819108291083910849108591086910879108891089910909109191092910939109491095910969109791098910999110091101911029110391104911059110691107911089110991110911119111291113911149111591116911179111891119911209112191122911239112491125911269112791128911299113091131911329113391134911359113691137911389113991140911419114291143911449114591146911479114891149911509115191152911539115491155911569115791158911599116091161911629116391164911659116691167911689116991170911719117291173911749117591176911779117891179911809118191182911839118491185911869118791188911899119091191911929119391194911959119691197911989119991200912019120291203912049120591206912079120891209912109121191212912139121491215912169121791218912199122091221912229122391224912259122691227912289122991230912319123291233912349123591236912379123891239912409124191242912439124491245912469124791248912499125091251912529125391254912559125691257912589125991260912619126291263912649126591266912679126891269912709127191272912739127491275912769127791278912799128091281912829128391284912859128691287912889128991290912919129291293912949129591296912979129891299913009130191302913039130491305913069130791308913099131091311913129131391314913159131691317913189131991320913219132291323913249132591326913279132891329913309133191332913339133491335913369133791338913399134091341913429134391344913459134691347913489134991350913519135291353913549135591356913579135891359913609136191362913639136491365913669136791368913699137091371913729137391374913759137691377913789137991380913819138291383913849138591386913879138891389913909139191392913939139491395913969139791398913999140091401914029140391404914059140691407914089140991410914119141291413914149141591416914179141891419914209142191422914239142491425914269142791428914299143091431914329143391434914359143691437914389143991440914419144291443914449144591446914479144891449914509145191452914539145491455914569145791458914599146091461914629146391464914659146691467914689146991470914719147291473914749147591476914779147891479914809148191482914839148491485914869148791488914899149091491914929149391494914959149691497914989149991500915019150291503915049150591506915079150891509915109151191512915139151491515915169151791518915199152091521915229152391524915259152691527915289152991530915319153291533915349153591536915379153891539915409154191542915439154491545915469154791548915499155091551915529155391554915559155691557915589155991560915619156291563915649156591566915679156891569915709157191572915739157491575915769157791578915799158091581915829158391584915859158691587915889158991590915919159291593915949159591596915979159891599916009160191602916039160491605916069160791608916099161091611916129161391614916159161691617916189161991620916219162291623916249162591626916279162891629916309163191632916339163491635916369163791638916399164091641916429164391644916459164691647916489164991650916519165291653916549165591656916579165891659916609166191662916639166491665916669166791668916699167091671916729167391674916759167691677916789167991680916819168291683916849168591686916879168891689916909169191692916939169491695916969169791698916999170091701917029170391704917059170691707917089170991710917119171291713917149171591716917179171891719917209172191722917239172491725917269172791728917299173091731917329173391734917359173691737917389173991740917419174291743917449174591746917479174891749917509175191752917539175491755917569175791758917599176091761917629176391764917659176691767917689176991770917719177291773917749177591776917779177891779917809178191782917839178491785917869178791788917899179091791917929179391794917959179691797917989179991800918019180291803918049180591806918079180891809918109181191812918139181491815918169181791818918199182091821918229182391824918259182691827918289182991830918319183291833918349183591836918379183891839918409184191842918439184491845918469184791848918499185091851918529185391854918559185691857918589185991860918619186291863918649186591866918679186891869918709187191872918739187491875918769187791878918799188091881918829188391884918859188691887918889188991890918919189291893918949189591896918979189891899919009190191902919039190491905919069190791908919099191091911919129191391914919159191691917919189191991920919219192291923919249192591926919279192891929919309193191932919339193491935919369193791938919399194091941919429194391944919459194691947919489194991950919519195291953919549195591956919579195891959919609196191962919639196491965919669196791968919699197091971919729197391974919759197691977919789197991980919819198291983919849198591986919879198891989919909199191992919939199491995919969199791998919999200092001920029200392004920059200692007920089200992010920119201292013920149201592016920179201892019920209202192022920239202492025920269202792028920299203092031920329203392034920359203692037920389203992040920419204292043920449204592046920479204892049920509205192052920539205492055920569205792058920599206092061920629206392064920659206692067920689206992070920719207292073920749207592076920779207892079920809208192082920839208492085920869208792088920899209092091920929209392094920959209692097920989209992100921019210292103921049210592106921079210892109921109211192112921139211492115921169211792118921199212092121921229212392124921259212692127921289212992130921319213292133921349213592136921379213892139921409214192142921439214492145921469214792148921499215092151921529215392154921559215692157921589215992160921619216292163921649216592166921679216892169921709217192172921739217492175921769217792178921799218092181921829218392184921859218692187921889218992190921919219292193921949219592196921979219892199922009220192202922039220492205922069220792208922099221092211922129221392214922159221692217922189221992220922219222292223922249222592226922279222892229922309223192232922339223492235922369223792238922399224092241922429224392244922459224692247922489224992250922519225292253922549225592256922579225892259922609226192262922639226492265922669226792268922699227092271922729227392274922759227692277922789227992280922819228292283922849228592286922879228892289922909229192292922939229492295922969229792298922999230092301923029230392304923059230692307923089230992310923119231292313923149231592316923179231892319923209232192322923239232492325923269232792328923299233092331923329233392334923359233692337923389233992340923419234292343923449234592346923479234892349923509235192352923539235492355923569235792358923599236092361923629236392364923659236692367923689236992370923719237292373923749237592376923779237892379923809238192382923839238492385923869238792388923899239092391923929239392394923959239692397923989239992400924019240292403924049240592406924079240892409924109241192412924139241492415924169241792418924199242092421924229242392424924259242692427924289242992430924319243292433924349243592436924379243892439924409244192442924439244492445924469244792448924499245092451924529245392454924559245692457924589245992460924619246292463924649246592466924679246892469924709247192472924739247492475924769247792478924799248092481924829248392484924859248692487924889248992490924919249292493924949249592496924979249892499925009250192502925039250492505925069250792508925099251092511925129251392514925159251692517925189251992520925219252292523925249252592526925279252892529925309253192532925339253492535925369253792538925399254092541925429254392544925459254692547925489254992550925519255292553925549255592556925579255892559925609256192562925639256492565925669256792568925699257092571925729257392574925759257692577925789257992580925819258292583925849258592586925879258892589925909259192592925939259492595925969259792598925999260092601926029260392604926059260692607926089260992610926119261292613926149261592616926179261892619926209262192622926239262492625926269262792628926299263092631926329263392634926359263692637926389263992640926419264292643926449264592646926479264892649926509265192652926539265492655926569265792658926599266092661926629266392664926659266692667926689266992670926719267292673926749267592676926779267892679926809268192682926839268492685926869268792688926899269092691926929269392694926959269692697926989269992700927019270292703927049270592706927079270892709927109271192712927139271492715927169271792718927199272092721927229272392724927259272692727927289272992730927319273292733927349273592736927379273892739927409274192742927439274492745927469274792748927499275092751927529275392754927559275692757927589275992760927619276292763927649276592766927679276892769927709277192772927739277492775927769277792778927799278092781927829278392784927859278692787927889278992790927919279292793927949279592796927979279892799928009280192802928039280492805928069280792808928099281092811928129281392814928159281692817928189281992820928219282292823928249282592826928279282892829928309283192832928339283492835928369283792838928399284092841928429284392844928459284692847928489284992850928519285292853928549285592856928579285892859928609286192862928639286492865928669286792868928699287092871928729287392874928759287692877928789287992880928819288292883928849288592886928879288892889928909289192892928939289492895928969289792898928999290092901929029290392904929059290692907929089290992910929119291292913929149291592916929179291892919929209292192922929239292492925929269292792928929299293092931929329293392934929359293692937929389293992940929419294292943929449294592946929479294892949929509295192952929539295492955929569295792958929599296092961929629296392964929659296692967929689296992970929719297292973929749297592976929779297892979929809298192982929839298492985929869298792988929899299092991929929299392994929959299692997929989299993000930019300293003930049300593006930079300893009930109301193012930139301493015930169301793018930199302093021930229302393024930259302693027930289302993030930319303293033930349303593036930379303893039930409304193042930439304493045930469304793048930499305093051930529305393054930559305693057930589305993060930619306293063930649306593066930679306893069930709307193072930739307493075930769307793078930799308093081930829308393084930859308693087930889308993090930919309293093930949309593096930979309893099931009310193102931039310493105931069310793108931099311093111931129311393114931159311693117931189311993120931219312293123931249312593126931279312893129931309313193132931339313493135931369313793138931399314093141931429314393144931459314693147931489314993150931519315293153931549315593156931579315893159931609316193162931639316493165931669316793168931699317093171931729317393174931759317693177931789317993180931819318293183931849318593186931879318893189931909319193192931939319493195931969319793198931999320093201932029320393204932059320693207932089320993210932119321293213932149321593216932179321893219932209322193222932239322493225932269322793228932299323093231932329323393234932359323693237932389323993240932419324293243932449324593246932479324893249932509325193252932539325493255932569325793258932599326093261932629326393264932659326693267932689326993270932719327293273932749327593276932779327893279932809328193282932839328493285932869328793288932899329093291932929329393294932959329693297932989329993300933019330293303933049330593306933079330893309933109331193312933139331493315933169331793318933199332093321933229332393324933259332693327933289332993330933319333293333933349333593336933379333893339933409334193342933439334493345933469334793348933499335093351933529335393354933559335693357933589335993360933619336293363933649336593366933679336893369933709337193372933739337493375933769337793378933799338093381933829338393384933859338693387933889338993390933919339293393933949339593396933979339893399934009340193402934039340493405934069340793408934099341093411934129341393414934159341693417934189341993420934219342293423934249342593426934279342893429934309343193432934339343493435934369343793438934399344093441934429344393444934459344693447934489344993450934519345293453934549345593456934579345893459934609346193462934639346493465934669346793468934699347093471934729347393474934759347693477934789347993480934819348293483934849348593486934879348893489934909349193492934939349493495934969349793498934999350093501935029350393504935059350693507935089350993510935119351293513935149351593516935179351893519935209352193522935239352493525935269352793528935299353093531935329353393534935359353693537935389353993540935419354293543935449354593546935479354893549935509355193552935539355493555935569355793558935599356093561935629356393564935659356693567935689356993570935719357293573935749357593576935779357893579935809358193582935839358493585935869358793588935899359093591935929359393594935959359693597935989359993600936019360293603936049360593606936079360893609936109361193612936139361493615936169361793618936199362093621936229362393624936259362693627936289362993630936319363293633936349363593636936379363893639936409364193642936439364493645936469364793648936499365093651936529365393654936559365693657936589365993660936619366293663936649366593666936679366893669936709367193672936739367493675936769367793678936799368093681936829368393684936859368693687936889368993690936919369293693936949369593696936979369893699937009370193702937039370493705937069370793708937099371093711937129371393714937159371693717937189371993720937219372293723937249372593726937279372893729937309373193732937339373493735937369373793738937399374093741937429374393744937459374693747937489374993750937519375293753937549375593756937579375893759937609376193762937639376493765937669376793768937699377093771937729377393774937759377693777937789377993780937819378293783937849378593786937879378893789937909379193792937939379493795937969379793798937999380093801938029380393804938059380693807938089380993810938119381293813938149381593816938179381893819938209382193822938239382493825938269382793828938299383093831938329383393834938359383693837938389383993840938419384293843938449384593846938479384893849938509385193852938539385493855938569385793858938599386093861938629386393864938659386693867938689386993870938719387293873938749387593876938779387893879938809388193882938839388493885938869388793888938899389093891938929389393894938959389693897938989389993900939019390293903939049390593906939079390893909939109391193912939139391493915939169391793918939199392093921939229392393924939259392693927939289392993930939319393293933939349393593936939379393893939939409394193942939439394493945939469394793948939499395093951939529395393954939559395693957939589395993960939619396293963939649396593966939679396893969939709397193972939739397493975939769397793978939799398093981939829398393984939859398693987939889398993990939919399293993939949399593996939979399893999940009400194002940039400494005940069400794008940099401094011940129401394014940159401694017940189401994020940219402294023940249402594026940279402894029940309403194032940339403494035940369403794038940399404094041940429404394044940459404694047940489404994050940519405294053940549405594056940579405894059940609406194062940639406494065940669406794068940699407094071940729407394074940759407694077940789407994080940819408294083940849408594086940879408894089940909409194092940939409494095940969409794098940999410094101941029410394104941059410694107941089410994110941119411294113941149411594116941179411894119941209412194122941239412494125941269412794128941299413094131941329413394134941359413694137941389413994140941419414294143941449414594146941479414894149941509415194152941539415494155941569415794158941599416094161941629416394164941659416694167941689416994170941719417294173941749417594176941779417894179941809418194182941839418494185941869418794188941899419094191941929419394194941959419694197941989419994200942019420294203942049420594206942079420894209942109421194212942139421494215942169421794218942199422094221942229422394224942259422694227942289422994230942319423294233942349423594236942379423894239942409424194242942439424494245942469424794248942499425094251942529425394254942559425694257942589425994260942619426294263942649426594266942679426894269942709427194272942739427494275942769427794278942799428094281942829428394284942859428694287942889428994290942919429294293942949429594296942979429894299943009430194302943039430494305943069430794308943099431094311943129431394314943159431694317943189431994320943219432294323943249432594326943279432894329943309433194332943339433494335943369433794338943399434094341943429434394344943459434694347943489434994350943519435294353943549435594356943579435894359943609436194362943639436494365943669436794368943699437094371943729437394374943759437694377943789437994380943819438294383943849438594386943879438894389943909439194392943939439494395943969439794398943999440094401944029440394404944059440694407944089440994410944119441294413944149441594416944179441894419944209442194422944239442494425944269442794428944299443094431944329443394434944359443694437944389443994440944419444294443944449444594446944479444894449944509445194452944539445494455944569445794458944599446094461944629446394464944659446694467944689446994470944719447294473944749447594476944779447894479944809448194482944839448494485944869448794488944899449094491944929449394494944959449694497944989449994500945019450294503945049450594506945079450894509945109451194512945139451494515945169451794518945199452094521945229452394524945259452694527945289452994530945319453294533945349453594536945379453894539945409454194542945439454494545945469454794548945499455094551945529455394554945559455694557945589455994560945619456294563945649456594566945679456894569945709457194572945739457494575945769457794578945799458094581945829458394584945859458694587945889458994590945919459294593945949459594596945979459894599946009460194602946039460494605946069460794608946099461094611946129461394614946159461694617946189461994620946219462294623946249462594626946279462894629946309463194632946339463494635946369463794638946399464094641946429464394644946459464694647946489464994650946519465294653946549465594656946579465894659946609466194662946639466494665946669466794668946699467094671946729467394674946759467694677946789467994680946819468294683946849468594686946879468894689946909469194692946939469494695946969469794698946999470094701947029470394704947059470694707947089470994710947119471294713947149471594716947179471894719947209472194722947239472494725947269472794728947299473094731947329473394734947359473694737947389473994740947419474294743947449474594746947479474894749947509475194752947539475494755947569475794758947599476094761947629476394764947659476694767947689476994770947719477294773947749477594776947779477894779947809478194782947839478494785947869478794788947899479094791947929479394794947959479694797947989479994800948019480294803948049480594806948079480894809948109481194812948139481494815948169481794818948199482094821948229482394824948259482694827948289482994830948319483294833948349483594836948379483894839948409484194842948439484494845948469484794848948499485094851948529485394854948559485694857948589485994860948619486294863948649486594866948679486894869948709487194872948739487494875948769487794878948799488094881948829488394884948859488694887948889488994890948919489294893948949489594896948979489894899949009490194902949039490494905949069490794908949099491094911949129491394914949159491694917949189491994920949219492294923949249492594926949279492894929949309493194932949339493494935949369493794938949399494094941949429494394944949459494694947949489494994950949519495294953949549495594956949579495894959949609496194962949639496494965949669496794968949699497094971949729497394974949759497694977949789497994980949819498294983949849498594986949879498894989949909499194992949939499494995949969499794998949999500095001950029500395004950059500695007950089500995010950119501295013950149501595016950179501895019950209502195022950239502495025950269502795028950299503095031950329503395034950359503695037950389503995040950419504295043950449504595046950479504895049950509505195052950539505495055950569505795058950599506095061950629506395064950659506695067950689506995070950719507295073950749507595076950779507895079950809508195082950839508495085950869508795088950899509095091950929509395094950959509695097950989509995100951019510295103951049510595106951079510895109951109511195112951139511495115951169511795118951199512095121951229512395124951259512695127951289512995130951319513295133951349513595136951379513895139951409514195142951439514495145951469514795148951499515095151951529515395154951559515695157951589515995160951619516295163951649516595166951679516895169951709517195172951739517495175951769517795178951799518095181951829518395184951859518695187951889518995190951919519295193951949519595196951979519895199952009520195202952039520495205952069520795208952099521095211952129521395214952159521695217952189521995220952219522295223952249522595226952279522895229952309523195232952339523495235952369523795238952399524095241952429524395244952459524695247952489524995250952519525295253952549525595256952579525895259952609526195262952639526495265952669526795268952699527095271952729527395274952759527695277952789527995280952819528295283952849528595286952879528895289952909529195292952939529495295952969529795298952999530095301953029530395304953059530695307953089530995310953119531295313953149531595316953179531895319953209532195322953239532495325953269532795328953299533095331953329533395334953359533695337953389533995340953419534295343953449534595346953479534895349953509535195352953539535495355953569535795358953599536095361953629536395364953659536695367953689536995370953719537295373953749537595376953779537895379953809538195382953839538495385953869538795388953899539095391953929539395394953959539695397953989539995400954019540295403954049540595406954079540895409954109541195412954139541495415954169541795418954199542095421954229542395424954259542695427954289542995430954319543295433954349543595436954379543895439954409544195442954439544495445954469544795448954499545095451954529545395454954559545695457954589545995460954619546295463954649546595466954679546895469954709547195472954739547495475954769547795478954799548095481954829548395484954859548695487954889548995490954919549295493954949549595496954979549895499955009550195502955039550495505955069550795508955099551095511955129551395514955159551695517955189551995520955219552295523955249552595526955279552895529955309553195532955339553495535955369553795538955399554095541955429554395544955459554695547955489554995550955519555295553955549555595556955579555895559955609556195562955639556495565955669556795568955699557095571955729557395574955759557695577955789557995580955819558295583955849558595586955879558895589955909559195592955939559495595955969559795598955999560095601956029560395604956059560695607956089560995610956119561295613956149561595616956179561895619956209562195622956239562495625956269562795628956299563095631956329563395634956359563695637956389563995640956419564295643956449564595646956479564895649956509565195652956539565495655956569565795658956599566095661956629566395664956659566695667956689566995670956719567295673956749567595676956779567895679956809568195682956839568495685956869568795688956899569095691956929569395694956959569695697956989569995700957019570295703957049570595706957079570895709957109571195712957139571495715957169571795718957199572095721957229572395724957259572695727957289572995730957319573295733957349573595736957379573895739957409574195742957439574495745957469574795748957499575095751957529575395754957559575695757957589575995760957619576295763957649576595766957679576895769957709577195772957739577495775957769577795778957799578095781957829578395784957859578695787957889578995790957919579295793957949579595796957979579895799958009580195802958039580495805958069580795808958099581095811958129581395814958159581695817958189581995820958219582295823958249582595826958279582895829958309583195832958339583495835958369583795838958399584095841958429584395844958459584695847958489584995850958519585295853958549585595856958579585895859958609586195862958639586495865958669586795868958699587095871958729587395874958759587695877958789587995880958819588295883958849588595886958879588895889958909589195892958939589495895958969589795898958999590095901959029590395904959059590695907959089590995910959119591295913959149591595916959179591895919959209592195922959239592495925959269592795928959299593095931959329593395934959359593695937959389593995940959419594295943959449594595946959479594895949959509595195952959539595495955959569595795958959599596095961959629596395964959659596695967959689596995970959719597295973959749597595976959779597895979959809598195982959839598495985959869598795988959899599095991959929599395994959959599695997959989599996000960019600296003960049600596006960079600896009960109601196012960139601496015960169601796018960199602096021960229602396024960259602696027960289602996030960319603296033960349603596036960379603896039960409604196042960439604496045960469604796048960499605096051960529605396054960559605696057960589605996060960619606296063960649606596066960679606896069960709607196072960739607496075960769607796078960799608096081960829608396084960859608696087960889608996090960919609296093960949609596096960979609896099961009610196102961039610496105961069610796108961099611096111961129611396114961159611696117961189611996120961219612296123961249612596126961279612896129961309613196132961339613496135961369613796138961399614096141961429614396144961459614696147961489614996150961519615296153961549615596156961579615896159961609616196162961639616496165961669616796168961699617096171961729617396174961759617696177961789617996180961819618296183961849618596186961879618896189961909619196192961939619496195961969619796198961999620096201962029620396204962059620696207962089620996210962119621296213962149621596216962179621896219962209622196222962239622496225962269622796228962299623096231962329623396234962359623696237962389623996240962419624296243962449624596246962479624896249962509625196252962539625496255962569625796258962599626096261962629626396264962659626696267962689626996270962719627296273962749627596276962779627896279962809628196282962839628496285962869628796288962899629096291962929629396294962959629696297962989629996300963019630296303963049630596306963079630896309963109631196312963139631496315963169631796318963199632096321963229632396324963259632696327963289632996330963319633296333963349633596336963379633896339963409634196342963439634496345963469634796348963499635096351963529635396354963559635696357963589635996360963619636296363963649636596366963679636896369963709637196372963739637496375963769637796378963799638096381963829638396384963859638696387963889638996390963919639296393963949639596396963979639896399964009640196402964039640496405964069640796408964099641096411964129641396414964159641696417964189641996420964219642296423964249642596426964279642896429964309643196432964339643496435964369643796438964399644096441964429644396444964459644696447964489644996450964519645296453964549645596456964579645896459964609646196462964639646496465964669646796468964699647096471964729647396474964759647696477964789647996480964819648296483964849648596486964879648896489964909649196492964939649496495964969649796498964999650096501965029650396504965059650696507965089650996510965119651296513965149651596516965179651896519965209652196522965239652496525965269652796528965299653096531965329653396534965359653696537965389653996540965419654296543965449654596546965479654896549965509655196552965539655496555965569655796558965599656096561965629656396564965659656696567965689656996570965719657296573965749657596576965779657896579965809658196582965839658496585965869658796588965899659096591965929659396594965959659696597965989659996600966019660296603966049660596606966079660896609966109661196612966139661496615966169661796618966199662096621966229662396624966259662696627966289662996630966319663296633966349663596636966379663896639966409664196642966439664496645966469664796648966499665096651966529665396654966559665696657966589665996660966619666296663966649666596666966679666896669966709667196672966739667496675966769667796678966799668096681966829668396684966859668696687966889668996690966919669296693966949669596696966979669896699967009670196702967039670496705967069670796708967099671096711967129671396714967159671696717967189671996720967219672296723967249672596726967279672896729967309673196732967339673496735967369673796738967399674096741967429674396744967459674696747967489674996750967519675296753967549675596756967579675896759967609676196762967639676496765967669676796768967699677096771967729677396774967759677696777967789677996780967819678296783967849678596786967879678896789967909679196792967939679496795967969679796798967999680096801968029680396804968059680696807968089680996810968119681296813968149681596816968179681896819968209682196822968239682496825968269682796828968299683096831968329683396834968359683696837968389683996840968419684296843968449684596846968479684896849968509685196852968539685496855968569685796858968599686096861968629686396864968659686696867968689686996870968719687296873968749687596876968779687896879968809688196882968839688496885968869688796888968899689096891968929689396894968959689696897968989689996900969019690296903969049690596906969079690896909969109691196912969139691496915969169691796918969199692096921969229692396924969259692696927969289692996930969319693296933969349693596936969379693896939969409694196942969439694496945969469694796948969499695096951969529695396954969559695696957969589695996960969619696296963969649696596966969679696896969969709697196972969739697496975969769697796978969799698096981969829698396984969859698696987969889698996990969919699296993969949699596996969979699896999970009700197002970039700497005970069700797008970099701097011970129701397014970159701697017970189701997020970219702297023970249702597026970279702897029970309703197032970339703497035970369703797038970399704097041970429704397044970459704697047970489704997050970519705297053970549705597056970579705897059970609706197062970639706497065970669706797068970699707097071970729707397074970759707697077970789707997080970819708297083970849708597086970879708897089970909709197092970939709497095970969709797098970999710097101971029710397104971059710697107971089710997110971119711297113971149711597116971179711897119971209712197122971239712497125971269712797128971299713097131971329713397134971359713697137971389713997140971419714297143971449714597146971479714897149971509715197152971539715497155971569715797158971599716097161971629716397164971659716697167971689716997170971719717297173971749717597176971779717897179971809718197182971839718497185971869718797188971899719097191971929719397194971959719697197971989719997200972019720297203972049720597206972079720897209972109721197212972139721497215972169721797218972199722097221972229722397224972259722697227972289722997230972319723297233972349723597236972379723897239972409724197242972439724497245972469724797248972499725097251972529725397254972559725697257972589725997260972619726297263972649726597266972679726897269972709727197272972739727497275972769727797278972799728097281972829728397284972859728697287972889728997290972919729297293972949729597296972979729897299973009730197302973039730497305973069730797308973099731097311973129731397314973159731697317973189731997320973219732297323973249732597326973279732897329973309733197332973339733497335973369733797338973399734097341973429734397344973459734697347973489734997350973519735297353973549735597356973579735897359973609736197362973639736497365973669736797368973699737097371973729737397374973759737697377973789737997380973819738297383973849738597386973879738897389973909739197392973939739497395973969739797398973999740097401974029740397404974059740697407974089740997410974119741297413974149741597416974179741897419974209742197422974239742497425974269742797428974299743097431974329743397434974359743697437974389743997440974419744297443974449744597446974479744897449974509745197452974539745497455974569745797458974599746097461974629746397464974659746697467974689746997470974719747297473974749747597476974779747897479974809748197482974839748497485974869748797488974899749097491974929749397494974959749697497974989749997500975019750297503975049750597506975079750897509975109751197512975139751497515975169751797518975199752097521975229752397524975259752697527975289752997530975319753297533975349753597536975379753897539975409754197542975439754497545975469754797548975499755097551975529755397554975559755697557975589755997560975619756297563975649756597566975679756897569975709757197572975739757497575975769757797578975799758097581975829758397584975859758697587975889758997590975919759297593975949759597596975979759897599976009760197602976039760497605976069760797608976099761097611976129761397614976159761697617976189761997620976219762297623976249762597626976279762897629976309763197632976339763497635976369763797638976399764097641976429764397644976459764697647976489764997650976519765297653976549765597656976579765897659976609766197662976639766497665976669766797668976699767097671976729767397674976759767697677976789767997680976819768297683976849768597686976879768897689976909769197692976939769497695976969769797698976999770097701977029770397704977059770697707977089770997710977119771297713977149771597716977179771897719977209772197722977239772497725977269772797728977299773097731977329773397734977359773697737977389773997740977419774297743977449774597746977479774897749977509775197752977539775497755977569775797758977599776097761977629776397764977659776697767977689776997770977719777297773977749777597776977779777897779977809778197782977839778497785977869778797788977899779097791977929779397794977959779697797977989779997800978019780297803978049780597806978079780897809978109781197812978139781497815978169781797818978199782097821978229782397824978259782697827978289782997830978319783297833978349783597836978379783897839978409784197842978439784497845978469784797848978499785097851978529785397854978559785697857978589785997860978619786297863978649786597866978679786897869978709787197872978739787497875978769787797878978799788097881978829788397884978859788697887978889788997890978919789297893978949789597896978979789897899979009790197902979039790497905979069790797908979099791097911979129791397914979159791697917979189791997920979219792297923979249792597926979279792897929979309793197932979339793497935979369793797938979399794097941979429794397944979459794697947979489794997950979519795297953979549795597956979579795897959979609796197962979639796497965979669796797968979699797097971979729797397974979759797697977979789797997980979819798297983979849798597986979879798897989979909799197992979939799497995979969799797998979999800098001980029800398004980059800698007980089800998010980119801298013980149801598016980179801898019980209802198022980239802498025980269802798028980299803098031980329803398034980359803698037980389803998040980419804298043980449804598046980479804898049980509805198052980539805498055980569805798058980599806098061980629806398064980659806698067980689806998070980719807298073980749807598076980779807898079980809808198082980839808498085980869808798088980899809098091980929809398094980959809698097980989809998100981019810298103981049810598106981079810898109981109811198112981139811498115981169811798118981199812098121981229812398124981259812698127981289812998130981319813298133981349813598136981379813898139981409814198142981439814498145981469814798148981499815098151981529815398154981559815698157981589815998160981619816298163981649816598166981679816898169981709817198172981739817498175981769817798178981799818098181981829818398184981859818698187981889818998190981919819298193981949819598196981979819898199982009820198202982039820498205982069820798208982099821098211982129821398214982159821698217982189821998220982219822298223982249822598226982279822898229982309823198232982339823498235982369823798238982399824098241982429824398244982459824698247982489824998250982519825298253982549825598256982579825898259982609826198262982639826498265982669826798268982699827098271982729827398274982759827698277982789827998280982819828298283982849828598286982879828898289982909829198292982939829498295982969829798298982999830098301983029830398304983059830698307983089830998310983119831298313983149831598316983179831898319983209832198322983239832498325983269832798328983299833098331983329833398334983359833698337983389833998340983419834298343983449834598346983479834898349983509835198352983539835498355983569835798358983599836098361983629836398364983659836698367983689836998370983719837298373983749837598376983779837898379983809838198382983839838498385983869838798388983899839098391983929839398394983959839698397983989839998400984019840298403984049840598406984079840898409984109841198412984139841498415984169841798418984199842098421984229842398424984259842698427984289842998430984319843298433984349843598436984379843898439984409844198442984439844498445984469844798448984499845098451984529845398454984559845698457984589845998460984619846298463984649846598466984679846898469984709847198472984739847498475984769847798478984799848098481984829848398484984859848698487984889848998490984919849298493984949849598496984979849898499985009850198502985039850498505985069850798508985099851098511985129851398514985159851698517985189851998520985219852298523985249852598526985279852898529985309853198532985339853498535985369853798538985399854098541985429854398544985459854698547985489854998550985519855298553985549855598556985579855898559985609856198562985639856498565985669856798568985699857098571985729857398574985759857698577985789857998580985819858298583985849858598586985879858898589985909859198592985939859498595985969859798598985999860098601986029860398604986059860698607986089860998610986119861298613986149861598616986179861898619986209862198622986239862498625986269862798628986299863098631986329863398634986359863698637986389863998640986419864298643986449864598646986479864898649986509865198652986539865498655986569865798658986599866098661986629866398664986659866698667986689866998670986719867298673986749867598676986779867898679986809868198682986839868498685986869868798688986899869098691986929869398694986959869698697986989869998700987019870298703987049870598706987079870898709987109871198712987139871498715987169871798718987199872098721987229872398724987259872698727987289872998730987319873298733987349873598736987379873898739987409874198742987439874498745987469874798748987499875098751987529875398754987559875698757987589875998760987619876298763987649876598766987679876898769987709877198772987739877498775987769877798778987799878098781987829878398784987859878698787987889878998790987919879298793987949879598796987979879898799988009880198802988039880498805988069880798808988099881098811988129881398814988159881698817988189881998820988219882298823988249882598826988279882898829988309883198832988339883498835988369883798838988399884098841988429884398844988459884698847988489884998850988519885298853988549885598856988579885898859988609886198862988639886498865988669886798868988699887098871988729887398874988759887698877988789887998880988819888298883988849888598886988879888898889988909889198892988939889498895988969889798898988999890098901989029890398904989059890698907989089890998910989119891298913989149891598916989179891898919989209892198922989239892498925989269892798928989299893098931989329893398934989359893698937989389893998940989419894298943989449894598946989479894898949989509895198952989539895498955989569895798958989599896098961989629896398964989659896698967989689896998970989719897298973989749897598976989779897898979989809898198982989839898498985989869898798988989899899098991989929899398994989959899698997989989899999000990019900299003990049900599006990079900899009990109901199012990139901499015990169901799018990199902099021990229902399024990259902699027990289902999030990319903299033990349903599036990379903899039990409904199042990439904499045990469904799048990499905099051990529905399054990559905699057990589905999060990619906299063990649906599066990679906899069990709907199072990739907499075990769907799078990799908099081990829908399084990859908699087990889908999090990919909299093990949909599096990979909899099991009910199102991039910499105991069910799108991099911099111991129911399114991159911699117991189911999120991219912299123991249912599126991279912899129991309913199132991339913499135991369913799138991399914099141991429914399144991459914699147991489914999150991519915299153991549915599156991579915899159991609916199162991639916499165991669916799168991699917099171991729917399174991759917699177991789917999180991819918299183991849918599186991879918899189991909919199192991939919499195991969919799198991999920099201992029920399204992059920699207992089920999210992119921299213992149921599216992179921899219992209922199222992239922499225992269922799228992299923099231992329923399234992359923699237992389923999240992419924299243992449924599246992479924899249992509925199252992539925499255992569925799258992599926099261992629926399264992659926699267992689926999270992719927299273992749927599276992779927899279992809928199282992839928499285992869928799288992899929099291992929929399294992959929699297992989929999300993019930299303993049930599306993079930899309993109931199312993139931499315993169931799318993199932099321993229932399324993259932699327993289932999330993319933299333993349933599336993379933899339993409934199342993439934499345993469934799348993499935099351993529935399354993559935699357993589935999360993619936299363993649936599366993679936899369993709937199372993739937499375993769937799378993799938099381993829938399384993859938699387993889938999390993919939299393993949939599396993979939899399994009940199402994039940499405994069940799408994099941099411994129941399414994159941699417994189941999420994219942299423994249942599426994279942899429994309943199432994339943499435994369943799438994399944099441994429944399444994459944699447994489944999450994519945299453994549945599456994579945899459994609946199462994639946499465994669946799468994699947099471994729947399474994759947699477994789947999480994819948299483994849948599486994879948899489994909949199492994939949499495994969949799498994999950099501995029950399504995059950699507995089950999510995119951299513995149951599516995179951899519995209952199522995239952499525995269952799528995299953099531995329953399534995359953699537995389953999540995419954299543995449954599546995479954899549995509955199552995539955499555995569955799558995599956099561995629956399564995659956699567995689956999570995719957299573995749957599576995779957899579995809958199582995839958499585995869958799588995899959099591995929959399594995959959699597995989959999600996019960299603996049960599606996079960899609996109961199612996139961499615996169961799618996199962099621996229962399624996259962699627996289962999630996319963299633996349963599636996379963899639996409964199642996439964499645996469964799648996499965099651996529965399654996559965699657996589965999660996619966299663996649966599666996679966899669996709967199672996739967499675996769967799678996799968099681996829968399684996859968699687996889968999690996919969299693996949969599696996979969899699997009970199702997039970499705997069970799708997099971099711997129971399714997159971699717997189971999720997219972299723997249972599726997279972899729997309973199732997339973499735997369973799738997399974099741997429974399744997459974699747997489974999750997519975299753997549975599756997579975899759997609976199762997639976499765997669976799768997699977099771997729977399774997759977699777997789977999780997819978299783997849978599786997879978899789997909979199792997939979499795997969979799798997999980099801998029980399804998059980699807998089980999810998119981299813998149981599816998179981899819998209982199822998239982499825998269982799828998299983099831998329983399834998359983699837998389983999840998419984299843998449984599846998479984899849998509985199852998539985499855998569985799858998599986099861998629986399864998659986699867998689986999870998719987299873998749987599876998779987899879998809988199882998839988499885998869988799888998899989099891998929989399894998959989699897998989989999900999019990299903999049990599906999079990899909999109991199912999139991499915999169991799918999199992099921999229992399924999259992699927999289992999930999319993299933999349993599936999379993899939999409994199942999439994499945999469994799948999499995099951999529995399954999559995699957999589995999960999619996299963999649996599966999679996899969999709997199972999739997499975999769997799978999799998099981999829998399984999859998699987999889998999990999919999299993999949999599996999979999899999100000100001100002100003100004100005100006100007100008100009100010100011100012100013100014100015100016100017100018100019100020100021100022100023100024100025100026100027100028100029100030100031100032100033100034100035100036100037100038100039100040100041100042100043100044100045100046100047100048100049100050100051100052100053100054100055100056100057100058100059100060100061100062100063100064100065100066100067100068100069100070100071100072100073100074100075100076100077100078100079100080100081100082100083100084100085100086100087100088100089100090100091100092100093100094100095100096100097100098100099100100100101100102100103100104100105100106100107100108100109100110100111100112100113100114100115100116100117100118100119100120100121100122100123100124100125100126100127100128100129100130100131100132100133100134100135100136100137100138100139100140100141100142100143100144100145100146100147100148100149100150100151100152100153100154100155100156100157100158100159100160100161100162100163100164100165100166100167100168100169100170100171100172100173100174100175100176100177100178100179100180100181100182100183100184100185100186100187100188100189100190100191100192100193100194100195100196100197100198100199100200100201100202100203100204100205100206100207100208100209100210100211100212100213100214100215100216100217100218100219100220100221100222100223100224100225100226100227100228100229100230100231100232100233100234100235100236100237100238100239100240100241100242100243100244100245100246100247100248100249100250100251100252100253100254100255100256100257100258100259100260100261100262100263100264100265100266100267100268100269100270100271100272100273100274100275100276100277100278100279100280100281100282100283100284100285100286100287100288100289100290100291100292100293100294100295100296100297100298100299100300100301100302100303100304100305100306100307100308100309100310100311100312100313100314100315100316100317100318100319100320100321100322100323100324100325100326100327100328100329100330100331100332100333100334100335100336100337100338100339100340100341100342100343100344100345100346100347100348100349100350100351100352100353100354100355100356100357100358100359100360100361100362100363100364100365100366100367100368100369100370100371100372100373100374100375100376100377100378100379100380100381100382100383100384100385100386100387100388100389100390100391100392100393100394100395100396100397100398100399100400100401100402100403100404100405100406100407100408100409100410100411100412100413100414100415100416100417100418100419100420100421100422100423100424100425100426100427100428100429100430100431100432100433100434100435100436100437100438100439100440100441100442100443100444100445100446100447100448100449100450100451100452100453100454100455100456100457100458100459100460100461100462100463100464100465100466100467100468100469100470100471100472100473100474100475100476100477100478100479100480100481100482100483100484100485100486100487100488100489100490100491100492100493100494100495100496100497100498100499100500100501100502100503100504100505100506100507100508100509100510100511100512100513100514100515100516100517100518100519100520100521100522100523100524100525100526100527100528100529100530100531100532100533100534100535100536100537100538100539100540100541100542100543100544100545100546100547100548100549100550100551100552100553100554100555100556100557100558100559100560100561100562100563100564100565100566100567100568100569100570100571100572100573100574100575100576100577100578100579100580100581100582100583100584100585100586100587100588100589100590100591100592100593100594100595100596100597100598100599100600100601100602100603100604100605100606100607100608100609100610100611100612100613100614100615100616100617100618100619100620100621100622100623100624100625100626100627100628100629100630100631100632100633100634100635100636100637100638100639100640100641100642100643100644100645100646100647100648100649100650100651100652100653100654100655100656100657100658100659100660100661100662100663100664100665100666100667100668100669100670100671100672100673100674100675100676100677100678100679100680100681100682100683100684100685100686100687100688100689100690100691100692100693100694100695100696100697100698100699100700100701100702100703100704100705100706100707100708100709100710100711100712100713100714100715100716100717100718100719100720100721100722100723100724100725100726100727100728100729100730100731100732100733100734100735100736100737100738100739100740100741100742100743100744100745100746100747100748100749100750100751100752100753100754100755100756100757100758100759100760100761100762100763100764100765100766100767100768100769100770100771100772100773100774100775100776100777100778100779100780100781100782100783100784100785100786100787100788100789100790100791100792100793100794100795100796100797100798100799100800100801100802100803100804100805100806100807100808100809100810100811100812100813100814100815100816100817100818100819100820100821100822100823100824100825100826100827100828100829100830100831100832100833100834100835100836100837100838100839100840100841100842100843100844100845100846100847100848100849100850100851100852100853100854100855100856100857100858100859100860100861100862100863100864100865100866100867100868100869100870100871100872100873100874100875100876100877100878100879100880100881100882100883100884100885100886100887100888100889100890100891100892100893100894100895100896100897100898100899100900100901100902100903100904100905100906100907100908100909100910100911100912100913100914100915100916100917100918100919100920100921100922100923100924100925100926100927100928100929100930100931100932100933100934100935100936100937100938100939100940100941100942100943100944100945100946100947100948100949100950100951100952100953100954100955100956100957100958100959100960100961100962100963100964100965100966100967100968100969100970100971100972100973100974100975100976100977100978100979100980100981100982100983100984100985100986100987100988100989100990100991100992100993100994100995100996100997100998100999101000101001101002101003101004101005101006101007101008101009101010101011101012101013101014101015101016101017101018101019101020101021101022101023101024101025101026101027101028101029101030101031101032101033101034101035101036101037101038101039101040101041101042101043101044101045101046101047101048101049101050101051101052101053101054101055101056101057101058101059101060101061101062101063101064101065101066101067101068101069101070101071101072101073101074101075101076101077101078101079101080101081101082101083101084101085101086101087101088101089101090101091101092101093101094101095101096101097101098101099101100101101101102101103101104101105101106101107101108101109101110101111101112101113101114101115101116101117101118101119101120101121101122101123101124101125101126101127101128101129101130101131101132101133101134101135101136101137101138101139101140101141101142101143101144101145101146101147101148101149101150101151101152101153101154101155101156101157101158101159101160101161101162101163101164101165101166101167101168101169101170101171101172101173101174101175101176101177101178101179101180101181101182101183101184101185101186101187101188101189101190101191101192101193101194101195101196101197101198101199101200101201101202101203101204101205101206101207101208101209101210101211101212101213101214101215101216101217101218101219101220101221101222101223101224101225101226101227101228101229101230101231101232101233101234101235101236101237101238101239101240101241101242101243101244101245101246101247101248101249101250101251101252101253101254101255101256101257101258101259101260101261101262101263101264101265101266101267101268101269101270101271101272101273101274101275101276101277101278101279101280101281101282101283101284101285101286101287101288101289101290101291101292101293101294101295101296101297101298101299101300101301101302101303101304101305101306101307101308101309101310101311101312101313101314101315101316101317101318101319101320101321101322101323101324101325101326101327101328101329101330101331101332101333101334101335101336101337101338101339101340101341101342101343101344101345101346101347101348101349101350101351101352101353101354101355101356101357101358101359101360101361101362101363101364101365101366101367101368101369101370101371101372101373101374101375101376101377101378101379101380101381101382101383101384101385101386101387101388101389101390101391101392101393101394101395101396101397101398101399101400101401101402101403101404101405101406101407101408101409101410101411101412101413101414101415101416101417101418101419101420101421101422101423101424101425101426101427101428101429101430101431101432101433101434101435101436101437101438101439101440101441101442101443101444101445101446101447101448101449101450101451101452101453101454101455101456101457101458101459101460101461101462101463101464101465101466101467101468101469101470101471101472101473101474101475101476101477101478101479101480101481101482101483101484101485101486101487101488101489101490101491101492101493101494101495101496101497101498101499101500101501101502101503101504101505101506101507101508101509101510101511101512101513101514101515101516101517101518101519101520101521101522101523101524101525101526101527101528101529101530101531101532101533101534101535101536101537101538101539101540101541101542101543101544101545101546101547101548101549101550101551101552101553101554101555101556101557101558101559101560101561101562101563101564101565101566101567101568101569101570101571101572101573101574101575101576101577101578101579101580101581101582101583101584101585101586101587101588101589101590101591101592101593101594101595101596101597101598101599101600101601101602101603101604101605101606101607101608101609101610101611101612101613101614101615101616101617101618101619101620101621101622101623101624101625101626101627101628101629101630101631101632101633101634101635101636101637101638101639101640101641101642101643101644101645101646101647101648101649101650101651101652101653101654101655101656101657101658101659101660101661101662101663101664101665101666101667101668101669101670101671101672101673101674101675101676101677101678101679101680101681101682101683101684101685101686101687101688101689101690101691101692101693101694101695101696101697101698101699101700101701101702101703101704101705101706101707101708101709101710101711101712101713101714101715101716101717101718101719101720101721101722101723101724101725101726101727101728101729101730101731101732101733101734101735101736101737101738101739101740101741101742101743101744101745101746101747101748101749101750101751101752101753101754101755101756101757101758101759101760101761101762101763101764101765101766101767101768101769101770101771101772101773101774101775101776101777101778101779101780101781101782101783101784101785101786101787101788101789101790101791101792101793101794101795101796101797101798101799101800101801101802101803101804101805101806101807101808101809101810101811101812101813101814101815101816101817101818101819101820101821101822101823101824101825101826101827101828101829101830101831101832101833101834101835101836101837101838101839101840101841101842101843101844101845101846101847101848101849101850101851101852101853101854101855101856101857101858101859101860101861101862101863101864101865101866101867101868101869101870101871101872101873101874101875101876101877101878101879101880101881101882101883101884101885101886101887101888101889101890101891101892101893101894101895101896101897101898101899101900101901101902101903101904101905101906101907101908101909101910101911101912101913101914101915101916101917101918101919101920101921101922101923101924101925101926101927101928101929101930101931101932101933101934101935101936101937101938101939101940101941101942101943101944101945101946101947101948101949101950101951101952101953101954101955101956101957101958101959101960101961101962101963101964101965101966101967101968101969101970101971101972101973101974101975101976101977101978101979101980101981101982101983101984101985101986101987101988101989101990101991101992101993101994101995101996101997101998101999102000102001102002102003102004102005102006102007102008102009102010102011102012102013102014102015102016102017102018102019102020102021102022102023102024102025102026102027102028102029102030102031102032102033102034102035102036102037102038102039102040102041102042102043102044102045102046102047102048102049102050102051102052102053102054102055102056102057102058102059102060102061102062102063102064102065102066102067102068102069102070102071102072102073102074102075102076102077102078102079102080102081102082102083102084102085102086102087102088102089102090102091102092102093102094102095102096102097102098102099102100102101102102102103102104102105102106102107102108102109102110102111102112102113102114102115102116102117102118102119102120102121102122102123102124102125102126102127102128102129102130102131102132102133102134102135102136102137102138102139102140102141102142102143102144102145102146102147102148102149102150102151102152102153102154102155102156102157102158102159102160102161102162102163102164102165102166102167102168102169102170102171102172102173102174102175102176102177102178102179102180102181102182102183102184102185102186102187102188102189102190102191102192102193102194102195102196102197102198102199102200102201102202102203102204102205102206102207102208102209102210102211102212102213102214102215102216102217102218102219102220102221102222102223102224102225102226102227102228102229102230102231102232102233102234102235102236102237102238102239102240102241102242102243102244102245102246102247102248102249102250102251102252102253102254102255102256102257102258102259102260102261102262102263102264102265102266102267102268102269102270102271102272102273102274102275102276102277102278102279102280102281102282102283102284102285102286102287102288102289102290102291102292102293102294102295102296102297102298102299102300102301102302102303102304102305102306102307102308102309102310102311102312102313102314102315102316102317102318102319102320102321102322102323102324102325102326102327102328102329102330102331102332102333102334102335102336102337102338102339102340102341102342102343102344102345102346102347102348102349102350102351102352102353102354102355102356102357102358102359102360102361102362102363102364102365102366102367102368102369102370102371102372102373102374102375102376102377102378102379102380102381102382102383102384102385102386102387102388102389102390102391102392102393102394102395102396102397102398102399102400102401102402102403102404102405102406102407102408102409102410102411102412102413102414102415102416102417102418102419102420102421102422102423102424102425102426102427102428102429102430102431102432102433102434102435102436102437102438102439102440102441102442102443102444102445102446102447102448102449102450102451102452102453102454102455102456102457102458102459102460102461102462102463102464102465102466102467102468102469102470102471102472102473102474102475102476102477102478102479102480102481102482102483102484102485102486102487102488102489102490102491102492102493102494102495102496102497102498102499102500102501102502102503102504102505102506102507102508102509102510102511102512102513102514102515102516102517102518102519102520102521102522102523102524102525102526102527102528102529102530102531102532102533102534102535102536102537102538102539102540102541102542102543102544102545102546102547102548102549102550102551102552102553102554102555102556102557102558102559102560102561102562102563102564102565102566102567102568102569102570102571102572102573102574102575102576102577102578102579102580102581102582102583102584102585102586102587102588102589102590102591102592102593102594102595102596102597102598102599102600102601102602102603102604102605102606102607102608102609102610102611102612102613102614102615102616102617102618102619102620102621102622102623102624102625102626102627102628102629102630102631102632102633102634102635102636102637102638102639102640102641102642102643102644102645102646102647102648102649102650102651102652102653102654102655102656102657102658102659102660102661102662102663102664102665102666102667102668102669102670102671102672102673102674102675102676102677102678102679102680102681102682102683102684102685102686102687102688102689102690102691102692102693102694102695102696102697102698102699102700102701102702102703102704102705102706102707102708102709102710102711102712102713102714102715102716102717102718102719102720102721102722102723102724102725102726102727102728102729102730102731102732102733102734102735102736102737102738102739102740102741102742102743102744102745102746102747102748102749102750102751102752102753102754102755102756102757102758102759102760102761102762102763102764102765102766102767102768102769102770102771102772102773102774102775102776102777102778102779102780102781102782102783102784102785102786102787102788102789102790102791102792102793102794102795102796102797102798102799102800102801102802102803102804102805102806102807102808102809102810102811102812102813102814102815102816102817102818102819102820102821102822102823102824102825102826102827102828102829102830102831102832102833102834102835102836102837102838102839102840102841102842102843102844102845102846102847102848102849102850102851102852102853102854102855102856102857102858102859102860102861102862102863102864102865102866102867102868102869102870102871102872102873102874102875102876102877102878102879102880102881102882102883102884102885102886102887102888102889102890102891102892102893102894102895102896102897102898102899102900102901102902102903102904102905102906102907102908102909102910102911102912102913102914102915102916102917102918102919102920102921102922102923102924102925102926102927102928102929102930102931102932102933102934102935102936102937102938102939102940102941102942102943102944102945102946102947102948102949102950102951102952102953102954102955102956102957102958102959102960102961102962102963102964102965102966102967102968102969102970102971102972102973102974102975102976102977102978102979102980102981102982102983102984102985102986102987102988102989102990102991102992102993102994102995102996102997102998102999103000103001103002103003103004103005103006103007103008103009103010103011103012103013103014103015103016103017103018103019103020103021103022103023103024103025103026103027103028103029103030103031103032103033103034103035103036103037103038103039103040103041103042103043103044103045103046103047103048103049103050103051103052103053103054103055103056103057103058103059103060103061103062103063103064103065103066103067103068103069103070103071103072103073103074103075103076103077103078103079103080103081103082103083103084103085103086103087103088103089103090103091103092103093103094103095103096103097103098103099103100103101103102103103103104103105103106103107103108103109103110103111103112103113103114103115103116103117103118103119103120103121103122103123103124103125103126103127103128103129103130103131103132103133103134103135103136103137103138103139103140103141103142103143103144103145103146103147103148103149103150103151103152103153103154103155103156103157103158103159103160103161103162103163103164103165103166103167103168103169103170103171103172103173103174103175103176103177103178103179103180103181103182103183103184103185103186103187103188103189103190103191103192103193103194103195103196103197103198103199103200103201103202103203103204103205103206103207103208103209103210103211103212103213103214103215103216103217103218103219103220103221103222103223103224103225103226103227103228103229103230103231103232103233103234103235103236103237103238103239103240103241103242103243103244103245103246103247103248103249103250103251103252103253103254103255103256103257103258103259103260103261103262103263103264103265103266103267103268103269103270103271103272103273103274103275103276103277103278103279103280103281103282103283103284103285103286103287103288103289103290103291103292103293103294103295103296103297103298103299103300103301103302103303103304103305103306103307103308103309103310103311103312103313103314103315103316103317103318103319103320103321103322103323103324103325103326103327103328103329103330103331103332103333103334103335103336103337103338103339103340103341103342103343103344103345103346103347103348103349103350103351103352103353103354103355103356103357103358103359103360103361103362103363103364103365103366103367103368103369103370103371103372103373103374103375103376103377103378103379103380103381103382103383103384103385103386103387103388103389103390103391103392103393103394103395103396103397103398103399103400103401103402103403103404103405103406103407103408103409103410103411103412103413103414103415103416103417103418103419103420103421103422103423103424103425103426103427103428103429103430103431103432103433103434103435103436103437103438103439103440103441103442103443103444103445103446103447103448103449103450103451103452103453103454103455103456103457103458103459103460103461103462103463103464103465103466103467103468103469103470103471103472103473103474103475103476103477103478103479103480103481103482103483103484103485103486103487103488103489103490103491103492103493103494103495103496103497103498103499103500103501103502103503103504103505103506103507103508103509103510103511103512103513103514103515103516103517103518103519103520103521103522103523103524103525103526103527103528103529103530103531103532103533103534103535103536103537103538103539103540103541103542103543103544103545103546103547103548103549103550103551103552103553103554103555103556103557103558103559103560103561103562103563103564103565103566103567103568103569103570103571103572103573103574103575103576103577103578103579103580103581103582103583103584103585103586103587103588103589103590103591103592103593103594103595103596103597103598103599103600103601103602103603103604103605103606103607103608103609103610103611103612103613103614103615103616103617103618103619103620103621103622103623103624103625103626103627103628103629103630103631103632103633103634103635103636103637103638103639103640103641103642103643103644103645103646103647103648103649103650103651103652103653103654103655103656103657103658103659103660103661103662103663103664103665103666103667103668103669103670103671103672103673103674103675103676103677103678103679103680103681103682103683103684103685103686103687103688103689103690103691103692103693103694103695103696103697103698103699103700103701103702103703103704103705103706103707103708103709103710103711103712103713103714103715103716103717103718103719103720103721103722103723103724103725103726103727103728103729103730103731103732103733103734103735103736103737103738103739103740103741103742103743103744103745103746103747103748103749103750103751103752103753103754103755103756103757103758103759103760103761103762103763103764103765103766103767103768103769103770103771103772103773103774103775103776103777103778103779103780103781103782103783103784103785103786103787103788103789103790103791103792103793103794103795103796103797103798103799103800103801103802103803103804103805103806103807103808103809103810103811103812103813103814103815103816103817103818103819103820103821103822103823103824103825103826103827103828103829103830103831103832103833103834103835103836103837103838103839103840103841103842103843103844103845103846103847103848103849103850103851103852103853103854103855103856103857103858103859103860103861103862103863103864103865103866103867103868103869103870103871103872103873103874103875103876103877103878103879103880103881103882103883103884103885103886103887103888103889103890103891103892103893103894103895103896103897103898103899103900103901103902103903103904103905103906103907103908103909103910103911103912103913103914103915103916103917103918103919103920103921103922103923103924103925103926103927103928103929103930103931103932103933103934103935103936103937103938103939103940103941103942103943103944103945103946103947103948103949103950103951103952103953103954103955103956103957103958103959103960103961103962103963103964103965103966103967103968103969103970103971103972103973103974103975103976103977103978103979103980103981103982103983103984103985103986103987103988103989103990103991103992103993103994103995103996103997103998103999104000104001104002104003104004104005104006104007104008104009104010104011104012104013104014104015104016104017104018104019104020104021104022104023104024104025104026104027104028104029104030104031104032104033104034104035104036104037104038104039104040104041104042104043104044104045104046104047104048104049104050104051104052104053104054104055104056104057104058104059104060104061104062104063104064104065104066104067104068104069104070104071104072104073104074104075104076104077104078104079104080104081104082104083104084104085104086104087104088104089104090104091104092104093104094104095104096104097104098104099104100104101104102104103104104104105104106104107104108104109104110104111104112104113104114104115104116104117104118104119104120104121104122104123104124104125104126104127104128104129104130104131104132104133104134104135104136104137104138104139104140104141104142104143104144104145104146104147104148104149104150104151104152104153104154104155104156104157104158104159104160104161104162104163104164104165104166104167104168104169104170104171104172104173104174104175104176104177104178104179104180104181104182104183104184104185104186104187104188104189104190104191104192104193104194104195104196104197104198104199104200104201104202104203104204104205104206104207104208104209104210104211104212104213104214104215104216104217104218104219104220104221104222104223104224104225104226104227104228104229104230104231104232104233104234104235104236104237104238104239104240104241104242104243104244104245104246104247104248104249104250104251104252104253104254104255104256104257104258104259104260104261104262104263104264104265104266104267104268104269104270104271104272104273104274104275104276104277104278104279104280104281104282104283104284104285104286104287104288104289104290104291104292104293104294104295104296104297104298104299104300104301104302104303104304104305104306104307104308104309104310104311104312104313104314104315104316104317104318104319104320104321104322104323104324104325104326104327104328104329104330104331104332104333104334104335104336104337104338104339104340104341104342104343104344104345104346104347104348104349104350104351104352104353104354104355104356104357104358104359104360104361104362104363104364104365104366104367104368104369104370104371104372104373104374104375104376104377104378104379104380104381104382104383104384104385104386104387104388104389104390104391104392104393104394104395104396104397104398104399104400104401104402104403104404104405104406104407104408104409104410104411104412104413104414104415104416104417104418104419104420104421104422104423104424104425104426104427104428104429104430104431104432104433104434104435104436104437104438104439104440104441104442104443104444104445104446104447104448104449104450104451104452104453104454104455104456104457104458104459104460104461104462104463104464104465104466104467104468104469104470104471104472104473104474104475104476104477104478104479104480104481104482104483104484104485104486104487104488104489104490104491104492104493104494104495104496104497104498104499104500104501104502104503104504104505104506104507104508104509104510104511104512104513104514104515104516104517104518104519104520104521104522104523104524104525104526104527104528104529104530104531104532104533104534104535104536104537104538104539104540104541104542104543104544104545104546104547104548104549104550104551104552104553104554104555104556104557104558104559104560104561104562104563104564104565104566104567104568104569104570104571104572104573104574104575104576104577104578104579104580104581104582104583104584104585104586104587104588104589104590104591104592104593104594104595104596104597104598104599104600104601104602104603104604104605104606104607104608104609104610104611104612104613104614104615104616104617104618104619104620104621104622104623104624104625104626104627104628104629104630104631104632104633104634104635104636104637104638104639104640104641104642104643104644104645104646104647104648104649104650104651104652104653104654104655104656104657104658104659104660104661104662104663104664104665104666104667104668104669104670104671104672104673104674104675104676104677104678104679104680104681104682104683104684104685104686104687104688104689104690104691104692104693104694104695104696104697104698104699104700104701104702104703104704104705104706104707104708104709104710104711104712104713104714104715104716104717104718104719104720104721104722104723104724104725104726104727104728104729104730104731104732104733104734104735104736104737104738104739104740104741104742104743104744104745104746104747104748104749104750104751104752104753104754104755104756104757104758104759104760104761104762104763104764104765104766104767104768104769104770104771104772104773104774104775104776104777104778104779104780104781104782104783104784104785104786104787104788104789104790104791104792104793104794104795104796104797104798104799104800104801104802104803104804104805104806104807104808104809104810104811104812104813104814104815104816104817104818104819104820104821104822104823104824104825104826104827104828104829104830104831104832104833104834104835104836104837104838104839104840104841104842104843104844104845104846104847104848104849104850104851104852104853104854104855104856104857104858104859104860104861104862104863104864104865104866104867104868104869104870104871104872104873104874104875104876104877104878104879104880104881104882104883104884104885104886104887104888104889104890104891104892104893104894104895104896104897104898104899104900104901104902104903104904104905104906104907104908104909104910104911104912104913104914104915104916104917104918104919104920104921104922104923104924104925104926104927104928104929104930104931104932104933104934104935104936104937104938104939104940104941104942104943104944104945104946104947104948104949104950104951104952104953104954104955104956104957104958104959104960104961104962104963104964104965104966104967104968104969104970104971104972104973104974104975104976104977104978104979104980104981104982104983104984104985104986104987104988104989104990104991104992104993104994104995104996104997104998104999105000105001105002105003105004105005105006105007105008105009105010105011105012105013105014105015105016105017105018105019105020105021105022105023105024105025105026105027105028105029105030105031105032105033105034105035105036105037105038105039105040105041105042105043105044105045105046105047105048105049105050105051105052105053105054105055105056105057105058105059105060105061105062105063105064105065105066105067105068105069105070105071105072105073105074105075105076105077105078105079105080105081105082105083105084105085105086105087105088105089105090105091105092105093105094105095105096105097105098105099105100105101105102105103105104105105105106105107105108105109105110105111105112105113105114105115105116105117105118105119105120105121105122105123105124105125105126105127105128105129105130105131105132105133105134105135105136105137105138105139105140105141105142105143105144105145105146105147105148105149105150105151105152105153105154105155105156105157105158105159105160105161105162105163105164105165105166105167105168105169105170105171105172105173105174105175105176105177105178105179105180105181105182105183105184105185105186105187105188105189105190105191105192105193105194105195105196105197105198105199105200105201105202105203105204105205105206105207105208105209105210105211105212105213105214105215105216105217105218105219105220105221105222105223105224105225105226105227105228105229105230105231105232105233105234105235105236105237105238105239105240105241105242105243105244105245105246105247105248105249105250105251105252105253105254105255105256105257105258105259105260105261105262105263105264105265105266105267105268105269105270105271105272105273105274105275105276105277105278105279105280105281105282105283105284105285105286105287105288105289105290105291105292105293105294105295105296105297105298105299105300105301105302105303105304105305105306105307105308105309105310105311105312105313105314105315105316105317105318105319105320105321105322105323105324105325105326105327105328105329105330105331105332105333105334105335105336105337105338105339105340105341105342105343105344105345105346105347105348105349105350105351105352105353105354105355105356105357105358105359105360105361105362105363105364105365105366105367105368105369105370105371105372105373105374105375105376105377105378105379105380105381105382105383105384105385105386105387105388105389105390105391105392105393105394105395105396105397105398105399105400105401105402105403105404105405105406105407105408105409105410105411105412105413105414105415105416105417105418105419105420105421105422105423105424105425105426105427105428105429105430105431105432105433105434105435105436105437105438105439105440105441105442105443105444105445105446105447105448105449105450105451105452105453105454105455105456105457105458105459105460105461105462105463105464105465105466105467105468105469105470105471105472105473105474105475105476105477105478105479105480105481105482105483105484105485105486105487105488105489105490105491105492105493105494105495105496105497105498105499105500105501105502105503105504105505105506105507105508105509105510105511105512105513105514105515105516105517105518105519105520105521105522105523105524105525105526105527105528105529105530105531105532105533105534105535105536105537105538105539105540105541105542105543105544105545105546105547105548105549105550105551105552105553105554105555105556105557105558105559105560105561105562105563105564105565105566105567105568105569105570105571105572105573105574105575105576105577105578105579105580105581105582105583105584105585105586105587105588105589105590105591105592105593105594105595105596105597105598105599105600105601105602105603105604105605105606105607105608105609105610105611105612105613105614105615105616105617105618105619105620105621105622105623105624105625105626105627105628105629105630105631105632105633105634105635105636105637105638105639105640105641105642105643105644105645105646105647105648105649105650105651105652105653105654105655105656105657105658105659105660105661105662105663105664105665105666105667105668105669105670105671105672105673105674105675105676105677105678105679105680105681105682105683105684105685105686105687105688105689105690105691105692105693105694105695105696105697105698105699105700105701105702105703105704105705105706105707105708105709105710105711105712105713105714105715105716105717105718105719105720105721105722105723105724105725105726105727105728105729105730105731105732105733105734105735105736105737105738105739105740105741105742105743105744105745105746105747105748105749105750105751105752105753105754105755105756105757105758105759105760105761105762105763105764105765105766105767105768105769105770105771105772105773105774105775105776105777105778105779105780105781105782105783105784105785105786105787105788105789105790105791105792105793105794105795105796105797105798105799105800105801105802105803105804105805105806105807105808105809105810105811105812105813105814105815105816105817105818105819105820105821105822105823105824105825105826105827105828105829105830105831105832105833105834105835105836105837105838105839105840105841105842105843105844105845105846105847105848105849105850105851105852105853105854105855105856105857105858105859105860105861105862105863105864105865105866105867105868105869105870105871105872105873105874105875105876105877105878105879105880105881105882105883105884105885105886105887105888105889105890105891105892105893105894105895105896105897105898105899105900105901105902105903105904105905105906105907105908105909105910105911105912105913105914105915105916105917105918105919105920105921105922105923105924105925105926105927105928105929105930105931105932105933105934105935105936105937105938105939105940105941105942105943105944105945105946105947105948105949105950105951105952105953105954105955105956105957105958105959105960105961105962105963105964105965105966105967105968105969105970105971105972105973105974105975105976105977105978105979105980105981105982105983105984105985105986105987105988105989105990105991105992105993105994105995105996105997105998105999106000106001106002106003106004106005106006106007106008106009106010106011106012106013106014106015106016106017106018106019106020106021106022106023106024106025106026106027106028106029106030106031106032106033106034106035106036106037106038106039106040106041106042106043106044106045106046106047106048106049106050106051106052106053106054106055106056106057106058106059106060106061106062106063106064106065106066106067106068106069106070106071106072106073106074106075106076106077106078106079106080106081106082106083106084106085106086106087106088106089106090106091106092106093106094106095106096106097106098106099106100106101106102106103106104106105106106106107106108106109106110106111106112106113106114106115106116106117106118106119106120106121106122106123106124106125106126106127106128106129106130106131106132106133106134106135106136106137106138106139106140106141106142106143106144106145106146106147106148106149106150106151106152106153106154106155106156106157106158106159106160106161106162106163106164106165106166106167106168106169106170106171106172106173106174106175106176106177106178106179106180106181106182106183106184106185106186106187106188106189106190106191106192106193106194106195106196106197106198106199106200106201106202106203106204106205106206106207106208106209106210106211106212106213106214106215106216106217106218106219106220106221106222106223106224106225106226106227106228106229106230106231106232106233106234106235106236106237106238106239106240106241106242106243106244106245106246106247106248106249106250106251106252106253106254106255106256106257106258106259106260106261106262106263106264106265106266106267106268106269106270106271106272106273106274106275106276106277106278106279106280106281106282106283106284106285106286106287106288106289106290106291106292106293106294106295106296106297106298106299106300106301106302106303106304106305106306106307106308106309106310106311106312106313106314106315106316106317106318106319106320106321106322106323106324106325106326106327106328106329106330106331106332106333106334106335106336106337106338106339106340106341106342106343106344106345106346106347106348106349106350106351106352106353106354106355106356106357106358106359106360106361106362106363106364106365106366106367106368106369106370106371106372106373106374106375106376106377106378106379106380106381106382106383106384106385106386106387106388106389106390106391106392106393106394106395106396106397106398106399106400106401106402106403106404106405106406106407106408106409106410106411106412106413106414106415106416106417106418106419106420106421106422106423106424106425106426106427106428106429106430106431106432106433106434106435106436106437106438106439106440106441106442106443106444106445106446106447106448106449106450106451106452106453106454106455106456106457106458106459106460106461106462106463106464106465106466106467106468106469106470106471106472106473106474106475106476106477106478106479106480106481106482106483106484106485106486106487106488106489106490106491106492106493106494106495106496106497106498106499106500106501106502106503106504106505106506106507106508106509106510106511106512106513106514106515106516106517106518106519106520106521106522106523106524106525106526106527106528106529106530106531106532106533106534106535106536106537106538106539106540106541106542106543106544106545106546106547106548106549106550106551106552106553106554106555106556106557106558106559106560106561106562106563106564106565106566106567106568106569106570106571106572106573106574106575106576106577106578106579106580106581106582106583106584106585106586106587106588106589106590106591106592106593106594106595106596106597106598106599106600106601106602106603106604106605106606106607106608106609106610106611106612106613106614106615106616106617106618106619106620106621106622106623106624106625106626106627106628106629106630106631106632106633106634106635106636106637106638106639106640106641106642106643106644106645106646106647106648106649106650106651106652106653106654106655106656106657106658106659106660106661106662106663106664106665106666106667106668106669106670106671106672106673106674106675106676106677106678106679106680106681106682106683106684106685106686106687106688106689106690106691106692106693106694106695106696106697106698106699106700106701106702106703106704106705106706106707106708106709106710106711106712106713106714106715106716106717106718106719106720106721106722106723106724106725106726106727106728106729106730106731106732106733106734106735106736106737106738106739106740106741106742106743106744106745106746106747106748106749106750106751106752106753106754106755106756106757106758106759106760106761106762106763106764106765106766106767106768106769106770106771106772106773106774106775106776106777106778106779106780106781106782106783106784106785106786106787106788106789106790106791106792106793106794106795106796106797106798106799106800106801106802106803106804106805106806106807106808106809106810106811106812106813106814106815106816106817106818106819106820106821106822106823106824106825106826106827106828106829106830106831106832106833106834106835106836106837106838106839106840106841106842106843106844106845106846106847106848106849106850106851106852106853106854106855106856106857106858106859106860106861106862106863106864106865106866106867106868106869106870106871106872106873106874106875106876106877106878106879106880106881106882106883106884106885106886106887106888106889106890106891106892106893106894106895106896106897106898106899106900106901106902106903106904106905106906106907106908106909106910106911106912106913106914106915106916106917106918106919106920106921106922106923106924106925106926106927106928106929106930106931106932106933106934106935106936106937106938106939106940106941106942106943106944106945106946106947106948106949106950106951106952106953106954106955106956106957106958106959106960106961106962106963106964106965106966106967106968106969106970106971106972106973106974106975106976106977106978106979106980106981106982106983106984106985106986106987106988106989106990106991106992106993106994106995106996106997106998106999107000107001107002107003107004107005107006107007107008107009107010107011107012107013107014107015107016107017107018107019107020107021107022107023107024107025107026107027107028107029107030107031107032107033107034107035107036107037107038107039107040107041107042107043107044107045107046107047107048107049107050107051107052107053107054107055107056107057107058107059107060107061107062107063107064107065107066107067107068107069107070107071107072107073107074107075107076107077107078107079107080107081107082107083107084107085107086107087107088107089107090107091107092107093107094107095107096107097107098107099107100107101107102107103107104107105107106107107107108107109107110107111107112107113107114107115107116107117107118107119107120107121107122107123107124107125107126107127107128107129107130107131107132107133107134107135107136107137107138107139107140107141107142107143107144107145107146107147107148107149107150107151107152107153107154107155107156107157107158107159107160107161107162107163107164107165107166107167107168107169107170107171107172107173107174107175107176107177107178107179107180107181107182107183107184107185107186107187107188107189107190107191107192107193107194107195107196107197107198107199107200107201107202107203107204107205107206107207107208107209107210107211107212107213107214107215107216107217107218107219107220107221107222107223107224107225107226107227107228107229107230107231107232107233107234107235107236107237107238107239107240107241107242107243107244107245107246107247107248107249107250107251107252107253107254107255107256107257107258107259107260107261107262107263107264107265107266107267107268107269107270107271107272107273107274107275107276107277107278107279107280107281107282107283107284107285107286107287107288107289107290107291107292107293107294107295107296107297107298107299107300107301107302107303107304107305107306107307107308107309107310107311107312107313107314107315107316107317107318107319107320107321107322107323107324107325107326107327107328107329107330107331107332107333107334107335107336107337107338107339107340107341107342107343107344107345107346107347107348107349107350107351107352107353107354107355107356107357107358107359107360107361107362107363107364107365107366107367107368107369107370107371107372107373107374107375107376107377107378107379107380107381107382107383107384107385107386107387107388107389107390107391107392107393107394107395107396107397107398107399107400107401107402107403107404107405107406107407107408107409107410107411107412107413107414107415107416107417107418107419107420107421107422107423107424107425107426107427107428107429107430107431107432107433107434107435107436107437107438107439107440107441107442107443107444107445107446107447107448107449107450107451107452107453107454107455107456107457107458107459107460107461107462107463107464107465107466107467107468107469107470107471107472107473107474107475107476107477107478107479107480107481107482107483107484107485107486107487107488107489107490107491107492107493107494107495107496107497107498107499107500107501107502107503107504107505107506107507107508107509107510107511107512107513107514107515107516107517107518107519107520107521107522107523107524107525107526107527107528107529107530107531107532107533107534107535107536107537107538107539107540107541107542107543107544107545107546107547107548107549107550107551107552107553107554107555107556107557107558107559107560107561107562107563107564107565107566107567107568107569107570107571107572107573107574107575107576107577107578107579107580107581107582107583107584107585107586107587107588107589107590107591107592107593107594107595107596107597107598107599107600107601107602107603107604107605107606107607107608107609107610107611107612107613107614107615107616107617107618107619107620107621107622107623107624107625107626107627107628107629107630107631107632107633107634107635107636107637107638107639107640107641107642107643107644107645107646107647107648107649107650107651107652107653107654107655107656107657107658107659107660107661107662107663107664107665107666107667107668107669107670107671107672107673107674107675107676107677107678107679107680107681107682107683107684107685107686107687107688107689107690107691107692107693107694107695107696107697107698107699107700107701107702107703107704107705107706107707107708107709107710107711107712107713107714107715107716107717107718107719107720107721107722107723107724107725107726107727107728107729107730107731107732107733107734107735107736107737107738107739107740107741107742107743107744107745107746107747107748107749107750107751107752107753107754107755107756107757107758107759107760107761107762107763107764107765107766107767107768107769107770107771107772107773107774107775107776107777107778107779107780107781107782107783107784107785107786107787107788107789107790107791107792107793107794107795107796107797107798107799107800107801107802107803107804107805107806107807107808107809107810107811107812107813107814107815107816107817107818107819107820107821107822107823107824107825107826107827107828107829107830107831107832107833107834107835107836107837107838107839107840107841107842107843107844107845107846107847107848107849107850107851107852107853107854107855107856107857107858107859107860107861107862107863107864107865107866107867107868107869107870107871107872107873107874107875107876107877107878107879107880107881107882107883107884107885107886107887107888107889107890107891107892107893107894107895107896107897107898107899107900107901107902107903107904107905107906107907107908107909107910107911107912107913107914107915107916107917107918107919107920107921107922107923107924107925107926107927107928107929107930107931107932107933107934107935107936107937107938107939107940107941107942107943107944107945107946107947107948107949107950107951107952107953107954107955107956107957107958107959107960107961107962107963107964107965107966107967107968107969107970107971107972107973107974107975107976107977107978107979107980107981107982107983107984107985107986107987107988107989107990107991107992107993107994107995107996107997107998107999108000108001108002108003108004108005108006108007108008108009108010108011108012108013108014108015108016108017108018108019108020108021108022108023108024108025108026108027108028108029108030108031108032108033108034108035108036108037108038108039108040108041108042108043108044108045108046108047108048108049108050108051108052108053108054108055108056108057108058108059108060108061108062108063108064108065108066108067108068108069108070108071108072108073108074108075108076108077108078108079108080108081108082108083108084108085108086108087108088108089108090108091108092108093108094108095108096108097108098108099108100108101108102108103108104108105108106108107108108108109108110108111108112108113108114108115108116108117108118108119108120108121108122108123108124108125108126108127108128108129108130108131108132108133108134108135108136108137108138108139108140108141108142108143108144108145108146108147108148108149108150108151108152108153108154108155108156108157108158108159108160108161108162108163108164108165108166108167108168108169108170108171108172108173108174108175108176108177108178108179108180108181108182108183108184108185108186108187108188108189108190108191108192108193108194108195108196108197108198108199108200108201108202108203108204108205108206108207108208108209108210108211108212108213108214108215108216108217108218108219108220108221108222108223108224108225108226108227108228108229108230108231108232108233108234108235108236108237108238108239108240108241108242108243108244108245108246108247108248108249108250108251108252108253108254108255108256108257108258108259108260108261108262108263108264108265108266108267108268108269108270108271108272108273108274108275108276108277108278108279108280108281108282108283108284108285108286108287108288108289108290108291108292108293108294108295108296108297108298108299108300108301108302108303108304108305108306108307108308108309108310108311108312108313108314108315108316108317108318108319108320108321108322108323108324108325108326108327108328108329108330108331108332108333108334108335108336108337108338108339108340108341108342108343108344108345108346108347108348108349108350108351108352108353108354108355108356108357108358108359108360108361108362108363108364108365108366108367108368108369108370108371108372108373108374108375108376108377108378108379108380108381108382108383108384108385108386108387108388108389108390108391108392108393108394108395108396108397108398108399108400108401108402108403108404108405108406108407108408108409108410108411108412108413108414108415108416108417108418108419108420108421108422108423108424108425108426108427108428108429108430108431108432108433108434108435108436108437108438108439108440108441108442108443108444108445108446108447108448108449108450108451108452108453108454108455108456108457108458108459108460108461108462108463108464108465108466108467108468108469108470108471108472108473108474108475108476108477108478108479108480108481108482108483108484108485108486108487108488108489108490108491108492108493108494108495108496108497108498108499108500108501108502108503108504108505108506108507108508108509108510108511108512108513108514108515108516108517108518108519108520108521108522108523108524108525108526108527108528108529108530108531108532108533108534108535108536108537108538108539108540108541108542108543108544108545108546108547108548108549108550108551108552108553108554108555108556108557108558108559108560108561108562108563108564108565108566108567108568108569108570108571108572108573108574108575108576108577108578108579108580108581108582108583108584108585108586108587108588108589108590108591108592108593108594108595108596108597108598108599108600108601108602108603108604108605108606108607108608108609108610108611108612108613108614108615108616108617108618108619108620108621108622108623108624108625108626108627108628108629108630108631108632108633108634108635108636108637108638108639108640108641108642108643108644108645108646108647108648108649108650108651108652108653108654108655108656108657108658108659108660108661108662108663108664108665108666108667108668108669108670108671108672108673108674108675108676108677108678108679108680108681108682108683108684108685108686108687108688108689108690108691108692108693108694108695108696108697108698108699108700108701108702108703108704108705108706108707108708108709108710108711108712108713108714108715108716108717108718108719108720108721108722108723108724108725108726108727108728108729108730108731108732108733108734108735108736108737108738108739108740108741108742108743108744108745108746108747108748108749108750108751108752108753108754108755108756108757108758108759108760108761108762108763108764108765108766108767108768108769108770108771108772108773108774108775108776108777108778108779108780108781108782108783108784108785108786108787108788108789108790108791108792108793108794108795108796108797108798108799108800108801108802108803108804108805108806108807108808108809108810108811108812108813108814108815108816108817108818108819108820108821108822108823108824108825108826108827108828108829108830108831108832108833108834108835108836108837108838108839108840108841108842108843108844108845108846108847108848108849108850108851108852108853108854108855108856108857108858108859108860108861108862108863108864108865108866108867108868108869108870108871108872108873108874108875108876108877108878108879108880108881108882108883108884108885108886108887108888108889108890108891108892108893108894108895108896108897108898108899108900108901108902108903108904108905108906108907108908108909108910108911108912108913108914108915108916108917108918108919108920108921108922108923108924108925108926108927108928108929108930108931108932108933108934108935108936108937108938108939108940108941108942108943108944108945108946108947108948108949108950108951108952108953108954108955108956108957108958108959108960108961108962108963108964108965108966108967108968108969108970108971108972108973108974108975108976108977108978108979108980108981108982108983108984108985108986108987108988108989108990108991108992108993108994108995108996108997108998108999109000109001109002109003109004109005109006109007109008109009109010109011109012109013109014109015109016109017109018109019109020109021109022109023109024109025109026109027109028109029109030109031109032109033109034109035109036109037109038109039109040109041109042109043109044109045109046109047109048109049109050109051109052109053109054109055109056109057109058109059109060109061109062109063109064109065109066109067109068109069109070109071109072109073109074109075109076109077109078109079109080109081109082109083109084109085109086109087109088109089109090109091109092109093109094109095109096109097109098109099109100109101109102109103109104109105109106109107109108109109109110109111109112109113109114109115109116109117109118109119109120109121109122109123109124109125109126109127109128109129109130109131109132109133109134109135109136109137109138109139109140109141109142109143109144109145109146109147109148109149109150109151109152109153109154109155109156109157109158109159109160109161109162109163109164109165109166109167109168109169109170109171109172109173109174109175109176109177109178109179109180109181109182109183109184109185109186109187109188109189109190109191109192109193109194109195109196109197109198109199109200109201109202109203109204109205109206109207109208109209109210109211109212109213109214109215109216109217109218109219109220109221109222109223109224109225109226109227109228109229109230109231109232109233109234109235109236109237109238109239109240109241109242109243109244109245109246109247109248109249109250109251109252109253109254109255109256109257109258109259109260109261109262109263109264109265109266109267109268109269109270109271109272109273109274109275109276109277109278109279109280109281109282109283109284109285109286109287109288109289109290109291109292109293109294109295109296109297109298109299109300109301109302109303109304109305109306109307109308109309109310109311109312109313109314109315109316109317109318109319109320109321109322109323109324109325109326109327109328109329109330109331109332109333109334109335109336109337109338109339109340109341109342109343109344109345109346109347109348109349109350109351109352109353109354109355109356109357109358109359109360109361109362109363109364109365109366109367109368109369109370109371109372109373109374109375109376109377109378109379109380109381109382109383109384109385109386109387109388109389109390109391109392109393109394109395109396109397109398109399109400109401109402109403109404109405109406109407109408109409109410109411109412109413109414109415109416109417109418109419109420109421109422109423109424109425109426109427109428109429109430109431109432109433109434109435109436109437109438109439109440109441109442109443109444109445109446109447109448109449109450109451109452109453109454109455109456109457109458109459109460109461109462109463109464109465109466109467109468109469109470109471109472109473109474109475109476109477109478109479109480109481109482109483109484109485109486109487109488109489109490109491109492109493109494109495109496109497109498109499109500109501109502109503109504109505109506109507109508109509109510109511109512109513109514109515109516109517109518109519109520109521109522109523109524109525109526109527109528109529109530109531109532109533109534109535109536109537109538109539109540109541109542109543109544109545109546109547109548109549109550109551109552109553109554109555109556109557109558109559109560109561109562109563109564109565109566109567109568109569109570109571109572109573109574109575109576109577109578109579109580109581109582109583109584109585109586109587109588109589109590109591109592109593109594109595109596109597109598109599109600109601109602109603109604109605109606109607109608109609109610109611109612109613109614109615109616109617109618109619109620109621109622109623109624109625109626109627109628109629109630109631109632109633109634109635109636109637109638109639109640109641109642109643109644109645109646109647109648109649109650109651109652109653109654109655109656109657109658109659109660109661109662109663109664109665109666109667109668109669109670109671109672109673109674109675109676109677109678109679109680109681109682109683109684109685109686109687109688109689109690109691109692109693109694109695109696109697109698109699109700109701109702109703109704109705109706109707109708109709109710109711109712109713109714109715109716109717109718109719109720109721109722109723109724109725109726109727109728109729109730109731109732109733109734109735109736109737109738109739109740109741109742109743109744109745109746109747109748109749109750109751109752109753109754109755109756109757109758109759109760109761109762109763109764109765109766109767109768109769109770109771109772109773109774109775109776109777109778109779109780109781109782109783109784109785109786109787109788109789109790109791109792109793109794109795109796109797109798109799109800109801109802109803109804109805109806109807109808109809109810109811109812109813109814109815109816109817109818109819109820109821109822109823109824109825109826109827109828109829109830109831109832109833109834109835109836109837109838109839109840109841109842109843109844109845109846109847109848109849109850109851109852109853109854109855109856109857109858109859109860109861109862109863109864109865109866109867109868109869109870109871109872109873109874109875109876109877109878109879109880109881109882109883109884109885109886109887109888109889109890109891109892109893109894109895109896109897109898109899109900109901109902109903109904109905109906109907109908109909109910109911109912109913109914109915109916109917109918109919109920109921109922109923109924109925109926109927109928109929109930109931109932109933109934109935109936109937109938109939109940109941109942109943109944109945109946109947109948109949109950109951109952109953109954109955109956109957109958109959109960109961109962109963109964109965109966109967109968109969109970109971109972109973109974109975109976109977109978109979109980109981109982109983109984109985109986109987109988109989109990109991109992109993109994109995109996109997109998109999110000110001110002110003110004110005110006110007110008110009110010110011110012110013110014110015110016110017110018110019110020110021110022110023110024110025110026110027110028110029110030110031110032110033110034110035110036110037110038110039110040110041110042110043110044110045110046110047110048110049110050110051110052110053110054110055110056110057110058110059110060110061110062110063110064110065110066110067110068110069110070110071110072110073110074110075110076110077110078110079110080110081110082110083110084110085110086110087110088110089110090110091110092110093110094110095110096110097110098110099110100110101110102110103110104110105110106110107110108110109110110110111110112110113110114110115110116110117110118110119110120110121110122110123110124110125110126110127110128110129110130110131110132110133110134110135110136110137110138110139110140110141110142110143110144110145110146110147110148110149110150110151110152110153110154110155110156110157110158110159110160110161110162110163110164110165110166110167110168110169110170110171110172110173110174110175110176110177110178110179110180110181110182110183110184110185110186110187110188110189110190110191110192110193110194110195110196110197110198110199110200110201110202110203110204110205110206110207110208110209110210110211110212110213110214110215110216110217110218110219110220110221110222110223110224110225110226110227110228110229110230110231110232110233110234110235110236110237110238110239110240110241110242110243110244110245110246110247110248110249110250110251110252110253110254110255110256110257110258110259110260110261110262110263110264110265110266110267110268110269110270110271110272110273110274110275110276110277110278110279110280110281110282110283110284110285110286110287110288110289110290110291110292110293110294110295110296110297110298110299110300110301110302110303110304110305110306110307110308110309110310110311110312110313110314110315110316110317110318110319110320110321110322110323110324110325110326110327110328110329110330110331110332110333110334110335110336110337110338110339110340110341110342110343110344110345110346110347110348110349110350110351110352110353110354110355110356110357110358110359110360110361110362110363110364110365110366110367110368110369110370110371110372110373110374110375110376110377110378110379110380110381110382110383110384110385110386110387110388110389110390110391110392110393110394110395110396110397110398110399110400110401110402110403110404110405110406110407110408110409110410110411110412110413110414110415110416110417110418110419110420110421110422110423110424110425110426110427110428110429110430110431110432110433110434110435110436110437110438110439110440110441110442110443110444110445110446110447110448110449110450110451110452110453110454110455110456110457110458110459110460110461110462110463110464110465110466110467110468110469110470110471110472110473110474110475110476110477110478110479110480110481110482110483110484110485110486110487110488110489110490110491110492110493110494110495110496110497110498110499110500110501110502110503110504110505110506110507110508110509110510110511110512110513110514110515110516110517110518110519110520110521110522110523110524110525110526110527110528110529110530110531110532110533110534110535110536110537110538110539110540110541110542110543110544110545110546110547110548110549110550110551110552110553110554110555110556110557110558110559110560110561110562110563110564110565110566110567110568110569110570110571110572110573110574110575110576110577110578110579110580110581110582110583110584110585110586110587110588110589110590110591110592110593110594110595110596110597110598110599110600110601110602110603110604110605110606110607110608110609110610110611110612110613110614110615110616110617110618110619110620110621110622110623110624110625110626110627110628110629110630110631110632110633110634110635110636110637110638110639110640110641110642110643110644110645110646110647110648110649110650110651110652110653110654110655110656110657110658110659110660110661110662110663110664110665110666110667110668110669110670110671110672110673110674110675110676110677110678110679110680110681110682110683110684110685110686110687110688110689110690110691110692110693110694110695110696110697110698110699110700110701110702110703110704110705110706110707110708110709110710110711110712110713110714110715110716110717110718110719110720110721110722110723110724110725110726110727110728110729110730110731110732110733110734110735110736110737110738110739110740110741110742110743110744110745110746110747110748110749110750110751110752110753110754110755110756110757110758110759110760110761110762110763110764110765110766110767110768110769110770110771110772110773110774110775110776110777110778110779110780110781110782110783110784110785110786110787110788110789110790110791110792110793110794110795110796110797110798110799110800110801110802110803110804110805110806110807110808110809110810110811110812110813110814110815110816110817110818110819110820110821110822110823110824110825110826110827110828110829110830110831110832110833110834110835110836110837110838110839110840110841110842110843110844110845110846110847110848110849110850110851110852110853110854110855110856110857110858110859110860110861110862110863110864110865110866110867110868110869110870110871110872110873110874110875110876110877110878110879110880110881110882110883110884110885110886110887110888110889110890110891110892110893110894110895110896110897110898110899110900110901110902110903110904110905110906110907110908110909110910110911110912110913110914110915110916110917110918110919110920110921110922110923110924110925110926110927110928110929110930110931110932110933110934110935110936110937110938110939110940110941110942110943110944110945110946110947110948110949110950110951110952110953110954110955110956110957110958110959110960110961110962110963110964110965110966110967110968110969110970110971110972110973110974110975110976110977110978110979110980110981110982110983110984110985110986110987110988110989110990110991110992110993110994110995110996110997110998110999111000111001111002111003111004111005111006111007111008111009111010111011111012111013111014111015111016111017111018111019111020111021111022111023111024111025111026111027111028111029111030111031111032111033111034111035111036111037111038111039111040111041111042111043111044111045111046111047111048111049111050111051111052111053111054111055111056111057111058111059111060111061111062111063111064111065111066111067111068111069111070111071111072111073111074111075111076111077111078111079111080111081111082111083111084111085111086111087111088111089111090111091111092111093111094111095111096111097111098111099111100111101111102111103111104111105111106111107111108111109111110111111111112111113111114111115111116111117111118111119111120111121111122111123111124111125111126111127111128111129111130111131111132111133111134111135111136111137111138111139111140111141111142111143111144111145111146111147111148111149111150111151111152111153111154111155111156111157111158111159111160111161111162111163111164111165111166111167111168111169111170111171111172111173111174111175111176111177111178111179111180111181111182111183111184111185111186111187111188111189111190111191111192111193111194111195111196111197111198111199111200111201111202111203111204111205111206111207111208111209111210111211111212111213111214111215111216111217111218111219111220111221111222111223111224111225111226111227111228111229111230111231111232111233111234111235111236111237111238111239111240111241111242111243111244111245111246111247111248111249111250111251111252111253111254111255111256111257111258111259111260111261111262111263111264111265111266111267111268111269111270111271111272111273111274111275111276111277111278111279111280111281111282111283111284111285111286111287111288111289111290111291111292111293111294111295111296111297111298111299111300111301111302111303111304111305111306111307111308111309111310111311111312111313111314111315111316111317111318111319111320111321111322111323111324111325111326111327111328111329111330111331111332111333111334111335111336111337111338111339111340111341111342111343111344111345111346111347111348111349111350111351111352111353111354111355111356111357111358111359111360111361111362111363111364111365111366111367111368111369111370111371111372111373111374111375111376111377111378111379111380111381111382111383111384111385111386111387111388111389111390111391111392111393111394111395111396111397111398111399111400111401111402111403111404111405111406111407111408111409111410111411111412111413111414111415111416111417111418111419111420111421111422111423111424111425111426111427111428111429111430111431111432111433111434111435111436111437111438111439111440111441111442111443111444111445111446111447111448111449111450111451111452111453111454111455111456111457111458111459111460111461111462111463111464111465111466111467111468111469111470111471111472111473111474111475111476111477111478111479111480111481111482111483111484111485111486111487111488111489111490111491111492111493111494111495111496111497111498111499111500111501111502111503111504111505111506111507111508111509111510111511111512111513111514111515111516111517111518111519111520111521111522111523111524111525111526111527111528111529111530111531111532111533111534111535111536111537111538111539111540111541111542111543111544111545111546111547111548111549111550111551111552111553111554111555111556111557111558111559111560111561111562111563111564111565111566111567111568111569111570111571111572111573111574111575111576111577111578111579111580111581111582111583111584111585111586111587111588111589111590111591111592111593111594111595111596111597111598111599111600111601111602111603111604111605111606111607111608111609111610111611111612111613111614111615111616111617111618111619111620111621111622111623111624111625111626111627111628111629111630111631111632111633111634111635111636111637111638111639111640111641111642111643111644111645111646111647111648111649111650111651111652111653111654111655111656111657111658111659111660111661111662111663111664111665111666111667111668111669111670111671111672111673111674111675111676111677111678111679111680111681111682111683111684111685111686111687111688111689111690111691111692111693111694111695111696111697111698111699111700111701111702111703111704111705111706111707111708111709111710111711111712111713111714111715111716111717111718111719111720111721111722111723111724111725111726111727111728111729111730111731111732111733111734111735111736111737111738111739111740111741111742111743111744111745111746111747111748111749111750111751111752111753111754111755111756111757111758111759111760111761111762111763111764111765111766111767111768111769111770111771111772111773111774111775111776111777111778111779111780111781111782111783111784111785111786111787111788111789111790111791111792111793111794111795111796111797111798111799111800111801111802111803111804111805111806111807111808111809111810111811111812111813111814111815111816111817111818111819111820111821111822111823111824111825111826111827111828111829111830111831111832111833111834111835111836111837111838111839111840111841111842111843111844111845111846111847111848111849111850111851111852111853111854111855111856111857111858111859111860111861111862111863111864111865111866111867111868111869111870111871111872111873111874111875111876111877111878111879111880111881111882111883111884111885111886111887111888111889111890111891111892111893111894111895111896111897111898111899111900111901111902111903111904111905111906111907111908111909111910111911111912111913111914111915111916111917111918111919111920111921111922111923111924111925111926111927111928111929111930111931111932111933111934111935111936111937111938111939111940111941111942111943111944111945111946111947111948111949111950111951111952111953111954111955111956111957111958111959111960111961111962111963111964111965111966111967111968111969111970111971111972111973111974111975111976111977111978111979111980111981111982111983111984111985111986111987111988111989111990111991111992111993111994111995111996111997111998111999112000112001112002112003112004112005112006112007112008112009112010112011112012112013112014112015112016112017112018112019112020112021112022112023112024112025112026112027112028112029112030112031112032112033112034112035112036112037112038112039112040112041112042112043112044112045112046112047112048112049112050112051112052112053112054112055112056112057112058112059112060112061112062112063112064112065112066112067112068112069112070112071112072112073112074112075112076112077112078112079112080112081112082112083112084112085112086112087112088112089112090112091112092112093112094112095112096112097112098112099112100112101112102112103112104112105112106112107112108112109112110112111112112112113112114112115112116112117112118112119112120112121112122112123112124112125112126112127112128112129112130112131112132112133112134112135112136112137112138112139112140112141112142112143112144112145112146112147112148112149112150112151112152112153112154112155112156112157112158112159112160112161112162112163112164112165112166112167112168112169112170112171112172112173112174112175112176112177112178112179112180112181112182112183112184112185112186112187112188112189112190112191112192112193112194112195112196112197112198112199112200112201112202112203112204112205112206112207112208112209112210112211112212112213112214112215112216112217112218112219112220112221112222112223112224112225112226112227112228112229112230112231112232112233112234112235112236112237112238112239112240112241112242112243112244112245112246112247112248112249112250112251112252112253112254112255112256112257112258112259112260112261112262112263112264112265112266112267112268112269112270112271112272112273112274112275112276112277112278112279112280112281112282112283112284112285112286112287112288112289112290112291112292112293112294112295112296112297112298112299112300112301112302112303112304112305112306112307112308112309112310112311112312112313112314112315112316112317112318112319112320112321112322112323112324112325112326112327112328112329112330112331112332112333112334112335112336112337112338112339112340112341112342112343112344112345112346112347112348112349112350112351112352112353112354112355112356112357112358112359112360112361112362112363112364112365112366112367112368112369112370112371112372112373112374112375112376112377112378112379112380112381112382112383112384112385112386112387112388112389112390112391112392112393112394112395112396112397112398112399112400112401112402112403112404112405112406112407112408112409112410112411112412112413112414112415112416112417112418112419112420112421112422112423112424112425112426112427112428112429112430112431112432112433112434112435112436112437112438112439112440112441112442112443112444112445112446112447112448112449112450112451112452112453112454112455112456112457112458112459112460112461112462112463112464112465112466112467112468112469112470112471112472112473112474112475112476112477112478112479112480112481112482112483112484112485112486112487112488112489112490112491112492112493112494112495112496112497112498112499112500112501112502112503112504112505112506112507112508112509112510112511112512112513112514112515112516112517112518112519112520112521112522112523112524112525112526112527112528112529112530112531112532112533112534112535112536112537112538112539112540112541112542112543112544112545112546112547112548112549112550112551112552112553112554112555112556112557112558112559112560112561112562112563112564112565112566112567112568112569112570112571112572112573112574112575112576112577112578112579112580112581112582112583112584112585112586112587112588112589112590112591112592112593112594112595112596112597112598112599112600112601112602112603112604112605112606112607112608112609112610112611112612112613112614112615112616112617112618112619112620112621112622112623112624112625112626112627112628112629112630112631112632112633112634112635112636112637112638112639112640112641112642112643112644112645112646112647112648112649112650112651112652112653112654112655112656112657112658112659112660112661112662112663112664112665112666112667112668112669112670112671112672112673112674112675112676112677112678112679112680112681112682112683112684112685112686112687112688112689112690112691112692112693112694112695112696112697112698112699112700112701112702112703112704112705112706112707112708112709112710112711112712112713112714112715112716112717112718112719112720112721112722112723112724112725112726112727112728112729112730112731112732112733112734112735112736112737112738112739112740112741112742112743112744112745112746112747112748112749112750112751112752112753112754112755112756112757112758112759112760112761112762112763112764112765112766112767112768112769112770112771112772112773112774112775112776112777112778112779112780112781112782112783112784112785112786112787112788112789112790112791112792112793112794112795112796112797112798112799112800112801112802112803112804112805112806112807112808112809112810112811112812112813112814112815112816112817112818112819112820112821112822112823112824112825112826112827112828112829112830112831112832112833112834112835112836112837112838112839112840112841112842112843112844112845112846112847112848112849112850112851112852112853112854112855112856112857112858112859112860112861112862112863112864112865112866112867112868112869112870112871112872112873112874112875112876112877112878112879112880112881112882112883112884112885112886112887112888112889112890112891112892112893112894112895112896112897112898112899112900112901112902112903112904112905112906112907112908112909112910112911112912112913112914112915112916112917112918112919112920112921112922112923112924112925112926112927112928112929112930112931112932112933112934112935112936112937112938112939112940112941112942112943112944112945112946112947112948112949112950112951112952112953112954112955112956112957112958112959112960112961112962112963112964112965112966112967112968112969112970112971112972112973112974112975112976112977112978112979112980112981112982112983112984112985112986112987112988112989112990112991112992112993112994112995112996112997112998112999113000113001113002113003113004113005113006113007113008113009113010113011113012113013113014113015113016113017113018113019113020113021113022113023113024113025113026113027113028113029113030113031113032113033113034113035113036113037113038113039113040113041113042113043113044113045113046113047113048113049113050113051113052113053113054113055113056113057113058113059113060113061113062113063113064113065113066113067113068113069113070113071113072113073113074113075113076113077113078113079113080113081113082113083113084113085113086113087113088113089113090113091113092113093113094113095113096113097113098113099113100113101113102113103113104113105113106113107113108113109113110113111113112113113113114113115113116113117113118113119113120113121113122113123113124113125113126113127113128113129113130113131113132113133113134113135113136113137113138113139113140113141113142113143113144113145113146113147113148113149113150113151113152113153113154113155113156113157113158113159113160113161113162113163113164113165113166113167113168113169113170113171113172113173113174113175113176113177113178113179113180113181113182113183113184113185113186113187113188113189113190113191113192113193113194113195113196113197113198113199113200113201113202113203113204113205113206113207113208113209113210113211113212113213113214113215113216113217113218113219113220113221113222113223113224113225113226113227113228113229113230113231113232113233113234113235113236113237113238113239113240113241113242113243113244113245113246113247113248113249113250113251113252113253113254113255113256113257113258113259113260113261113262113263113264113265113266113267113268113269113270113271113272113273113274113275113276113277113278113279113280113281113282113283113284113285113286113287113288113289113290113291113292113293113294113295113296113297113298113299113300113301113302113303113304113305113306113307113308113309113310113311113312113313113314113315113316113317113318113319113320113321113322113323113324113325113326113327113328113329113330113331113332113333113334113335113336113337113338113339113340113341113342113343113344113345113346113347113348113349113350113351113352113353113354113355113356113357113358113359113360113361113362113363113364113365113366113367113368113369113370113371113372113373113374113375113376113377113378113379113380113381113382113383113384113385113386113387113388113389113390113391113392113393113394113395113396113397113398113399113400113401113402113403113404113405113406113407113408113409113410113411113412113413113414113415113416113417113418113419113420113421113422113423113424113425113426113427113428113429113430113431113432113433113434113435113436113437113438113439113440113441113442113443113444113445113446113447113448113449113450113451113452113453113454113455113456113457113458113459113460113461113462113463113464113465113466113467113468113469113470113471113472113473113474113475113476113477113478113479113480113481113482113483113484113485113486113487113488113489113490113491113492113493113494113495113496113497113498113499113500113501113502113503113504113505113506113507113508113509113510113511113512113513113514113515113516113517113518113519113520113521113522113523113524113525113526113527113528113529113530113531113532113533113534113535113536113537113538113539113540113541113542113543113544113545113546113547113548113549113550113551113552113553113554113555113556113557113558113559113560113561113562113563113564113565113566113567113568113569113570113571113572113573113574113575113576113577113578113579113580113581113582113583113584113585113586113587113588113589113590113591113592113593113594113595113596113597113598113599113600113601113602113603113604113605113606113607113608113609113610113611113612113613113614113615113616113617113618113619113620113621113622113623113624113625113626113627113628113629113630113631113632113633113634113635113636113637113638113639113640113641113642113643113644113645113646113647113648113649113650113651113652113653113654113655113656113657113658113659113660113661113662113663113664113665113666113667113668113669113670113671113672113673113674113675113676113677113678113679113680113681113682113683113684113685113686113687113688113689113690113691113692113693113694113695113696113697113698113699113700113701113702113703113704113705113706113707113708113709113710113711113712113713113714113715113716113717113718113719113720113721113722113723113724113725113726113727113728113729113730113731113732113733113734113735113736113737113738113739113740113741113742113743113744113745113746113747113748113749113750113751113752113753113754113755113756113757113758113759113760113761113762113763113764113765113766113767113768113769113770113771113772113773113774113775113776113777113778113779113780113781113782113783113784113785113786113787113788113789113790113791113792113793113794113795113796113797113798113799113800113801113802113803113804113805113806113807113808113809113810113811113812113813113814113815113816113817113818113819113820113821113822113823113824113825113826113827113828113829113830113831113832113833113834113835113836113837113838113839113840113841113842113843113844113845113846113847113848113849113850113851113852113853113854113855113856113857113858113859113860113861113862113863113864113865113866113867113868113869113870113871113872113873113874113875113876113877113878113879113880113881113882113883113884113885113886113887113888113889113890113891113892113893113894113895113896113897113898113899113900113901113902113903113904113905113906113907113908113909113910113911113912113913113914113915113916113917113918113919113920113921113922113923113924113925113926113927113928113929113930113931113932113933113934113935113936113937113938113939113940113941113942113943113944113945113946113947113948113949113950113951113952113953113954113955113956113957113958113959113960113961113962113963113964113965113966113967113968113969113970113971113972113973113974113975113976113977113978113979113980113981113982113983113984113985113986113987113988113989113990113991113992113993113994113995113996113997113998113999114000114001114002114003114004114005114006114007114008114009114010114011114012114013114014114015114016114017114018114019114020114021114022114023114024114025114026114027114028114029114030114031114032114033114034114035114036114037114038114039114040114041114042114043114044114045114046114047114048114049114050114051114052114053114054114055114056114057114058114059114060114061114062114063114064114065114066114067114068114069114070114071114072114073114074114075114076114077114078114079114080114081114082114083114084114085114086114087114088114089114090114091114092114093114094114095114096114097114098114099114100114101114102114103114104114105114106114107114108114109114110114111114112114113114114114115114116114117114118114119114120114121114122114123114124114125114126114127114128114129114130114131114132114133114134114135114136114137114138114139114140114141114142114143114144114145114146114147114148114149114150114151114152114153114154114155114156114157114158114159114160114161114162114163114164114165114166114167114168114169114170114171114172114173114174114175114176114177114178114179114180114181114182114183114184114185114186114187114188114189114190114191114192114193114194114195114196114197114198114199114200114201114202114203114204114205114206114207114208114209114210114211114212114213114214114215114216114217114218114219114220114221114222114223114224114225114226114227114228114229114230114231114232114233114234114235114236114237114238114239114240114241114242114243114244114245114246114247114248114249114250114251114252114253114254114255114256114257114258114259114260114261114262114263114264114265114266114267114268114269114270114271114272114273114274114275114276114277114278114279114280114281114282114283114284114285114286114287114288114289114290114291114292114293114294114295114296114297114298114299114300114301114302114303114304114305114306114307114308114309114310114311114312114313114314114315114316114317114318114319114320114321114322114323114324114325114326114327114328114329114330114331114332114333114334114335114336114337114338114339114340114341114342114343114344114345114346114347114348114349114350114351114352114353114354114355114356114357114358114359114360114361114362114363114364114365114366114367114368114369114370114371114372114373114374114375114376114377114378114379114380114381114382114383114384114385114386114387114388114389114390114391114392114393114394114395114396114397114398114399114400114401114402114403114404114405114406114407114408114409114410114411114412114413114414114415114416114417114418114419114420114421114422114423114424114425114426114427114428114429114430114431114432114433114434114435114436114437114438114439114440114441114442114443114444114445114446114447114448114449114450114451114452114453114454114455114456114457114458114459114460114461114462114463114464114465114466114467114468114469114470114471114472114473114474114475114476114477114478114479114480114481114482114483114484114485114486114487114488114489114490114491114492114493114494114495114496114497114498114499114500114501114502114503114504114505114506114507114508114509114510114511114512114513114514114515114516114517114518114519114520114521114522114523114524114525114526114527114528114529114530114531114532114533114534114535114536114537114538114539114540114541114542114543114544114545114546114547114548114549114550114551114552114553114554114555114556114557114558114559114560114561114562114563114564114565114566114567114568114569114570114571114572114573114574114575114576114577114578114579114580114581114582114583114584114585114586114587114588114589114590114591114592114593114594114595114596114597114598114599114600114601114602114603114604114605114606114607114608114609114610114611114612114613114614114615114616114617114618114619114620114621114622114623114624114625114626114627114628114629114630114631114632114633114634114635114636114637114638114639114640114641114642114643114644114645114646114647114648114649114650114651114652114653114654114655114656114657114658114659114660114661114662114663114664114665114666114667114668114669114670114671114672114673114674114675114676114677114678114679114680114681114682114683114684114685114686114687114688114689114690114691114692114693114694114695114696114697114698114699114700114701114702114703114704114705114706114707114708114709114710114711114712114713114714114715114716114717114718114719114720114721114722114723114724114725114726114727114728114729114730114731114732114733114734114735114736114737114738114739114740114741114742114743114744114745114746114747114748114749114750114751114752114753114754114755114756114757114758114759114760114761114762114763114764114765114766114767114768114769114770114771114772114773114774114775114776114777114778114779114780114781114782114783114784114785114786114787114788114789114790114791114792114793114794114795114796114797114798114799114800114801114802114803114804114805114806114807114808114809114810114811114812114813114814114815114816114817114818114819114820114821114822114823114824114825114826114827114828114829114830114831114832114833114834114835114836114837114838114839114840114841114842114843114844114845114846114847114848114849114850114851114852114853114854114855114856114857114858114859114860114861114862114863114864114865114866114867114868114869114870114871114872114873114874114875114876114877114878114879114880114881114882114883114884114885114886114887114888114889114890114891114892114893114894114895114896114897114898114899114900114901114902114903114904114905114906114907114908114909114910114911114912114913114914114915114916114917114918114919114920114921114922114923114924114925114926114927114928114929114930114931114932114933114934114935114936114937114938114939114940114941114942114943114944114945114946114947114948114949114950114951114952114953114954114955114956114957114958114959114960114961114962114963114964114965114966114967114968114969114970114971114972114973114974114975114976114977114978114979114980114981114982114983114984114985114986114987114988114989114990114991114992114993114994114995114996114997114998114999115000115001115002115003115004115005115006115007115008115009115010115011115012115013115014115015115016115017115018115019115020115021115022115023115024115025115026115027115028115029115030115031115032115033115034115035115036115037115038115039115040115041115042115043115044115045115046115047115048115049115050115051115052115053115054115055115056115057115058115059115060115061115062115063115064115065115066115067115068115069115070115071115072115073115074115075115076115077115078115079115080115081115082115083115084115085115086115087115088115089115090115091115092115093115094115095115096115097115098115099115100115101115102115103115104115105115106115107115108115109115110115111115112115113115114115115115116115117115118115119115120115121115122115123115124115125115126115127115128115129115130115131115132115133115134115135115136115137115138115139115140115141115142115143115144115145115146115147115148115149115150115151115152115153115154115155115156115157115158115159115160115161115162115163115164115165115166115167115168115169115170115171115172115173115174115175115176115177115178115179115180115181115182115183115184115185115186115187115188115189115190115191115192115193115194115195115196115197115198115199115200115201115202115203115204115205115206115207115208115209115210115211115212115213115214115215115216115217115218115219115220115221115222115223115224115225115226115227115228115229115230115231115232115233115234115235115236115237115238115239115240115241115242115243115244115245115246115247115248115249115250115251115252115253115254115255115256115257115258115259115260115261115262115263115264115265115266115267115268115269115270115271115272115273115274115275115276115277115278115279115280115281115282115283115284115285115286115287115288115289115290115291115292115293115294115295115296115297115298115299115300115301115302115303115304115305115306115307115308115309115310115311115312115313115314115315115316115317115318115319115320115321115322115323115324115325115326115327115328115329115330115331115332115333115334115335115336115337115338115339115340115341115342115343115344115345115346115347115348115349115350115351115352115353115354115355115356115357115358115359115360115361115362115363115364115365115366115367115368115369115370115371115372115373115374115375115376115377115378115379115380115381115382115383115384115385115386115387115388115389115390115391115392115393115394115395115396115397115398115399115400115401115402115403115404115405115406115407115408115409115410115411115412115413115414115415115416115417115418115419115420115421115422115423115424115425115426115427115428115429115430115431115432115433115434115435115436115437115438115439115440115441115442115443115444115445115446115447115448115449115450115451115452115453115454115455115456115457115458115459115460115461115462115463115464115465115466115467115468115469115470115471115472115473115474115475115476115477115478115479115480115481115482115483115484115485115486115487115488115489115490115491115492115493115494115495115496115497115498115499115500115501115502115503115504115505115506115507115508115509115510115511115512115513115514115515115516115517115518115519115520115521115522115523115524115525115526115527115528115529115530115531115532115533115534115535115536115537115538115539115540115541115542115543115544115545115546115547115548115549115550115551115552115553115554115555115556115557115558115559115560115561115562115563115564115565115566115567115568115569115570115571115572115573115574115575115576115577115578115579115580115581115582115583115584115585115586115587115588115589115590115591115592115593115594115595115596115597115598115599115600115601115602115603115604115605115606115607115608115609115610115611115612115613115614115615115616115617115618115619115620115621115622115623115624115625115626115627115628115629115630115631115632115633115634115635115636115637115638115639115640115641115642115643115644115645115646115647115648115649115650115651115652115653115654115655115656115657115658115659115660115661115662115663115664115665115666115667115668115669115670115671115672115673115674115675115676115677115678115679115680115681115682115683115684115685115686115687115688115689115690115691115692115693115694115695115696115697115698115699115700115701115702115703115704115705115706115707115708115709115710115711115712115713115714115715115716115717115718115719115720115721115722115723115724115725115726115727115728115729115730115731115732115733115734115735115736115737115738115739115740115741115742115743115744115745115746115747115748115749115750115751115752115753115754115755115756115757115758115759115760115761115762115763115764115765115766115767115768115769115770115771115772115773115774115775115776115777115778115779115780115781115782115783115784115785115786115787115788115789115790115791115792115793115794115795115796115797115798115799115800115801115802115803115804115805115806115807115808115809115810115811115812115813115814115815115816115817115818115819115820115821115822115823115824115825115826115827115828115829115830115831115832115833115834115835115836115837115838115839115840115841115842115843115844115845115846115847115848115849115850115851115852115853115854115855115856115857115858115859115860115861115862115863115864115865115866115867115868115869115870115871115872115873115874115875115876115877115878115879115880115881115882115883115884115885115886115887115888115889115890115891115892115893115894115895115896115897115898115899115900115901115902115903115904115905115906115907115908115909115910115911115912115913115914115915115916115917115918115919115920115921115922115923115924115925115926115927115928115929115930115931115932115933115934115935115936115937115938115939115940115941115942115943115944115945115946115947115948115949115950115951115952115953115954115955115956115957115958115959115960115961115962115963115964115965115966115967115968115969115970115971115972115973115974115975115976115977115978115979115980115981115982115983115984115985115986115987115988115989115990115991115992115993115994115995115996115997115998115999116000116001116002116003116004116005116006116007116008116009116010116011116012116013116014116015116016116017116018116019116020116021116022116023116024116025116026116027116028116029116030116031116032116033116034116035116036116037116038116039116040116041116042116043116044116045116046116047116048116049116050116051116052116053116054116055116056116057116058116059116060116061116062116063116064116065116066116067116068116069116070116071116072116073116074116075116076116077116078116079116080116081116082116083116084116085116086116087116088116089116090116091116092116093116094116095116096116097116098116099116100116101116102116103116104116105116106116107116108116109116110116111116112116113116114116115116116116117116118116119116120116121116122116123116124116125116126116127116128116129116130116131116132116133116134116135116136116137116138116139116140116141116142116143116144116145116146116147116148116149116150116151116152116153116154116155116156116157116158116159116160116161116162116163116164116165116166116167116168116169116170116171116172116173116174116175116176116177116178116179116180116181116182116183116184116185116186116187116188116189116190116191116192116193116194116195116196116197116198116199116200116201116202116203116204116205116206116207116208116209116210116211116212116213116214116215116216116217116218116219116220116221116222116223116224116225116226116227116228116229116230116231116232116233116234116235116236116237116238116239116240116241116242116243116244116245116246116247116248116249116250116251116252116253116254116255116256116257116258116259116260116261116262116263116264116265116266116267116268116269116270116271116272116273116274116275116276116277116278116279116280116281116282116283116284116285116286116287116288116289116290116291116292116293116294116295116296116297116298116299116300116301116302116303116304116305116306116307116308116309116310116311116312116313116314116315116316116317116318116319116320116321116322116323116324116325116326116327116328116329116330116331116332116333116334116335116336116337116338116339116340116341116342116343116344116345116346116347116348116349116350116351116352116353116354116355116356116357116358116359116360116361116362116363116364116365116366116367116368116369116370116371116372116373116374116375116376116377116378116379116380116381116382116383116384116385116386116387116388116389116390116391116392116393116394116395116396116397116398116399116400116401116402116403116404116405116406116407116408116409116410116411116412116413116414116415116416116417116418116419116420116421116422116423116424116425116426116427116428116429116430116431116432116433116434116435116436116437116438116439116440116441116442116443116444116445116446116447116448116449116450116451116452116453116454116455116456116457116458116459116460116461116462116463116464116465116466116467116468116469116470116471116472116473116474116475116476116477116478116479116480116481116482116483116484116485116486116487116488116489116490116491116492116493116494116495116496116497116498116499116500116501116502116503116504116505116506116507116508116509116510116511116512116513116514116515116516116517116518116519116520116521116522116523116524116525116526116527116528116529116530116531116532116533116534116535116536116537116538116539116540116541116542116543116544116545116546116547116548116549116550116551116552116553116554116555116556116557116558116559116560116561116562116563116564116565116566116567116568116569116570116571116572116573116574116575116576116577116578116579116580116581116582116583116584116585116586116587116588116589116590116591116592116593116594116595116596116597116598116599116600116601116602116603116604116605116606116607116608116609116610116611116612116613116614116615116616116617116618116619116620116621116622116623116624116625116626116627116628116629116630116631116632116633116634116635116636116637116638116639116640116641116642116643116644116645116646116647116648116649116650116651116652116653116654116655116656116657116658116659116660116661116662116663116664116665116666116667116668116669116670116671116672116673116674116675116676116677116678116679116680116681116682116683116684116685116686116687116688116689116690116691116692116693116694116695116696116697116698116699116700116701116702116703116704116705116706116707116708116709116710116711116712116713116714116715116716116717116718116719116720116721116722116723116724116725116726116727116728116729116730116731116732116733116734116735116736116737116738116739116740116741116742116743116744116745116746116747116748116749116750116751116752116753116754116755116756116757116758116759116760116761116762116763116764116765116766116767116768116769116770116771116772116773116774116775116776116777116778116779116780116781116782116783116784116785116786116787116788116789116790116791116792116793116794116795116796116797116798116799116800116801116802116803116804116805116806116807116808116809116810116811116812116813116814116815116816116817116818116819116820116821116822116823116824116825116826116827116828116829116830116831116832116833116834116835116836116837116838116839116840116841116842116843116844116845116846116847116848116849116850116851116852116853116854116855116856116857116858116859116860116861116862116863116864116865116866116867116868116869116870116871116872116873116874116875116876116877116878116879116880116881116882116883116884116885116886116887116888116889116890116891116892116893116894116895116896116897116898116899116900116901116902116903116904116905116906116907116908116909116910116911116912116913116914116915116916116917116918116919116920116921116922116923116924116925116926116927116928116929116930116931116932116933116934116935116936116937116938116939116940116941116942116943116944116945116946116947116948116949116950116951116952116953116954116955116956116957116958116959116960116961116962116963116964116965116966116967116968116969116970116971116972116973116974116975116976116977116978116979116980116981116982116983116984116985116986116987116988116989116990116991116992116993116994116995116996116997116998116999117000117001117002117003117004117005117006117007117008117009117010117011117012117013117014117015117016117017117018117019117020117021117022117023117024117025117026117027117028117029117030117031117032117033117034117035117036117037117038117039117040117041117042117043117044117045117046117047117048117049117050117051117052117053117054117055117056117057117058117059117060117061117062117063117064117065117066117067117068117069117070117071117072117073117074117075117076117077117078117079117080117081117082117083117084117085117086117087117088117089117090117091117092117093117094117095117096117097117098117099117100117101117102117103117104117105117106117107117108117109117110117111117112117113117114117115117116117117117118117119117120117121117122117123117124117125117126117127117128117129117130117131117132117133117134117135117136117137117138117139117140117141117142117143117144117145117146117147117148117149117150117151117152117153117154117155117156117157117158117159117160117161117162117163117164117165117166117167117168117169117170117171117172117173117174117175117176117177117178117179117180117181117182117183117184117185117186117187117188117189117190117191117192117193117194117195117196117197117198117199117200117201117202117203117204117205117206117207117208117209117210117211117212117213117214117215117216117217117218117219117220117221117222117223117224117225117226117227117228117229117230117231117232117233117234117235117236117237117238117239117240117241117242117243117244117245117246117247117248117249117250117251117252117253117254117255117256117257117258117259117260117261117262117263117264117265117266117267117268117269117270117271117272117273117274117275117276117277117278117279117280117281117282117283117284117285117286117287117288117289117290117291117292117293117294117295117296117297117298117299117300117301117302117303117304117305117306117307117308117309117310117311117312117313117314117315117316117317117318117319117320117321117322117323117324117325117326117327117328117329117330117331117332117333117334117335117336117337117338117339117340117341117342117343117344117345117346117347117348117349117350117351117352117353117354117355117356117357117358117359117360117361117362117363117364117365117366117367117368117369117370117371117372117373117374117375117376117377117378117379117380117381117382117383117384117385117386117387117388117389117390117391117392117393117394117395117396117397117398117399117400117401117402117403117404117405117406117407117408117409117410117411117412117413117414117415117416117417117418117419117420117421117422117423117424117425117426117427117428117429117430117431117432117433117434117435117436117437117438117439117440117441117442117443117444117445117446117447117448117449117450117451117452117453117454117455117456117457117458117459117460117461117462117463117464117465117466117467117468117469117470117471117472117473117474117475117476117477117478117479117480117481117482117483117484117485117486117487117488117489117490117491117492117493117494117495117496117497117498117499117500117501117502117503117504117505117506117507117508117509117510117511117512117513117514117515117516117517117518117519117520117521117522117523117524117525117526117527117528117529117530117531117532117533117534117535117536117537117538117539117540117541117542117543117544117545117546117547117548117549117550117551117552117553117554117555117556117557117558117559117560117561117562117563117564117565117566117567117568117569117570117571117572117573117574117575117576117577117578117579117580117581117582117583117584117585117586117587117588117589117590117591117592117593117594117595117596117597117598117599117600117601117602117603117604117605117606117607117608117609117610117611117612117613117614117615117616117617117618117619117620117621117622117623117624117625117626117627117628117629117630117631117632117633117634117635117636117637117638117639117640117641117642117643117644117645117646117647117648117649117650117651117652117653117654117655117656117657117658117659117660117661117662117663117664117665117666117667117668117669117670117671117672117673117674117675117676117677117678117679117680117681117682117683117684117685117686117687117688117689117690117691117692117693117694117695117696117697117698117699117700117701117702117703117704117705117706117707117708117709117710117711117712117713117714117715117716117717117718117719117720117721117722117723117724117725117726117727117728117729117730117731117732117733117734117735117736117737117738117739117740117741117742117743117744117745117746117747117748117749117750117751117752117753117754117755117756117757117758117759117760117761117762117763117764117765117766117767117768117769117770117771117772117773117774117775117776117777117778117779117780117781117782117783117784117785117786117787117788117789117790117791117792117793117794117795117796117797117798117799117800117801117802117803117804117805117806117807117808117809117810117811117812117813117814117815117816117817117818117819117820117821117822117823117824117825117826117827117828117829117830117831117832117833117834117835117836117837117838117839117840117841117842117843117844117845117846117847117848117849117850117851117852117853117854117855117856117857117858117859117860117861117862117863117864117865117866117867117868117869117870117871117872117873117874117875117876117877117878117879117880117881117882117883117884117885117886117887117888117889117890117891117892117893117894117895117896117897117898117899117900117901117902117903117904117905117906117907117908117909117910117911117912117913117914117915117916117917117918117919117920117921117922117923117924117925117926117927117928117929117930117931117932117933117934117935117936117937117938117939117940117941117942117943117944117945117946117947117948117949117950117951117952117953117954117955117956117957117958117959117960117961117962117963117964117965117966117967117968117969117970117971117972117973117974117975117976117977117978117979117980117981117982117983117984117985117986117987117988117989117990117991117992117993117994117995117996117997117998117999118000118001118002118003118004118005118006118007118008118009118010118011118012118013118014118015118016118017118018118019118020118021118022118023118024118025118026118027118028118029118030118031118032118033118034118035118036118037118038118039118040118041118042118043118044118045118046118047118048118049118050118051118052118053118054118055118056118057118058118059118060118061118062118063118064118065118066118067118068118069118070118071118072118073118074118075118076118077118078118079118080118081118082118083118084118085118086118087118088118089118090118091118092118093118094118095118096118097118098118099118100118101118102118103118104118105118106118107118108118109118110118111118112118113118114118115118116118117118118118119118120118121118122118123118124118125118126118127118128118129118130118131118132118133118134118135118136118137118138118139118140118141118142118143118144118145118146118147118148118149118150118151118152118153118154118155118156118157118158118159118160118161118162118163118164118165118166118167118168118169118170118171118172118173118174118175118176118177118178118179118180118181118182118183118184118185118186118187118188118189118190118191118192118193118194118195118196118197118198118199118200118201118202118203118204118205118206118207118208118209118210118211118212118213118214118215118216118217118218118219118220118221118222118223118224118225118226118227118228118229118230118231118232118233118234118235118236118237118238118239118240118241118242118243118244118245118246118247118248118249118250118251118252118253118254118255118256118257118258118259118260118261118262118263118264118265118266118267118268118269118270118271118272118273118274118275118276118277118278118279118280118281118282118283118284118285118286118287118288118289118290118291118292118293118294118295118296118297118298118299118300118301118302118303118304118305118306118307118308118309118310118311118312118313118314118315118316118317118318118319118320118321118322118323118324118325118326118327118328118329118330118331118332118333118334118335118336118337118338118339118340118341118342118343118344118345118346118347118348118349118350118351118352118353118354118355118356118357118358118359118360118361118362118363118364118365118366118367118368118369118370118371118372118373118374118375118376118377118378118379118380118381118382118383118384118385118386118387118388118389118390118391118392118393118394118395118396118397118398118399118400118401118402118403118404118405118406118407118408118409118410118411118412118413118414118415118416118417118418118419118420118421118422118423118424118425118426118427118428118429118430118431118432118433118434118435118436118437118438118439118440118441118442118443118444118445118446118447118448118449118450118451118452118453118454118455118456118457118458118459118460118461118462118463118464118465118466118467118468118469118470118471118472118473118474118475118476118477118478118479118480118481118482118483118484118485118486118487118488118489118490118491118492118493118494118495118496118497118498118499118500118501118502118503118504118505118506118507118508118509118510118511118512118513118514118515118516118517118518118519118520118521118522118523118524118525118526118527118528118529118530118531118532118533118534118535118536118537118538118539118540118541118542118543118544118545118546118547118548118549118550118551118552118553118554118555118556118557118558118559118560118561118562118563118564118565118566118567118568118569118570118571118572118573118574118575118576118577118578118579118580118581118582118583118584118585118586118587118588118589118590118591118592118593118594118595118596118597118598118599118600118601118602118603118604118605118606118607118608118609118610118611118612118613118614118615118616118617118618118619118620118621118622118623118624118625118626118627118628118629118630118631118632118633118634118635118636118637118638118639118640118641118642118643118644118645118646118647118648118649118650118651118652118653118654118655118656118657118658118659118660118661118662118663118664118665118666118667118668118669118670118671118672118673118674118675118676118677118678118679118680118681118682118683118684118685118686118687118688118689118690118691118692118693118694118695118696118697118698118699118700118701118702118703118704118705118706118707118708118709118710118711118712118713118714118715118716118717118718118719118720118721118722118723118724118725118726118727118728118729118730118731118732118733118734118735118736118737118738118739118740118741118742118743118744118745118746118747118748118749118750118751118752118753118754118755118756118757118758118759118760118761118762118763118764118765118766118767118768118769118770118771118772118773118774118775118776118777118778118779118780118781118782118783118784118785118786118787118788118789118790118791118792118793118794118795118796118797118798118799118800118801118802118803118804118805118806118807118808118809118810118811118812118813118814118815118816118817118818118819118820118821118822118823118824118825118826118827118828118829118830118831118832118833118834118835118836118837118838118839118840118841118842118843118844118845118846118847118848118849118850118851118852118853118854118855118856118857118858118859118860118861118862118863118864118865118866118867118868118869118870118871118872118873118874118875118876118877118878118879118880118881118882118883118884118885118886118887118888118889118890118891118892118893118894118895118896118897118898118899118900118901118902118903118904118905118906118907118908118909118910118911118912118913118914118915118916118917118918118919118920118921118922118923118924118925118926118927118928118929118930118931118932118933118934118935118936118937118938118939118940118941118942118943118944118945118946118947118948118949118950118951118952118953118954118955118956118957118958118959118960118961118962118963118964118965118966118967118968118969118970118971118972118973118974118975118976118977118978118979118980118981118982118983118984118985118986118987118988118989118990118991118992118993118994118995118996118997118998118999119000119001119002119003119004119005119006119007119008119009119010119011119012119013119014119015119016119017119018119019119020119021119022119023119024119025119026119027119028119029119030119031119032119033119034119035119036119037119038119039119040119041119042119043119044119045119046119047119048119049119050119051119052119053119054119055119056119057119058119059119060119061119062119063119064119065119066119067119068119069119070119071119072119073119074119075119076119077119078119079119080119081119082119083119084119085119086119087119088119089119090119091119092119093119094119095119096119097119098119099119100119101119102119103119104119105119106119107119108119109119110119111119112119113119114119115119116119117119118119119119120119121119122119123119124119125119126119127119128119129119130119131119132119133119134119135119136119137119138119139119140119141119142119143119144119145119146119147119148119149119150119151119152119153119154119155119156119157119158119159119160119161119162119163119164119165119166119167119168119169119170119171119172119173119174119175119176119177119178119179119180119181119182119183119184119185119186119187119188119189119190119191119192119193119194119195119196119197119198119199119200119201119202119203119204119205119206119207119208119209119210119211119212119213119214119215119216119217119218119219119220119221119222119223119224119225119226119227119228119229119230119231119232119233119234119235119236119237119238119239119240119241119242119243119244119245119246119247119248119249119250119251119252119253119254119255119256119257119258119259119260119261119262119263119264119265119266119267119268119269119270119271119272119273119274119275119276119277119278119279119280119281119282119283119284119285119286119287119288119289119290119291119292119293119294119295119296119297119298119299119300119301119302119303119304119305119306119307119308119309119310119311119312119313119314119315119316119317119318119319119320119321119322119323119324119325119326119327119328119329119330119331119332119333119334119335119336119337119338119339119340119341119342119343119344119345119346119347119348119349119350119351119352119353119354119355119356119357119358119359119360119361119362119363119364119365119366119367119368119369119370119371119372119373119374119375119376119377119378119379119380119381119382119383119384119385119386119387119388119389119390119391119392119393119394119395119396119397119398119399119400119401119402119403119404119405119406119407119408119409119410119411119412119413119414119415119416119417119418119419119420119421119422119423119424119425119426119427119428119429119430119431119432119433119434119435119436119437119438119439119440119441119442119443119444119445119446119447119448119449119450119451119452119453119454119455119456119457119458119459119460119461119462119463119464119465119466119467119468119469119470119471119472119473119474119475119476119477119478119479119480119481119482119483119484119485119486119487119488119489119490119491119492119493119494119495119496119497119498119499119500119501119502119503119504119505119506119507119508119509119510119511119512119513119514119515119516119517119518119519119520119521119522119523119524119525119526119527119528119529119530119531119532119533119534119535119536119537119538119539119540119541119542119543119544119545119546119547119548119549119550119551119552119553119554119555119556119557119558119559119560119561119562119563119564119565119566119567119568119569119570119571119572119573119574119575119576119577119578119579119580119581119582119583119584119585119586119587119588119589119590119591119592119593119594119595119596119597119598119599119600119601119602119603119604119605119606119607119608119609119610119611119612119613119614119615119616119617119618119619119620119621119622119623119624119625119626119627119628119629119630119631119632119633119634119635119636119637119638119639119640119641119642119643119644119645119646119647119648119649119650119651119652119653119654119655119656119657119658119659119660119661119662119663119664119665119666119667119668119669119670119671119672119673119674119675119676119677119678119679119680119681119682119683119684119685119686119687119688119689119690119691119692119693119694119695119696119697119698119699119700119701119702119703119704119705119706119707119708119709119710119711119712119713119714119715119716119717119718119719119720119721119722119723119724119725119726119727119728119729119730119731119732119733119734119735119736119737119738119739119740119741119742119743119744119745119746119747119748119749119750119751119752119753119754119755119756119757119758119759119760119761119762119763119764119765119766119767119768119769119770119771119772119773119774119775119776119777119778119779119780119781119782119783119784119785119786119787119788119789119790119791119792119793119794119795119796119797119798119799119800119801119802119803119804119805119806119807119808119809119810119811119812119813119814119815119816119817119818119819119820119821119822119823119824119825119826119827119828119829119830119831119832119833119834119835119836119837119838119839119840119841119842119843119844119845119846119847119848119849119850119851119852119853119854119855119856119857119858119859119860119861119862119863119864119865119866119867119868119869119870119871119872119873119874119875119876119877119878119879119880119881119882119883119884119885119886119887119888119889119890119891119892119893119894119895119896119897119898119899119900119901119902119903119904119905119906119907119908119909119910119911119912119913119914119915119916119917119918119919119920119921119922119923119924119925119926119927119928119929119930119931119932119933119934119935119936119937119938119939119940119941119942119943119944119945119946119947119948119949119950119951119952119953119954119955119956119957119958119959119960119961119962119963119964119965119966119967119968119969119970119971119972119973119974119975119976119977119978119979119980119981119982119983119984119985119986119987119988119989119990119991119992119993119994119995119996119997119998119999120000120001120002120003120004120005120006120007120008120009120010120011120012120013120014120015120016120017120018120019120020120021120022120023120024120025120026120027120028120029120030120031120032120033120034120035120036120037120038120039120040120041120042120043120044120045120046120047120048120049120050120051120052120053120054120055120056120057120058120059120060120061120062120063120064120065120066120067120068120069120070120071120072120073120074120075120076120077120078120079120080120081120082120083120084120085120086120087120088120089120090120091120092120093120094120095120096120097120098120099120100120101120102120103120104120105120106120107120108120109120110120111120112120113120114120115120116120117120118120119120120120121120122120123120124120125120126120127120128120129120130120131120132120133120134120135120136120137120138120139120140120141120142120143120144120145120146120147120148120149120150120151120152120153120154120155120156120157120158120159120160120161120162120163120164120165120166120167120168120169120170120171120172120173120174120175120176120177120178120179120180120181120182120183120184120185120186120187120188120189120190120191120192120193120194120195120196120197120198120199120200120201120202120203120204120205120206120207120208120209120210120211120212120213120214120215120216120217120218120219120220120221120222120223120224120225120226120227120228120229120230120231120232120233120234120235120236120237120238120239120240120241120242120243120244120245120246120247120248120249120250120251120252120253120254120255120256120257120258120259120260120261120262120263120264120265120266120267120268120269120270120271120272120273120274120275120276120277120278120279120280120281120282120283120284120285120286120287120288120289120290120291120292120293120294120295120296120297120298120299120300120301120302120303120304120305120306120307120308120309120310120311120312120313120314120315120316120317120318120319120320120321120322120323120324120325120326120327120328120329120330120331120332120333120334120335120336120337120338120339120340120341120342120343120344120345120346120347120348120349120350120351120352120353120354120355120356120357120358120359120360120361120362120363120364120365120366120367120368120369120370120371120372120373120374120375120376120377120378120379120380120381120382120383120384120385120386120387120388120389120390120391120392120393120394120395120396120397120398120399120400120401120402120403120404120405120406120407120408120409120410120411120412120413120414120415120416120417120418120419120420120421120422120423120424120425120426120427120428120429120430120431120432120433120434120435120436120437120438120439120440120441120442120443120444120445120446120447120448120449120450120451120452120453120454120455120456120457120458120459120460120461120462120463120464120465120466120467120468120469120470120471120472120473120474120475120476120477120478120479120480120481120482120483120484120485120486120487120488120489120490120491120492120493120494120495120496120497120498120499120500120501120502120503120504120505120506120507120508120509120510120511120512120513120514120515120516120517120518120519120520120521120522120523120524120525120526120527120528120529120530120531120532120533120534120535120536120537120538120539120540120541120542120543120544120545120546120547120548120549120550120551120552120553120554120555120556120557120558120559120560120561120562120563120564120565120566120567120568120569120570120571120572120573120574120575120576120577120578120579120580120581120582120583120584120585120586120587120588120589120590120591120592120593120594120595120596120597120598120599120600120601120602120603120604120605120606120607120608120609120610120611120612120613120614120615120616120617120618120619120620120621120622120623120624120625120626120627120628120629120630120631120632120633120634120635120636120637120638120639120640120641120642120643120644120645120646120647120648120649120650120651120652120653120654120655120656120657120658120659120660120661120662120663120664120665120666120667120668120669120670120671120672120673120674120675120676120677120678120679120680120681120682120683120684120685120686120687120688120689120690120691120692120693120694120695120696120697120698120699120700120701120702120703120704120705120706120707120708120709120710120711120712120713120714120715120716120717120718120719120720120721120722120723120724120725120726120727120728120729120730120731120732120733120734120735120736120737120738120739120740120741120742120743120744120745120746120747120748120749120750120751120752120753120754120755120756120757120758120759120760120761120762120763120764120765120766120767120768120769120770120771120772120773120774120775120776120777120778120779120780120781120782120783120784120785120786120787120788120789120790120791120792120793120794120795120796120797120798120799120800120801120802120803120804120805120806120807120808120809120810120811120812120813120814120815120816120817120818120819120820120821120822120823120824120825120826120827120828120829120830120831120832120833120834120835120836120837120838120839120840120841120842120843120844120845120846120847120848120849120850120851120852120853120854120855120856120857120858120859120860120861120862120863120864120865120866120867120868120869120870120871120872120873120874120875120876120877120878120879120880120881120882120883120884120885120886120887120888120889120890120891120892120893120894120895120896120897120898120899120900120901120902120903120904120905120906120907120908120909120910120911120912120913120914120915120916120917120918120919120920120921120922120923120924120925120926120927120928120929120930120931120932120933120934120935120936120937120938120939120940120941120942120943120944120945120946120947120948120949120950120951120952120953120954120955120956120957120958120959120960120961120962120963120964120965120966120967120968120969120970120971120972120973120974120975120976120977120978120979120980120981120982120983120984120985120986120987120988120989120990120991120992120993120994120995120996120997120998120999121000121001121002121003121004121005121006121007121008121009121010121011121012121013121014121015121016121017121018121019121020121021121022121023121024121025121026121027121028121029121030121031121032121033121034121035121036121037121038121039121040121041121042121043121044121045121046121047121048121049121050121051121052121053121054121055121056121057121058121059121060121061121062121063121064121065121066121067121068121069121070121071121072121073121074121075121076121077121078121079121080121081121082121083121084121085121086121087121088121089121090121091121092121093121094121095121096121097121098121099121100121101121102121103121104121105121106121107121108121109121110121111121112121113121114121115121116121117121118121119121120121121121122121123121124121125121126121127121128121129121130121131121132121133121134121135121136121137121138121139121140121141121142121143121144121145121146121147121148121149121150121151121152121153121154121155121156121157121158121159121160121161121162121163121164121165121166121167121168121169121170121171121172121173121174121175121176121177121178121179121180121181121182121183121184121185121186121187121188121189121190121191121192121193121194121195121196121197121198121199121200121201121202121203121204121205121206121207121208121209121210121211121212121213121214121215121216121217121218121219121220121221121222121223121224121225121226121227121228121229121230121231121232121233121234121235121236121237121238121239121240121241121242121243121244121245121246121247121248121249121250121251121252121253121254121255121256121257121258121259121260121261121262121263121264121265121266121267121268121269121270121271121272121273121274121275121276121277121278121279121280121281121282121283121284121285121286121287121288121289121290121291121292121293121294121295121296121297121298121299121300121301121302121303121304121305121306121307121308121309121310121311121312121313121314121315121316121317121318121319121320121321121322121323121324121325121326121327121328121329121330121331121332121333121334121335121336121337121338121339121340121341121342121343121344121345121346121347121348121349121350121351121352121353121354121355121356121357121358121359121360121361121362121363121364121365121366121367121368121369121370121371121372121373121374121375121376121377121378121379121380121381121382121383121384121385121386121387121388121389121390121391121392121393121394121395121396121397121398121399121400121401121402121403121404121405121406121407121408121409121410121411121412121413121414121415121416121417121418121419121420121421121422121423121424121425121426121427121428121429121430121431121432121433121434121435121436121437121438121439121440121441121442121443121444121445121446121447121448121449121450121451121452121453121454121455121456121457121458121459121460121461121462121463121464121465121466121467121468121469121470121471121472121473121474121475121476121477121478121479121480121481121482121483121484121485121486121487121488121489121490121491121492121493121494121495121496121497121498121499121500121501121502121503121504121505121506121507121508121509121510121511121512121513121514121515121516121517121518121519121520121521121522121523121524121525121526121527121528121529121530121531121532121533121534121535121536121537121538121539121540121541121542121543121544121545121546121547121548121549121550121551121552121553121554121555121556121557121558121559121560121561121562121563121564121565121566121567121568121569121570121571121572121573121574121575121576121577121578121579121580121581121582121583121584121585121586121587121588121589121590121591121592121593121594121595121596121597121598121599121600121601121602121603121604121605121606121607121608121609121610121611121612121613121614121615121616121617121618121619121620121621121622121623121624121625121626121627121628121629121630121631121632121633121634121635121636121637121638121639121640121641121642121643121644121645121646121647121648121649121650121651121652121653121654121655121656121657121658121659121660121661121662121663121664121665121666121667121668121669121670121671121672121673121674121675121676121677121678121679121680121681121682121683121684121685121686121687121688121689121690121691121692121693121694121695121696121697121698121699121700121701121702121703121704121705121706121707121708121709121710121711121712121713121714121715121716121717121718121719121720121721121722121723121724121725121726121727121728121729121730121731121732121733121734121735121736121737121738121739121740121741121742121743121744121745121746121747121748121749121750121751121752121753121754121755121756121757121758121759121760121761121762121763121764121765121766121767121768121769121770121771121772121773121774121775121776121777121778121779121780121781121782121783121784121785121786121787121788121789121790121791121792121793121794121795121796121797121798121799121800121801121802121803121804121805121806121807121808121809121810121811121812121813121814121815121816121817121818121819121820121821121822121823121824121825121826121827121828121829121830121831121832121833121834121835121836121837121838121839121840121841121842121843121844121845121846121847121848121849121850121851121852121853121854121855121856121857121858121859121860121861121862121863121864121865121866121867121868121869121870121871121872121873121874121875121876121877121878121879121880121881121882121883121884121885121886121887121888121889121890121891121892121893121894121895121896121897121898121899121900121901121902121903121904121905121906121907121908121909121910121911121912121913121914121915121916121917121918121919121920121921121922121923121924121925121926121927121928121929121930121931121932121933121934121935121936121937121938121939121940121941121942121943121944121945121946121947121948121949121950121951121952121953121954121955121956121957121958121959121960121961121962121963121964121965121966121967121968121969121970121971121972121973121974121975121976121977121978121979121980121981121982121983121984121985121986121987121988121989121990121991121992121993121994121995121996121997121998121999122000122001122002122003122004122005122006122007122008122009122010122011122012122013122014122015122016122017122018122019122020122021122022122023122024122025122026122027122028122029122030122031122032122033122034122035122036122037122038122039122040122041122042122043122044122045122046122047122048122049122050122051122052122053122054122055122056122057122058122059122060122061122062122063122064122065122066122067122068122069122070122071122072122073122074122075122076122077122078122079122080122081122082122083122084122085122086122087122088122089122090122091122092122093122094122095122096122097122098122099122100122101122102122103122104122105122106122107122108122109122110122111122112122113122114122115122116122117122118122119122120122121122122122123122124122125122126122127122128122129122130122131122132122133122134122135122136122137122138122139122140122141122142122143122144122145122146122147122148122149122150122151122152122153122154122155122156122157122158122159122160122161122162122163122164122165122166122167122168122169122170122171122172122173122174122175122176122177122178122179122180122181122182122183122184122185122186122187122188122189122190122191122192122193122194122195122196122197122198122199122200122201122202122203122204122205122206122207122208122209122210122211122212122213122214122215122216122217122218122219122220122221122222122223122224122225122226122227122228122229122230122231122232122233122234122235122236122237122238122239122240122241122242122243122244122245122246122247122248122249122250122251122252122253122254122255122256122257122258122259122260122261122262122263122264122265122266122267122268122269122270122271122272122273122274122275122276122277122278122279122280122281122282122283122284122285122286122287122288122289122290122291122292122293122294122295122296122297122298122299122300122301122302122303122304122305122306122307122308122309122310122311122312122313122314122315122316122317122318122319122320122321122322122323122324122325122326122327122328122329122330122331122332122333122334122335122336122337122338122339122340122341122342122343122344122345122346122347122348122349122350122351122352122353122354122355122356122357122358122359122360122361122362122363122364122365122366122367122368122369122370122371122372122373122374122375122376122377122378122379122380122381122382122383122384122385122386122387122388122389122390122391122392122393122394122395122396122397122398122399122400122401122402122403122404122405122406122407122408122409122410122411122412122413122414122415122416122417122418122419122420122421122422122423122424122425122426122427122428122429122430122431122432122433122434122435122436122437122438122439122440122441122442122443122444122445122446122447122448122449122450122451122452122453122454122455122456122457122458122459122460122461122462122463122464122465122466122467122468122469122470122471122472122473122474122475122476122477122478122479122480122481122482122483122484122485122486122487122488122489122490122491122492122493122494122495122496122497122498122499122500122501122502122503122504122505122506122507122508122509122510122511122512122513122514122515122516122517122518122519122520122521122522122523122524122525122526122527122528122529122530122531122532122533122534122535122536122537122538122539122540122541122542122543122544122545122546122547122548122549122550122551122552122553122554122555122556122557122558122559122560122561122562122563122564122565122566122567122568122569122570122571122572122573122574122575122576122577122578122579122580122581122582122583122584122585122586122587122588122589122590122591122592122593122594122595122596122597122598122599122600122601122602122603122604122605122606122607122608122609122610122611122612122613122614122615122616122617122618122619122620122621122622122623122624122625122626122627122628122629122630122631122632122633122634122635122636122637122638122639122640122641122642122643122644122645122646122647122648122649122650122651122652122653122654122655122656122657122658122659122660122661122662122663122664122665122666122667122668122669122670122671122672122673122674122675122676122677122678122679122680122681122682122683122684122685122686122687122688122689122690122691122692122693122694122695122696122697122698122699122700122701122702122703122704122705122706122707122708122709122710122711122712122713122714122715122716122717122718122719122720122721122722122723122724122725122726122727122728122729122730122731122732122733122734122735122736122737122738122739122740122741122742122743122744122745122746122747122748122749122750122751122752122753122754122755122756122757122758122759122760122761122762122763122764122765122766122767122768122769122770122771122772122773122774122775122776122777122778122779122780122781122782122783122784122785122786122787122788122789122790122791122792122793122794122795122796122797122798122799122800122801122802122803122804122805122806122807122808122809122810122811122812122813122814122815122816122817122818122819122820122821122822122823122824122825122826122827122828122829122830122831122832122833122834122835122836122837122838122839122840122841122842122843122844122845122846122847122848122849122850122851122852122853122854122855122856122857122858122859122860122861122862122863122864122865122866122867122868122869122870122871122872122873122874122875122876122877122878122879122880122881122882122883122884122885122886122887122888122889122890122891122892122893122894122895122896122897122898122899122900122901122902122903122904122905122906122907122908122909122910122911122912122913122914122915122916122917122918122919122920122921122922122923122924122925122926122927122928122929122930122931122932122933122934122935122936122937122938122939122940122941122942122943122944122945122946122947122948122949122950122951122952122953122954122955122956122957122958122959122960122961122962122963122964122965122966122967122968122969122970122971122972122973122974122975122976122977122978122979122980122981122982122983122984122985122986122987122988122989122990122991122992122993122994122995122996122997122998122999123000123001123002123003123004123005123006123007123008123009123010123011123012123013123014123015123016123017123018123019123020123021123022123023123024123025123026123027123028123029123030123031123032123033123034123035123036123037123038123039123040123041123042123043123044123045123046123047123048123049123050123051123052123053123054123055123056123057123058123059123060123061123062123063123064123065123066123067123068123069123070123071123072123073123074123075123076123077123078123079123080123081123082123083123084123085123086123087123088123089123090123091123092123093123094123095123096123097123098123099123100123101123102123103123104123105123106123107123108123109123110123111123112123113123114123115123116123117123118123119123120123121123122123123123124123125123126123127123128123129123130123131123132123133123134123135123136123137123138123139123140123141123142123143123144123145123146123147123148123149123150123151123152123153123154123155123156123157123158123159123160123161123162123163123164123165123166123167123168123169123170123171123172123173123174123175123176123177123178123179123180123181123182123183123184123185123186123187123188123189123190123191123192123193123194123195123196123197123198123199123200123201123202123203123204123205123206123207123208123209123210123211123212123213123214123215123216123217123218123219123220123221123222123223123224123225123226123227123228123229123230123231123232123233123234123235123236123237123238123239123240123241123242123243123244123245123246123247123248123249123250123251123252123253123254123255123256123257123258123259123260123261123262123263123264123265123266123267123268123269123270123271123272123273123274123275123276123277123278123279123280123281123282123283123284123285123286123287123288123289123290123291123292123293123294123295123296123297123298123299123300123301123302123303123304123305123306123307123308123309123310123311123312123313123314123315123316123317123318123319123320123321123322123323123324123325123326123327123328123329123330123331123332123333123334123335123336123337123338123339123340123341123342123343123344123345123346123347123348123349123350123351123352123353123354123355123356123357123358123359123360123361123362123363123364123365123366123367123368123369123370123371123372123373123374123375123376123377123378123379123380123381123382123383123384123385123386123387123388123389123390123391123392123393123394123395123396123397123398123399123400123401123402123403123404123405123406123407123408123409123410123411123412123413123414123415123416123417123418123419123420123421123422123423123424123425123426123427123428123429123430123431123432123433123434123435123436123437123438123439123440123441123442123443123444123445123446123447123448123449123450123451123452123453123454123455123456123457123458123459123460123461123462123463123464123465123466123467123468123469123470123471123472123473123474123475123476123477123478123479123480123481123482123483123484123485123486123487123488123489123490123491123492123493123494123495123496123497123498123499123500123501123502123503123504123505123506123507123508123509123510123511123512123513123514123515123516123517123518123519123520123521123522123523123524123525123526123527123528123529123530123531123532123533123534123535123536123537123538123539123540123541123542123543123544123545123546123547123548123549123550123551123552123553123554123555123556123557123558123559123560123561123562123563123564123565123566123567123568123569123570123571123572123573123574123575123576123577123578123579123580123581123582123583123584123585123586123587123588123589123590123591123592123593123594123595123596123597123598123599123600123601123602123603123604123605123606123607123608123609123610123611123612123613123614123615123616123617123618123619123620123621123622123623123624123625123626123627123628123629123630123631123632123633123634123635123636123637123638123639123640123641123642123643123644123645123646123647123648123649123650123651123652123653123654123655123656123657123658123659123660123661123662123663123664123665123666123667123668123669123670123671123672123673123674123675123676123677123678123679123680123681123682123683123684123685123686123687123688123689123690123691123692123693123694123695123696123697123698123699123700123701123702123703123704123705123706123707123708123709123710123711123712123713123714123715123716123717123718123719123720123721123722123723123724123725123726123727123728123729123730123731123732123733123734123735123736123737123738123739123740123741123742123743123744123745123746123747123748123749123750123751123752123753123754123755123756123757123758123759123760123761123762123763123764123765123766123767123768123769123770123771123772123773123774123775123776123777123778123779123780123781123782123783123784123785123786123787123788123789123790123791123792123793123794123795123796123797123798123799123800123801123802123803123804123805123806123807123808123809123810123811123812123813123814123815123816123817123818123819123820123821123822123823123824123825123826123827123828123829123830123831123832123833123834123835123836123837123838123839123840123841123842123843123844123845123846123847123848123849123850123851123852123853123854123855123856123857123858123859123860123861123862123863123864123865123866123867123868123869123870123871123872123873123874123875123876123877123878123879123880123881123882123883123884123885123886123887123888123889123890123891123892123893123894123895123896123897123898123899123900123901123902123903123904123905123906123907123908123909123910123911123912123913123914123915123916123917123918123919123920123921123922123923123924123925123926123927123928123929123930123931123932123933123934123935123936123937123938123939123940123941123942123943123944123945123946123947123948123949123950123951123952123953123954123955123956123957123958123959123960123961123962123963123964123965123966123967123968123969123970123971123972123973123974123975123976123977123978123979123980123981123982123983123984123985123986123987123988123989123990123991123992123993123994123995123996123997123998123999124000124001124002124003124004124005124006124007124008124009124010124011124012124013124014124015124016124017124018124019124020124021124022124023124024124025124026124027124028124029124030124031124032124033124034124035124036124037124038124039124040124041124042124043124044124045124046124047124048124049124050124051124052124053124054124055124056124057124058124059124060124061124062124063124064124065124066124067124068124069124070124071124072124073124074124075124076124077124078124079124080124081124082124083124084124085124086124087124088124089124090124091124092124093124094124095124096124097124098124099124100124101124102124103124104124105124106124107124108124109124110124111124112124113124114124115124116124117124118124119124120124121124122124123124124124125124126124127124128124129124130124131124132124133124134124135124136124137124138124139124140124141124142124143124144124145124146124147124148124149124150124151124152124153124154124155124156124157124158124159124160124161124162124163124164124165124166124167124168124169124170124171124172124173124174124175124176124177124178124179124180124181124182124183124184124185124186124187124188124189124190124191124192124193124194124195124196124197124198124199124200124201124202124203124204124205124206124207124208124209124210124211124212124213124214124215124216124217124218124219124220124221124222124223124224124225124226124227124228124229124230124231124232124233124234124235124236124237124238124239124240124241124242124243124244124245124246124247124248124249124250124251124252124253124254124255124256124257124258124259124260124261124262124263124264124265124266124267124268124269124270124271124272124273124274124275124276124277124278124279124280124281124282124283124284124285124286124287124288124289124290124291124292124293124294124295124296124297124298124299124300124301124302124303124304124305124306124307124308124309124310124311124312124313124314124315124316124317124318124319124320124321124322124323124324124325124326124327124328124329124330124331124332124333124334124335124336124337124338124339124340124341124342124343124344124345124346124347124348124349124350124351124352124353124354124355124356124357124358124359124360124361124362124363124364124365124366124367124368124369124370124371124372124373124374124375124376124377124378124379124380124381124382124383124384124385124386124387124388124389124390124391124392124393124394124395124396124397124398124399124400124401124402124403124404124405124406124407124408124409124410124411124412124413124414124415124416124417124418124419124420124421124422124423124424124425124426124427124428124429124430124431124432124433124434124435124436124437124438124439124440124441124442124443124444124445124446124447124448124449124450124451124452124453124454124455124456124457124458124459124460124461124462124463124464124465124466124467124468124469124470124471124472124473124474124475124476124477124478124479124480124481124482124483124484124485124486124487124488124489124490124491124492124493124494124495124496124497124498124499124500124501124502124503124504124505124506124507124508124509124510124511124512124513124514124515124516124517124518124519124520124521124522124523124524124525124526124527124528124529124530124531124532124533124534124535124536124537124538124539124540124541124542124543124544124545124546124547124548124549124550124551124552124553124554124555124556124557124558124559124560124561124562124563124564124565124566124567124568124569124570124571124572124573124574124575124576124577124578124579124580124581124582124583124584124585124586124587124588124589124590124591124592124593124594124595124596124597124598124599124600124601124602124603124604124605124606124607124608124609124610124611124612124613124614124615124616124617124618124619124620124621124622124623124624124625124626124627124628124629124630124631124632124633124634124635124636124637124638124639124640124641124642124643124644124645124646124647124648124649124650124651124652124653124654124655124656124657124658124659124660124661124662124663124664124665124666124667124668124669124670124671124672124673124674124675124676124677124678124679124680124681124682124683124684124685124686124687124688124689124690124691124692124693124694124695124696124697124698124699124700124701124702124703124704124705124706124707124708124709124710124711124712124713124714124715124716124717124718124719124720124721124722124723124724124725124726124727124728124729124730124731124732124733124734124735124736124737124738124739124740124741124742124743124744124745124746124747124748124749124750124751124752124753124754124755124756124757124758124759124760124761124762124763124764124765124766124767124768124769124770124771124772124773124774124775124776124777124778124779124780124781124782124783124784124785124786124787124788124789124790124791124792124793124794124795124796124797124798124799124800124801124802124803124804124805124806124807124808124809124810124811124812124813124814124815124816124817124818124819124820124821124822124823124824124825124826124827124828124829124830124831124832124833124834124835124836124837124838124839124840124841124842124843124844124845124846124847124848124849124850124851124852124853124854124855124856124857124858124859124860124861124862124863124864124865124866124867124868124869124870124871124872124873124874124875124876124877124878124879124880124881124882124883124884124885124886124887124888124889124890124891124892124893124894124895124896124897124898124899124900124901124902124903124904124905124906124907124908124909124910124911124912124913124914124915124916124917124918124919124920124921124922124923124924124925124926124927124928124929124930124931124932124933124934124935124936124937124938124939124940124941124942124943124944124945124946124947124948124949124950124951124952124953124954124955124956124957124958124959124960124961124962124963124964124965124966124967124968124969124970124971124972124973124974124975124976124977124978124979124980124981124982124983124984124985124986124987124988124989124990124991124992124993124994124995124996124997124998124999125000125001125002125003125004125005125006125007125008125009125010125011125012125013125014125015125016125017125018125019125020125021125022125023125024125025125026125027125028125029125030125031125032125033125034125035125036125037125038125039125040125041125042125043125044125045125046125047125048125049125050125051125052125053125054125055125056125057125058125059125060125061125062125063125064125065125066125067125068125069125070125071125072125073125074125075125076125077125078125079125080125081125082125083125084125085125086125087125088125089125090125091125092125093125094125095125096125097125098125099125100125101125102125103125104125105125106125107125108125109125110125111125112125113125114125115125116125117125118125119125120125121125122125123125124125125125126125127125128125129125130125131125132125133125134125135125136125137125138125139125140125141125142125143125144125145125146125147125148125149125150125151125152125153125154125155125156125157125158125159125160125161125162125163125164125165125166125167125168125169125170125171125172125173125174125175125176125177125178125179125180125181125182125183125184125185125186125187125188125189125190125191125192125193125194125195125196125197125198125199125200125201125202125203125204125205125206125207125208125209125210125211125212125213125214125215125216125217125218125219125220125221125222125223125224125225125226125227125228125229125230125231125232125233125234125235125236125237125238125239125240125241125242125243125244125245125246125247125248125249125250125251125252125253125254125255125256125257125258125259125260125261125262125263125264125265125266125267125268125269125270125271125272125273125274125275125276125277125278125279125280125281125282125283125284125285125286125287125288125289125290125291125292125293125294125295125296125297125298125299125300125301125302125303125304125305125306125307125308125309125310125311125312125313125314125315125316125317125318125319125320125321125322125323125324125325125326125327125328125329125330125331125332125333125334125335125336125337125338125339125340125341125342125343125344125345125346125347125348125349125350125351125352125353125354125355125356125357125358125359125360125361125362125363125364125365125366125367125368125369125370125371125372125373125374125375125376125377125378125379125380125381125382125383125384125385125386125387125388125389125390125391125392125393125394125395125396125397125398125399125400125401125402125403125404125405125406125407125408125409125410125411125412125413125414125415125416125417125418125419125420125421125422125423125424125425125426125427125428125429125430125431125432125433125434125435125436125437125438125439125440125441125442125443125444125445125446125447125448125449125450125451125452125453125454125455125456125457125458125459125460125461125462125463125464125465125466125467125468125469125470125471125472125473125474125475125476125477125478125479125480125481125482125483125484125485125486125487125488125489125490125491125492125493125494125495125496125497125498125499125500125501125502125503125504125505125506125507125508125509125510125511125512125513125514125515125516125517125518125519125520125521125522125523125524125525125526125527125528125529125530125531125532125533125534125535125536125537125538125539125540125541125542125543125544125545125546125547125548125549125550125551125552125553125554125555125556125557125558125559125560125561125562125563125564125565125566125567125568125569125570125571125572125573125574125575125576125577125578125579125580125581125582125583125584125585125586125587125588125589125590125591125592125593125594125595125596125597125598125599125600125601125602125603125604125605125606125607125608125609125610125611125612125613125614125615125616125617125618125619125620125621125622125623125624125625125626125627125628125629125630125631125632125633125634125635125636125637125638125639125640125641125642125643125644125645125646125647125648125649125650125651125652125653125654125655125656125657125658125659125660125661125662125663125664125665125666125667125668125669125670125671125672125673125674125675125676125677125678125679125680125681125682125683125684125685125686125687125688125689125690125691125692125693125694125695125696125697125698125699125700125701125702125703125704125705125706125707125708125709125710125711125712125713125714125715125716125717125718125719125720125721125722125723125724125725125726125727125728125729125730125731125732125733125734125735125736125737125738125739125740125741125742125743125744125745125746125747125748125749125750125751125752125753125754125755125756125757125758125759125760125761125762125763125764125765125766125767125768125769125770125771125772125773125774125775125776125777125778125779125780125781125782125783125784125785125786125787125788125789125790125791125792125793125794125795125796125797125798125799125800125801125802125803125804125805125806125807125808125809125810125811125812125813125814125815125816125817125818125819125820125821125822125823125824125825125826125827125828125829125830125831125832125833125834125835125836125837125838125839125840125841125842125843125844125845125846125847125848125849125850125851125852125853125854125855125856125857125858125859125860125861125862125863125864125865125866125867125868125869125870125871125872125873125874125875125876125877125878125879125880125881125882125883125884125885125886125887125888125889125890125891125892125893125894125895125896125897125898125899125900125901125902125903125904125905125906125907125908125909125910125911125912125913125914125915125916125917125918125919125920125921125922125923125924125925125926125927125928125929125930125931125932125933125934125935125936125937125938125939125940125941125942125943125944125945125946125947125948125949125950125951125952125953125954125955125956125957125958125959125960125961125962125963125964125965125966125967125968125969125970125971125972125973125974125975125976125977125978125979125980125981125982125983125984125985125986125987125988125989125990125991125992125993125994125995125996125997125998125999126000126001126002126003126004126005126006126007126008126009126010126011126012126013126014126015126016126017126018126019126020126021126022126023126024126025126026126027126028126029126030126031126032126033126034126035126036126037126038126039126040126041126042126043126044126045126046126047126048126049126050126051126052126053126054126055126056126057126058126059126060126061126062126063126064126065126066126067126068126069126070126071126072126073126074126075126076126077126078126079126080126081126082126083126084126085126086126087126088126089126090126091126092126093126094126095126096126097126098126099126100126101126102126103126104126105126106126107126108126109126110126111126112126113126114126115126116126117126118126119126120126121126122126123126124126125126126126127126128126129126130126131126132126133126134126135126136126137126138126139126140126141126142126143126144126145126146126147126148126149126150126151126152126153126154126155126156126157126158126159126160126161126162126163126164126165126166126167126168126169126170126171126172126173126174126175126176126177126178126179126180126181126182126183126184126185126186126187126188126189126190126191126192126193126194126195126196126197
  1. /******/ (function(modules) { // webpackBootstrap
  2. /******/ // install a JSONP callback for chunk loading
  3. /******/ var parentJsonpFunction = window["webpackJsonp"];
  4. /******/ window["webpackJsonp"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {
  5. /******/ // add "moreModules" to the modules object,
  6. /******/ // then flag all "chunkIds" as loaded and fire callback
  7. /******/ var moduleId, chunkId, i = 0, resolves = [], result;
  8. /******/ for(;i < chunkIds.length; i++) {
  9. /******/ chunkId = chunkIds[i];
  10. /******/ if(installedChunks[chunkId]) {
  11. /******/ resolves.push(installedChunks[chunkId][0]);
  12. /******/ }
  13. /******/ installedChunks[chunkId] = 0;
  14. /******/ }
  15. /******/ for(moduleId in moreModules) {
  16. /******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
  17. /******/ modules[moduleId] = moreModules[moduleId];
  18. /******/ }
  19. /******/ }
  20. /******/ if(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);
  21. /******/ while(resolves.length) {
  22. /******/ resolves.shift()();
  23. /******/ }
  24. /******/ if(executeModules) {
  25. /******/ for(i=0; i < executeModules.length; i++) {
  26. /******/ result = __webpack_require__(__webpack_require__.s = executeModules[i]);
  27. /******/ }
  28. /******/ }
  29. /******/ return result;
  30. /******/ };
  31. /******/
  32. /******/ // The module cache
  33. /******/ var installedModules = {};
  34. /******/
  35. /******/ // objects to store loaded and loading chunks
  36. /******/ var installedChunks = {
  37. /******/ 5: 0
  38. /******/ };
  39. /******/
  40. /******/ // The require function
  41. /******/ function __webpack_require__(moduleId) {
  42. /******/
  43. /******/ // Check if module is in cache
  44. /******/ if(installedModules[moduleId]) {
  45. /******/ return installedModules[moduleId].exports;
  46. /******/ }
  47. /******/ // Create a new module (and put it into the cache)
  48. /******/ var module = installedModules[moduleId] = {
  49. /******/ i: moduleId,
  50. /******/ l: false,
  51. /******/ exports: {}
  52. /******/ };
  53. /******/
  54. /******/ // Execute the module function
  55. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  56. /******/
  57. /******/ // Flag the module as loaded
  58. /******/ module.l = true;
  59. /******/
  60. /******/ // Return the exports of the module
  61. /******/ return module.exports;
  62. /******/ }
  63. /******/
  64. /******/ // This file contains only the entry chunk.
  65. /******/ // The chunk loading function for additional chunks
  66. /******/ __webpack_require__.e = function requireEnsure(chunkId) {
  67. /******/ var installedChunkData = installedChunks[chunkId];
  68. /******/ if(installedChunkData === 0) {
  69. /******/ return new Promise(function(resolve) { resolve(); });
  70. /******/ }
  71. /******/
  72. /******/ // a Promise means "currently loading".
  73. /******/ if(installedChunkData) {
  74. /******/ return installedChunkData[2];
  75. /******/ }
  76. /******/
  77. /******/ // setup Promise in chunk cache
  78. /******/ var promise = new Promise(function(resolve, reject) {
  79. /******/ installedChunkData = installedChunks[chunkId] = [resolve, reject];
  80. /******/ });
  81. /******/ installedChunkData[2] = promise;
  82. /******/
  83. /******/ // start chunk loading
  84. /******/ var head = document.getElementsByTagName('head')[0];
  85. /******/ var script = document.createElement('script');
  86. /******/ script.type = 'text/javascript';
  87. /******/ script.charset = 'utf-8';
  88. /******/ script.async = true;
  89. /******/ script.timeout = 120000;
  90. /******/
  91. /******/ if (__webpack_require__.nc) {
  92. /******/ script.setAttribute("nonce", __webpack_require__.nc);
  93. /******/ }
  94. /******/ script.src = __webpack_require__.p + "" + chunkId + ".js";
  95. /******/ var timeout = setTimeout(onScriptComplete, 120000);
  96. /******/ script.onerror = script.onload = onScriptComplete;
  97. /******/ function onScriptComplete() {
  98. /******/ // avoid mem leaks in IE.
  99. /******/ script.onerror = script.onload = null;
  100. /******/ clearTimeout(timeout);
  101. /******/ var chunk = installedChunks[chunkId];
  102. /******/ if(chunk !== 0) {
  103. /******/ if(chunk) {
  104. /******/ chunk[1](new Error('Loading chunk ' + chunkId + ' failed.'));
  105. /******/ }
  106. /******/ installedChunks[chunkId] = undefined;
  107. /******/ }
  108. /******/ };
  109. /******/ head.appendChild(script);
  110. /******/
  111. /******/ return promise;
  112. /******/ };
  113. /******/
  114. /******/ // expose the modules object (__webpack_modules__)
  115. /******/ __webpack_require__.m = modules;
  116. /******/
  117. /******/ // expose the module cache
  118. /******/ __webpack_require__.c = installedModules;
  119. /******/
  120. /******/ // define getter function for harmony exports
  121. /******/ __webpack_require__.d = function(exports, name, getter) {
  122. /******/ if(!__webpack_require__.o(exports, name)) {
  123. /******/ Object.defineProperty(exports, name, {
  124. /******/ configurable: false,
  125. /******/ enumerable: true,
  126. /******/ get: getter
  127. /******/ });
  128. /******/ }
  129. /******/ };
  130. /******/
  131. /******/ // getDefaultExport function for compatibility with non-harmony modules
  132. /******/ __webpack_require__.n = function(module) {
  133. /******/ var getter = module && module.__esModule ?
  134. /******/ function getDefault() { return module['default']; } :
  135. /******/ function getModuleExports() { return module; };
  136. /******/ __webpack_require__.d(getter, 'a', getter);
  137. /******/ return getter;
  138. /******/ };
  139. /******/
  140. /******/ // Object.prototype.hasOwnProperty.call
  141. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  142. /******/
  143. /******/ // __webpack_public_path__
  144. /******/ __webpack_require__.p = "build/";
  145. /******/
  146. /******/ // on error function for async loading
  147. /******/ __webpack_require__.oe = function(err) { console.error(err); throw err; };
  148. /******/ })
  149. /************************************************************************/
  150. /******/ ([
  151. /* 0 */
  152. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  153. "use strict";
  154. /* WEBPACK VAR INJECTION */(function(global) {/* unused harmony export createPlatform */
  155. /* unused harmony export assertPlatform */
  156. /* unused harmony export destroyPlatform */
  157. /* unused harmony export getPlatform */
  158. /* unused harmony export PlatformRef */
  159. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return ApplicationRef; });
  160. /* unused harmony export enableProdMode */
  161. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_16", function() { return isDevMode; });
  162. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_13", function() { return createPlatformFactory; });
  163. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "L", function() { return NgProbeToken; });
  164. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return APP_ID; });
  165. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "P", function() { return PACKAGE_ROOT_URL; });
  166. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "R", function() { return PLATFORM_INITIALIZER; });
  167. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Q", function() { return PLATFORM_ID; });
  168. /* unused harmony export APP_BOOTSTRAP_LISTENER */
  169. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return APP_INITIALIZER; });
  170. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return ApplicationInitStatus; });
  171. /* unused harmony export DebugElement */
  172. /* unused harmony export DebugNode */
  173. /* unused harmony export asNativeElements */
  174. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_15", function() { return getDebugNode; });
  175. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_6", function() { return Testability; });
  176. /* unused harmony export TestabilityRegistry */
  177. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_18", function() { return setTestabilityGetter; });
  178. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_3", function() { return TRANSLATIONS; });
  179. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_4", function() { return TRANSLATIONS_FORMAT; });
  180. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "G", function() { return LOCALE_ID; });
  181. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "H", function() { return MissingTranslationStrategy; });
  182. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return ApplicationModule; });
  183. /* unused harmony export wtfCreateScope */
  184. /* unused harmony export wtfLeave */
  185. /* unused harmony export wtfStartTimeRange */
  186. /* unused harmony export wtfEndTimeRange */
  187. /* unused harmony export Type */
  188. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "v", function() { return EventEmitter; });
  189. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "u", function() { return ErrorHandler; });
  190. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Z", function() { return Sanitizer; });
  191. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_0", function() { return SecurityContext; });
  192. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ANALYZE_FOR_ENTRY_COMPONENTS; });
  193. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return Attribute; });
  194. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return ContentChild; });
  195. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return ContentChildren; });
  196. /* unused harmony export Query */
  197. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_8", function() { return ViewChild; });
  198. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_9", function() { return ViewChildren; });
  199. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return Component; });
  200. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return Directive; });
  201. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "x", function() { return HostBinding; });
  202. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "y", function() { return HostListener; });
  203. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "D", function() { return Input; });
  204. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "O", function() { return Output; });
  205. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "S", function() { return Pipe; });
  206. /* unused harmony export CUSTOM_ELEMENTS_SCHEMA */
  207. /* unused harmony export NO_ERRORS_SCHEMA */
  208. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "I", function() { return NgModule; });
  209. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_11", function() { return ViewEncapsulation; });
  210. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_7", function() { return Version; });
  211. /* unused harmony export VERSION */
  212. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_14", function() { return forwardRef; });
  213. /* unused harmony export resolveForwardRef */
  214. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "C", function() { return Injector; });
  215. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "U", function() { return ReflectiveInjector; });
  216. /* unused harmony export ResolvedReflectiveFactory */
  217. /* unused harmony export ReflectiveKey */
  218. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "B", function() { return InjectionToken; });
  219. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "z", function() { return Inject; });
  220. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "N", function() { return Optional; });
  221. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "A", function() { return Injectable; });
  222. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_1", function() { return Self; });
  223. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_2", function() { return SkipSelf; });
  224. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "w", function() { return Host; });
  225. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "M", function() { return NgZone; });
  226. /* unused harmony export RenderComponentType */
  227. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "V", function() { return Renderer; });
  228. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "W", function() { return Renderer2; });
  229. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "X", function() { return RendererFactory2; });
  230. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Y", function() { return RendererStyleFlags2; });
  231. /* unused harmony export RootRenderer */
  232. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return COMPILER_OPTIONS; });
  233. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return Compiler; });
  234. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return CompilerFactory; });
  235. /* unused harmony export ModuleWithComponentFactories */
  236. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return ComponentFactory; });
  237. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return ComponentRef; });
  238. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return ComponentFactoryResolver; });
  239. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return ElementRef; });
  240. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "J", function() { return NgModuleFactory; });
  241. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "K", function() { return NgModuleRef; });
  242. /* unused harmony export NgModuleFactoryLoader */
  243. /* unused harmony export getModuleFactory */
  244. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "T", function() { return QueryList; });
  245. /* unused harmony export SystemJsNgModuleLoader */
  246. /* unused harmony export SystemJsNgModuleLoaderConfig */
  247. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_5", function() { return TemplateRef; });
  248. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_10", function() { return ViewContainerRef; });
  249. /* unused harmony export EmbeddedViewRef */
  250. /* unused harmony export ViewRef */
  251. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return ChangeDetectionStrategy; });
  252. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return ChangeDetectorRef; });
  253. /* unused harmony export DefaultIterableDiffer */
  254. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "E", function() { return IterableDiffers; });
  255. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "F", function() { return KeyValueDiffers; });
  256. /* unused harmony export SimpleChange */
  257. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_12", function() { return WrappedValue; });
  258. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_17", function() { return platformCore; });
  259. /* unused harmony export ɵALLOW_MULTIPLE_PLATFORMS */
  260. /* unused harmony export ɵAPP_ID_RANDOM_PROVIDER */
  261. /* unused harmony export ɵdevModeEqual */
  262. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_33", function() { return isListLikeIterable; });
  263. /* unused harmony export ɵChangeDetectorStatus */
  264. /* unused harmony export ɵisDefaultChangeDetectionStrategy */
  265. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_20", function() { return Console; });
  266. /* unused harmony export ɵComponentFactory */
  267. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_19", function() { return CodegenComponentFactoryResolver; });
  268. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_23", function() { return ReflectionCapabilities; });
  269. /* unused harmony export ɵRenderDebugInfo */
  270. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_30", function() { return _global; });
  271. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_36", function() { return looseIdentical; });
  272. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_48", function() { return stringify; });
  273. /* unused harmony export ɵmakeDecorator */
  274. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_34", function() { return isObservable; });
  275. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_35", function() { return isPromise; });
  276. /* unused harmony export ɵclearOverrides */
  277. /* unused harmony export ɵoverrideComponentView */
  278. /* unused harmony export ɵoverrideProvider */
  279. /* unused harmony export ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR */
  280. /* unused harmony export ɵdefineComponent */
  281. /* unused harmony export ɵdetectChanges */
  282. /* unused harmony export ɵrenderComponent */
  283. /* unused harmony export ɵC */
  284. /* unused harmony export ɵD */
  285. /* unused harmony export ɵE */
  286. /* unused harmony export ɵT */
  287. /* unused harmony export ɵV */
  288. /* unused harmony export ɵb */
  289. /* unused harmony export ɵb1 */
  290. /* unused harmony export ɵc */
  291. /* unused harmony export ɵcR */
  292. /* unused harmony export ɵcr */
  293. /* unused harmony export ɵe */
  294. /* unused harmony export ɵp */
  295. /* unused harmony export ɵs */
  296. /* unused harmony export ɵt */
  297. /* unused harmony export ɵv */
  298. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_47", function() { return registerModuleFactory; });
  299. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_21", function() { return EMPTY_ARRAY; });
  300. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_22", function() { return EMPTY_MAP; });
  301. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_24", function() { return anchorDef; });
  302. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_25", function() { return createComponentFactory; });
  303. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_26", function() { return createNgModuleFactory; });
  304. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_27", function() { return createRendererType2; });
  305. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_28", function() { return directiveDef; });
  306. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_29", function() { return elementDef; });
  307. /* unused harmony export ɵelementEventFullName */
  308. /* unused harmony export ɵgetComponentViewDefinitionFactory */
  309. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_31", function() { return inlineInterpolate; });
  310. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_32", function() { return interpolate; });
  311. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_37", function() { return moduleDef; });
  312. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_38", function() { return moduleProvideDef; });
  313. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_39", function() { return ngContentDef; });
  314. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_40", function() { return nodeValue; });
  315. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_42", function() { return pipeDef; });
  316. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_45", function() { return providerDef; });
  317. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_41", function() { return pureArrayDef; });
  318. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_43", function() { return pureObjectDef; });
  319. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_44", function() { return purePipeDef; });
  320. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_46", function() { return queryDef; });
  321. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_49", function() { return textDef; });
  322. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_50", function() { return unwrapValue; });
  323. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_51", function() { return viewDef; });
  324. /* unused harmony export AUTO_STYLE */
  325. /* unused harmony export trigger */
  326. /* unused harmony export animate */
  327. /* unused harmony export group */
  328. /* unused harmony export sequence */
  329. /* unused harmony export style */
  330. /* unused harmony export state */
  331. /* unused harmony export keyframes */
  332. /* unused harmony export transition */
  333. /* unused harmony export ɵbf */
  334. /* unused harmony export ɵbg */
  335. /* unused harmony export ɵbk */
  336. /* unused harmony export ɵbh */
  337. /* unused harmony export ɵbj */
  338. /* unused harmony export ɵbi */
  339. /* unused harmony export ɵbl */
  340. /* unused harmony export ɵbe */
  341. /* unused harmony export ɵn */
  342. /* unused harmony export ɵo */
  343. /* unused harmony export ɵq */
  344. /* unused harmony export ɵi */
  345. /* unused harmony export ɵj */
  346. /* unused harmony export ɵk */
  347. /* unused harmony export ɵl */
  348. /* unused harmony export ɵm */
  349. /* unused harmony export ɵf */
  350. /* unused harmony export ɵg */
  351. /* unused harmony export ɵh */
  352. /* unused harmony export ɵr */
  353. /* unused harmony export ɵw */
  354. /* unused harmony export ɵu */
  355. /* unused harmony export ɵz */
  356. /* unused harmony export ɵx */
  357. /* unused harmony export ɵy */
  358. /* unused harmony export ɵbc */
  359. /* unused harmony export ɵa */
  360. /* unused harmony export ɵd */
  361. /* unused harmony export ɵba */
  362. /* unused harmony export ɵbb */
  363. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(25);
  364. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__ = __webpack_require__(9);
  365. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__);
  366. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_observable_merge__ = __webpack_require__(210);
  367. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_observable_merge___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_observable_merge__);
  368. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_operator_share__ = __webpack_require__(218);
  369. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_operator_share___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_operator_share__);
  370. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_Subject__ = __webpack_require__(33);
  371. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_Subject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_rxjs_Subject__);
  372. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_Subscription__ = __webpack_require__(30);
  373. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_Subscription___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_rxjs_Subscription__);
  374. /**
  375. * @license Angular v5.2.11
  376. * (c) 2010-2018 Google, Inc. https://angular.io/
  377. * License: MIT
  378. */
  379. /**
  380. * @fileoverview added by tsickle
  381. * @suppress {checkTypes} checked by tsc
  382. */
  383. /**
  384. * @license
  385. * Copyright Google Inc. All Rights Reserved.
  386. *
  387. * Use of this source code is governed by an MIT-style license that can be
  388. * found in the LICENSE file at https://angular.io/license
  389. */
  390. /**
  391. * Creates a token that can be used in a DI Provider.
  392. *
  393. * Use an `InjectionToken` whenever the type you are injecting is not reified (does not have a
  394. * runtime representation) such as when injecting an interface, callable type, array or
  395. * parametrized type.
  396. *
  397. * `InjectionToken` is parameterized on `T` which is the type of object which will be returned by
  398. * the `Injector`. This provides additional level of type safety.
  399. *
  400. * ```
  401. * interface MyInterface {...}
  402. * var myInterface = injector.get(new InjectionToken<MyInterface>('SomeToken'));
  403. * // myInterface is inferred to be MyInterface.
  404. * ```
  405. *
  406. * ### Example
  407. *
  408. * {\@example core/di/ts/injector_spec.ts region='InjectionToken'}
  409. *
  410. * \@stable
  411. * @template T
  412. */
  413. var InjectionToken = /** @class */ (function () {
  414. function InjectionToken(_desc) {
  415. this._desc = _desc;
  416. /**
  417. * \@internal
  418. */
  419. this.ngMetadataName = 'InjectionToken';
  420. }
  421. /**
  422. * @return {?}
  423. */
  424. InjectionToken.prototype.toString = /**
  425. * @return {?}
  426. */
  427. function () { return "InjectionToken " + this._desc; };
  428. return InjectionToken;
  429. }());
  430. /**
  431. * @fileoverview added by tsickle
  432. * @suppress {checkTypes} checked by tsc
  433. */
  434. /**
  435. * @license
  436. * Copyright Google Inc. All Rights Reserved.
  437. *
  438. * Use of this source code is governed by an MIT-style license that can be
  439. * found in the LICENSE file at https://angular.io/license
  440. */
  441. /**
  442. * An interface implemented by all Angular type decorators, which allows them to be used as ES7
  443. * decorators as well as
  444. * Angular DSL syntax.
  445. *
  446. * ES7 syntax:
  447. *
  448. * ```
  449. * \@ng.Component({...})
  450. * class MyClass {...}
  451. * ```
  452. * \@stable
  453. * @record
  454. */
  455. var ANNOTATIONS = '__annotations__';
  456. var PARAMETERS = '__paramaters__';
  457. var PROP_METADATA = '__prop__metadata__';
  458. /**
  459. * @suppress {globalThis}
  460. * @param {?} name
  461. * @param {?=} props
  462. * @param {?=} parentClass
  463. * @param {?=} chainFn
  464. * @return {?}
  465. */
  466. function makeDecorator(name, props, parentClass, chainFn) {
  467. var /** @type {?} */ metaCtor = makeMetadataCtor(props);
  468. /**
  469. * @param {?} objOrType
  470. * @return {?}
  471. */
  472. function DecoratorFactory(objOrType) {
  473. if (this instanceof DecoratorFactory) {
  474. metaCtor.call(this, objOrType);
  475. return this;
  476. }
  477. var /** @type {?} */ annotationInstance = new (/** @type {?} */ (DecoratorFactory))(objOrType);
  478. var /** @type {?} */ TypeDecorator = /** @type {?} */ (function TypeDecorator(cls) {
  479. // Use of Object.defineProperty is important since it creates non-enumerable property which
  480. // prevents the property is copied during subclassing.
  481. var /** @type {?} */ annotations = cls.hasOwnProperty(ANNOTATIONS) ?
  482. (/** @type {?} */ (cls))[ANNOTATIONS] :
  483. Object.defineProperty(cls, ANNOTATIONS, { value: [] })[ANNOTATIONS];
  484. annotations.push(annotationInstance);
  485. return cls;
  486. });
  487. if (chainFn)
  488. chainFn(TypeDecorator);
  489. return TypeDecorator;
  490. }
  491. if (parentClass) {
  492. DecoratorFactory.prototype = Object.create(parentClass.prototype);
  493. }
  494. DecoratorFactory.prototype.ngMetadataName = name;
  495. (/** @type {?} */ (DecoratorFactory)).annotationCls = DecoratorFactory;
  496. return /** @type {?} */ (DecoratorFactory);
  497. }
  498. /**
  499. * @param {?=} props
  500. * @return {?}
  501. */
  502. function makeMetadataCtor(props) {
  503. return function ctor() {
  504. var args = [];
  505. for (var _i = 0; _i < arguments.length; _i++) {
  506. args[_i] = arguments[_i];
  507. }
  508. if (props) {
  509. var /** @type {?} */ values = props.apply(void 0, args);
  510. for (var /** @type {?} */ propName in values) {
  511. this[propName] = values[propName];
  512. }
  513. }
  514. };
  515. }
  516. /**
  517. * @param {?} name
  518. * @param {?=} props
  519. * @param {?=} parentClass
  520. * @return {?}
  521. */
  522. function makeParamDecorator(name, props, parentClass) {
  523. var /** @type {?} */ metaCtor = makeMetadataCtor(props);
  524. /**
  525. * @param {...?} args
  526. * @return {?}
  527. */
  528. function ParamDecoratorFactory() {
  529. var args = [];
  530. for (var _i = 0; _i < arguments.length; _i++) {
  531. args[_i] = arguments[_i];
  532. }
  533. if (this instanceof ParamDecoratorFactory) {
  534. metaCtor.apply(this, args);
  535. return this;
  536. }
  537. var /** @type {?} */ annotationInstance = new ((_a = (/** @type {?} */ (ParamDecoratorFactory))).bind.apply(_a, [void 0].concat(args)))();
  538. (/** @type {?} */ (ParamDecorator)).annotation = annotationInstance;
  539. return ParamDecorator;
  540. /**
  541. * @param {?} cls
  542. * @param {?} unusedKey
  543. * @param {?} index
  544. * @return {?}
  545. */
  546. function ParamDecorator(cls, unusedKey, index) {
  547. // Use of Object.defineProperty is important since it creates non-enumerable property which
  548. // prevents the property is copied during subclassing.
  549. var /** @type {?} */ parameters = cls.hasOwnProperty(PARAMETERS) ?
  550. (/** @type {?} */ (cls))[PARAMETERS] :
  551. Object.defineProperty(cls, PARAMETERS, { value: [] })[PARAMETERS];
  552. // there might be gaps if some in between parameters do not have annotations.
  553. // we pad with nulls.
  554. while (parameters.length <= index) {
  555. parameters.push(null);
  556. }
  557. (parameters[index] = parameters[index] || []).push(annotationInstance);
  558. return cls;
  559. }
  560. var _a;
  561. }
  562. if (parentClass) {
  563. ParamDecoratorFactory.prototype = Object.create(parentClass.prototype);
  564. }
  565. ParamDecoratorFactory.prototype.ngMetadataName = name;
  566. (/** @type {?} */ (ParamDecoratorFactory)).annotationCls = ParamDecoratorFactory;
  567. return ParamDecoratorFactory;
  568. }
  569. /**
  570. * @param {?} name
  571. * @param {?=} props
  572. * @param {?=} parentClass
  573. * @return {?}
  574. */
  575. function makePropDecorator(name, props, parentClass) {
  576. var /** @type {?} */ metaCtor = makeMetadataCtor(props);
  577. /**
  578. * @param {...?} args
  579. * @return {?}
  580. */
  581. function PropDecoratorFactory() {
  582. var args = [];
  583. for (var _i = 0; _i < arguments.length; _i++) {
  584. args[_i] = arguments[_i];
  585. }
  586. if (this instanceof PropDecoratorFactory) {
  587. metaCtor.apply(this, args);
  588. return this;
  589. }
  590. var /** @type {?} */ decoratorInstance = new ((_a = (/** @type {?} */ (PropDecoratorFactory))).bind.apply(_a, [void 0].concat(args)))();
  591. return function PropDecorator(target, name) {
  592. var /** @type {?} */ constructor = target.constructor;
  593. // Use of Object.defineProperty is important since it creates non-enumerable property which
  594. // prevents the property is copied during subclassing.
  595. var /** @type {?} */ meta = constructor.hasOwnProperty(PROP_METADATA) ?
  596. (/** @type {?} */ (constructor))[PROP_METADATA] :
  597. Object.defineProperty(constructor, PROP_METADATA, { value: {} })[PROP_METADATA];
  598. meta[name] = meta.hasOwnProperty(name) && meta[name] || [];
  599. meta[name].unshift(decoratorInstance);
  600. };
  601. var _a;
  602. }
  603. if (parentClass) {
  604. PropDecoratorFactory.prototype = Object.create(parentClass.prototype);
  605. }
  606. PropDecoratorFactory.prototype.ngMetadataName = name;
  607. (/** @type {?} */ (PropDecoratorFactory)).annotationCls = PropDecoratorFactory;
  608. return PropDecoratorFactory;
  609. }
  610. /**
  611. * @fileoverview added by tsickle
  612. * @suppress {checkTypes} checked by tsc
  613. */
  614. /**
  615. * @license
  616. * Copyright Google Inc. All Rights Reserved.
  617. *
  618. * Use of this source code is governed by an MIT-style license that can be
  619. * found in the LICENSE file at https://angular.io/license
  620. */
  621. /**
  622. * This token can be used to create a virtual provider that will populate the
  623. * `entryComponents` fields of components and ng modules based on its `useValue`.
  624. * All components that are referenced in the `useValue` value (either directly
  625. * or in a nested array or map) will be added to the `entryComponents` property.
  626. *
  627. * ### Example
  628. * The following example shows how the router can populate the `entryComponents`
  629. * field of an NgModule based on the router configuration which refers
  630. * to components.
  631. *
  632. * ```typescript
  633. * // helper function inside the router
  634. * function provideRoutes(routes) {
  635. * return [
  636. * {provide: ROUTES, useValue: routes},
  637. * {provide: ANALYZE_FOR_ENTRY_COMPONENTS, useValue: routes, multi: true}
  638. * ];
  639. * }
  640. *
  641. * // user code
  642. * let routes = [
  643. * {path: '/root', component: RootComp},
  644. * {path: '/teams', component: TeamsComp}
  645. * ];
  646. *
  647. * \@NgModule({
  648. * providers: [provideRoutes(routes)]
  649. * })
  650. * class ModuleWithRoutes {}
  651. * ```
  652. *
  653. * \@experimental
  654. */
  655. var ANALYZE_FOR_ENTRY_COMPONENTS = new InjectionToken('AnalyzeForEntryComponents');
  656. /**
  657. * Type of the Attribute decorator / constructor function.
  658. *
  659. * \@stable
  660. * @record
  661. */
  662. /**
  663. * Attribute decorator and metadata.
  664. *
  665. * \@stable
  666. * \@Annotation
  667. */
  668. var Attribute = makeParamDecorator('Attribute', function (attributeName) { return ({ attributeName: attributeName }); });
  669. /**
  670. * Base class for query metadata.
  671. *
  672. * See {\@link ContentChildren}, {\@link ContentChild}, {\@link ViewChildren}, {\@link ViewChild} for
  673. * more information.
  674. *
  675. * \@stable
  676. * @abstract
  677. */
  678. var Query = /** @class */ (function () {
  679. function Query() {
  680. }
  681. return Query;
  682. }());
  683. /**
  684. * Type of the ContentChildren decorator / constructor function.
  685. *
  686. * See {\@link ContentChildren}.
  687. *
  688. * \@stable
  689. * @record
  690. */
  691. /**
  692. * ContentChildren decorator and metadata.
  693. *
  694. * \@stable
  695. * \@Annotation
  696. */
  697. var ContentChildren = makePropDecorator('ContentChildren', function (selector, data) {
  698. if (data === void 0) { data = {}; }
  699. return (Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */])({ selector: selector, first: false, isViewQuery: false, descendants: false }, data));
  700. }, Query);
  701. /**
  702. * Type of the ContentChild decorator / constructor function.
  703. *
  704. *
  705. * \@stable
  706. * @record
  707. */
  708. /**
  709. * ContentChild decorator and metadata.
  710. *
  711. * \@stable
  712. * \@Annotation
  713. */
  714. var ContentChild = makePropDecorator('ContentChild', function (selector, data) {
  715. if (data === void 0) { data = {}; }
  716. return (Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */])({ selector: selector, first: true, isViewQuery: false, descendants: true }, data));
  717. }, Query);
  718. /**
  719. * Type of the ViewChildren decorator / constructor function.
  720. *
  721. * See {\@link ViewChildren}.
  722. *
  723. * \@stable
  724. * @record
  725. */
  726. /**
  727. * ViewChildren decorator and metadata.
  728. *
  729. * \@stable
  730. * \@Annotation
  731. */
  732. var ViewChildren = makePropDecorator('ViewChildren', function (selector, data) {
  733. if (data === void 0) { data = {}; }
  734. return (Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */])({ selector: selector, first: false, isViewQuery: true, descendants: true }, data));
  735. }, Query);
  736. /**
  737. * Type of the ViewChild decorator / constructor function.
  738. *
  739. * See {\@link ViewChild}
  740. *
  741. * \@stable
  742. * @record
  743. */
  744. /**
  745. * ViewChild decorator and metadata.
  746. *
  747. * \@stable
  748. * \@Annotation
  749. */
  750. var ViewChild = makePropDecorator('ViewChild', function (selector, data) {
  751. return (Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */])({ selector: selector, first: true, isViewQuery: true, descendants: true }, data));
  752. }, Query);
  753. /**
  754. * @fileoverview added by tsickle
  755. * @suppress {checkTypes} checked by tsc
  756. */
  757. /**
  758. * @license
  759. * Copyright Google Inc. All Rights Reserved.
  760. *
  761. * Use of this source code is governed by an MIT-style license that can be
  762. * found in the LICENSE file at https://angular.io/license
  763. */
  764. /** @enum {number} */
  765. var ChangeDetectionStrategy = {
  766. /**
  767. * `OnPush` means that the change detector's mode will be initially set to `CheckOnce`.
  768. */
  769. OnPush: 0,
  770. /**
  771. * `Default` means that the change detector's mode will be initially set to `CheckAlways`.
  772. */
  773. Default: 1,
  774. };
  775. ChangeDetectionStrategy[ChangeDetectionStrategy.OnPush] = "OnPush";
  776. ChangeDetectionStrategy[ChangeDetectionStrategy.Default] = "Default";
  777. /** @enum {number} */
  778. var ChangeDetectorStatus = {
  779. /**
  780. * `CheckOnce` means that after calling detectChanges the mode of the change detector
  781. * will become `Checked`.
  782. */
  783. CheckOnce: 0,
  784. /**
  785. * `Checked` means that the change detector should be skipped until its mode changes to
  786. * `CheckOnce`.
  787. */
  788. Checked: 1,
  789. /**
  790. * `CheckAlways` means that after calling detectChanges the mode of the change detector
  791. * will remain `CheckAlways`.
  792. */
  793. CheckAlways: 2,
  794. /**
  795. * `Detached` means that the change detector sub tree is not a part of the main tree and
  796. * should be skipped.
  797. */
  798. Detached: 3,
  799. /**
  800. * `Errored` means that the change detector encountered an error checking a binding
  801. * or calling a directive lifecycle method and is now in an inconsistent state. Change
  802. * detectors in this state will no longer detect changes.
  803. */
  804. Errored: 4,
  805. /**
  806. * `Destroyed` means that the change detector is destroyed.
  807. */
  808. Destroyed: 5,
  809. };
  810. ChangeDetectorStatus[ChangeDetectorStatus.CheckOnce] = "CheckOnce";
  811. ChangeDetectorStatus[ChangeDetectorStatus.Checked] = "Checked";
  812. ChangeDetectorStatus[ChangeDetectorStatus.CheckAlways] = "CheckAlways";
  813. ChangeDetectorStatus[ChangeDetectorStatus.Detached] = "Detached";
  814. ChangeDetectorStatus[ChangeDetectorStatus.Errored] = "Errored";
  815. ChangeDetectorStatus[ChangeDetectorStatus.Destroyed] = "Destroyed";
  816. /**
  817. * @param {?} changeDetectionStrategy
  818. * @return {?}
  819. */
  820. function isDefaultChangeDetectionStrategy(changeDetectionStrategy) {
  821. return changeDetectionStrategy == null ||
  822. changeDetectionStrategy === ChangeDetectionStrategy.Default;
  823. }
  824. /**
  825. * @fileoverview added by tsickle
  826. * @suppress {checkTypes} checked by tsc
  827. */
  828. /**
  829. * @license
  830. * Copyright Google Inc. All Rights Reserved.
  831. *
  832. * Use of this source code is governed by an MIT-style license that can be
  833. * found in the LICENSE file at https://angular.io/license
  834. */
  835. /**
  836. * Type of the Directive decorator / constructor function.
  837. *
  838. * \@stable
  839. * @record
  840. */
  841. /**
  842. * Directive decorator and metadata.
  843. *
  844. * \@stable
  845. * \@Annotation
  846. */
  847. var Directive = makeDecorator('Directive', function (dir) {
  848. if (dir === void 0) { dir = {}; }
  849. return dir;
  850. });
  851. /**
  852. * Type of the Component decorator / constructor function.
  853. *
  854. * \@stable
  855. * @record
  856. */
  857. /**
  858. * Component decorator and metadata.
  859. *
  860. * \@stable
  861. * \@Annotation
  862. */
  863. var Component = makeDecorator('Component', function (c) {
  864. if (c === void 0) { c = {}; }
  865. return (Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */])({ changeDetection: ChangeDetectionStrategy.Default }, c));
  866. }, Directive);
  867. /**
  868. * Type of the Pipe decorator / constructor function.
  869. *
  870. * \@stable
  871. * @record
  872. */
  873. /**
  874. * Pipe decorator and metadata.
  875. *
  876. * \@stable
  877. * \@Annotation
  878. */
  879. var Pipe = makeDecorator('Pipe', function (p) { return (Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */])({ pure: true }, p)); });
  880. /**
  881. * Type of the Input decorator / constructor function.
  882. *
  883. * \@stable
  884. * @record
  885. */
  886. /**
  887. * Input decorator and metadata.
  888. *
  889. * \@stable
  890. * \@Annotation
  891. */
  892. var Input = makePropDecorator('Input', function (bindingPropertyName) { return ({ bindingPropertyName: bindingPropertyName }); });
  893. /**
  894. * Type of the Output decorator / constructor function.
  895. *
  896. * \@stable
  897. * @record
  898. */
  899. /**
  900. * Output decorator and metadata.
  901. *
  902. * \@stable
  903. * \@Annotation
  904. */
  905. var Output = makePropDecorator('Output', function (bindingPropertyName) { return ({ bindingPropertyName: bindingPropertyName }); });
  906. /**
  907. * Type of the HostBinding decorator / constructor function.
  908. *
  909. * \@stable
  910. * @record
  911. */
  912. /**
  913. * HostBinding decorator and metadata.
  914. *
  915. * \@stable
  916. * \@Annotation
  917. */
  918. var HostBinding = makePropDecorator('HostBinding', function (hostPropertyName) { return ({ hostPropertyName: hostPropertyName }); });
  919. /**
  920. * Type of the HostListener decorator / constructor function.
  921. *
  922. * \@stable
  923. * @record
  924. */
  925. /**
  926. * HostListener decorator and metadata.
  927. *
  928. * \@stable
  929. * \@Annotation
  930. */
  931. var HostListener = makePropDecorator('HostListener', function (eventName, args) { return ({ eventName: eventName, args: args }); });
  932. /**
  933. * @fileoverview added by tsickle
  934. * @suppress {checkTypes} checked by tsc
  935. */
  936. /**
  937. * @license
  938. * Copyright Google Inc. All Rights Reserved.
  939. *
  940. * Use of this source code is governed by an MIT-style license that can be
  941. * found in the LICENSE file at https://angular.io/license
  942. */
  943. /**
  944. * A wrapper around a module that also includes the providers.
  945. *
  946. * \@stable
  947. * @record
  948. */
  949. /**
  950. * Interface for schema definitions in \@NgModules.
  951. *
  952. * \@experimental
  953. * @record
  954. */
  955. /**
  956. * Defines a schema that will allow:
  957. * - any non-Angular elements with a `-` in their name,
  958. * - any properties on elements with a `-` in their name which is the common rule for custom
  959. * elements.
  960. *
  961. * \@stable
  962. */
  963. var CUSTOM_ELEMENTS_SCHEMA = {
  964. name: 'custom-elements'
  965. };
  966. /**
  967. * Defines a schema that will allow any property on any element.
  968. *
  969. * \@experimental
  970. */
  971. var NO_ERRORS_SCHEMA = {
  972. name: 'no-errors-schema'
  973. };
  974. /**
  975. * Type of the NgModule decorator / constructor function.
  976. *
  977. * \@stable
  978. * @record
  979. */
  980. /**
  981. * NgModule decorator and metadata.
  982. *
  983. * \@stable
  984. * \@Annotation
  985. */
  986. var NgModule = makeDecorator('NgModule', function (ngModule) { return ngModule; });
  987. /**
  988. * @fileoverview added by tsickle
  989. * @suppress {checkTypes} checked by tsc
  990. */
  991. /**
  992. * @license
  993. * Copyright Google Inc. All Rights Reserved.
  994. *
  995. * Use of this source code is governed by an MIT-style license that can be
  996. * found in the LICENSE file at https://angular.io/license
  997. */
  998. /** @enum {number} */
  999. var ViewEncapsulation = {
  1000. /**
  1001. * Emulate `Native` scoping of styles by adding an attribute containing surrogate id to the Host
  1002. * Element and pre-processing the style rules provided via {@link Component#styles styles} or
  1003. * {@link Component#styleUrls styleUrls}, and adding the new Host Element attribute to all
  1004. * selectors.
  1005. *
  1006. * This is the default option.
  1007. */
  1008. Emulated: 0,
  1009. /**
  1010. * Use the native encapsulation mechanism of the renderer.
  1011. *
  1012. * For the DOM this means using [Shadow DOM](https://w3c.github.io/webcomponents/spec/shadow/) and
  1013. * creating a ShadowRoot for Component's Host Element.
  1014. */
  1015. Native: 1,
  1016. /**
  1017. * Don't provide any template or style encapsulation.
  1018. */
  1019. None: 2,
  1020. };
  1021. ViewEncapsulation[ViewEncapsulation.Emulated] = "Emulated";
  1022. ViewEncapsulation[ViewEncapsulation.Native] = "Native";
  1023. ViewEncapsulation[ViewEncapsulation.None] = "None";
  1024. /**
  1025. * @fileoverview added by tsickle
  1026. * @suppress {checkTypes} checked by tsc
  1027. */
  1028. /**
  1029. * @license
  1030. * Copyright Google Inc. All Rights Reserved.
  1031. *
  1032. * Use of this source code is governed by an MIT-style license that can be
  1033. * found in the LICENSE file at https://angular.io/license
  1034. */
  1035. /**
  1036. * @fileoverview added by tsickle
  1037. * @suppress {checkTypes} checked by tsc
  1038. */
  1039. /**
  1040. * @license
  1041. * Copyright Google Inc. All Rights Reserved.
  1042. *
  1043. * Use of this source code is governed by an MIT-style license that can be
  1044. * found in the LICENSE file at https://angular.io/license
  1045. */
  1046. /**
  1047. * \@whatItDoes Represents the version of Angular
  1048. *
  1049. * \@stable
  1050. */
  1051. var Version = /** @class */ (function () {
  1052. function Version(full) {
  1053. this.full = full;
  1054. this.major = full.split('.')[0];
  1055. this.minor = full.split('.')[1];
  1056. this.patch = full.split('.').slice(2).join('.');
  1057. }
  1058. return Version;
  1059. }());
  1060. /**
  1061. * \@stable
  1062. */
  1063. var VERSION = new Version('5.2.11');
  1064. /**
  1065. * @fileoverview added by tsickle
  1066. * @suppress {checkTypes} checked by tsc
  1067. */
  1068. /**
  1069. * @license
  1070. * Copyright Google Inc. All Rights Reserved.
  1071. *
  1072. * Use of this source code is governed by an MIT-style license that can be
  1073. * found in the LICENSE file at https://angular.io/license
  1074. */
  1075. /**
  1076. * Type of the Inject decorator / constructor function.
  1077. *
  1078. * \@stable
  1079. * @record
  1080. */
  1081. /**
  1082. * Inject decorator and metadata.
  1083. *
  1084. * \@stable
  1085. * \@Annotation
  1086. */
  1087. var Inject = makeParamDecorator('Inject', function (token) { return ({ token: token }); });
  1088. /**
  1089. * Type of the Optional decorator / constructor function.
  1090. *
  1091. * \@stable
  1092. * @record
  1093. */
  1094. /**
  1095. * Optional decorator and metadata.
  1096. *
  1097. * \@stable
  1098. * \@Annotation
  1099. */
  1100. var Optional = makeParamDecorator('Optional');
  1101. /**
  1102. * Type of the Injectable decorator / constructor function.
  1103. *
  1104. * \@stable
  1105. * @record
  1106. */
  1107. /**
  1108. * Injectable decorator and metadata.
  1109. *
  1110. * \@stable
  1111. * \@Annotation
  1112. */
  1113. var Injectable = makeDecorator('Injectable');
  1114. /**
  1115. * Type of the Self decorator / constructor function.
  1116. *
  1117. * \@stable
  1118. * @record
  1119. */
  1120. /**
  1121. * Self decorator and metadata.
  1122. *
  1123. * \@stable
  1124. * \@Annotation
  1125. */
  1126. var Self = makeParamDecorator('Self');
  1127. /**
  1128. * Type of the SkipSelf decorator / constructor function.
  1129. *
  1130. * \@stable
  1131. * @record
  1132. */
  1133. /**
  1134. * SkipSelf decorator and metadata.
  1135. *
  1136. * \@stable
  1137. * \@Annotation
  1138. */
  1139. var SkipSelf = makeParamDecorator('SkipSelf');
  1140. /**
  1141. * Type of the Host decorator / constructor function.
  1142. *
  1143. * \@stable
  1144. * @record
  1145. */
  1146. /**
  1147. * Host decorator and metadata.
  1148. *
  1149. * \@stable
  1150. * \@Annotation
  1151. */
  1152. var Host = makeParamDecorator('Host');
  1153. /**
  1154. * @fileoverview added by tsickle
  1155. * @suppress {checkTypes} checked by tsc
  1156. */
  1157. /**
  1158. * @license
  1159. * Copyright Google Inc. All Rights Reserved.
  1160. *
  1161. * Use of this source code is governed by an MIT-style license that can be
  1162. * found in the LICENSE file at https://angular.io/license
  1163. */
  1164. var __window = typeof window !== 'undefined' && window;
  1165. var __self = typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' &&
  1166. self instanceof WorkerGlobalScope && self;
  1167. var __global = typeof global !== 'undefined' && global;
  1168. var _global = __window || __global || __self;
  1169. var promise = Promise.resolve(0);
  1170. var _symbolIterator = null;
  1171. /**
  1172. * @return {?}
  1173. */
  1174. function getSymbolIterator() {
  1175. if (!_symbolIterator) {
  1176. var /** @type {?} */ Symbol_1 = _global['Symbol'];
  1177. if (Symbol_1 && Symbol_1.iterator) {
  1178. _symbolIterator = Symbol_1.iterator;
  1179. }
  1180. else {
  1181. // es6-shim specific logic
  1182. var /** @type {?} */ keys = Object.getOwnPropertyNames(Map.prototype);
  1183. for (var /** @type {?} */ i = 0; i < keys.length; ++i) {
  1184. var /** @type {?} */ key = keys[i];
  1185. if (key !== 'entries' && key !== 'size' &&
  1186. (/** @type {?} */ (Map)).prototype[key] === Map.prototype['entries']) {
  1187. _symbolIterator = key;
  1188. }
  1189. }
  1190. }
  1191. }
  1192. return _symbolIterator;
  1193. }
  1194. /**
  1195. * @param {?} fn
  1196. * @return {?}
  1197. */
  1198. function scheduleMicroTask(fn) {
  1199. if (typeof Zone === 'undefined') {
  1200. // use promise to schedule microTask instead of use Zone
  1201. promise.then(function () { fn && fn.apply(null, null); });
  1202. }
  1203. else {
  1204. Zone.current.scheduleMicroTask('scheduleMicrotask', fn);
  1205. }
  1206. }
  1207. /**
  1208. * @param {?} a
  1209. * @param {?} b
  1210. * @return {?}
  1211. */
  1212. function looseIdentical(a, b) {
  1213. return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);
  1214. }
  1215. /**
  1216. * @param {?} token
  1217. * @return {?}
  1218. */
  1219. function stringify(token) {
  1220. if (typeof token === 'string') {
  1221. return token;
  1222. }
  1223. if (token instanceof Array) {
  1224. return '[' + token.map(stringify).join(', ') + ']';
  1225. }
  1226. if (token == null) {
  1227. return '' + token;
  1228. }
  1229. if (token.overriddenName) {
  1230. return "" + token.overriddenName;
  1231. }
  1232. if (token.name) {
  1233. return "" + token.name;
  1234. }
  1235. var /** @type {?} */ res = token.toString();
  1236. if (res == null) {
  1237. return '' + res;
  1238. }
  1239. var /** @type {?} */ newLineIndex = res.indexOf('\n');
  1240. return newLineIndex === -1 ? res : res.substring(0, newLineIndex);
  1241. }
  1242. /**
  1243. * @fileoverview added by tsickle
  1244. * @suppress {checkTypes} checked by tsc
  1245. */
  1246. /**
  1247. * @license
  1248. * Copyright Google Inc. All Rights Reserved.
  1249. *
  1250. * Use of this source code is governed by an MIT-style license that can be
  1251. * found in the LICENSE file at https://angular.io/license
  1252. */
  1253. /**
  1254. * An interface that a function passed into {\@link forwardRef} has to implement.
  1255. *
  1256. * ### Example
  1257. *
  1258. * {\@example core/di/ts/forward_ref/forward_ref_spec.ts region='forward_ref_fn'}
  1259. * \@experimental
  1260. * @record
  1261. */
  1262. /**
  1263. * Allows to refer to references which are not yet defined.
  1264. *
  1265. * For instance, `forwardRef` is used when the `token` which we need to refer to for the purposes of
  1266. * DI is declared,
  1267. * but not yet defined. It is also used when the `token` which we use when creating a query is not
  1268. * yet defined.
  1269. *
  1270. * ### Example
  1271. * {\@example core/di/ts/forward_ref/forward_ref_spec.ts region='forward_ref'}
  1272. * \@experimental
  1273. * @param {?} forwardRefFn
  1274. * @return {?}
  1275. */
  1276. function forwardRef(forwardRefFn) {
  1277. (/** @type {?} */ (forwardRefFn)).__forward_ref__ = forwardRef;
  1278. (/** @type {?} */ (forwardRefFn)).toString = function () { return stringify(this()); };
  1279. return (/** @type {?} */ (/** @type {?} */ (forwardRefFn)));
  1280. }
  1281. /**
  1282. * Lazily retrieves the reference value from a forwardRef.
  1283. *
  1284. * Acts as the identity function when given a non-forward-ref value.
  1285. *
  1286. * ### Example ([live demo](http://plnkr.co/edit/GU72mJrk1fiodChcmiDR?p=preview))
  1287. *
  1288. * {\@example core/di/ts/forward_ref/forward_ref_spec.ts region='resolve_forward_ref'}
  1289. *
  1290. * See: {\@link forwardRef}
  1291. * \@experimental
  1292. * @param {?} type
  1293. * @return {?}
  1294. */
  1295. function resolveForwardRef(type) {
  1296. if (typeof type === 'function' && type.hasOwnProperty('__forward_ref__') &&
  1297. type.__forward_ref__ === forwardRef) {
  1298. return (/** @type {?} */ (type))();
  1299. }
  1300. else {
  1301. return type;
  1302. }
  1303. }
  1304. /**
  1305. * @fileoverview added by tsickle
  1306. * @suppress {checkTypes} checked by tsc
  1307. */
  1308. /**
  1309. * @license
  1310. * Copyright Google Inc. All Rights Reserved.
  1311. *
  1312. * Use of this source code is governed by an MIT-style license that can be
  1313. * found in the LICENSE file at https://angular.io/license
  1314. */
  1315. var SOURCE = '__source';
  1316. var _THROW_IF_NOT_FOUND = new Object();
  1317. var THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND;
  1318. var _NullInjector = /** @class */ (function () {
  1319. function _NullInjector() {
  1320. }
  1321. /**
  1322. * @param {?} token
  1323. * @param {?=} notFoundValue
  1324. * @return {?}
  1325. */
  1326. _NullInjector.prototype.get = /**
  1327. * @param {?} token
  1328. * @param {?=} notFoundValue
  1329. * @return {?}
  1330. */
  1331. function (token, notFoundValue) {
  1332. if (notFoundValue === void 0) { notFoundValue = _THROW_IF_NOT_FOUND; }
  1333. if (notFoundValue === _THROW_IF_NOT_FOUND) {
  1334. throw new Error("NullInjectorError: No provider for " + stringify(token) + "!");
  1335. }
  1336. return notFoundValue;
  1337. };
  1338. return _NullInjector;
  1339. }());
  1340. /**
  1341. * \@whatItDoes Injector interface
  1342. * \@howToUse
  1343. * ```
  1344. * const injector: Injector = ...;
  1345. * injector.get(...);
  1346. * ```
  1347. *
  1348. * \@description
  1349. * For more details, see the {\@linkDocs guide/dependency-injection "Dependency Injection Guide"}.
  1350. *
  1351. * ### Example
  1352. *
  1353. * {\@example core/di/ts/injector_spec.ts region='Injector'}
  1354. *
  1355. * `Injector` returns itself when given `Injector` as a token:
  1356. * {\@example core/di/ts/injector_spec.ts region='injectInjector'}
  1357. *
  1358. * \@stable
  1359. * @abstract
  1360. */
  1361. var Injector = /** @class */ (function () {
  1362. function Injector() {
  1363. }
  1364. /**
  1365. * Create a new Injector which is configure using `StaticProvider`s.
  1366. *
  1367. * ### Example
  1368. *
  1369. * {@example core/di/ts/provider_spec.ts region='ConstructorProvider'}
  1370. */
  1371. /**
  1372. * Create a new Injector which is configure using `StaticProvider`s.
  1373. *
  1374. * ### Example
  1375. *
  1376. * {\@example core/di/ts/provider_spec.ts region='ConstructorProvider'}
  1377. * @param {?} options
  1378. * @param {?=} parent
  1379. * @return {?}
  1380. */
  1381. Injector.create = /**
  1382. * Create a new Injector which is configure using `StaticProvider`s.
  1383. *
  1384. * ### Example
  1385. *
  1386. * {\@example core/di/ts/provider_spec.ts region='ConstructorProvider'}
  1387. * @param {?} options
  1388. * @param {?=} parent
  1389. * @return {?}
  1390. */
  1391. function (options, parent) {
  1392. if (Array.isArray(options)) {
  1393. return new StaticInjector(options, parent);
  1394. }
  1395. else {
  1396. return new StaticInjector(options.providers, options.parent, options.name || null);
  1397. }
  1398. };
  1399. Injector.THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND;
  1400. Injector.NULL = new _NullInjector();
  1401. return Injector;
  1402. }());
  1403. var IDENT = function (value) {
  1404. return value;
  1405. };
  1406. var EMPTY = /** @type {?} */ ([]);
  1407. var CIRCULAR = IDENT;
  1408. var MULTI_PROVIDER_FN = function () {
  1409. return Array.prototype.slice.call(arguments);
  1410. };
  1411. var GET_PROPERTY_NAME = /** @type {?} */ ({});
  1412. var ɵ2 = GET_PROPERTY_NAME;
  1413. var USE_VALUE = getClosureSafeProperty({ provide: String, useValue: ɵ2 });
  1414. var NG_TOKEN_PATH = 'ngTokenPath';
  1415. var NG_TEMP_TOKEN_PATH = 'ngTempTokenPath';
  1416. var NULL_INJECTOR = Injector.NULL;
  1417. var NEW_LINE = /\n/gm;
  1418. var NO_NEW_LINE = 'ɵ';
  1419. var StaticInjector = /** @class */ (function () {
  1420. function StaticInjector(providers, parent, source) {
  1421. if (parent === void 0) { parent = NULL_INJECTOR; }
  1422. if (source === void 0) { source = null; }
  1423. this.parent = parent;
  1424. this.source = source;
  1425. var /** @type {?} */ records = this._records = new Map();
  1426. records.set(Injector, /** @type {?} */ ({ token: Injector, fn: IDENT, deps: EMPTY, value: this, useNew: false }));
  1427. recursivelyProcessProviders(records, providers);
  1428. }
  1429. /**
  1430. * @param {?} token
  1431. * @param {?=} notFoundValue
  1432. * @return {?}
  1433. */
  1434. StaticInjector.prototype.get = /**
  1435. * @param {?} token
  1436. * @param {?=} notFoundValue
  1437. * @return {?}
  1438. */
  1439. function (token, notFoundValue) {
  1440. var /** @type {?} */ record = this._records.get(token);
  1441. try {
  1442. return tryResolveToken(token, record, this._records, this.parent, notFoundValue);
  1443. }
  1444. catch (/** @type {?} */ e) {
  1445. var /** @type {?} */ tokenPath = e[NG_TEMP_TOKEN_PATH];
  1446. if (token[SOURCE]) {
  1447. tokenPath.unshift(token[SOURCE]);
  1448. }
  1449. e.message = formatError('\n' + e.message, tokenPath, this.source);
  1450. e[NG_TOKEN_PATH] = tokenPath;
  1451. e[NG_TEMP_TOKEN_PATH] = null;
  1452. throw e;
  1453. }
  1454. };
  1455. /**
  1456. * @return {?}
  1457. */
  1458. StaticInjector.prototype.toString = /**
  1459. * @return {?}
  1460. */
  1461. function () {
  1462. var /** @type {?} */ tokens = /** @type {?} */ ([]), /** @type {?} */ records = this._records;
  1463. records.forEach(function (v, token) { return tokens.push(stringify(token)); });
  1464. return "StaticInjector[" + tokens.join(', ') + "]";
  1465. };
  1466. return StaticInjector;
  1467. }());
  1468. /**
  1469. * @param {?} provider
  1470. * @return {?}
  1471. */
  1472. function resolveProvider(provider) {
  1473. var /** @type {?} */ deps = computeDeps(provider);
  1474. var /** @type {?} */ fn = IDENT;
  1475. var /** @type {?} */ value = EMPTY;
  1476. var /** @type {?} */ useNew = false;
  1477. var /** @type {?} */ provide = resolveForwardRef(provider.provide);
  1478. if (USE_VALUE in provider) {
  1479. // We need to use USE_VALUE in provider since provider.useValue could be defined as undefined.
  1480. value = (/** @type {?} */ (provider)).useValue;
  1481. }
  1482. else if ((/** @type {?} */ (provider)).useFactory) {
  1483. fn = (/** @type {?} */ (provider)).useFactory;
  1484. }
  1485. else if ((/** @type {?} */ (provider)).useExisting) {
  1486. // Just use IDENT
  1487. }
  1488. else if ((/** @type {?} */ (provider)).useClass) {
  1489. useNew = true;
  1490. fn = resolveForwardRef((/** @type {?} */ (provider)).useClass);
  1491. }
  1492. else if (typeof provide == 'function') {
  1493. useNew = true;
  1494. fn = provide;
  1495. }
  1496. else {
  1497. throw staticError('StaticProvider does not have [useValue|useFactory|useExisting|useClass] or [provide] is not newable', provider);
  1498. }
  1499. return { deps: deps, fn: fn, useNew: useNew, value: value };
  1500. }
  1501. /**
  1502. * @param {?} token
  1503. * @return {?}
  1504. */
  1505. function multiProviderMixError(token) {
  1506. return staticError('Cannot mix multi providers and regular providers', token);
  1507. }
  1508. /**
  1509. * @param {?} records
  1510. * @param {?} provider
  1511. * @return {?}
  1512. */
  1513. function recursivelyProcessProviders(records, provider) {
  1514. if (provider) {
  1515. provider = resolveForwardRef(provider);
  1516. if (provider instanceof Array) {
  1517. // if we have an array recurse into the array
  1518. for (var /** @type {?} */ i = 0; i < provider.length; i++) {
  1519. recursivelyProcessProviders(records, provider[i]);
  1520. }
  1521. }
  1522. else if (typeof provider === 'function') {
  1523. // Functions were supported in ReflectiveInjector, but are not here. For safety give useful
  1524. // error messages
  1525. throw staticError('Function/Class not supported', provider);
  1526. }
  1527. else if (provider && typeof provider === 'object' && provider.provide) {
  1528. // At this point we have what looks like a provider: {provide: ?, ....}
  1529. var /** @type {?} */ token = resolveForwardRef(provider.provide);
  1530. var /** @type {?} */ resolvedProvider = resolveProvider(provider);
  1531. if (provider.multi === true) {
  1532. // This is a multi provider.
  1533. var /** @type {?} */ multiProvider = records.get(token);
  1534. if (multiProvider) {
  1535. if (multiProvider.fn !== MULTI_PROVIDER_FN) {
  1536. throw multiProviderMixError(token);
  1537. }
  1538. }
  1539. else {
  1540. // Create a placeholder factory which will look up the constituents of the multi provider.
  1541. records.set(token, multiProvider = /** @type {?} */ ({
  1542. token: provider.provide,
  1543. deps: [],
  1544. useNew: false,
  1545. fn: MULTI_PROVIDER_FN,
  1546. value: EMPTY
  1547. }));
  1548. }
  1549. // Treat the provider as the token.
  1550. token = provider;
  1551. multiProvider.deps.push({ token: token, options: 6 /* Default */ });
  1552. }
  1553. var /** @type {?} */ record = records.get(token);
  1554. if (record && record.fn == MULTI_PROVIDER_FN) {
  1555. throw multiProviderMixError(token);
  1556. }
  1557. records.set(token, resolvedProvider);
  1558. }
  1559. else {
  1560. throw staticError('Unexpected provider', provider);
  1561. }
  1562. }
  1563. }
  1564. /**
  1565. * @param {?} token
  1566. * @param {?} record
  1567. * @param {?} records
  1568. * @param {?} parent
  1569. * @param {?} notFoundValue
  1570. * @return {?}
  1571. */
  1572. function tryResolveToken(token, record, records, parent, notFoundValue) {
  1573. try {
  1574. return resolveToken(token, record, records, parent, notFoundValue);
  1575. }
  1576. catch (/** @type {?} */ e) {
  1577. // ensure that 'e' is of type Error.
  1578. if (!(e instanceof Error)) {
  1579. e = new Error(e);
  1580. }
  1581. var /** @type {?} */ path = e[NG_TEMP_TOKEN_PATH] = e[NG_TEMP_TOKEN_PATH] || [];
  1582. path.unshift(token);
  1583. if (record && record.value == CIRCULAR) {
  1584. // Reset the Circular flag.
  1585. record.value = EMPTY;
  1586. }
  1587. throw e;
  1588. }
  1589. }
  1590. /**
  1591. * @param {?} token
  1592. * @param {?} record
  1593. * @param {?} records
  1594. * @param {?} parent
  1595. * @param {?} notFoundValue
  1596. * @return {?}
  1597. */
  1598. function resolveToken(token, record, records, parent, notFoundValue) {
  1599. var /** @type {?} */ value;
  1600. if (record) {
  1601. // If we don't have a record, this implies that we don't own the provider hence don't know how
  1602. // to resolve it.
  1603. value = record.value;
  1604. if (value == CIRCULAR) {
  1605. throw Error(NO_NEW_LINE + 'Circular dependency');
  1606. }
  1607. else if (value === EMPTY) {
  1608. record.value = CIRCULAR;
  1609. var /** @type {?} */ obj = undefined;
  1610. var /** @type {?} */ useNew = record.useNew;
  1611. var /** @type {?} */ fn = record.fn;
  1612. var /** @type {?} */ depRecords = record.deps;
  1613. var /** @type {?} */ deps = EMPTY;
  1614. if (depRecords.length) {
  1615. deps = [];
  1616. for (var /** @type {?} */ i = 0; i < depRecords.length; i++) {
  1617. var /** @type {?} */ depRecord = depRecords[i];
  1618. var /** @type {?} */ options = depRecord.options;
  1619. var /** @type {?} */ childRecord = options & 2 /* CheckSelf */ ? records.get(depRecord.token) : undefined;
  1620. deps.push(tryResolveToken(
  1621. // Current Token to resolve
  1622. depRecord.token, childRecord, records,
  1623. // If we don't know how to resolve dependency and we should not check parent for it,
  1624. // than pass in Null injector.
  1625. !childRecord && !(options & 4 /* CheckParent */) ? NULL_INJECTOR : parent, options & 1 /* Optional */ ? null : Injector.THROW_IF_NOT_FOUND));
  1626. }
  1627. }
  1628. record.value = value = useNew ? new ((_a = (/** @type {?} */ (fn))).bind.apply(_a, [void 0].concat(deps)))() : fn.apply(obj, deps);
  1629. }
  1630. }
  1631. else {
  1632. value = parent.get(token, notFoundValue);
  1633. }
  1634. return value;
  1635. var _a;
  1636. }
  1637. /**
  1638. * @param {?} provider
  1639. * @return {?}
  1640. */
  1641. function computeDeps(provider) {
  1642. var /** @type {?} */ deps = EMPTY;
  1643. var /** @type {?} */ providerDeps = (/** @type {?} */ (provider)).deps;
  1644. if (providerDeps && providerDeps.length) {
  1645. deps = [];
  1646. for (var /** @type {?} */ i = 0; i < providerDeps.length; i++) {
  1647. var /** @type {?} */ options = 6;
  1648. var /** @type {?} */ token = resolveForwardRef(providerDeps[i]);
  1649. if (token instanceof Array) {
  1650. for (var /** @type {?} */ j = 0, /** @type {?} */ annotations = token; j < annotations.length; j++) {
  1651. var /** @type {?} */ annotation = annotations[j];
  1652. if (annotation instanceof Optional || annotation == Optional) {
  1653. options = options | 1 /* Optional */;
  1654. }
  1655. else if (annotation instanceof SkipSelf || annotation == SkipSelf) {
  1656. options = options & ~2 /* CheckSelf */;
  1657. }
  1658. else if (annotation instanceof Self || annotation == Self) {
  1659. options = options & ~4 /* CheckParent */;
  1660. }
  1661. else if (annotation instanceof Inject) {
  1662. token = (/** @type {?} */ (annotation)).token;
  1663. }
  1664. else {
  1665. token = resolveForwardRef(annotation);
  1666. }
  1667. }
  1668. }
  1669. deps.push({ token: token, options: options });
  1670. }
  1671. }
  1672. else if ((/** @type {?} */ (provider)).useExisting) {
  1673. var /** @type {?} */ token = resolveForwardRef((/** @type {?} */ (provider)).useExisting);
  1674. deps = [{ token: token, options: 6 /* Default */ }];
  1675. }
  1676. else if (!providerDeps && !(USE_VALUE in provider)) {
  1677. // useValue & useExisting are the only ones which are exempt from deps all others need it.
  1678. throw staticError('\'deps\' required', provider);
  1679. }
  1680. return deps;
  1681. }
  1682. /**
  1683. * @param {?} text
  1684. * @param {?} obj
  1685. * @param {?=} source
  1686. * @return {?}
  1687. */
  1688. function formatError(text, obj, source) {
  1689. if (source === void 0) { source = null; }
  1690. text = text && text.charAt(0) === '\n' && text.charAt(1) == NO_NEW_LINE ? text.substr(2) : text;
  1691. var /** @type {?} */ context = stringify(obj);
  1692. if (obj instanceof Array) {
  1693. context = obj.map(stringify).join(' -> ');
  1694. }
  1695. else if (typeof obj === 'object') {
  1696. var /** @type {?} */ parts = /** @type {?} */ ([]);
  1697. for (var /** @type {?} */ key in obj) {
  1698. if (obj.hasOwnProperty(key)) {
  1699. var /** @type {?} */ value = obj[key];
  1700. parts.push(key + ':' + (typeof value === 'string' ? JSON.stringify(value) : stringify(value)));
  1701. }
  1702. }
  1703. context = "{" + parts.join(', ') + "}";
  1704. }
  1705. return "StaticInjectorError" + (source ? '(' + source + ')' : '') + "[" + context + "]: " + text.replace(NEW_LINE, '\n ');
  1706. }
  1707. /**
  1708. * @param {?} text
  1709. * @param {?} obj
  1710. * @return {?}
  1711. */
  1712. function staticError(text, obj) {
  1713. return new Error(formatError(text, obj));
  1714. }
  1715. /**
  1716. * @template T
  1717. * @param {?} objWithPropertyToExtract
  1718. * @return {?}
  1719. */
  1720. function getClosureSafeProperty(objWithPropertyToExtract) {
  1721. for (var /** @type {?} */ key in objWithPropertyToExtract) {
  1722. if (objWithPropertyToExtract[key] === GET_PROPERTY_NAME) {
  1723. return key;
  1724. }
  1725. }
  1726. throw Error('!prop');
  1727. }
  1728. /**
  1729. * @fileoverview added by tsickle
  1730. * @suppress {checkTypes} checked by tsc
  1731. */
  1732. /**
  1733. * @license
  1734. * Copyright Google Inc. All Rights Reserved.
  1735. *
  1736. * Use of this source code is governed by an MIT-style license that can be
  1737. * found in the LICENSE file at https://angular.io/license
  1738. */
  1739. var ERROR_DEBUG_CONTEXT = 'ngDebugContext';
  1740. var ERROR_ORIGINAL_ERROR = 'ngOriginalError';
  1741. var ERROR_LOGGER = 'ngErrorLogger';
  1742. /**
  1743. * @param {?} error
  1744. * @return {?}
  1745. */
  1746. /**
  1747. * @param {?} error
  1748. * @return {?}
  1749. */
  1750. function getDebugContext(error) {
  1751. return (/** @type {?} */ (error))[ERROR_DEBUG_CONTEXT];
  1752. }
  1753. /**
  1754. * @param {?} error
  1755. * @return {?}
  1756. */
  1757. function getOriginalError(error) {
  1758. return (/** @type {?} */ (error))[ERROR_ORIGINAL_ERROR];
  1759. }
  1760. /**
  1761. * @param {?} error
  1762. * @return {?}
  1763. */
  1764. function getErrorLogger(error) {
  1765. return (/** @type {?} */ (error))[ERROR_LOGGER] || defaultErrorLogger;
  1766. }
  1767. /**
  1768. * @param {?} console
  1769. * @param {...?} values
  1770. * @return {?}
  1771. */
  1772. function defaultErrorLogger(console) {
  1773. var values = [];
  1774. for (var _i = 1; _i < arguments.length; _i++) {
  1775. values[_i - 1] = arguments[_i];
  1776. }
  1777. console.error.apply(console, values);
  1778. }
  1779. /**
  1780. * @fileoverview added by tsickle
  1781. * @suppress {checkTypes} checked by tsc
  1782. */
  1783. /**
  1784. * @license
  1785. * Copyright Google Inc. All Rights Reserved.
  1786. *
  1787. * Use of this source code is governed by an MIT-style license that can be
  1788. * found in the LICENSE file at https://angular.io/license
  1789. */
  1790. /**
  1791. * \@whatItDoes Provides a hook for centralized exception handling.
  1792. *
  1793. * \@description
  1794. *
  1795. * The default implementation of `ErrorHandler` prints error messages to the `console`. To
  1796. * intercept error handling, write a custom exception handler that replaces this default as
  1797. * appropriate for your app.
  1798. *
  1799. * ### Example
  1800. *
  1801. * ```
  1802. * class MyErrorHandler implements ErrorHandler {
  1803. * handleError(error) {
  1804. * // do something with the exception
  1805. * }
  1806. * }
  1807. *
  1808. * \@NgModule({
  1809. * providers: [{provide: ErrorHandler, useClass: MyErrorHandler}]
  1810. * })
  1811. * class MyModule {}
  1812. * ```
  1813. *
  1814. * \@stable
  1815. */
  1816. var ErrorHandler = /** @class */ (function () {
  1817. function ErrorHandler() {
  1818. /**
  1819. * \@internal
  1820. */
  1821. this._console = console;
  1822. }
  1823. /**
  1824. * @param {?} error
  1825. * @return {?}
  1826. */
  1827. ErrorHandler.prototype.handleError = /**
  1828. * @param {?} error
  1829. * @return {?}
  1830. */
  1831. function (error) {
  1832. var /** @type {?} */ originalError = this._findOriginalError(error);
  1833. var /** @type {?} */ context = this._findContext(error);
  1834. // Note: Browser consoles show the place from where console.error was called.
  1835. // We can use this to give users additional information about the error.
  1836. var /** @type {?} */ errorLogger = getErrorLogger(error);
  1837. errorLogger(this._console, "ERROR", error);
  1838. if (originalError) {
  1839. errorLogger(this._console, "ORIGINAL ERROR", originalError);
  1840. }
  1841. if (context) {
  1842. errorLogger(this._console, 'ERROR CONTEXT', context);
  1843. }
  1844. };
  1845. /** @internal */
  1846. /**
  1847. * \@internal
  1848. * @param {?} error
  1849. * @return {?}
  1850. */
  1851. ErrorHandler.prototype._findContext = /**
  1852. * \@internal
  1853. * @param {?} error
  1854. * @return {?}
  1855. */
  1856. function (error) {
  1857. if (error) {
  1858. return getDebugContext(error) ? getDebugContext(error) :
  1859. this._findContext(getOriginalError(error));
  1860. }
  1861. return null;
  1862. };
  1863. /** @internal */
  1864. /**
  1865. * \@internal
  1866. * @param {?} error
  1867. * @return {?}
  1868. */
  1869. ErrorHandler.prototype._findOriginalError = /**
  1870. * \@internal
  1871. * @param {?} error
  1872. * @return {?}
  1873. */
  1874. function (error) {
  1875. var /** @type {?} */ e = getOriginalError(error);
  1876. while (e && getOriginalError(e)) {
  1877. e = getOriginalError(e);
  1878. }
  1879. return e;
  1880. };
  1881. return ErrorHandler;
  1882. }());
  1883. /**
  1884. * @param {?} message
  1885. * @param {?} originalError
  1886. * @return {?}
  1887. */
  1888. function wrappedError(message, originalError) {
  1889. var /** @type {?} */ msg = message + " caused by: " + (originalError instanceof Error ? originalError.message : originalError);
  1890. var /** @type {?} */ error = Error(msg);
  1891. (/** @type {?} */ (error))[ERROR_ORIGINAL_ERROR] = originalError;
  1892. return error;
  1893. }
  1894. /**
  1895. * @fileoverview added by tsickle
  1896. * @suppress {checkTypes} checked by tsc
  1897. */
  1898. /**
  1899. * @license
  1900. * Copyright Google Inc. All Rights Reserved.
  1901. *
  1902. * Use of this source code is governed by an MIT-style license that can be
  1903. * found in the LICENSE file at https://angular.io/license
  1904. */
  1905. /**
  1906. * @param {?} keys
  1907. * @return {?}
  1908. */
  1909. function findFirstClosedCycle(keys) {
  1910. var /** @type {?} */ res = [];
  1911. for (var /** @type {?} */ i = 0; i < keys.length; ++i) {
  1912. if (res.indexOf(keys[i]) > -1) {
  1913. res.push(keys[i]);
  1914. return res;
  1915. }
  1916. res.push(keys[i]);
  1917. }
  1918. return res;
  1919. }
  1920. /**
  1921. * @param {?} keys
  1922. * @return {?}
  1923. */
  1924. function constructResolvingPath(keys) {
  1925. if (keys.length > 1) {
  1926. var /** @type {?} */ reversed = findFirstClosedCycle(keys.slice().reverse());
  1927. var /** @type {?} */ tokenStrs = reversed.map(function (k) { return stringify(k.token); });
  1928. return ' (' + tokenStrs.join(' -> ') + ')';
  1929. }
  1930. return '';
  1931. }
  1932. /**
  1933. * @record
  1934. */
  1935. /**
  1936. * @param {?} injector
  1937. * @param {?} key
  1938. * @param {?} constructResolvingMessage
  1939. * @param {?=} originalError
  1940. * @return {?}
  1941. */
  1942. function injectionError(injector, key, constructResolvingMessage, originalError) {
  1943. var /** @type {?} */ keys = [key];
  1944. var /** @type {?} */ errMsg = constructResolvingMessage(keys);
  1945. var /** @type {?} */ error = /** @type {?} */ ((originalError ? wrappedError(errMsg, originalError) : Error(errMsg)));
  1946. error.addKey = addKey;
  1947. error.keys = keys;
  1948. error.injectors = [injector];
  1949. error.constructResolvingMessage = constructResolvingMessage;
  1950. (/** @type {?} */ (error))[ERROR_ORIGINAL_ERROR] = originalError;
  1951. return error;
  1952. }
  1953. /**
  1954. * @this {?}
  1955. * @param {?} injector
  1956. * @param {?} key
  1957. * @return {?}
  1958. */
  1959. function addKey(injector, key) {
  1960. this.injectors.push(injector);
  1961. this.keys.push(key);
  1962. // Note: This updated message won't be reflected in the `.stack` property
  1963. this.message = this.constructResolvingMessage(this.keys);
  1964. }
  1965. /**
  1966. * Thrown when trying to retrieve a dependency by key from {\@link Injector}, but the
  1967. * {\@link Injector} does not have a {\@link Provider} for the given key.
  1968. *
  1969. * ### Example ([live demo](http://plnkr.co/edit/vq8D3FRB9aGbnWJqtEPE?p=preview))
  1970. *
  1971. * ```typescript
  1972. * class A {
  1973. * constructor(b:B) {}
  1974. * }
  1975. *
  1976. * expect(() => Injector.resolveAndCreate([A])).toThrowError();
  1977. * ```
  1978. * @param {?} injector
  1979. * @param {?} key
  1980. * @return {?}
  1981. */
  1982. function noProviderError(injector, key) {
  1983. return injectionError(injector, key, function (keys) {
  1984. var /** @type {?} */ first = stringify(keys[0].token);
  1985. return "No provider for " + first + "!" + constructResolvingPath(keys);
  1986. });
  1987. }
  1988. /**
  1989. * Thrown when dependencies form a cycle.
  1990. *
  1991. * ### Example ([live demo](http://plnkr.co/edit/wYQdNos0Tzql3ei1EV9j?p=info))
  1992. *
  1993. * ```typescript
  1994. * var injector = Injector.resolveAndCreate([
  1995. * {provide: "one", useFactory: (two) => "two", deps: [[new Inject("two")]]},
  1996. * {provide: "two", useFactory: (one) => "one", deps: [[new Inject("one")]]}
  1997. * ]);
  1998. *
  1999. * expect(() => injector.get("one")).toThrowError();
  2000. * ```
  2001. *
  2002. * Retrieving `A` or `B` throws a `CyclicDependencyError` as the graph above cannot be constructed.
  2003. * @param {?} injector
  2004. * @param {?} key
  2005. * @return {?}
  2006. */
  2007. function cyclicDependencyError(injector, key) {
  2008. return injectionError(injector, key, function (keys) {
  2009. return "Cannot instantiate cyclic dependency!" + constructResolvingPath(keys);
  2010. });
  2011. }
  2012. /**
  2013. * Thrown when a constructing type returns with an Error.
  2014. *
  2015. * The `InstantiationError` class contains the original error plus the dependency graph which caused
  2016. * this object to be instantiated.
  2017. *
  2018. * ### Example ([live demo](http://plnkr.co/edit/7aWYdcqTQsP0eNqEdUAf?p=preview))
  2019. *
  2020. * ```typescript
  2021. * class A {
  2022. * constructor() {
  2023. * throw new Error('message');
  2024. * }
  2025. * }
  2026. *
  2027. * var injector = Injector.resolveAndCreate([A]);
  2028. * try {
  2029. * injector.get(A);
  2030. * } catch (e) {
  2031. * expect(e instanceof InstantiationError).toBe(true);
  2032. * expect(e.originalException.message).toEqual("message");
  2033. * expect(e.originalStack).toBeDefined();
  2034. * }
  2035. * ```
  2036. * @param {?} injector
  2037. * @param {?} originalException
  2038. * @param {?} originalStack
  2039. * @param {?} key
  2040. * @return {?}
  2041. */
  2042. function instantiationError(injector, originalException, originalStack, key) {
  2043. return injectionError(injector, key, function (keys) {
  2044. var /** @type {?} */ first = stringify(keys[0].token);
  2045. return originalException.message + ": Error during instantiation of " + first + "!" + constructResolvingPath(keys) + ".";
  2046. }, originalException);
  2047. }
  2048. /**
  2049. * Thrown when an object other then {\@link Provider} (or `Type`) is passed to {\@link Injector}
  2050. * creation.
  2051. *
  2052. * ### Example ([live demo](http://plnkr.co/edit/YatCFbPAMCL0JSSQ4mvH?p=preview))
  2053. *
  2054. * ```typescript
  2055. * expect(() => Injector.resolveAndCreate(["not a type"])).toThrowError();
  2056. * ```
  2057. * @param {?} provider
  2058. * @return {?}
  2059. */
  2060. function invalidProviderError(provider) {
  2061. return Error("Invalid provider - only instances of Provider and Type are allowed, got: " + provider);
  2062. }
  2063. /**
  2064. * Thrown when the class has no annotation information.
  2065. *
  2066. * Lack of annotation information prevents the {\@link Injector} from determining which dependencies
  2067. * need to be injected into the constructor.
  2068. *
  2069. * ### Example ([live demo](http://plnkr.co/edit/rHnZtlNS7vJOPQ6pcVkm?p=preview))
  2070. *
  2071. * ```typescript
  2072. * class A {
  2073. * constructor(b) {}
  2074. * }
  2075. *
  2076. * expect(() => Injector.resolveAndCreate([A])).toThrowError();
  2077. * ```
  2078. *
  2079. * This error is also thrown when the class not marked with {\@link Injectable} has parameter types.
  2080. *
  2081. * ```typescript
  2082. * class B {}
  2083. *
  2084. * class A {
  2085. * constructor(b:B) {} // no information about the parameter types of A is available at runtime.
  2086. * }
  2087. *
  2088. * expect(() => Injector.resolveAndCreate([A,B])).toThrowError();
  2089. * ```
  2090. * \@stable
  2091. * @param {?} typeOrFunc
  2092. * @param {?} params
  2093. * @return {?}
  2094. */
  2095. function noAnnotationError(typeOrFunc, params) {
  2096. var /** @type {?} */ signature = [];
  2097. for (var /** @type {?} */ i = 0, /** @type {?} */ ii = params.length; i < ii; i++) {
  2098. var /** @type {?} */ parameter = params[i];
  2099. if (!parameter || parameter.length == 0) {
  2100. signature.push('?');
  2101. }
  2102. else {
  2103. signature.push(parameter.map(stringify).join(' '));
  2104. }
  2105. }
  2106. return Error('Cannot resolve all parameters for \'' + stringify(typeOrFunc) + '\'(' +
  2107. signature.join(', ') + '). ' +
  2108. 'Make sure that all the parameters are decorated with Inject or have valid type annotations and that \'' +
  2109. stringify(typeOrFunc) + '\' is decorated with Injectable.');
  2110. }
  2111. /**
  2112. * Thrown when getting an object by index.
  2113. *
  2114. * ### Example ([live demo](http://plnkr.co/edit/bRs0SX2OTQiJzqvjgl8P?p=preview))
  2115. *
  2116. * ```typescript
  2117. * class A {}
  2118. *
  2119. * var injector = Injector.resolveAndCreate([A]);
  2120. *
  2121. * expect(() => injector.getAt(100)).toThrowError();
  2122. * ```
  2123. * \@stable
  2124. * @param {?} index
  2125. * @return {?}
  2126. */
  2127. function outOfBoundsError(index) {
  2128. return Error("Index " + index + " is out-of-bounds.");
  2129. }
  2130. /**
  2131. * Thrown when a multi provider and a regular provider are bound to the same token.
  2132. *
  2133. * ### Example
  2134. *
  2135. * ```typescript
  2136. * expect(() => Injector.resolveAndCreate([
  2137. * { provide: "Strings", useValue: "string1", multi: true},
  2138. * { provide: "Strings", useValue: "string2", multi: false}
  2139. * ])).toThrowError();
  2140. * ```
  2141. * @param {?} provider1
  2142. * @param {?} provider2
  2143. * @return {?}
  2144. */
  2145. function mixingMultiProvidersWithRegularProvidersError(provider1, provider2) {
  2146. return Error("Cannot mix multi providers and regular providers, got: " + provider1 + " " + provider2);
  2147. }
  2148. /**
  2149. * @fileoverview added by tsickle
  2150. * @suppress {checkTypes} checked by tsc
  2151. */
  2152. /**
  2153. * @license
  2154. * Copyright Google Inc. All Rights Reserved.
  2155. *
  2156. * Use of this source code is governed by an MIT-style license that can be
  2157. * found in the LICENSE file at https://angular.io/license
  2158. */
  2159. /**
  2160. * A unique object used for retrieving items from the {\@link ReflectiveInjector}.
  2161. *
  2162. * Keys have:
  2163. * - a system-wide unique `id`.
  2164. * - a `token`.
  2165. *
  2166. * `Key` is used internally by {\@link ReflectiveInjector} because its system-wide unique `id` allows
  2167. * the
  2168. * injector to store created objects in a more efficient way.
  2169. *
  2170. * `Key` should not be created directly. {\@link ReflectiveInjector} creates keys automatically when
  2171. * resolving
  2172. * providers.
  2173. * @deprecated No replacement
  2174. */
  2175. var ReflectiveKey = /** @class */ (function () {
  2176. /**
  2177. * Private
  2178. */
  2179. function ReflectiveKey(token, id) {
  2180. this.token = token;
  2181. this.id = id;
  2182. if (!token) {
  2183. throw new Error('Token must be defined!');
  2184. }
  2185. this.displayName = stringify(this.token);
  2186. }
  2187. /**
  2188. * Retrieves a `Key` for a token.
  2189. */
  2190. /**
  2191. * Retrieves a `Key` for a token.
  2192. * @param {?} token
  2193. * @return {?}
  2194. */
  2195. ReflectiveKey.get = /**
  2196. * Retrieves a `Key` for a token.
  2197. * @param {?} token
  2198. * @return {?}
  2199. */
  2200. function (token) {
  2201. return _globalKeyRegistry.get(resolveForwardRef(token));
  2202. };
  2203. Object.defineProperty(ReflectiveKey, "numberOfKeys", {
  2204. /**
  2205. * @returns the number of keys registered in the system.
  2206. */
  2207. get: /**
  2208. * @return {?} the number of keys registered in the system.
  2209. */
  2210. function () { return _globalKeyRegistry.numberOfKeys; },
  2211. enumerable: true,
  2212. configurable: true
  2213. });
  2214. return ReflectiveKey;
  2215. }());
  2216. var KeyRegistry = /** @class */ (function () {
  2217. function KeyRegistry() {
  2218. this._allKeys = new Map();
  2219. }
  2220. /**
  2221. * @param {?} token
  2222. * @return {?}
  2223. */
  2224. KeyRegistry.prototype.get = /**
  2225. * @param {?} token
  2226. * @return {?}
  2227. */
  2228. function (token) {
  2229. if (token instanceof ReflectiveKey)
  2230. return token;
  2231. if (this._allKeys.has(token)) {
  2232. return /** @type {?} */ ((this._allKeys.get(token)));
  2233. }
  2234. var /** @type {?} */ newKey = new ReflectiveKey(token, ReflectiveKey.numberOfKeys);
  2235. this._allKeys.set(token, newKey);
  2236. return newKey;
  2237. };
  2238. Object.defineProperty(KeyRegistry.prototype, "numberOfKeys", {
  2239. get: /**
  2240. * @return {?}
  2241. */
  2242. function () { return this._allKeys.size; },
  2243. enumerable: true,
  2244. configurable: true
  2245. });
  2246. return KeyRegistry;
  2247. }());
  2248. var _globalKeyRegistry = new KeyRegistry();
  2249. /**
  2250. * @fileoverview added by tsickle
  2251. * @suppress {checkTypes} checked by tsc
  2252. */
  2253. /**
  2254. * @license
  2255. * Copyright Google Inc. All Rights Reserved.
  2256. *
  2257. * Use of this source code is governed by an MIT-style license that can be
  2258. * found in the LICENSE file at https://angular.io/license
  2259. */
  2260. /**
  2261. * \@whatItDoes Represents a type that a Component or other object is instances of.
  2262. *
  2263. * \@description
  2264. *
  2265. * An example of a `Type` is `MyCustomComponent` class, which in JavaScript is be represented by
  2266. * the `MyCustomComponent` constructor function.
  2267. *
  2268. * \@stable
  2269. */
  2270. var Type = Function;
  2271. /**
  2272. * @param {?} v
  2273. * @return {?}
  2274. */
  2275. function isType(v) {
  2276. return typeof v === 'function';
  2277. }
  2278. /**
  2279. * @fileoverview added by tsickle
  2280. * @suppress {checkTypes} checked by tsc
  2281. */
  2282. /**
  2283. * @license
  2284. * Copyright Google Inc. All Rights Reserved.
  2285. *
  2286. * Use of this source code is governed by an MIT-style license that can be
  2287. * found in the LICENSE file at https://angular.io/license
  2288. */
  2289. /**
  2290. * Attention: These regex has to hold even if the code is minified!
  2291. */
  2292. var DELEGATE_CTOR = /^function\s+\S+\(\)\s*{[\s\S]+\.apply\(this,\s*arguments\)/;
  2293. var INHERITED_CLASS = /^class\s+[A-Za-z\d$_]*\s*extends\s+[A-Za-z\d$_]+\s*{/;
  2294. var INHERITED_CLASS_WITH_CTOR = /^class\s+[A-Za-z\d$_]*\s*extends\s+[A-Za-z\d$_]+\s*{[\s\S]*constructor\s*\(/;
  2295. var ReflectionCapabilities = /** @class */ (function () {
  2296. function ReflectionCapabilities(reflect) {
  2297. this._reflect = reflect || _global['Reflect'];
  2298. }
  2299. /**
  2300. * @return {?}
  2301. */
  2302. ReflectionCapabilities.prototype.isReflectionEnabled = /**
  2303. * @return {?}
  2304. */
  2305. function () { return true; };
  2306. /**
  2307. * @template T
  2308. * @param {?} t
  2309. * @return {?}
  2310. */
  2311. ReflectionCapabilities.prototype.factory = /**
  2312. * @template T
  2313. * @param {?} t
  2314. * @return {?}
  2315. */
  2316. function (t) { return function () {
  2317. var args = [];
  2318. for (var _i = 0; _i < arguments.length; _i++) {
  2319. args[_i] = arguments[_i];
  2320. }
  2321. return new (t.bind.apply(t, [void 0].concat(args)))();
  2322. }; };
  2323. /** @internal */
  2324. /**
  2325. * \@internal
  2326. * @param {?} paramTypes
  2327. * @param {?} paramAnnotations
  2328. * @return {?}
  2329. */
  2330. ReflectionCapabilities.prototype._zipTypesAndAnnotations = /**
  2331. * \@internal
  2332. * @param {?} paramTypes
  2333. * @param {?} paramAnnotations
  2334. * @return {?}
  2335. */
  2336. function (paramTypes, paramAnnotations) {
  2337. var /** @type {?} */ result;
  2338. if (typeof paramTypes === 'undefined') {
  2339. result = new Array(paramAnnotations.length);
  2340. }
  2341. else {
  2342. result = new Array(paramTypes.length);
  2343. }
  2344. for (var /** @type {?} */ i = 0; i < result.length; i++) {
  2345. // TS outputs Object for parameters without types, while Traceur omits
  2346. // the annotations. For now we preserve the Traceur behavior to aid
  2347. // migration, but this can be revisited.
  2348. if (typeof paramTypes === 'undefined') {
  2349. result[i] = [];
  2350. }
  2351. else if (paramTypes[i] != Object) {
  2352. result[i] = [paramTypes[i]];
  2353. }
  2354. else {
  2355. result[i] = [];
  2356. }
  2357. if (paramAnnotations && paramAnnotations[i] != null) {
  2358. result[i] = result[i].concat(paramAnnotations[i]);
  2359. }
  2360. }
  2361. return result;
  2362. };
  2363. /**
  2364. * @param {?} type
  2365. * @param {?} parentCtor
  2366. * @return {?}
  2367. */
  2368. ReflectionCapabilities.prototype._ownParameters = /**
  2369. * @param {?} type
  2370. * @param {?} parentCtor
  2371. * @return {?}
  2372. */
  2373. function (type, parentCtor) {
  2374. var /** @type {?} */ typeStr = type.toString();
  2375. // If we have no decorators, we only have function.length as metadata.
  2376. // In that case, to detect whether a child class declared an own constructor or not,
  2377. // we need to look inside of that constructor to check whether it is
  2378. // just calling the parent.
  2379. // This also helps to work around for https://github.com/Microsoft/TypeScript/issues/12439
  2380. // that sets 'design:paramtypes' to []
  2381. // if a class inherits from another class but has no ctor declared itself.
  2382. if (DELEGATE_CTOR.exec(typeStr) ||
  2383. (INHERITED_CLASS.exec(typeStr) && !INHERITED_CLASS_WITH_CTOR.exec(typeStr))) {
  2384. return null;
  2385. }
  2386. // Prefer the direct API.
  2387. if ((/** @type {?} */ (type)).parameters && (/** @type {?} */ (type)).parameters !== parentCtor.parameters) {
  2388. return (/** @type {?} */ (type)).parameters;
  2389. }
  2390. // API of tsickle for lowering decorators to properties on the class.
  2391. var /** @type {?} */ tsickleCtorParams = (/** @type {?} */ (type)).ctorParameters;
  2392. if (tsickleCtorParams && tsickleCtorParams !== parentCtor.ctorParameters) {
  2393. // Newer tsickle uses a function closure
  2394. // Retain the non-function case for compatibility with older tsickle
  2395. var /** @type {?} */ ctorParameters = typeof tsickleCtorParams === 'function' ? tsickleCtorParams() : tsickleCtorParams;
  2396. var /** @type {?} */ paramTypes_1 = ctorParameters.map(function (ctorParam) { return ctorParam && ctorParam.type; });
  2397. var /** @type {?} */ paramAnnotations_1 = ctorParameters.map(function (ctorParam) {
  2398. return ctorParam && convertTsickleDecoratorIntoMetadata(ctorParam.decorators);
  2399. });
  2400. return this._zipTypesAndAnnotations(paramTypes_1, paramAnnotations_1);
  2401. }
  2402. // API for metadata created by invoking the decorators.
  2403. var /** @type {?} */ paramAnnotations = type.hasOwnProperty(PARAMETERS) && (/** @type {?} */ (type))[PARAMETERS];
  2404. var /** @type {?} */ paramTypes = this._reflect && this._reflect.getOwnMetadata &&
  2405. this._reflect.getOwnMetadata('design:paramtypes', type);
  2406. if (paramTypes || paramAnnotations) {
  2407. return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);
  2408. }
  2409. // If a class has no decorators, at least create metadata
  2410. // based on function.length.
  2411. // Note: We know that this is a real constructor as we checked
  2412. // the content of the constructor above.
  2413. return new Array((/** @type {?} */ (type.length))).fill(undefined);
  2414. };
  2415. /**
  2416. * @param {?} type
  2417. * @return {?}
  2418. */
  2419. ReflectionCapabilities.prototype.parameters = /**
  2420. * @param {?} type
  2421. * @return {?}
  2422. */
  2423. function (type) {
  2424. // Note: only report metadata if we have at least one class decorator
  2425. // to stay in sync with the static reflector.
  2426. if (!isType(type)) {
  2427. return [];
  2428. }
  2429. var /** @type {?} */ parentCtor = getParentCtor(type);
  2430. var /** @type {?} */ parameters = this._ownParameters(type, parentCtor);
  2431. if (!parameters && parentCtor !== Object) {
  2432. parameters = this.parameters(parentCtor);
  2433. }
  2434. return parameters || [];
  2435. };
  2436. /**
  2437. * @param {?} typeOrFunc
  2438. * @param {?} parentCtor
  2439. * @return {?}
  2440. */
  2441. ReflectionCapabilities.prototype._ownAnnotations = /**
  2442. * @param {?} typeOrFunc
  2443. * @param {?} parentCtor
  2444. * @return {?}
  2445. */
  2446. function (typeOrFunc, parentCtor) {
  2447. // Prefer the direct API.
  2448. if ((/** @type {?} */ (typeOrFunc)).annotations && (/** @type {?} */ (typeOrFunc)).annotations !== parentCtor.annotations) {
  2449. var /** @type {?} */ annotations = (/** @type {?} */ (typeOrFunc)).annotations;
  2450. if (typeof annotations === 'function' && annotations.annotations) {
  2451. annotations = annotations.annotations;
  2452. }
  2453. return annotations;
  2454. }
  2455. // API of tsickle for lowering decorators to properties on the class.
  2456. if ((/** @type {?} */ (typeOrFunc)).decorators && (/** @type {?} */ (typeOrFunc)).decorators !== parentCtor.decorators) {
  2457. return convertTsickleDecoratorIntoMetadata((/** @type {?} */ (typeOrFunc)).decorators);
  2458. }
  2459. // API for metadata created by invoking the decorators.
  2460. if (typeOrFunc.hasOwnProperty(ANNOTATIONS)) {
  2461. return (/** @type {?} */ (typeOrFunc))[ANNOTATIONS];
  2462. }
  2463. return null;
  2464. };
  2465. /**
  2466. * @param {?} typeOrFunc
  2467. * @return {?}
  2468. */
  2469. ReflectionCapabilities.prototype.annotations = /**
  2470. * @param {?} typeOrFunc
  2471. * @return {?}
  2472. */
  2473. function (typeOrFunc) {
  2474. if (!isType(typeOrFunc)) {
  2475. return [];
  2476. }
  2477. var /** @type {?} */ parentCtor = getParentCtor(typeOrFunc);
  2478. var /** @type {?} */ ownAnnotations = this._ownAnnotations(typeOrFunc, parentCtor) || [];
  2479. var /** @type {?} */ parentAnnotations = parentCtor !== Object ? this.annotations(parentCtor) : [];
  2480. return parentAnnotations.concat(ownAnnotations);
  2481. };
  2482. /**
  2483. * @param {?} typeOrFunc
  2484. * @param {?} parentCtor
  2485. * @return {?}
  2486. */
  2487. ReflectionCapabilities.prototype._ownPropMetadata = /**
  2488. * @param {?} typeOrFunc
  2489. * @param {?} parentCtor
  2490. * @return {?}
  2491. */
  2492. function (typeOrFunc, parentCtor) {
  2493. // Prefer the direct API.
  2494. if ((/** @type {?} */ (typeOrFunc)).propMetadata &&
  2495. (/** @type {?} */ (typeOrFunc)).propMetadata !== parentCtor.propMetadata) {
  2496. var /** @type {?} */ propMetadata = (/** @type {?} */ (typeOrFunc)).propMetadata;
  2497. if (typeof propMetadata === 'function' && propMetadata.propMetadata) {
  2498. propMetadata = propMetadata.propMetadata;
  2499. }
  2500. return propMetadata;
  2501. }
  2502. // API of tsickle for lowering decorators to properties on the class.
  2503. if ((/** @type {?} */ (typeOrFunc)).propDecorators &&
  2504. (/** @type {?} */ (typeOrFunc)).propDecorators !== parentCtor.propDecorators) {
  2505. var /** @type {?} */ propDecorators_1 = (/** @type {?} */ (typeOrFunc)).propDecorators;
  2506. var /** @type {?} */ propMetadata_1 = /** @type {?} */ ({});
  2507. Object.keys(propDecorators_1).forEach(function (prop) {
  2508. propMetadata_1[prop] = convertTsickleDecoratorIntoMetadata(propDecorators_1[prop]);
  2509. });
  2510. return propMetadata_1;
  2511. }
  2512. // API for metadata created by invoking the decorators.
  2513. if (typeOrFunc.hasOwnProperty(PROP_METADATA)) {
  2514. return (/** @type {?} */ (typeOrFunc))[PROP_METADATA];
  2515. }
  2516. return null;
  2517. };
  2518. /**
  2519. * @param {?} typeOrFunc
  2520. * @return {?}
  2521. */
  2522. ReflectionCapabilities.prototype.propMetadata = /**
  2523. * @param {?} typeOrFunc
  2524. * @return {?}
  2525. */
  2526. function (typeOrFunc) {
  2527. if (!isType(typeOrFunc)) {
  2528. return {};
  2529. }
  2530. var /** @type {?} */ parentCtor = getParentCtor(typeOrFunc);
  2531. var /** @type {?} */ propMetadata = {};
  2532. if (parentCtor !== Object) {
  2533. var /** @type {?} */ parentPropMetadata_1 = this.propMetadata(parentCtor);
  2534. Object.keys(parentPropMetadata_1).forEach(function (propName) {
  2535. propMetadata[propName] = parentPropMetadata_1[propName];
  2536. });
  2537. }
  2538. var /** @type {?} */ ownPropMetadata = this._ownPropMetadata(typeOrFunc, parentCtor);
  2539. if (ownPropMetadata) {
  2540. Object.keys(ownPropMetadata).forEach(function (propName) {
  2541. var /** @type {?} */ decorators = [];
  2542. if (propMetadata.hasOwnProperty(propName)) {
  2543. decorators.push.apply(decorators, propMetadata[propName]);
  2544. }
  2545. decorators.push.apply(decorators, ownPropMetadata[propName]);
  2546. propMetadata[propName] = decorators;
  2547. });
  2548. }
  2549. return propMetadata;
  2550. };
  2551. /**
  2552. * @param {?} type
  2553. * @param {?} lcProperty
  2554. * @return {?}
  2555. */
  2556. ReflectionCapabilities.prototype.hasLifecycleHook = /**
  2557. * @param {?} type
  2558. * @param {?} lcProperty
  2559. * @return {?}
  2560. */
  2561. function (type, lcProperty) {
  2562. return type instanceof Type && lcProperty in type.prototype;
  2563. };
  2564. /**
  2565. * @param {?} type
  2566. * @return {?}
  2567. */
  2568. ReflectionCapabilities.prototype.guards = /**
  2569. * @param {?} type
  2570. * @return {?}
  2571. */
  2572. function (type) { return {}; };
  2573. /**
  2574. * @param {?} name
  2575. * @return {?}
  2576. */
  2577. ReflectionCapabilities.prototype.getter = /**
  2578. * @param {?} name
  2579. * @return {?}
  2580. */
  2581. function (name) { return /** @type {?} */ (new Function('o', 'return o.' + name + ';')); };
  2582. /**
  2583. * @param {?} name
  2584. * @return {?}
  2585. */
  2586. ReflectionCapabilities.prototype.setter = /**
  2587. * @param {?} name
  2588. * @return {?}
  2589. */
  2590. function (name) {
  2591. return /** @type {?} */ (new Function('o', 'v', 'return o.' + name + ' = v;'));
  2592. };
  2593. /**
  2594. * @param {?} name
  2595. * @return {?}
  2596. */
  2597. ReflectionCapabilities.prototype.method = /**
  2598. * @param {?} name
  2599. * @return {?}
  2600. */
  2601. function (name) {
  2602. var /** @type {?} */ functionBody = "if (!o." + name + ") throw new Error('\"" + name + "\" is undefined');\n return o." + name + ".apply(o, args);";
  2603. return /** @type {?} */ (new Function('o', 'args', functionBody));
  2604. };
  2605. // There is not a concept of import uri in Js, but this is useful in developing Dart applications.
  2606. /**
  2607. * @param {?} type
  2608. * @return {?}
  2609. */
  2610. ReflectionCapabilities.prototype.importUri = /**
  2611. * @param {?} type
  2612. * @return {?}
  2613. */
  2614. function (type) {
  2615. // StaticSymbol
  2616. if (typeof type === 'object' && type['filePath']) {
  2617. return type['filePath'];
  2618. }
  2619. // Runtime type
  2620. return "./" + stringify(type);
  2621. };
  2622. /**
  2623. * @param {?} type
  2624. * @return {?}
  2625. */
  2626. ReflectionCapabilities.prototype.resourceUri = /**
  2627. * @param {?} type
  2628. * @return {?}
  2629. */
  2630. function (type) { return "./" + stringify(type); };
  2631. /**
  2632. * @param {?} name
  2633. * @param {?} moduleUrl
  2634. * @param {?} members
  2635. * @param {?} runtime
  2636. * @return {?}
  2637. */
  2638. ReflectionCapabilities.prototype.resolveIdentifier = /**
  2639. * @param {?} name
  2640. * @param {?} moduleUrl
  2641. * @param {?} members
  2642. * @param {?} runtime
  2643. * @return {?}
  2644. */
  2645. function (name, moduleUrl, members, runtime) {
  2646. return runtime;
  2647. };
  2648. /**
  2649. * @param {?} enumIdentifier
  2650. * @param {?} name
  2651. * @return {?}
  2652. */
  2653. ReflectionCapabilities.prototype.resolveEnum = /**
  2654. * @param {?} enumIdentifier
  2655. * @param {?} name
  2656. * @return {?}
  2657. */
  2658. function (enumIdentifier, name) { return enumIdentifier[name]; };
  2659. return ReflectionCapabilities;
  2660. }());
  2661. /**
  2662. * @param {?} decoratorInvocations
  2663. * @return {?}
  2664. */
  2665. function convertTsickleDecoratorIntoMetadata(decoratorInvocations) {
  2666. if (!decoratorInvocations) {
  2667. return [];
  2668. }
  2669. return decoratorInvocations.map(function (decoratorInvocation) {
  2670. var /** @type {?} */ decoratorType = decoratorInvocation.type;
  2671. var /** @type {?} */ annotationCls = decoratorType.annotationCls;
  2672. var /** @type {?} */ annotationArgs = decoratorInvocation.args ? decoratorInvocation.args : [];
  2673. return new (annotationCls.bind.apply(annotationCls, [void 0].concat(annotationArgs)))();
  2674. });
  2675. }
  2676. /**
  2677. * @param {?} ctor
  2678. * @return {?}
  2679. */
  2680. function getParentCtor(ctor) {
  2681. var /** @type {?} */ parentProto = ctor.prototype ? Object.getPrototypeOf(ctor.prototype) : null;
  2682. var /** @type {?} */ parentCtor = parentProto ? parentProto.constructor : null;
  2683. // Note: We always use `Object` as the null value
  2684. // to simplify checking later on.
  2685. return parentCtor || Object;
  2686. }
  2687. /**
  2688. * @fileoverview added by tsickle
  2689. * @suppress {checkTypes} checked by tsc
  2690. */
  2691. /**
  2692. * @license
  2693. * Copyright Google Inc. All Rights Reserved.
  2694. *
  2695. * Use of this source code is governed by an MIT-style license that can be
  2696. * found in the LICENSE file at https://angular.io/license
  2697. */
  2698. /**
  2699. * Provides access to reflection data about symbols. Used internally by Angular
  2700. * to power dependency injection and compilation.
  2701. */
  2702. var Reflector = /** @class */ (function () {
  2703. function Reflector(reflectionCapabilities) {
  2704. this.reflectionCapabilities = reflectionCapabilities;
  2705. }
  2706. /**
  2707. * @param {?} caps
  2708. * @return {?}
  2709. */
  2710. Reflector.prototype.updateCapabilities = /**
  2711. * @param {?} caps
  2712. * @return {?}
  2713. */
  2714. function (caps) { this.reflectionCapabilities = caps; };
  2715. /**
  2716. * @param {?} type
  2717. * @return {?}
  2718. */
  2719. Reflector.prototype.factory = /**
  2720. * @param {?} type
  2721. * @return {?}
  2722. */
  2723. function (type) { return this.reflectionCapabilities.factory(type); };
  2724. /**
  2725. * @param {?} typeOrFunc
  2726. * @return {?}
  2727. */
  2728. Reflector.prototype.parameters = /**
  2729. * @param {?} typeOrFunc
  2730. * @return {?}
  2731. */
  2732. function (typeOrFunc) {
  2733. return this.reflectionCapabilities.parameters(typeOrFunc);
  2734. };
  2735. /**
  2736. * @param {?} typeOrFunc
  2737. * @return {?}
  2738. */
  2739. Reflector.prototype.annotations = /**
  2740. * @param {?} typeOrFunc
  2741. * @return {?}
  2742. */
  2743. function (typeOrFunc) {
  2744. return this.reflectionCapabilities.annotations(typeOrFunc);
  2745. };
  2746. /**
  2747. * @param {?} typeOrFunc
  2748. * @return {?}
  2749. */
  2750. Reflector.prototype.propMetadata = /**
  2751. * @param {?} typeOrFunc
  2752. * @return {?}
  2753. */
  2754. function (typeOrFunc) {
  2755. return this.reflectionCapabilities.propMetadata(typeOrFunc);
  2756. };
  2757. /**
  2758. * @param {?} type
  2759. * @param {?} lcProperty
  2760. * @return {?}
  2761. */
  2762. Reflector.prototype.hasLifecycleHook = /**
  2763. * @param {?} type
  2764. * @param {?} lcProperty
  2765. * @return {?}
  2766. */
  2767. function (type, lcProperty) {
  2768. return this.reflectionCapabilities.hasLifecycleHook(type, lcProperty);
  2769. };
  2770. /**
  2771. * @param {?} name
  2772. * @return {?}
  2773. */
  2774. Reflector.prototype.getter = /**
  2775. * @param {?} name
  2776. * @return {?}
  2777. */
  2778. function (name) { return this.reflectionCapabilities.getter(name); };
  2779. /**
  2780. * @param {?} name
  2781. * @return {?}
  2782. */
  2783. Reflector.prototype.setter = /**
  2784. * @param {?} name
  2785. * @return {?}
  2786. */
  2787. function (name) { return this.reflectionCapabilities.setter(name); };
  2788. /**
  2789. * @param {?} name
  2790. * @return {?}
  2791. */
  2792. Reflector.prototype.method = /**
  2793. * @param {?} name
  2794. * @return {?}
  2795. */
  2796. function (name) { return this.reflectionCapabilities.method(name); };
  2797. /**
  2798. * @param {?} type
  2799. * @return {?}
  2800. */
  2801. Reflector.prototype.importUri = /**
  2802. * @param {?} type
  2803. * @return {?}
  2804. */
  2805. function (type) { return this.reflectionCapabilities.importUri(type); };
  2806. /**
  2807. * @param {?} type
  2808. * @return {?}
  2809. */
  2810. Reflector.prototype.resourceUri = /**
  2811. * @param {?} type
  2812. * @return {?}
  2813. */
  2814. function (type) { return this.reflectionCapabilities.resourceUri(type); };
  2815. /**
  2816. * @param {?} name
  2817. * @param {?} moduleUrl
  2818. * @param {?} members
  2819. * @param {?} runtime
  2820. * @return {?}
  2821. */
  2822. Reflector.prototype.resolveIdentifier = /**
  2823. * @param {?} name
  2824. * @param {?} moduleUrl
  2825. * @param {?} members
  2826. * @param {?} runtime
  2827. * @return {?}
  2828. */
  2829. function (name, moduleUrl, members, runtime) {
  2830. return this.reflectionCapabilities.resolveIdentifier(name, moduleUrl, members, runtime);
  2831. };
  2832. /**
  2833. * @param {?} identifier
  2834. * @param {?} name
  2835. * @return {?}
  2836. */
  2837. Reflector.prototype.resolveEnum = /**
  2838. * @param {?} identifier
  2839. * @param {?} name
  2840. * @return {?}
  2841. */
  2842. function (identifier, name) {
  2843. return this.reflectionCapabilities.resolveEnum(identifier, name);
  2844. };
  2845. return Reflector;
  2846. }());
  2847. /**
  2848. * @fileoverview added by tsickle
  2849. * @suppress {checkTypes} checked by tsc
  2850. */
  2851. /**
  2852. * @license
  2853. * Copyright Google Inc. All Rights Reserved.
  2854. *
  2855. * Use of this source code is governed by an MIT-style license that can be
  2856. * found in the LICENSE file at https://angular.io/license
  2857. */
  2858. /**
  2859. * The {\@link Reflector} used internally in Angular to access metadata
  2860. * about symbols.
  2861. */
  2862. var reflector = new Reflector(new ReflectionCapabilities());
  2863. /**
  2864. * @fileoverview added by tsickle
  2865. * @suppress {checkTypes} checked by tsc
  2866. */
  2867. /**
  2868. * @license
  2869. * Copyright Google Inc. All Rights Reserved.
  2870. *
  2871. * Use of this source code is governed by an MIT-style license that can be
  2872. * found in the LICENSE file at https://angular.io/license
  2873. */
  2874. /**
  2875. * `Dependency` is used by the framework to extend DI.
  2876. * This is internal to Angular and should not be used directly.
  2877. */
  2878. var ReflectiveDependency = /** @class */ (function () {
  2879. function ReflectiveDependency(key, optional, visibility) {
  2880. this.key = key;
  2881. this.optional = optional;
  2882. this.visibility = visibility;
  2883. }
  2884. /**
  2885. * @param {?} key
  2886. * @return {?}
  2887. */
  2888. ReflectiveDependency.fromKey = /**
  2889. * @param {?} key
  2890. * @return {?}
  2891. */
  2892. function (key) {
  2893. return new ReflectiveDependency(key, false, null);
  2894. };
  2895. return ReflectiveDependency;
  2896. }());
  2897. var _EMPTY_LIST = [];
  2898. /**
  2899. * An internal resolved representation of a {\@link Provider} used by the {\@link Injector}.
  2900. *
  2901. * It is usually created automatically by `Injector.resolveAndCreate`.
  2902. *
  2903. * It can be created manually, as follows:
  2904. *
  2905. * ### Example ([live demo](http://plnkr.co/edit/RfEnhh8kUEI0G3qsnIeT?p%3Dpreview&p=preview))
  2906. *
  2907. * ```typescript
  2908. * var resolvedProviders = Injector.resolve([{ provide: 'message', useValue: 'Hello' }]);
  2909. * var injector = Injector.fromResolvedProviders(resolvedProviders);
  2910. *
  2911. * expect(injector.get('message')).toEqual('Hello');
  2912. * ```
  2913. *
  2914. * \@experimental
  2915. * @record
  2916. */
  2917. var ResolvedReflectiveProvider_ = /** @class */ (function () {
  2918. function ResolvedReflectiveProvider_(key, resolvedFactories, multiProvider) {
  2919. this.key = key;
  2920. this.resolvedFactories = resolvedFactories;
  2921. this.multiProvider = multiProvider;
  2922. this.resolvedFactory = this.resolvedFactories[0];
  2923. }
  2924. return ResolvedReflectiveProvider_;
  2925. }());
  2926. /**
  2927. * An internal resolved representation of a factory function created by resolving {\@link
  2928. * Provider}.
  2929. * \@experimental
  2930. */
  2931. var ResolvedReflectiveFactory = /** @class */ (function () {
  2932. function ResolvedReflectiveFactory(factory, dependencies) {
  2933. this.factory = factory;
  2934. this.dependencies = dependencies;
  2935. }
  2936. return ResolvedReflectiveFactory;
  2937. }());
  2938. /**
  2939. * Resolve a single provider.
  2940. * @param {?} provider
  2941. * @return {?}
  2942. */
  2943. function resolveReflectiveFactory(provider) {
  2944. var /** @type {?} */ factoryFn;
  2945. var /** @type {?} */ resolvedDeps;
  2946. if (provider.useClass) {
  2947. var /** @type {?} */ useClass = resolveForwardRef(provider.useClass);
  2948. factoryFn = reflector.factory(useClass);
  2949. resolvedDeps = _dependenciesFor(useClass);
  2950. }
  2951. else if (provider.useExisting) {
  2952. factoryFn = function (aliasInstance) { return aliasInstance; };
  2953. resolvedDeps = [ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))];
  2954. }
  2955. else if (provider.useFactory) {
  2956. factoryFn = provider.useFactory;
  2957. resolvedDeps = constructDependencies(provider.useFactory, provider.deps);
  2958. }
  2959. else {
  2960. factoryFn = function () { return provider.useValue; };
  2961. resolvedDeps = _EMPTY_LIST;
  2962. }
  2963. return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);
  2964. }
  2965. /**
  2966. * Converts the {\@link Provider} into {\@link ResolvedProvider}.
  2967. *
  2968. * {\@link Injector} internally only uses {\@link ResolvedProvider}, {\@link Provider} contains
  2969. * convenience provider syntax.
  2970. * @param {?} provider
  2971. * @return {?}
  2972. */
  2973. function resolveReflectiveProvider(provider) {
  2974. return new ResolvedReflectiveProvider_(ReflectiveKey.get(provider.provide), [resolveReflectiveFactory(provider)], provider.multi || false);
  2975. }
  2976. /**
  2977. * Resolve a list of Providers.
  2978. * @param {?} providers
  2979. * @return {?}
  2980. */
  2981. function resolveReflectiveProviders(providers) {
  2982. var /** @type {?} */ normalized = _normalizeProviders(providers, []);
  2983. var /** @type {?} */ resolved = normalized.map(resolveReflectiveProvider);
  2984. var /** @type {?} */ resolvedProviderMap = mergeResolvedReflectiveProviders(resolved, new Map());
  2985. return Array.from(resolvedProviderMap.values());
  2986. }
  2987. /**
  2988. * Merges a list of ResolvedProviders into a list where
  2989. * each key is contained exactly once and multi providers
  2990. * have been merged.
  2991. * @param {?} providers
  2992. * @param {?} normalizedProvidersMap
  2993. * @return {?}
  2994. */
  2995. function mergeResolvedReflectiveProviders(providers, normalizedProvidersMap) {
  2996. for (var /** @type {?} */ i = 0; i < providers.length; i++) {
  2997. var /** @type {?} */ provider = providers[i];
  2998. var /** @type {?} */ existing = normalizedProvidersMap.get(provider.key.id);
  2999. if (existing) {
  3000. if (provider.multiProvider !== existing.multiProvider) {
  3001. throw mixingMultiProvidersWithRegularProvidersError(existing, provider);
  3002. }
  3003. if (provider.multiProvider) {
  3004. for (var /** @type {?} */ j = 0; j < provider.resolvedFactories.length; j++) {
  3005. existing.resolvedFactories.push(provider.resolvedFactories[j]);
  3006. }
  3007. }
  3008. else {
  3009. normalizedProvidersMap.set(provider.key.id, provider);
  3010. }
  3011. }
  3012. else {
  3013. var /** @type {?} */ resolvedProvider = void 0;
  3014. if (provider.multiProvider) {
  3015. resolvedProvider = new ResolvedReflectiveProvider_(provider.key, provider.resolvedFactories.slice(), provider.multiProvider);
  3016. }
  3017. else {
  3018. resolvedProvider = provider;
  3019. }
  3020. normalizedProvidersMap.set(provider.key.id, resolvedProvider);
  3021. }
  3022. }
  3023. return normalizedProvidersMap;
  3024. }
  3025. /**
  3026. * @param {?} providers
  3027. * @param {?} res
  3028. * @return {?}
  3029. */
  3030. function _normalizeProviders(providers, res) {
  3031. providers.forEach(function (b) {
  3032. if (b instanceof Type) {
  3033. res.push({ provide: b, useClass: b });
  3034. }
  3035. else if (b && typeof b == 'object' && (/** @type {?} */ (b)).provide !== undefined) {
  3036. res.push(/** @type {?} */ (b));
  3037. }
  3038. else if (b instanceof Array) {
  3039. _normalizeProviders(b, res);
  3040. }
  3041. else {
  3042. throw invalidProviderError(b);
  3043. }
  3044. });
  3045. return res;
  3046. }
  3047. /**
  3048. * @param {?} typeOrFunc
  3049. * @param {?=} dependencies
  3050. * @return {?}
  3051. */
  3052. function constructDependencies(typeOrFunc, dependencies) {
  3053. if (!dependencies) {
  3054. return _dependenciesFor(typeOrFunc);
  3055. }
  3056. else {
  3057. var /** @type {?} */ params_1 = dependencies.map(function (t) { return [t]; });
  3058. return dependencies.map(function (t) { return _extractToken(typeOrFunc, t, params_1); });
  3059. }
  3060. }
  3061. /**
  3062. * @param {?} typeOrFunc
  3063. * @return {?}
  3064. */
  3065. function _dependenciesFor(typeOrFunc) {
  3066. var /** @type {?} */ params = reflector.parameters(typeOrFunc);
  3067. if (!params)
  3068. return [];
  3069. if (params.some(function (p) { return p == null; })) {
  3070. throw noAnnotationError(typeOrFunc, params);
  3071. }
  3072. return params.map(function (p) { return _extractToken(typeOrFunc, p, params); });
  3073. }
  3074. /**
  3075. * @param {?} typeOrFunc
  3076. * @param {?} metadata
  3077. * @param {?} params
  3078. * @return {?}
  3079. */
  3080. function _extractToken(typeOrFunc, metadata, params) {
  3081. var /** @type {?} */ token = null;
  3082. var /** @type {?} */ optional = false;
  3083. if (!Array.isArray(metadata)) {
  3084. if (metadata instanceof Inject) {
  3085. return _createDependency(metadata.token, optional, null);
  3086. }
  3087. else {
  3088. return _createDependency(metadata, optional, null);
  3089. }
  3090. }
  3091. var /** @type {?} */ visibility = null;
  3092. for (var /** @type {?} */ i = 0; i < metadata.length; ++i) {
  3093. var /** @type {?} */ paramMetadata = metadata[i];
  3094. if (paramMetadata instanceof Type) {
  3095. token = paramMetadata;
  3096. }
  3097. else if (paramMetadata instanceof Inject) {
  3098. token = paramMetadata.token;
  3099. }
  3100. else if (paramMetadata instanceof Optional) {
  3101. optional = true;
  3102. }
  3103. else if (paramMetadata instanceof Self || paramMetadata instanceof SkipSelf) {
  3104. visibility = paramMetadata;
  3105. }
  3106. else if (paramMetadata instanceof InjectionToken) {
  3107. token = paramMetadata;
  3108. }
  3109. }
  3110. token = resolveForwardRef(token);
  3111. if (token != null) {
  3112. return _createDependency(token, optional, visibility);
  3113. }
  3114. else {
  3115. throw noAnnotationError(typeOrFunc, params);
  3116. }
  3117. }
  3118. /**
  3119. * @param {?} token
  3120. * @param {?} optional
  3121. * @param {?} visibility
  3122. * @return {?}
  3123. */
  3124. function _createDependency(token, optional, visibility) {
  3125. return new ReflectiveDependency(ReflectiveKey.get(token), optional, visibility);
  3126. }
  3127. /**
  3128. * @fileoverview added by tsickle
  3129. * @suppress {checkTypes} checked by tsc
  3130. */
  3131. /**
  3132. * @license
  3133. * Copyright Google Inc. All Rights Reserved.
  3134. *
  3135. * Use of this source code is governed by an MIT-style license that can be
  3136. * found in the LICENSE file at https://angular.io/license
  3137. */
  3138. // Threshold for the dynamic version
  3139. var UNDEFINED = new Object();
  3140. /**
  3141. * A ReflectiveDependency injection container used for instantiating objects and resolving
  3142. * dependencies.
  3143. *
  3144. * An `Injector` is a replacement for a `new` operator, which can automatically resolve the
  3145. * constructor dependencies.
  3146. *
  3147. * In typical use, application code asks for the dependencies in the constructor and they are
  3148. * resolved by the `Injector`.
  3149. *
  3150. * ### Example ([live demo](http://plnkr.co/edit/jzjec0?p=preview))
  3151. *
  3152. * The following example creates an `Injector` configured to create `Engine` and `Car`.
  3153. *
  3154. * ```typescript
  3155. * \@Injectable()
  3156. * class Engine {
  3157. * }
  3158. *
  3159. * \@Injectable()
  3160. * class Car {
  3161. * constructor(public engine:Engine) {}
  3162. * }
  3163. *
  3164. * var injector = ReflectiveInjector.resolveAndCreate([Car, Engine]);
  3165. * var car = injector.get(Car);
  3166. * expect(car instanceof Car).toBe(true);
  3167. * expect(car.engine instanceof Engine).toBe(true);
  3168. * ```
  3169. *
  3170. * Notice, we don't use the `new` operator because we explicitly want to have the `Injector`
  3171. * resolve all of the object's dependencies automatically.
  3172. *
  3173. * @deprecated from v5 - slow and brings in a lot of code, Use `Injector.create` instead.
  3174. * @abstract
  3175. */
  3176. var ReflectiveInjector = /** @class */ (function () {
  3177. function ReflectiveInjector() {
  3178. }
  3179. /**
  3180. * Turns an array of provider definitions into an array of resolved providers.
  3181. *
  3182. * A resolution is a process of flattening multiple nested arrays and converting individual
  3183. * providers into an array of {@link ResolvedReflectiveProvider}s.
  3184. *
  3185. * ### Example ([live demo](http://plnkr.co/edit/AiXTHi?p=preview))
  3186. *
  3187. * ```typescript
  3188. * @Injectable()
  3189. * class Engine {
  3190. * }
  3191. *
  3192. * @Injectable()
  3193. * class Car {
  3194. * constructor(public engine:Engine) {}
  3195. * }
  3196. *
  3197. * var providers = ReflectiveInjector.resolve([Car, [[Engine]]]);
  3198. *
  3199. * expect(providers.length).toEqual(2);
  3200. *
  3201. * expect(providers[0] instanceof ResolvedReflectiveProvider).toBe(true);
  3202. * expect(providers[0].key.displayName).toBe("Car");
  3203. * expect(providers[0].dependencies.length).toEqual(1);
  3204. * expect(providers[0].factory).toBeDefined();
  3205. *
  3206. * expect(providers[1].key.displayName).toBe("Engine");
  3207. * });
  3208. * ```
  3209. *
  3210. * See {@link ReflectiveInjector#fromResolvedProviders fromResolvedProviders} for more info.
  3211. */
  3212. /**
  3213. * Turns an array of provider definitions into an array of resolved providers.
  3214. *
  3215. * A resolution is a process of flattening multiple nested arrays and converting individual
  3216. * providers into an array of {\@link ResolvedReflectiveProvider}s.
  3217. *
  3218. * ### Example ([live demo](http://plnkr.co/edit/AiXTHi?p=preview))
  3219. *
  3220. * ```typescript
  3221. * \@Injectable()
  3222. * class Engine {
  3223. * }
  3224. *
  3225. * \@Injectable()
  3226. * class Car {
  3227. * constructor(public engine:Engine) {}
  3228. * }
  3229. *
  3230. * var providers = ReflectiveInjector.resolve([Car, [[Engine]]]);
  3231. *
  3232. * expect(providers.length).toEqual(2);
  3233. *
  3234. * expect(providers[0] instanceof ResolvedReflectiveProvider).toBe(true);
  3235. * expect(providers[0].key.displayName).toBe("Car");
  3236. * expect(providers[0].dependencies.length).toEqual(1);
  3237. * expect(providers[0].factory).toBeDefined();
  3238. *
  3239. * expect(providers[1].key.displayName).toBe("Engine");
  3240. * });
  3241. * ```
  3242. *
  3243. * See {\@link ReflectiveInjector#fromResolvedProviders fromResolvedProviders} for more info.
  3244. * @param {?} providers
  3245. * @return {?}
  3246. */
  3247. ReflectiveInjector.resolve = /**
  3248. * Turns an array of provider definitions into an array of resolved providers.
  3249. *
  3250. * A resolution is a process of flattening multiple nested arrays and converting individual
  3251. * providers into an array of {\@link ResolvedReflectiveProvider}s.
  3252. *
  3253. * ### Example ([live demo](http://plnkr.co/edit/AiXTHi?p=preview))
  3254. *
  3255. * ```typescript
  3256. * \@Injectable()
  3257. * class Engine {
  3258. * }
  3259. *
  3260. * \@Injectable()
  3261. * class Car {
  3262. * constructor(public engine:Engine) {}
  3263. * }
  3264. *
  3265. * var providers = ReflectiveInjector.resolve([Car, [[Engine]]]);
  3266. *
  3267. * expect(providers.length).toEqual(2);
  3268. *
  3269. * expect(providers[0] instanceof ResolvedReflectiveProvider).toBe(true);
  3270. * expect(providers[0].key.displayName).toBe("Car");
  3271. * expect(providers[0].dependencies.length).toEqual(1);
  3272. * expect(providers[0].factory).toBeDefined();
  3273. *
  3274. * expect(providers[1].key.displayName).toBe("Engine");
  3275. * });
  3276. * ```
  3277. *
  3278. * See {\@link ReflectiveInjector#fromResolvedProviders fromResolvedProviders} for more info.
  3279. * @param {?} providers
  3280. * @return {?}
  3281. */
  3282. function (providers) {
  3283. return resolveReflectiveProviders(providers);
  3284. };
  3285. /**
  3286. * Resolves an array of providers and creates an injector from those providers.
  3287. *
  3288. * The passed-in providers can be an array of `Type`, {@link Provider},
  3289. * or a recursive array of more providers.
  3290. *
  3291. * ### Example ([live demo](http://plnkr.co/edit/ePOccA?p=preview))
  3292. *
  3293. * ```typescript
  3294. * @Injectable()
  3295. * class Engine {
  3296. * }
  3297. *
  3298. * @Injectable()
  3299. * class Car {
  3300. * constructor(public engine:Engine) {}
  3301. * }
  3302. *
  3303. * var injector = ReflectiveInjector.resolveAndCreate([Car, Engine]);
  3304. * expect(injector.get(Car) instanceof Car).toBe(true);
  3305. * ```
  3306. *
  3307. * This function is slower than the corresponding `fromResolvedProviders`
  3308. * because it needs to resolve the passed-in providers first.
  3309. * See {@link ReflectiveInjector#resolve resolve} and
  3310. * {@link ReflectiveInjector#fromResolvedProviders fromResolvedProviders}.
  3311. */
  3312. /**
  3313. * Resolves an array of providers and creates an injector from those providers.
  3314. *
  3315. * The passed-in providers can be an array of `Type`, {\@link Provider},
  3316. * or a recursive array of more providers.
  3317. *
  3318. * ### Example ([live demo](http://plnkr.co/edit/ePOccA?p=preview))
  3319. *
  3320. * ```typescript
  3321. * \@Injectable()
  3322. * class Engine {
  3323. * }
  3324. *
  3325. * \@Injectable()
  3326. * class Car {
  3327. * constructor(public engine:Engine) {}
  3328. * }
  3329. *
  3330. * var injector = ReflectiveInjector.resolveAndCreate([Car, Engine]);
  3331. * expect(injector.get(Car) instanceof Car).toBe(true);
  3332. * ```
  3333. *
  3334. * This function is slower than the corresponding `fromResolvedProviders`
  3335. * because it needs to resolve the passed-in providers first.
  3336. * See {\@link ReflectiveInjector#resolve resolve} and
  3337. * {\@link ReflectiveInjector#fromResolvedProviders fromResolvedProviders}.
  3338. * @param {?} providers
  3339. * @param {?=} parent
  3340. * @return {?}
  3341. */
  3342. ReflectiveInjector.resolveAndCreate = /**
  3343. * Resolves an array of providers and creates an injector from those providers.
  3344. *
  3345. * The passed-in providers can be an array of `Type`, {\@link Provider},
  3346. * or a recursive array of more providers.
  3347. *
  3348. * ### Example ([live demo](http://plnkr.co/edit/ePOccA?p=preview))
  3349. *
  3350. * ```typescript
  3351. * \@Injectable()
  3352. * class Engine {
  3353. * }
  3354. *
  3355. * \@Injectable()
  3356. * class Car {
  3357. * constructor(public engine:Engine) {}
  3358. * }
  3359. *
  3360. * var injector = ReflectiveInjector.resolveAndCreate([Car, Engine]);
  3361. * expect(injector.get(Car) instanceof Car).toBe(true);
  3362. * ```
  3363. *
  3364. * This function is slower than the corresponding `fromResolvedProviders`
  3365. * because it needs to resolve the passed-in providers first.
  3366. * See {\@link ReflectiveInjector#resolve resolve} and
  3367. * {\@link ReflectiveInjector#fromResolvedProviders fromResolvedProviders}.
  3368. * @param {?} providers
  3369. * @param {?=} parent
  3370. * @return {?}
  3371. */
  3372. function (providers, parent) {
  3373. var /** @type {?} */ ResolvedReflectiveProviders = ReflectiveInjector.resolve(providers);
  3374. return ReflectiveInjector.fromResolvedProviders(ResolvedReflectiveProviders, parent);
  3375. };
  3376. /**
  3377. * Creates an injector from previously resolved providers.
  3378. *
  3379. * This API is the recommended way to construct injectors in performance-sensitive parts.
  3380. *
  3381. * ### Example ([live demo](http://plnkr.co/edit/KrSMci?p=preview))
  3382. *
  3383. * ```typescript
  3384. * @Injectable()
  3385. * class Engine {
  3386. * }
  3387. *
  3388. * @Injectable()
  3389. * class Car {
  3390. * constructor(public engine:Engine) {}
  3391. * }
  3392. *
  3393. * var providers = ReflectiveInjector.resolve([Car, Engine]);
  3394. * var injector = ReflectiveInjector.fromResolvedProviders(providers);
  3395. * expect(injector.get(Car) instanceof Car).toBe(true);
  3396. * ```
  3397. * @experimental
  3398. */
  3399. /**
  3400. * Creates an injector from previously resolved providers.
  3401. *
  3402. * This API is the recommended way to construct injectors in performance-sensitive parts.
  3403. *
  3404. * ### Example ([live demo](http://plnkr.co/edit/KrSMci?p=preview))
  3405. *
  3406. * ```typescript
  3407. * \@Injectable()
  3408. * class Engine {
  3409. * }
  3410. *
  3411. * \@Injectable()
  3412. * class Car {
  3413. * constructor(public engine:Engine) {}
  3414. * }
  3415. *
  3416. * var providers = ReflectiveInjector.resolve([Car, Engine]);
  3417. * var injector = ReflectiveInjector.fromResolvedProviders(providers);
  3418. * expect(injector.get(Car) instanceof Car).toBe(true);
  3419. * ```
  3420. * \@experimental
  3421. * @param {?} providers
  3422. * @param {?=} parent
  3423. * @return {?}
  3424. */
  3425. ReflectiveInjector.fromResolvedProviders = /**
  3426. * Creates an injector from previously resolved providers.
  3427. *
  3428. * This API is the recommended way to construct injectors in performance-sensitive parts.
  3429. *
  3430. * ### Example ([live demo](http://plnkr.co/edit/KrSMci?p=preview))
  3431. *
  3432. * ```typescript
  3433. * \@Injectable()
  3434. * class Engine {
  3435. * }
  3436. *
  3437. * \@Injectable()
  3438. * class Car {
  3439. * constructor(public engine:Engine) {}
  3440. * }
  3441. *
  3442. * var providers = ReflectiveInjector.resolve([Car, Engine]);
  3443. * var injector = ReflectiveInjector.fromResolvedProviders(providers);
  3444. * expect(injector.get(Car) instanceof Car).toBe(true);
  3445. * ```
  3446. * \@experimental
  3447. * @param {?} providers
  3448. * @param {?=} parent
  3449. * @return {?}
  3450. */
  3451. function (providers, parent) {
  3452. return new ReflectiveInjector_(providers, parent);
  3453. };
  3454. return ReflectiveInjector;
  3455. }());
  3456. var ReflectiveInjector_ = /** @class */ (function () {
  3457. /**
  3458. * Private
  3459. */
  3460. function ReflectiveInjector_(_providers, _parent) {
  3461. /**
  3462. * \@internal
  3463. */
  3464. this._constructionCounter = 0;
  3465. this._providers = _providers;
  3466. this.parent = _parent || null;
  3467. var /** @type {?} */ len = _providers.length;
  3468. this.keyIds = new Array(len);
  3469. this.objs = new Array(len);
  3470. for (var /** @type {?} */ i = 0; i < len; i++) {
  3471. this.keyIds[i] = _providers[i].key.id;
  3472. this.objs[i] = UNDEFINED;
  3473. }
  3474. }
  3475. /**
  3476. * @param {?} token
  3477. * @param {?=} notFoundValue
  3478. * @return {?}
  3479. */
  3480. ReflectiveInjector_.prototype.get = /**
  3481. * @param {?} token
  3482. * @param {?=} notFoundValue
  3483. * @return {?}
  3484. */
  3485. function (token, notFoundValue) {
  3486. if (notFoundValue === void 0) { notFoundValue = THROW_IF_NOT_FOUND; }
  3487. return this._getByKey(ReflectiveKey.get(token), null, notFoundValue);
  3488. };
  3489. /**
  3490. * @param {?} providers
  3491. * @return {?}
  3492. */
  3493. ReflectiveInjector_.prototype.resolveAndCreateChild = /**
  3494. * @param {?} providers
  3495. * @return {?}
  3496. */
  3497. function (providers) {
  3498. var /** @type {?} */ ResolvedReflectiveProviders = ReflectiveInjector.resolve(providers);
  3499. return this.createChildFromResolved(ResolvedReflectiveProviders);
  3500. };
  3501. /**
  3502. * @param {?} providers
  3503. * @return {?}
  3504. */
  3505. ReflectiveInjector_.prototype.createChildFromResolved = /**
  3506. * @param {?} providers
  3507. * @return {?}
  3508. */
  3509. function (providers) {
  3510. var /** @type {?} */ inj = new ReflectiveInjector_(providers);
  3511. (/** @type {?} */ (inj)).parent = this;
  3512. return inj;
  3513. };
  3514. /**
  3515. * @param {?} provider
  3516. * @return {?}
  3517. */
  3518. ReflectiveInjector_.prototype.resolveAndInstantiate = /**
  3519. * @param {?} provider
  3520. * @return {?}
  3521. */
  3522. function (provider) {
  3523. return this.instantiateResolved(ReflectiveInjector.resolve([provider])[0]);
  3524. };
  3525. /**
  3526. * @param {?} provider
  3527. * @return {?}
  3528. */
  3529. ReflectiveInjector_.prototype.instantiateResolved = /**
  3530. * @param {?} provider
  3531. * @return {?}
  3532. */
  3533. function (provider) {
  3534. return this._instantiateProvider(provider);
  3535. };
  3536. /**
  3537. * @param {?} index
  3538. * @return {?}
  3539. */
  3540. ReflectiveInjector_.prototype.getProviderAtIndex = /**
  3541. * @param {?} index
  3542. * @return {?}
  3543. */
  3544. function (index) {
  3545. if (index < 0 || index >= this._providers.length) {
  3546. throw outOfBoundsError(index);
  3547. }
  3548. return this._providers[index];
  3549. };
  3550. /** @internal */
  3551. /**
  3552. * \@internal
  3553. * @param {?} provider
  3554. * @return {?}
  3555. */
  3556. ReflectiveInjector_.prototype._new = /**
  3557. * \@internal
  3558. * @param {?} provider
  3559. * @return {?}
  3560. */
  3561. function (provider) {
  3562. if (this._constructionCounter++ > this._getMaxNumberOfObjects()) {
  3563. throw cyclicDependencyError(this, provider.key);
  3564. }
  3565. return this._instantiateProvider(provider);
  3566. };
  3567. /**
  3568. * @return {?}
  3569. */
  3570. ReflectiveInjector_.prototype._getMaxNumberOfObjects = /**
  3571. * @return {?}
  3572. */
  3573. function () { return this.objs.length; };
  3574. /**
  3575. * @param {?} provider
  3576. * @return {?}
  3577. */
  3578. ReflectiveInjector_.prototype._instantiateProvider = /**
  3579. * @param {?} provider
  3580. * @return {?}
  3581. */
  3582. function (provider) {
  3583. if (provider.multiProvider) {
  3584. var /** @type {?} */ res = new Array(provider.resolvedFactories.length);
  3585. for (var /** @type {?} */ i = 0; i < provider.resolvedFactories.length; ++i) {
  3586. res[i] = this._instantiate(provider, provider.resolvedFactories[i]);
  3587. }
  3588. return res;
  3589. }
  3590. else {
  3591. return this._instantiate(provider, provider.resolvedFactories[0]);
  3592. }
  3593. };
  3594. /**
  3595. * @param {?} provider
  3596. * @param {?} ResolvedReflectiveFactory
  3597. * @return {?}
  3598. */
  3599. ReflectiveInjector_.prototype._instantiate = /**
  3600. * @param {?} provider
  3601. * @param {?} ResolvedReflectiveFactory
  3602. * @return {?}
  3603. */
  3604. function (provider, ResolvedReflectiveFactory$$1) {
  3605. var _this = this;
  3606. var /** @type {?} */ factory = ResolvedReflectiveFactory$$1.factory;
  3607. var /** @type {?} */ deps;
  3608. try {
  3609. deps =
  3610. ResolvedReflectiveFactory$$1.dependencies.map(function (dep) { return _this._getByReflectiveDependency(dep); });
  3611. }
  3612. catch (/** @type {?} */ e) {
  3613. if (e.addKey) {
  3614. e.addKey(this, provider.key);
  3615. }
  3616. throw e;
  3617. }
  3618. var /** @type {?} */ obj;
  3619. try {
  3620. obj = factory.apply(void 0, deps);
  3621. }
  3622. catch (/** @type {?} */ e) {
  3623. throw instantiationError(this, e, e.stack, provider.key);
  3624. }
  3625. return obj;
  3626. };
  3627. /**
  3628. * @param {?} dep
  3629. * @return {?}
  3630. */
  3631. ReflectiveInjector_.prototype._getByReflectiveDependency = /**
  3632. * @param {?} dep
  3633. * @return {?}
  3634. */
  3635. function (dep) {
  3636. return this._getByKey(dep.key, dep.visibility, dep.optional ? null : THROW_IF_NOT_FOUND);
  3637. };
  3638. /**
  3639. * @param {?} key
  3640. * @param {?} visibility
  3641. * @param {?} notFoundValue
  3642. * @return {?}
  3643. */
  3644. ReflectiveInjector_.prototype._getByKey = /**
  3645. * @param {?} key
  3646. * @param {?} visibility
  3647. * @param {?} notFoundValue
  3648. * @return {?}
  3649. */
  3650. function (key, visibility, notFoundValue) {
  3651. if (key === ReflectiveInjector_.INJECTOR_KEY) {
  3652. return this;
  3653. }
  3654. if (visibility instanceof Self) {
  3655. return this._getByKeySelf(key, notFoundValue);
  3656. }
  3657. else {
  3658. return this._getByKeyDefault(key, notFoundValue, visibility);
  3659. }
  3660. };
  3661. /**
  3662. * @param {?} keyId
  3663. * @return {?}
  3664. */
  3665. ReflectiveInjector_.prototype._getObjByKeyId = /**
  3666. * @param {?} keyId
  3667. * @return {?}
  3668. */
  3669. function (keyId) {
  3670. for (var /** @type {?} */ i = 0; i < this.keyIds.length; i++) {
  3671. if (this.keyIds[i] === keyId) {
  3672. if (this.objs[i] === UNDEFINED) {
  3673. this.objs[i] = this._new(this._providers[i]);
  3674. }
  3675. return this.objs[i];
  3676. }
  3677. }
  3678. return UNDEFINED;
  3679. };
  3680. /** @internal */
  3681. /**
  3682. * \@internal
  3683. * @param {?} key
  3684. * @param {?} notFoundValue
  3685. * @return {?}
  3686. */
  3687. ReflectiveInjector_.prototype._throwOrNull = /**
  3688. * \@internal
  3689. * @param {?} key
  3690. * @param {?} notFoundValue
  3691. * @return {?}
  3692. */
  3693. function (key, notFoundValue) {
  3694. if (notFoundValue !== THROW_IF_NOT_FOUND) {
  3695. return notFoundValue;
  3696. }
  3697. else {
  3698. throw noProviderError(this, key);
  3699. }
  3700. };
  3701. /** @internal */
  3702. /**
  3703. * \@internal
  3704. * @param {?} key
  3705. * @param {?} notFoundValue
  3706. * @return {?}
  3707. */
  3708. ReflectiveInjector_.prototype._getByKeySelf = /**
  3709. * \@internal
  3710. * @param {?} key
  3711. * @param {?} notFoundValue
  3712. * @return {?}
  3713. */
  3714. function (key, notFoundValue) {
  3715. var /** @type {?} */ obj = this._getObjByKeyId(key.id);
  3716. return (obj !== UNDEFINED) ? obj : this._throwOrNull(key, notFoundValue);
  3717. };
  3718. /** @internal */
  3719. /**
  3720. * \@internal
  3721. * @param {?} key
  3722. * @param {?} notFoundValue
  3723. * @param {?} visibility
  3724. * @return {?}
  3725. */
  3726. ReflectiveInjector_.prototype._getByKeyDefault = /**
  3727. * \@internal
  3728. * @param {?} key
  3729. * @param {?} notFoundValue
  3730. * @param {?} visibility
  3731. * @return {?}
  3732. */
  3733. function (key, notFoundValue, visibility) {
  3734. var /** @type {?} */ inj;
  3735. if (visibility instanceof SkipSelf) {
  3736. inj = this.parent;
  3737. }
  3738. else {
  3739. inj = this;
  3740. }
  3741. while (inj instanceof ReflectiveInjector_) {
  3742. var /** @type {?} */ inj_ = /** @type {?} */ (inj);
  3743. var /** @type {?} */ obj = inj_._getObjByKeyId(key.id);
  3744. if (obj !== UNDEFINED)
  3745. return obj;
  3746. inj = inj_.parent;
  3747. }
  3748. if (inj !== null) {
  3749. return inj.get(key.token, notFoundValue);
  3750. }
  3751. else {
  3752. return this._throwOrNull(key, notFoundValue);
  3753. }
  3754. };
  3755. Object.defineProperty(ReflectiveInjector_.prototype, "displayName", {
  3756. get: /**
  3757. * @return {?}
  3758. */
  3759. function () {
  3760. var /** @type {?} */ providers = _mapProviders(this, function (b) { return ' "' + b.key.displayName + '" '; })
  3761. .join(', ');
  3762. return "ReflectiveInjector(providers: [" + providers + "])";
  3763. },
  3764. enumerable: true,
  3765. configurable: true
  3766. });
  3767. /**
  3768. * @return {?}
  3769. */
  3770. ReflectiveInjector_.prototype.toString = /**
  3771. * @return {?}
  3772. */
  3773. function () { return this.displayName; };
  3774. ReflectiveInjector_.INJECTOR_KEY = ReflectiveKey.get(Injector);
  3775. return ReflectiveInjector_;
  3776. }());
  3777. /**
  3778. * @param {?} injector
  3779. * @param {?} fn
  3780. * @return {?}
  3781. */
  3782. function _mapProviders(injector, fn) {
  3783. var /** @type {?} */ res = new Array(injector._providers.length);
  3784. for (var /** @type {?} */ i = 0; i < injector._providers.length; ++i) {
  3785. res[i] = fn(injector.getProviderAtIndex(i));
  3786. }
  3787. return res;
  3788. }
  3789. /**
  3790. * @fileoverview added by tsickle
  3791. * @suppress {checkTypes} checked by tsc
  3792. */
  3793. /**
  3794. * @license
  3795. * Copyright Google Inc. All Rights Reserved.
  3796. *
  3797. * Use of this source code is governed by an MIT-style license that can be
  3798. * found in the LICENSE file at https://angular.io/license
  3799. */
  3800. /**
  3801. * @module
  3802. * @description
  3803. * The `di` module provides dependency injection container services.
  3804. */
  3805. /**
  3806. * @fileoverview added by tsickle
  3807. * @suppress {checkTypes} checked by tsc
  3808. */
  3809. /**
  3810. * @license
  3811. * Copyright Google Inc. All Rights Reserved.
  3812. *
  3813. * Use of this source code is governed by an MIT-style license that can be
  3814. * found in the LICENSE file at https://angular.io/license
  3815. */
  3816. /**
  3817. * Determine if the argument is shaped like a Promise
  3818. * @param {?} obj
  3819. * @return {?}
  3820. */
  3821. function isPromise(obj) {
  3822. // allow any Promise/A+ compliant thenable.
  3823. // It's up to the caller to ensure that obj.then conforms to the spec
  3824. return !!obj && typeof obj.then === 'function';
  3825. }
  3826. /**
  3827. * Determine if the argument is an Observable
  3828. * @param {?} obj
  3829. * @return {?}
  3830. */
  3831. function isObservable(obj) {
  3832. // TODO: use Symbol.observable when https://github.com/ReactiveX/rxjs/issues/2415 will be resolved
  3833. return !!obj && typeof obj.subscribe === 'function';
  3834. }
  3835. /**
  3836. * @fileoverview added by tsickle
  3837. * @suppress {checkTypes} checked by tsc
  3838. */
  3839. /**
  3840. * @license
  3841. * Copyright Google Inc. All Rights Reserved.
  3842. *
  3843. * Use of this source code is governed by an MIT-style license that can be
  3844. * found in the LICENSE file at https://angular.io/license
  3845. */
  3846. /**
  3847. * A function that will be executed when an application is initialized.
  3848. * \@experimental
  3849. */
  3850. var APP_INITIALIZER = new InjectionToken('Application Initializer');
  3851. /**
  3852. * A class that reflects the state of running {\@link APP_INITIALIZER}s.
  3853. *
  3854. * \@experimental
  3855. */
  3856. var ApplicationInitStatus = /** @class */ (function () {
  3857. function ApplicationInitStatus(appInits) {
  3858. var _this = this;
  3859. this.appInits = appInits;
  3860. this.initialized = false;
  3861. this.done = false;
  3862. this.donePromise = new Promise(function (res, rej) {
  3863. _this.resolve = res;
  3864. _this.reject = rej;
  3865. });
  3866. }
  3867. /** @internal */
  3868. /**
  3869. * \@internal
  3870. * @return {?}
  3871. */
  3872. ApplicationInitStatus.prototype.runInitializers = /**
  3873. * \@internal
  3874. * @return {?}
  3875. */
  3876. function () {
  3877. var _this = this;
  3878. if (this.initialized) {
  3879. return;
  3880. }
  3881. var /** @type {?} */ asyncInitPromises = [];
  3882. var /** @type {?} */ complete = function () {
  3883. (/** @type {?} */ (_this)).done = true;
  3884. _this.resolve();
  3885. };
  3886. if (this.appInits) {
  3887. for (var /** @type {?} */ i = 0; i < this.appInits.length; i++) {
  3888. var /** @type {?} */ initResult = this.appInits[i]();
  3889. if (isPromise(initResult)) {
  3890. asyncInitPromises.push(initResult);
  3891. }
  3892. }
  3893. }
  3894. Promise.all(asyncInitPromises).then(function () { complete(); }).catch(function (e) { _this.reject(e); });
  3895. if (asyncInitPromises.length === 0) {
  3896. complete();
  3897. }
  3898. this.initialized = true;
  3899. };
  3900. ApplicationInitStatus.decorators = [
  3901. { type: Injectable },
  3902. ];
  3903. /** @nocollapse */
  3904. ApplicationInitStatus.ctorParameters = function () { return [
  3905. { type: Array, decorators: [{ type: Inject, args: [APP_INITIALIZER,] }, { type: Optional },] },
  3906. ]; };
  3907. return ApplicationInitStatus;
  3908. }());
  3909. /**
  3910. * @fileoverview added by tsickle
  3911. * @suppress {checkTypes} checked by tsc
  3912. */
  3913. /**
  3914. * @license
  3915. * Copyright Google Inc. All Rights Reserved.
  3916. *
  3917. * Use of this source code is governed by an MIT-style license that can be
  3918. * found in the LICENSE file at https://angular.io/license
  3919. */
  3920. /**
  3921. * A DI Token representing a unique string id assigned to the application by Angular and used
  3922. * primarily for prefixing application attributes and CSS styles when
  3923. * {\@link ViewEncapsulation#Emulated ViewEncapsulation.Emulated} is being used.
  3924. *
  3925. * If you need to avoid randomly generated value to be used as an application id, you can provide
  3926. * a custom value via a DI provider <!-- TODO: provider --> configuring the root {\@link Injector}
  3927. * using this token.
  3928. * \@experimental
  3929. */
  3930. var APP_ID = new InjectionToken('AppId');
  3931. /**
  3932. * @return {?}
  3933. */
  3934. function _appIdRandomProviderFactory() {
  3935. return "" + _randomChar() + _randomChar() + _randomChar();
  3936. }
  3937. /**
  3938. * Providers that will generate a random APP_ID_TOKEN.
  3939. * \@experimental
  3940. */
  3941. var APP_ID_RANDOM_PROVIDER = {
  3942. provide: APP_ID,
  3943. useFactory: _appIdRandomProviderFactory,
  3944. deps: /** @type {?} */ ([]),
  3945. };
  3946. /**
  3947. * @return {?}
  3948. */
  3949. function _randomChar() {
  3950. return String.fromCharCode(97 + Math.floor(Math.random() * 25));
  3951. }
  3952. /**
  3953. * A function that will be executed when a platform is initialized.
  3954. * \@experimental
  3955. */
  3956. var PLATFORM_INITIALIZER = new InjectionToken('Platform Initializer');
  3957. /**
  3958. * A token that indicates an opaque platform id.
  3959. * \@experimental
  3960. */
  3961. var PLATFORM_ID = new InjectionToken('Platform ID');
  3962. /**
  3963. * All callbacks provided via this token will be called for every component that is bootstrapped.
  3964. * Signature of the callback:
  3965. *
  3966. * `(componentRef: ComponentRef) => void`.
  3967. *
  3968. * \@experimental
  3969. */
  3970. var APP_BOOTSTRAP_LISTENER = new InjectionToken('appBootstrapListener');
  3971. /**
  3972. * A token which indicates the root directory of the application
  3973. * \@experimental
  3974. */
  3975. var PACKAGE_ROOT_URL = new InjectionToken('Application Packages Root URL');
  3976. /**
  3977. * @fileoverview added by tsickle
  3978. * @suppress {checkTypes} checked by tsc
  3979. */
  3980. /**
  3981. * @license
  3982. * Copyright Google Inc. All Rights Reserved.
  3983. *
  3984. * Use of this source code is governed by an MIT-style license that can be
  3985. * found in the LICENSE file at https://angular.io/license
  3986. */
  3987. var Console = /** @class */ (function () {
  3988. function Console() {
  3989. }
  3990. /**
  3991. * @param {?} message
  3992. * @return {?}
  3993. */
  3994. Console.prototype.log = /**
  3995. * @param {?} message
  3996. * @return {?}
  3997. */
  3998. function (message) {
  3999. // tslint:disable-next-line:no-console
  4000. console.log(message);
  4001. };
  4002. // Note: for reporting errors use `DOM.logError()` as it is platform specific
  4003. /**
  4004. * @param {?} message
  4005. * @return {?}
  4006. */
  4007. Console.prototype.warn = /**
  4008. * @param {?} message
  4009. * @return {?}
  4010. */
  4011. function (message) {
  4012. // tslint:disable-next-line:no-console
  4013. console.warn(message);
  4014. };
  4015. Console.decorators = [
  4016. { type: Injectable },
  4017. ];
  4018. /** @nocollapse */
  4019. Console.ctorParameters = function () { return []; };
  4020. return Console;
  4021. }());
  4022. /**
  4023. * @fileoverview added by tsickle
  4024. * @suppress {checkTypes} checked by tsc
  4025. */
  4026. /**
  4027. * @license
  4028. * Copyright Google Inc. All Rights Reserved.
  4029. *
  4030. * Use of this source code is governed by an MIT-style license that can be
  4031. * found in the LICENSE file at https://angular.io/license
  4032. */
  4033. /**
  4034. * Combination of NgModuleFactory and ComponentFactorys.
  4035. *
  4036. * \@experimental
  4037. * @template T
  4038. */
  4039. var ModuleWithComponentFactories = /** @class */ (function () {
  4040. function ModuleWithComponentFactories(ngModuleFactory, componentFactories) {
  4041. this.ngModuleFactory = ngModuleFactory;
  4042. this.componentFactories = componentFactories;
  4043. }
  4044. return ModuleWithComponentFactories;
  4045. }());
  4046. /**
  4047. * @return {?}
  4048. */
  4049. function _throwError() {
  4050. throw new Error("Runtime compiler is not loaded");
  4051. }
  4052. /**
  4053. * Low-level service for running the angular compiler during runtime
  4054. * to create {\@link ComponentFactory}s, which
  4055. * can later be used to create and render a Component instance.
  4056. *
  4057. * Each `\@NgModule` provides an own `Compiler` to its injector,
  4058. * that will use the directives/pipes of the ng module for compilation
  4059. * of components.
  4060. * \@stable
  4061. */
  4062. var Compiler = /** @class */ (function () {
  4063. function Compiler() {
  4064. }
  4065. /**
  4066. * Compiles the given NgModule and all of its components. All templates of the components listed
  4067. * in `entryComponents` have to be inlined.
  4068. */
  4069. /**
  4070. * Compiles the given NgModule and all of its components. All templates of the components listed
  4071. * in `entryComponents` have to be inlined.
  4072. * @template T
  4073. * @param {?} moduleType
  4074. * @return {?}
  4075. */
  4076. Compiler.prototype.compileModuleSync = /**
  4077. * Compiles the given NgModule and all of its components. All templates of the components listed
  4078. * in `entryComponents` have to be inlined.
  4079. * @template T
  4080. * @param {?} moduleType
  4081. * @return {?}
  4082. */
  4083. function (moduleType) { throw _throwError(); };
  4084. /**
  4085. * Compiles the given NgModule and all of its components
  4086. */
  4087. /**
  4088. * Compiles the given NgModule and all of its components
  4089. * @template T
  4090. * @param {?} moduleType
  4091. * @return {?}
  4092. */
  4093. Compiler.prototype.compileModuleAsync = /**
  4094. * Compiles the given NgModule and all of its components
  4095. * @template T
  4096. * @param {?} moduleType
  4097. * @return {?}
  4098. */
  4099. function (moduleType) { throw _throwError(); };
  4100. /**
  4101. * Same as {@link #compileModuleSync} but also creates ComponentFactories for all components.
  4102. */
  4103. /**
  4104. * Same as {\@link #compileModuleSync} but also creates ComponentFactories for all components.
  4105. * @template T
  4106. * @param {?} moduleType
  4107. * @return {?}
  4108. */
  4109. Compiler.prototype.compileModuleAndAllComponentsSync = /**
  4110. * Same as {\@link #compileModuleSync} but also creates ComponentFactories for all components.
  4111. * @template T
  4112. * @param {?} moduleType
  4113. * @return {?}
  4114. */
  4115. function (moduleType) {
  4116. throw _throwError();
  4117. };
  4118. /**
  4119. * Same as {@link #compileModuleAsync} but also creates ComponentFactories for all components.
  4120. */
  4121. /**
  4122. * Same as {\@link #compileModuleAsync} but also creates ComponentFactories for all components.
  4123. * @template T
  4124. * @param {?} moduleType
  4125. * @return {?}
  4126. */
  4127. Compiler.prototype.compileModuleAndAllComponentsAsync = /**
  4128. * Same as {\@link #compileModuleAsync} but also creates ComponentFactories for all components.
  4129. * @template T
  4130. * @param {?} moduleType
  4131. * @return {?}
  4132. */
  4133. function (moduleType) {
  4134. throw _throwError();
  4135. };
  4136. /**
  4137. * Clears all caches.
  4138. */
  4139. /**
  4140. * Clears all caches.
  4141. * @return {?}
  4142. */
  4143. Compiler.prototype.clearCache = /**
  4144. * Clears all caches.
  4145. * @return {?}
  4146. */
  4147. function () { };
  4148. /**
  4149. * Clears the cache for the given component/ngModule.
  4150. */
  4151. /**
  4152. * Clears the cache for the given component/ngModule.
  4153. * @param {?} type
  4154. * @return {?}
  4155. */
  4156. Compiler.prototype.clearCacheFor = /**
  4157. * Clears the cache for the given component/ngModule.
  4158. * @param {?} type
  4159. * @return {?}
  4160. */
  4161. function (type) { };
  4162. Compiler.decorators = [
  4163. { type: Injectable },
  4164. ];
  4165. /** @nocollapse */
  4166. Compiler.ctorParameters = function () { return []; };
  4167. return Compiler;
  4168. }());
  4169. /**
  4170. * Token to provide CompilerOptions in the platform injector.
  4171. *
  4172. * \@experimental
  4173. */
  4174. var COMPILER_OPTIONS = new InjectionToken('compilerOptions');
  4175. /**
  4176. * A factory for creating a Compiler
  4177. *
  4178. * \@experimental
  4179. * @abstract
  4180. */
  4181. var CompilerFactory = /** @class */ (function () {
  4182. function CompilerFactory() {
  4183. }
  4184. return CompilerFactory;
  4185. }());
  4186. /**
  4187. * @fileoverview added by tsickle
  4188. * @suppress {checkTypes} checked by tsc
  4189. */
  4190. /**
  4191. * @license
  4192. * Copyright Google Inc. All Rights Reserved.
  4193. *
  4194. * Use of this source code is governed by an MIT-style license that can be
  4195. * found in the LICENSE file at https://angular.io/license
  4196. */
  4197. /**
  4198. * Represents an instance of a Component created via a {\@link ComponentFactory}.
  4199. *
  4200. * `ComponentRef` provides access to the Component Instance as well other objects related to this
  4201. * Component Instance and allows you to destroy the Component Instance via the {\@link #destroy}
  4202. * method.
  4203. * \@stable
  4204. * @abstract
  4205. * @template C
  4206. */
  4207. var ComponentRef = /** @class */ (function () {
  4208. function ComponentRef() {
  4209. }
  4210. return ComponentRef;
  4211. }());
  4212. /**
  4213. * \@stable
  4214. * @abstract
  4215. * @template C
  4216. */
  4217. var ComponentFactory = /** @class */ (function () {
  4218. function ComponentFactory() {
  4219. }
  4220. return ComponentFactory;
  4221. }());
  4222. /**
  4223. * @fileoverview added by tsickle
  4224. * @suppress {checkTypes} checked by tsc
  4225. */
  4226. /**
  4227. * @license
  4228. * Copyright Google Inc. All Rights Reserved.
  4229. *
  4230. * Use of this source code is governed by an MIT-style license that can be
  4231. * found in the LICENSE file at https://angular.io/license
  4232. */
  4233. /**
  4234. * @param {?} component
  4235. * @return {?}
  4236. */
  4237. function noComponentFactoryError(component) {
  4238. var /** @type {?} */ error = Error("No component factory found for " + stringify(component) + ". Did you add it to @NgModule.entryComponents?");
  4239. (/** @type {?} */ (error))[ERROR_COMPONENT] = component;
  4240. return error;
  4241. }
  4242. var ERROR_COMPONENT = 'ngComponent';
  4243. /**
  4244. * @param {?} error
  4245. * @return {?}
  4246. */
  4247. var _NullComponentFactoryResolver = /** @class */ (function () {
  4248. function _NullComponentFactoryResolver() {
  4249. }
  4250. /**
  4251. * @template T
  4252. * @param {?} component
  4253. * @return {?}
  4254. */
  4255. _NullComponentFactoryResolver.prototype.resolveComponentFactory = /**
  4256. * @template T
  4257. * @param {?} component
  4258. * @return {?}
  4259. */
  4260. function (component) {
  4261. throw noComponentFactoryError(component);
  4262. };
  4263. return _NullComponentFactoryResolver;
  4264. }());
  4265. /**
  4266. * \@stable
  4267. * @abstract
  4268. */
  4269. var ComponentFactoryResolver = /** @class */ (function () {
  4270. function ComponentFactoryResolver() {
  4271. }
  4272. ComponentFactoryResolver.NULL = new _NullComponentFactoryResolver();
  4273. return ComponentFactoryResolver;
  4274. }());
  4275. var CodegenComponentFactoryResolver = /** @class */ (function () {
  4276. function CodegenComponentFactoryResolver(factories, _parent, _ngModule) {
  4277. this._parent = _parent;
  4278. this._ngModule = _ngModule;
  4279. this._factories = new Map();
  4280. for (var /** @type {?} */ i = 0; i < factories.length; i++) {
  4281. var /** @type {?} */ factory = factories[i];
  4282. this._factories.set(factory.componentType, factory);
  4283. }
  4284. }
  4285. /**
  4286. * @template T
  4287. * @param {?} component
  4288. * @return {?}
  4289. */
  4290. CodegenComponentFactoryResolver.prototype.resolveComponentFactory = /**
  4291. * @template T
  4292. * @param {?} component
  4293. * @return {?}
  4294. */
  4295. function (component) {
  4296. var /** @type {?} */ factory = this._factories.get(component);
  4297. if (!factory && this._parent) {
  4298. factory = this._parent.resolveComponentFactory(component);
  4299. }
  4300. if (!factory) {
  4301. throw noComponentFactoryError(component);
  4302. }
  4303. return new ComponentFactoryBoundToModule(factory, this._ngModule);
  4304. };
  4305. return CodegenComponentFactoryResolver;
  4306. }());
  4307. /**
  4308. * @template C
  4309. */
  4310. var ComponentFactoryBoundToModule = /** @class */ (function (_super) {
  4311. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(ComponentFactoryBoundToModule, _super);
  4312. function ComponentFactoryBoundToModule(factory, ngModule) {
  4313. var _this = _super.call(this) || this;
  4314. _this.factory = factory;
  4315. _this.ngModule = ngModule;
  4316. _this.selector = factory.selector;
  4317. _this.componentType = factory.componentType;
  4318. _this.ngContentSelectors = factory.ngContentSelectors;
  4319. _this.inputs = factory.inputs;
  4320. _this.outputs = factory.outputs;
  4321. return _this;
  4322. }
  4323. /**
  4324. * @param {?} injector
  4325. * @param {?=} projectableNodes
  4326. * @param {?=} rootSelectorOrNode
  4327. * @param {?=} ngModule
  4328. * @return {?}
  4329. */
  4330. ComponentFactoryBoundToModule.prototype.create = /**
  4331. * @param {?} injector
  4332. * @param {?=} projectableNodes
  4333. * @param {?=} rootSelectorOrNode
  4334. * @param {?=} ngModule
  4335. * @return {?}
  4336. */
  4337. function (injector, projectableNodes, rootSelectorOrNode, ngModule) {
  4338. return this.factory.create(injector, projectableNodes, rootSelectorOrNode, ngModule || this.ngModule);
  4339. };
  4340. return ComponentFactoryBoundToModule;
  4341. }(ComponentFactory));
  4342. /**
  4343. * @fileoverview added by tsickle
  4344. * @suppress {checkTypes} checked by tsc
  4345. */
  4346. /**
  4347. * @license
  4348. * Copyright Google Inc. All Rights Reserved.
  4349. *
  4350. * Use of this source code is governed by an MIT-style license that can be
  4351. * found in the LICENSE file at https://angular.io/license
  4352. */
  4353. /**
  4354. * Represents an instance of an NgModule created via a {\@link NgModuleFactory}.
  4355. *
  4356. * `NgModuleRef` provides access to the NgModule Instance as well other objects related to this
  4357. * NgModule Instance.
  4358. *
  4359. * \@stable
  4360. * @abstract
  4361. * @template T
  4362. */
  4363. var NgModuleRef = /** @class */ (function () {
  4364. function NgModuleRef() {
  4365. }
  4366. return NgModuleRef;
  4367. }());
  4368. /**
  4369. * @record
  4370. * @template T
  4371. */
  4372. /**
  4373. * \@experimental
  4374. * @abstract
  4375. * @template T
  4376. */
  4377. var NgModuleFactory = /** @class */ (function () {
  4378. function NgModuleFactory() {
  4379. }
  4380. return NgModuleFactory;
  4381. }());
  4382. /**
  4383. * @fileoverview added by tsickle
  4384. * @suppress {checkTypes} checked by tsc
  4385. */
  4386. /**
  4387. * @license
  4388. * Copyright Google Inc. All Rights Reserved.
  4389. *
  4390. * Use of this source code is governed by an MIT-style license that can be
  4391. * found in the LICENSE file at https://angular.io/license
  4392. */
  4393. /**
  4394. * A scope function for the Web Tracing Framework (WTF).
  4395. *
  4396. * \@experimental
  4397. * @record
  4398. */
  4399. /**
  4400. * @record
  4401. */
  4402. /**
  4403. * @record
  4404. */
  4405. var trace;
  4406. var events;
  4407. /**
  4408. * @return {?}
  4409. */
  4410. function detectWTF() {
  4411. var /** @type {?} */ wtf = (/** @type {?} */ (_global /** TODO #9100 */) /** TODO #9100 */)['wtf'];
  4412. if (wtf) {
  4413. trace = wtf['trace'];
  4414. if (trace) {
  4415. events = trace['events'];
  4416. return true;
  4417. }
  4418. }
  4419. return false;
  4420. }
  4421. /**
  4422. * @param {?} signature
  4423. * @param {?=} flags
  4424. * @return {?}
  4425. */
  4426. function createScope(signature, flags) {
  4427. if (flags === void 0) { flags = null; }
  4428. return events.createScope(signature, flags);
  4429. }
  4430. /**
  4431. * @template T
  4432. * @param {?} scope
  4433. * @param {?=} returnValue
  4434. * @return {?}
  4435. */
  4436. function leave(scope, returnValue) {
  4437. trace.leaveScope(scope, returnValue);
  4438. return returnValue;
  4439. }
  4440. /**
  4441. * @param {?} rangeType
  4442. * @param {?} action
  4443. * @return {?}
  4444. */
  4445. function startTimeRange(rangeType, action) {
  4446. return trace.beginTimeRange(rangeType, action);
  4447. }
  4448. /**
  4449. * @param {?} range
  4450. * @return {?}
  4451. */
  4452. function endTimeRange(range) {
  4453. trace.endTimeRange(range);
  4454. }
  4455. /**
  4456. * @fileoverview added by tsickle
  4457. * @suppress {checkTypes} checked by tsc
  4458. */
  4459. /**
  4460. * @license
  4461. * Copyright Google Inc. All Rights Reserved.
  4462. *
  4463. * Use of this source code is governed by an MIT-style license that can be
  4464. * found in the LICENSE file at https://angular.io/license
  4465. */
  4466. /**
  4467. * True if WTF is enabled.
  4468. */
  4469. var wtfEnabled = detectWTF();
  4470. /**
  4471. * @param {?=} arg0
  4472. * @param {?=} arg1
  4473. * @return {?}
  4474. */
  4475. function noopScope(arg0, arg1) {
  4476. return null;
  4477. }
  4478. /**
  4479. * Create trace scope.
  4480. *
  4481. * Scopes must be strictly nested and are analogous to stack frames, but
  4482. * do not have to follow the stack frames. Instead it is recommended that they follow logical
  4483. * nesting. You may want to use
  4484. * [Event
  4485. * Signatures](http://google.github.io/tracing-framework/instrumenting-code.html#custom-events)
  4486. * as they are defined in WTF.
  4487. *
  4488. * Used to mark scope entry. The return value is used to leave the scope.
  4489. *
  4490. * var myScope = wtfCreateScope('MyClass#myMethod(ascii someVal)');
  4491. *
  4492. * someMethod() {
  4493. * var s = myScope('Foo'); // 'Foo' gets stored in tracing UI
  4494. * // DO SOME WORK HERE
  4495. * return wtfLeave(s, 123); // Return value 123
  4496. * }
  4497. *
  4498. * Note, adding try-finally block around the work to ensure that `wtfLeave` gets called can
  4499. * negatively impact the performance of your application. For this reason we recommend that
  4500. * you don't add them to ensure that `wtfLeave` gets called. In production `wtfLeave` is a noop and
  4501. * so try-finally block has no value. When debugging perf issues, skipping `wtfLeave`, do to
  4502. * exception, will produce incorrect trace, but presence of exception signifies logic error which
  4503. * needs to be fixed before the app should be profiled. Add try-finally only when you expect that
  4504. * an exception is expected during normal execution while profiling.
  4505. *
  4506. * \@experimental
  4507. */
  4508. var wtfCreateScope = wtfEnabled ? createScope : function (signature, flags) { return noopScope; };
  4509. /**
  4510. * Used to mark end of Scope.
  4511. *
  4512. * - `scope` to end.
  4513. * - `returnValue` (optional) to be passed to the WTF.
  4514. *
  4515. * Returns the `returnValue for easy chaining.
  4516. * \@experimental
  4517. */
  4518. var wtfLeave = wtfEnabled ? leave : function (s, r) { return r; };
  4519. /**
  4520. * Used to mark Async start. Async are similar to scope but they don't have to be strictly nested.
  4521. * The return value is used in the call to [endAsync]. Async ranges only work if WTF has been
  4522. * enabled.
  4523. *
  4524. * someMethod() {
  4525. * var s = wtfStartTimeRange('HTTP:GET', 'some.url');
  4526. * var future = new Future.delay(5).then((_) {
  4527. * wtfEndTimeRange(s);
  4528. * });
  4529. * }
  4530. * \@experimental
  4531. */
  4532. var wtfStartTimeRange = wtfEnabled ? startTimeRange : function (rangeType, action) { return null; };
  4533. /**
  4534. * Ends a async time range operation.
  4535. * [range] is the return value from [wtfStartTimeRange] Async ranges only work if WTF has been
  4536. * enabled.
  4537. * \@experimental
  4538. */
  4539. var wtfEndTimeRange = wtfEnabled ? endTimeRange : function (r) { return null; };
  4540. /**
  4541. * @fileoverview added by tsickle
  4542. * @suppress {checkTypes} checked by tsc
  4543. */
  4544. /**
  4545. * @license
  4546. * Copyright Google Inc. All Rights Reserved.
  4547. *
  4548. * Use of this source code is governed by an MIT-style license that can be
  4549. * found in the LICENSE file at https://angular.io/license
  4550. */
  4551. /**
  4552. * Use by directives and components to emit custom Events.
  4553. *
  4554. * ### Examples
  4555. *
  4556. * In the following example, `Zippy` alternatively emits `open` and `close` events when its
  4557. * title gets clicked:
  4558. *
  4559. * ```
  4560. * \@Component({
  4561. * selector: 'zippy',
  4562. * template: `
  4563. * <div class="zippy">
  4564. * <div (click)="toggle()">Toggle</div>
  4565. * <div [hidden]="!visible">
  4566. * <ng-content></ng-content>
  4567. * </div>
  4568. * </div>`})
  4569. * export class Zippy {
  4570. * visible: boolean = true;
  4571. * \@Output() open: EventEmitter<any> = new EventEmitter();
  4572. * \@Output() close: EventEmitter<any> = new EventEmitter();
  4573. *
  4574. * toggle() {
  4575. * this.visible = !this.visible;
  4576. * if (this.visible) {
  4577. * this.open.emit(null);
  4578. * } else {
  4579. * this.close.emit(null);
  4580. * }
  4581. * }
  4582. * }
  4583. * ```
  4584. *
  4585. * The events payload can be accessed by the parameter `$event` on the components output event
  4586. * handler:
  4587. *
  4588. * ```
  4589. * <zippy (open)="onOpen($event)" (close)="onClose($event)"></zippy>
  4590. * ```
  4591. *
  4592. * Uses Rx.Observable but provides an adapter to make it work as specified here:
  4593. * https://github.com/jhusain/observable-spec
  4594. *
  4595. * Once a reference implementation of the spec is available, switch to it.
  4596. * \@stable
  4597. * @template T
  4598. */
  4599. var EventEmitter = /** @class */ (function (_super) {
  4600. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(EventEmitter, _super);
  4601. /**
  4602. * Creates an instance of {@link EventEmitter}, which depending on `isAsync`,
  4603. * delivers events synchronously or asynchronously.
  4604. *
  4605. * @param isAsync By default, events are delivered synchronously (default value: `false`).
  4606. * Set to `true` for asynchronous event delivery.
  4607. */
  4608. function EventEmitter(isAsync) {
  4609. if (isAsync === void 0) { isAsync = false; }
  4610. var _this = _super.call(this) || this;
  4611. _this.__isAsync = isAsync;
  4612. return _this;
  4613. }
  4614. /**
  4615. * @param {?=} value
  4616. * @return {?}
  4617. */
  4618. EventEmitter.prototype.emit = /**
  4619. * @param {?=} value
  4620. * @return {?}
  4621. */
  4622. function (value) { _super.prototype.next.call(this, value); };
  4623. /**
  4624. * @param {?=} generatorOrNext
  4625. * @param {?=} error
  4626. * @param {?=} complete
  4627. * @return {?}
  4628. */
  4629. EventEmitter.prototype.subscribe = /**
  4630. * @param {?=} generatorOrNext
  4631. * @param {?=} error
  4632. * @param {?=} complete
  4633. * @return {?}
  4634. */
  4635. function (generatorOrNext, error, complete) {
  4636. var /** @type {?} */ schedulerFn;
  4637. var /** @type {?} */ errorFn = function (err) { return null; };
  4638. var /** @type {?} */ completeFn = function () { return null; };
  4639. if (generatorOrNext && typeof generatorOrNext === 'object') {
  4640. schedulerFn = this.__isAsync ? function (value) {
  4641. setTimeout(function () { return generatorOrNext.next(value); });
  4642. } : function (value) { generatorOrNext.next(value); };
  4643. if (generatorOrNext.error) {
  4644. errorFn = this.__isAsync ? function (err) { setTimeout(function () { return generatorOrNext.error(err); }); } :
  4645. function (err) { generatorOrNext.error(err); };
  4646. }
  4647. if (generatorOrNext.complete) {
  4648. completeFn = this.__isAsync ? function () { setTimeout(function () { return generatorOrNext.complete(); }); } :
  4649. function () { generatorOrNext.complete(); };
  4650. }
  4651. }
  4652. else {
  4653. schedulerFn = this.__isAsync ? function (value) { setTimeout(function () { return generatorOrNext(value); }); } :
  4654. function (value) { generatorOrNext(value); };
  4655. if (error) {
  4656. errorFn =
  4657. this.__isAsync ? function (err) { setTimeout(function () { return error(err); }); } : function (err) { error(err); };
  4658. }
  4659. if (complete) {
  4660. completeFn =
  4661. this.__isAsync ? function () { setTimeout(function () { return complete(); }); } : function () { complete(); };
  4662. }
  4663. }
  4664. var /** @type {?} */ sink = _super.prototype.subscribe.call(this, schedulerFn, errorFn, completeFn);
  4665. if (generatorOrNext instanceof __WEBPACK_IMPORTED_MODULE_5_rxjs_Subscription__["Subscription"]) {
  4666. generatorOrNext.add(sink);
  4667. }
  4668. return sink;
  4669. };
  4670. return EventEmitter;
  4671. }(__WEBPACK_IMPORTED_MODULE_4_rxjs_Subject__["Subject"]));
  4672. /**
  4673. * @fileoverview added by tsickle
  4674. * @suppress {checkTypes} checked by tsc
  4675. */
  4676. /**
  4677. * @license
  4678. * Copyright Google Inc. All Rights Reserved.
  4679. *
  4680. * Use of this source code is governed by an MIT-style license that can be
  4681. * found in the LICENSE file at https://angular.io/license
  4682. */
  4683. /**
  4684. * An injectable service for executing work inside or outside of the Angular zone.
  4685. *
  4686. * The most common use of this service is to optimize performance when starting a work consisting of
  4687. * one or more asynchronous tasks that don't require UI updates or error handling to be handled by
  4688. * Angular. Such tasks can be kicked off via {\@link #runOutsideAngular} and if needed, these tasks
  4689. * can reenter the Angular zone via {\@link #run}.
  4690. *
  4691. * <!-- TODO: add/fix links to:
  4692. * - docs explaining zones and the use of zones in Angular and change-detection
  4693. * - link to runOutsideAngular/run (throughout this file!)
  4694. * -->
  4695. *
  4696. * ### Example
  4697. *
  4698. * ```
  4699. * import {Component, NgZone} from '\@angular/core';
  4700. * import {NgIf} from '\@angular/common';
  4701. *
  4702. * \@Component({
  4703. * selector: 'ng-zone-demo',
  4704. * template: `
  4705. * <h2>Demo: NgZone</h2>
  4706. *
  4707. * <p>Progress: {{progress}}%</p>
  4708. * <p *ngIf="progress >= 100">Done processing {{label}} of Angular zone!</p>
  4709. *
  4710. * <button (click)="processWithinAngularZone()">Process within Angular zone</button>
  4711. * <button (click)="processOutsideOfAngularZone()">Process outside of Angular zone</button>
  4712. * `,
  4713. * })
  4714. * export class NgZoneDemo {
  4715. * progress: number = 0;
  4716. * label: string;
  4717. *
  4718. * constructor(private _ngZone: NgZone) {}
  4719. *
  4720. * // Loop inside the Angular zone
  4721. * // so the UI DOES refresh after each setTimeout cycle
  4722. * processWithinAngularZone() {
  4723. * this.label = 'inside';
  4724. * this.progress = 0;
  4725. * this._increaseProgress(() => console.log('Inside Done!'));
  4726. * }
  4727. *
  4728. * // Loop outside of the Angular zone
  4729. * // so the UI DOES NOT refresh after each setTimeout cycle
  4730. * processOutsideOfAngularZone() {
  4731. * this.label = 'outside';
  4732. * this.progress = 0;
  4733. * this._ngZone.runOutsideAngular(() => {
  4734. * this._increaseProgress(() => {
  4735. * // reenter the Angular zone and display done
  4736. * this._ngZone.run(() => { console.log('Outside Done!'); });
  4737. * });
  4738. * });
  4739. * }
  4740. *
  4741. * _increaseProgress(doneCallback: () => void) {
  4742. * this.progress += 1;
  4743. * console.log(`Current progress: ${this.progress}%`);
  4744. *
  4745. * if (this.progress < 100) {
  4746. * window.setTimeout(() => this._increaseProgress(doneCallback), 10);
  4747. * } else {
  4748. * doneCallback();
  4749. * }
  4750. * }
  4751. * }
  4752. * ```
  4753. *
  4754. * \@experimental
  4755. */
  4756. var NgZone = /** @class */ (function () {
  4757. function NgZone(_a) {
  4758. var _b = _a.enableLongStackTrace, enableLongStackTrace = _b === void 0 ? false : _b;
  4759. this.hasPendingMicrotasks = false;
  4760. this.hasPendingMacrotasks = false;
  4761. /**
  4762. * Whether there are no outstanding microtasks or macrotasks.
  4763. */
  4764. this.isStable = true;
  4765. /**
  4766. * Notifies when code enters Angular Zone. This gets fired first on VM Turn.
  4767. */
  4768. this.onUnstable = new EventEmitter(false);
  4769. /**
  4770. * Notifies when there is no more microtasks enqueued in the current VM Turn.
  4771. * This is a hint for Angular to do change detection, which may enqueue more microtasks.
  4772. * For this reason this event can fire multiple times per VM Turn.
  4773. */
  4774. this.onMicrotaskEmpty = new EventEmitter(false);
  4775. /**
  4776. * Notifies when the last `onMicrotaskEmpty` has run and there are no more microtasks, which
  4777. * implies we are about to relinquish VM turn.
  4778. * This event gets called just once.
  4779. */
  4780. this.onStable = new EventEmitter(false);
  4781. /**
  4782. * Notifies that an error has been delivered.
  4783. */
  4784. this.onError = new EventEmitter(false);
  4785. if (typeof Zone == 'undefined') {
  4786. throw new Error("In this configuration Angular requires Zone.js");
  4787. }
  4788. Zone.assertZonePatched();
  4789. var /** @type {?} */ self = /** @type {?} */ ((this));
  4790. self._nesting = 0;
  4791. self._outer = self._inner = Zone.current;
  4792. if ((/** @type {?} */ (Zone))['wtfZoneSpec']) {
  4793. self._inner = self._inner.fork((/** @type {?} */ (Zone))['wtfZoneSpec']);
  4794. }
  4795. if (enableLongStackTrace && (/** @type {?} */ (Zone))['longStackTraceZoneSpec']) {
  4796. self._inner = self._inner.fork((/** @type {?} */ (Zone))['longStackTraceZoneSpec']);
  4797. }
  4798. forkInnerZoneWithAngularBehavior(self);
  4799. }
  4800. /**
  4801. * @return {?}
  4802. */
  4803. NgZone.isInAngularZone = /**
  4804. * @return {?}
  4805. */
  4806. function () { return Zone.current.get('isAngularZone') === true; };
  4807. /**
  4808. * @return {?}
  4809. */
  4810. NgZone.assertInAngularZone = /**
  4811. * @return {?}
  4812. */
  4813. function () {
  4814. if (!NgZone.isInAngularZone()) {
  4815. throw new Error('Expected to be in Angular Zone, but it is not!');
  4816. }
  4817. };
  4818. /**
  4819. * @return {?}
  4820. */
  4821. NgZone.assertNotInAngularZone = /**
  4822. * @return {?}
  4823. */
  4824. function () {
  4825. if (NgZone.isInAngularZone()) {
  4826. throw new Error('Expected to not be in Angular Zone, but it is!');
  4827. }
  4828. };
  4829. /**
  4830. * Executes the `fn` function synchronously within the Angular zone and returns value returned by
  4831. * the function.
  4832. *
  4833. * Running functions via `run` allows you to reenter Angular zone from a task that was executed
  4834. * outside of the Angular zone (typically started via {@link #runOutsideAngular}).
  4835. *
  4836. * Any future tasks or microtasks scheduled from within this function will continue executing from
  4837. * within the Angular zone.
  4838. *
  4839. * If a synchronous error happens it will be rethrown and not reported via `onError`.
  4840. */
  4841. /**
  4842. * Executes the `fn` function synchronously within the Angular zone and returns value returned by
  4843. * the function.
  4844. *
  4845. * Running functions via `run` allows you to reenter Angular zone from a task that was executed
  4846. * outside of the Angular zone (typically started via {\@link #runOutsideAngular}).
  4847. *
  4848. * Any future tasks or microtasks scheduled from within this function will continue executing from
  4849. * within the Angular zone.
  4850. *
  4851. * If a synchronous error happens it will be rethrown and not reported via `onError`.
  4852. * @template T
  4853. * @param {?} fn
  4854. * @param {?=} applyThis
  4855. * @param {?=} applyArgs
  4856. * @return {?}
  4857. */
  4858. NgZone.prototype.run = /**
  4859. * Executes the `fn` function synchronously within the Angular zone and returns value returned by
  4860. * the function.
  4861. *
  4862. * Running functions via `run` allows you to reenter Angular zone from a task that was executed
  4863. * outside of the Angular zone (typically started via {\@link #runOutsideAngular}).
  4864. *
  4865. * Any future tasks or microtasks scheduled from within this function will continue executing from
  4866. * within the Angular zone.
  4867. *
  4868. * If a synchronous error happens it will be rethrown and not reported via `onError`.
  4869. * @template T
  4870. * @param {?} fn
  4871. * @param {?=} applyThis
  4872. * @param {?=} applyArgs
  4873. * @return {?}
  4874. */
  4875. function (fn, applyThis, applyArgs) {
  4876. return /** @type {?} */ ((/** @type {?} */ ((this)))._inner.run(fn, applyThis, applyArgs));
  4877. };
  4878. /**
  4879. * Executes the `fn` function synchronously within the Angular zone as a task and returns value
  4880. * returned by the function.
  4881. *
  4882. * Running functions via `run` allows you to reenter Angular zone from a task that was executed
  4883. * outside of the Angular zone (typically started via {@link #runOutsideAngular}).
  4884. *
  4885. * Any future tasks or microtasks scheduled from within this function will continue executing from
  4886. * within the Angular zone.
  4887. *
  4888. * If a synchronous error happens it will be rethrown and not reported via `onError`.
  4889. */
  4890. /**
  4891. * Executes the `fn` function synchronously within the Angular zone as a task and returns value
  4892. * returned by the function.
  4893. *
  4894. * Running functions via `run` allows you to reenter Angular zone from a task that was executed
  4895. * outside of the Angular zone (typically started via {\@link #runOutsideAngular}).
  4896. *
  4897. * Any future tasks or microtasks scheduled from within this function will continue executing from
  4898. * within the Angular zone.
  4899. *
  4900. * If a synchronous error happens it will be rethrown and not reported via `onError`.
  4901. * @template T
  4902. * @param {?} fn
  4903. * @param {?=} applyThis
  4904. * @param {?=} applyArgs
  4905. * @param {?=} name
  4906. * @return {?}
  4907. */
  4908. NgZone.prototype.runTask = /**
  4909. * Executes the `fn` function synchronously within the Angular zone as a task and returns value
  4910. * returned by the function.
  4911. *
  4912. * Running functions via `run` allows you to reenter Angular zone from a task that was executed
  4913. * outside of the Angular zone (typically started via {\@link #runOutsideAngular}).
  4914. *
  4915. * Any future tasks or microtasks scheduled from within this function will continue executing from
  4916. * within the Angular zone.
  4917. *
  4918. * If a synchronous error happens it will be rethrown and not reported via `onError`.
  4919. * @template T
  4920. * @param {?} fn
  4921. * @param {?=} applyThis
  4922. * @param {?=} applyArgs
  4923. * @param {?=} name
  4924. * @return {?}
  4925. */
  4926. function (fn, applyThis, applyArgs, name) {
  4927. var /** @type {?} */ zone = (/** @type {?} */ ((this)))._inner;
  4928. var /** @type {?} */ task = zone.scheduleEventTask('NgZoneEvent: ' + name, fn, EMPTY_PAYLOAD, noop, noop);
  4929. try {
  4930. return /** @type {?} */ (zone.runTask(task, applyThis, applyArgs));
  4931. }
  4932. finally {
  4933. zone.cancelTask(task);
  4934. }
  4935. };
  4936. /**
  4937. * Same as `run`, except that synchronous errors are caught and forwarded via `onError` and not
  4938. * rethrown.
  4939. */
  4940. /**
  4941. * Same as `run`, except that synchronous errors are caught and forwarded via `onError` and not
  4942. * rethrown.
  4943. * @template T
  4944. * @param {?} fn
  4945. * @param {?=} applyThis
  4946. * @param {?=} applyArgs
  4947. * @return {?}
  4948. */
  4949. NgZone.prototype.runGuarded = /**
  4950. * Same as `run`, except that synchronous errors are caught and forwarded via `onError` and not
  4951. * rethrown.
  4952. * @template T
  4953. * @param {?} fn
  4954. * @param {?=} applyThis
  4955. * @param {?=} applyArgs
  4956. * @return {?}
  4957. */
  4958. function (fn, applyThis, applyArgs) {
  4959. return /** @type {?} */ ((/** @type {?} */ ((this)))._inner.runGuarded(fn, applyThis, applyArgs));
  4960. };
  4961. /**
  4962. * Executes the `fn` function synchronously in Angular's parent zone and returns value returned by
  4963. * the function.
  4964. *
  4965. * Running functions via {@link #runOutsideAngular} allows you to escape Angular's zone and do
  4966. * work that
  4967. * doesn't trigger Angular change-detection or is subject to Angular's error handling.
  4968. *
  4969. * Any future tasks or microtasks scheduled from within this function will continue executing from
  4970. * outside of the Angular zone.
  4971. *
  4972. * Use {@link #run} to reenter the Angular zone and do work that updates the application model.
  4973. */
  4974. /**
  4975. * Executes the `fn` function synchronously in Angular's parent zone and returns value returned by
  4976. * the function.
  4977. *
  4978. * Running functions via {\@link #runOutsideAngular} allows you to escape Angular's zone and do
  4979. * work that
  4980. * doesn't trigger Angular change-detection or is subject to Angular's error handling.
  4981. *
  4982. * Any future tasks or microtasks scheduled from within this function will continue executing from
  4983. * outside of the Angular zone.
  4984. *
  4985. * Use {\@link #run} to reenter the Angular zone and do work that updates the application model.
  4986. * @template T
  4987. * @param {?} fn
  4988. * @return {?}
  4989. */
  4990. NgZone.prototype.runOutsideAngular = /**
  4991. * Executes the `fn` function synchronously in Angular's parent zone and returns value returned by
  4992. * the function.
  4993. *
  4994. * Running functions via {\@link #runOutsideAngular} allows you to escape Angular's zone and do
  4995. * work that
  4996. * doesn't trigger Angular change-detection or is subject to Angular's error handling.
  4997. *
  4998. * Any future tasks or microtasks scheduled from within this function will continue executing from
  4999. * outside of the Angular zone.
  5000. *
  5001. * Use {\@link #run} to reenter the Angular zone and do work that updates the application model.
  5002. * @template T
  5003. * @param {?} fn
  5004. * @return {?}
  5005. */
  5006. function (fn) {
  5007. return /** @type {?} */ ((/** @type {?} */ ((this)))._outer.run(fn));
  5008. };
  5009. return NgZone;
  5010. }());
  5011. /**
  5012. * @return {?}
  5013. */
  5014. function noop() { }
  5015. var EMPTY_PAYLOAD = {};
  5016. /**
  5017. * @param {?} zone
  5018. * @return {?}
  5019. */
  5020. function checkStable(zone) {
  5021. if (zone._nesting == 0 && !zone.hasPendingMicrotasks && !zone.isStable) {
  5022. try {
  5023. zone._nesting++;
  5024. zone.onMicrotaskEmpty.emit(null);
  5025. }
  5026. finally {
  5027. zone._nesting--;
  5028. if (!zone.hasPendingMicrotasks) {
  5029. try {
  5030. zone.runOutsideAngular(function () { return zone.onStable.emit(null); });
  5031. }
  5032. finally {
  5033. zone.isStable = true;
  5034. }
  5035. }
  5036. }
  5037. }
  5038. }
  5039. /**
  5040. * @param {?} zone
  5041. * @return {?}
  5042. */
  5043. function forkInnerZoneWithAngularBehavior(zone) {
  5044. zone._inner = zone._inner.fork({
  5045. name: 'angular',
  5046. properties: /** @type {?} */ ({ 'isAngularZone': true }),
  5047. onInvokeTask: function (delegate, current, target, task, applyThis, applyArgs) {
  5048. try {
  5049. onEnter(zone);
  5050. return delegate.invokeTask(target, task, applyThis, applyArgs);
  5051. }
  5052. finally {
  5053. onLeave(zone);
  5054. }
  5055. },
  5056. onInvoke: function (delegate, current, target, callback, applyThis, applyArgs, source) {
  5057. try {
  5058. onEnter(zone);
  5059. return delegate.invoke(target, callback, applyThis, applyArgs, source);
  5060. }
  5061. finally {
  5062. onLeave(zone);
  5063. }
  5064. },
  5065. onHasTask: function (delegate, current, target, hasTaskState) {
  5066. delegate.hasTask(target, hasTaskState);
  5067. if (current === target) {
  5068. // We are only interested in hasTask events which originate from our zone
  5069. // (A child hasTask event is not interesting to us)
  5070. if (hasTaskState.change == 'microTask') {
  5071. zone.hasPendingMicrotasks = hasTaskState.microTask;
  5072. checkStable(zone);
  5073. }
  5074. else if (hasTaskState.change == 'macroTask') {
  5075. zone.hasPendingMacrotasks = hasTaskState.macroTask;
  5076. }
  5077. }
  5078. },
  5079. onHandleError: function (delegate, current, target, error) {
  5080. delegate.handleError(target, error);
  5081. zone.runOutsideAngular(function () { return zone.onError.emit(error); });
  5082. return false;
  5083. }
  5084. });
  5085. }
  5086. /**
  5087. * @param {?} zone
  5088. * @return {?}
  5089. */
  5090. function onEnter(zone) {
  5091. zone._nesting++;
  5092. if (zone.isStable) {
  5093. zone.isStable = false;
  5094. zone.onUnstable.emit(null);
  5095. }
  5096. }
  5097. /**
  5098. * @param {?} zone
  5099. * @return {?}
  5100. */
  5101. function onLeave(zone) {
  5102. zone._nesting--;
  5103. checkStable(zone);
  5104. }
  5105. /**
  5106. * Provides a noop implementation of `NgZone` which does nothing. This zone requires explicit calls
  5107. * to framework to perform rendering.
  5108. */
  5109. var NoopNgZone = /** @class */ (function () {
  5110. function NoopNgZone() {
  5111. this.hasPendingMicrotasks = false;
  5112. this.hasPendingMacrotasks = false;
  5113. this.isStable = true;
  5114. this.onUnstable = new EventEmitter();
  5115. this.onMicrotaskEmpty = new EventEmitter();
  5116. this.onStable = new EventEmitter();
  5117. this.onError = new EventEmitter();
  5118. }
  5119. /**
  5120. * @param {?} fn
  5121. * @return {?}
  5122. */
  5123. NoopNgZone.prototype.run = /**
  5124. * @param {?} fn
  5125. * @return {?}
  5126. */
  5127. function (fn) { return fn(); };
  5128. /**
  5129. * @param {?} fn
  5130. * @return {?}
  5131. */
  5132. NoopNgZone.prototype.runGuarded = /**
  5133. * @param {?} fn
  5134. * @return {?}
  5135. */
  5136. function (fn) { return fn(); };
  5137. /**
  5138. * @param {?} fn
  5139. * @return {?}
  5140. */
  5141. NoopNgZone.prototype.runOutsideAngular = /**
  5142. * @param {?} fn
  5143. * @return {?}
  5144. */
  5145. function (fn) { return fn(); };
  5146. /**
  5147. * @template T
  5148. * @param {?} fn
  5149. * @return {?}
  5150. */
  5151. NoopNgZone.prototype.runTask = /**
  5152. * @template T
  5153. * @param {?} fn
  5154. * @return {?}
  5155. */
  5156. function (fn) { return fn(); };
  5157. return NoopNgZone;
  5158. }());
  5159. /**
  5160. * @fileoverview added by tsickle
  5161. * @suppress {checkTypes} checked by tsc
  5162. */
  5163. /**
  5164. * @license
  5165. * Copyright Google Inc. All Rights Reserved.
  5166. *
  5167. * Use of this source code is governed by an MIT-style license that can be
  5168. * found in the LICENSE file at https://angular.io/license
  5169. */
  5170. /**
  5171. * The Testability service provides testing hooks that can be accessed from
  5172. * the browser and by services such as Protractor. Each bootstrapped Angular
  5173. * application on the page will have an instance of Testability.
  5174. * \@experimental
  5175. */
  5176. var Testability = /** @class */ (function () {
  5177. function Testability(_ngZone) {
  5178. this._ngZone = _ngZone;
  5179. /**
  5180. * \@internal
  5181. */
  5182. this._pendingCount = 0;
  5183. /**
  5184. * \@internal
  5185. */
  5186. this._isZoneStable = true;
  5187. /**
  5188. * Whether any work was done since the last 'whenStable' callback. This is
  5189. * useful to detect if this could have potentially destabilized another
  5190. * component while it is stabilizing.
  5191. * \@internal
  5192. */
  5193. this._didWork = false;
  5194. /**
  5195. * \@internal
  5196. */
  5197. this._callbacks = [];
  5198. this._watchAngularEvents();
  5199. }
  5200. /** @internal */
  5201. /**
  5202. * \@internal
  5203. * @return {?}
  5204. */
  5205. Testability.prototype._watchAngularEvents = /**
  5206. * \@internal
  5207. * @return {?}
  5208. */
  5209. function () {
  5210. var _this = this;
  5211. this._ngZone.onUnstable.subscribe({
  5212. next: function () {
  5213. _this._didWork = true;
  5214. _this._isZoneStable = false;
  5215. }
  5216. });
  5217. this._ngZone.runOutsideAngular(function () {
  5218. _this._ngZone.onStable.subscribe({
  5219. next: function () {
  5220. NgZone.assertNotInAngularZone();
  5221. scheduleMicroTask(function () {
  5222. _this._isZoneStable = true;
  5223. _this._runCallbacksIfReady();
  5224. });
  5225. }
  5226. });
  5227. });
  5228. };
  5229. /**
  5230. * Increases the number of pending request
  5231. */
  5232. /**
  5233. * Increases the number of pending request
  5234. * @return {?}
  5235. */
  5236. Testability.prototype.increasePendingRequestCount = /**
  5237. * Increases the number of pending request
  5238. * @return {?}
  5239. */
  5240. function () {
  5241. this._pendingCount += 1;
  5242. this._didWork = true;
  5243. return this._pendingCount;
  5244. };
  5245. /**
  5246. * Decreases the number of pending request
  5247. */
  5248. /**
  5249. * Decreases the number of pending request
  5250. * @return {?}
  5251. */
  5252. Testability.prototype.decreasePendingRequestCount = /**
  5253. * Decreases the number of pending request
  5254. * @return {?}
  5255. */
  5256. function () {
  5257. this._pendingCount -= 1;
  5258. if (this._pendingCount < 0) {
  5259. throw new Error('pending async requests below zero');
  5260. }
  5261. this._runCallbacksIfReady();
  5262. return this._pendingCount;
  5263. };
  5264. /**
  5265. * Whether an associated application is stable
  5266. */
  5267. /**
  5268. * Whether an associated application is stable
  5269. * @return {?}
  5270. */
  5271. Testability.prototype.isStable = /**
  5272. * Whether an associated application is stable
  5273. * @return {?}
  5274. */
  5275. function () {
  5276. return this._isZoneStable && this._pendingCount == 0 && !this._ngZone.hasPendingMacrotasks;
  5277. };
  5278. /** @internal */
  5279. /**
  5280. * \@internal
  5281. * @return {?}
  5282. */
  5283. Testability.prototype._runCallbacksIfReady = /**
  5284. * \@internal
  5285. * @return {?}
  5286. */
  5287. function () {
  5288. var _this = this;
  5289. if (this.isStable()) {
  5290. // Schedules the call backs in a new frame so that it is always async.
  5291. scheduleMicroTask(function () {
  5292. while (_this._callbacks.length !== 0) {
  5293. (/** @type {?} */ ((_this._callbacks.pop())))(_this._didWork);
  5294. }
  5295. _this._didWork = false;
  5296. });
  5297. }
  5298. else {
  5299. // Not Ready
  5300. this._didWork = true;
  5301. }
  5302. };
  5303. /**
  5304. * Run callback when the application is stable
  5305. * @param callback function to be called after the application is stable
  5306. */
  5307. /**
  5308. * Run callback when the application is stable
  5309. * @param {?} callback function to be called after the application is stable
  5310. * @return {?}
  5311. */
  5312. Testability.prototype.whenStable = /**
  5313. * Run callback when the application is stable
  5314. * @param {?} callback function to be called after the application is stable
  5315. * @return {?}
  5316. */
  5317. function (callback) {
  5318. this._callbacks.push(callback);
  5319. this._runCallbacksIfReady();
  5320. };
  5321. /**
  5322. * Get the number of pending requests
  5323. */
  5324. /**
  5325. * Get the number of pending requests
  5326. * @return {?}
  5327. */
  5328. Testability.prototype.getPendingRequestCount = /**
  5329. * Get the number of pending requests
  5330. * @return {?}
  5331. */
  5332. function () { return this._pendingCount; };
  5333. /**
  5334. * Find providers by name
  5335. * @param using The root element to search from
  5336. * @param provider The name of binding variable
  5337. * @param exactMatch Whether using exactMatch
  5338. */
  5339. /**
  5340. * Find providers by name
  5341. * @param {?} using The root element to search from
  5342. * @param {?} provider The name of binding variable
  5343. * @param {?} exactMatch Whether using exactMatch
  5344. * @return {?}
  5345. */
  5346. Testability.prototype.findProviders = /**
  5347. * Find providers by name
  5348. * @param {?} using The root element to search from
  5349. * @param {?} provider The name of binding variable
  5350. * @param {?} exactMatch Whether using exactMatch
  5351. * @return {?}
  5352. */
  5353. function (using, provider, exactMatch) {
  5354. // TODO(juliemr): implement.
  5355. return [];
  5356. };
  5357. Testability.decorators = [
  5358. { type: Injectable },
  5359. ];
  5360. /** @nocollapse */
  5361. Testability.ctorParameters = function () { return [
  5362. { type: NgZone, },
  5363. ]; };
  5364. return Testability;
  5365. }());
  5366. /**
  5367. * A global registry of {\@link Testability} instances for specific elements.
  5368. * \@experimental
  5369. */
  5370. var TestabilityRegistry = /** @class */ (function () {
  5371. function TestabilityRegistry() {
  5372. /**
  5373. * \@internal
  5374. */
  5375. this._applications = new Map();
  5376. _testabilityGetter.addToWindow(this);
  5377. }
  5378. /**
  5379. * Registers an application with a testability hook so that it can be tracked
  5380. * @param token token of application, root element
  5381. * @param testability Testability hook
  5382. */
  5383. /**
  5384. * Registers an application with a testability hook so that it can be tracked
  5385. * @param {?} token token of application, root element
  5386. * @param {?} testability Testability hook
  5387. * @return {?}
  5388. */
  5389. TestabilityRegistry.prototype.registerApplication = /**
  5390. * Registers an application with a testability hook so that it can be tracked
  5391. * @param {?} token token of application, root element
  5392. * @param {?} testability Testability hook
  5393. * @return {?}
  5394. */
  5395. function (token, testability) {
  5396. this._applications.set(token, testability);
  5397. };
  5398. /**
  5399. * Unregisters an application.
  5400. * @param token token of application, root element
  5401. */
  5402. /**
  5403. * Unregisters an application.
  5404. * @param {?} token token of application, root element
  5405. * @return {?}
  5406. */
  5407. TestabilityRegistry.prototype.unregisterApplication = /**
  5408. * Unregisters an application.
  5409. * @param {?} token token of application, root element
  5410. * @return {?}
  5411. */
  5412. function (token) { this._applications.delete(token); };
  5413. /**
  5414. * Unregisters all applications
  5415. */
  5416. /**
  5417. * Unregisters all applications
  5418. * @return {?}
  5419. */
  5420. TestabilityRegistry.prototype.unregisterAllApplications = /**
  5421. * Unregisters all applications
  5422. * @return {?}
  5423. */
  5424. function () { this._applications.clear(); };
  5425. /**
  5426. * Get a testability hook associated with the application
  5427. * @param elem root element
  5428. */
  5429. /**
  5430. * Get a testability hook associated with the application
  5431. * @param {?} elem root element
  5432. * @return {?}
  5433. */
  5434. TestabilityRegistry.prototype.getTestability = /**
  5435. * Get a testability hook associated with the application
  5436. * @param {?} elem root element
  5437. * @return {?}
  5438. */
  5439. function (elem) { return this._applications.get(elem) || null; };
  5440. /**
  5441. * Get all registered testabilities
  5442. */
  5443. /**
  5444. * Get all registered testabilities
  5445. * @return {?}
  5446. */
  5447. TestabilityRegistry.prototype.getAllTestabilities = /**
  5448. * Get all registered testabilities
  5449. * @return {?}
  5450. */
  5451. function () { return Array.from(this._applications.values()); };
  5452. /**
  5453. * Get all registered applications(root elements)
  5454. */
  5455. /**
  5456. * Get all registered applications(root elements)
  5457. * @return {?}
  5458. */
  5459. TestabilityRegistry.prototype.getAllRootElements = /**
  5460. * Get all registered applications(root elements)
  5461. * @return {?}
  5462. */
  5463. function () { return Array.from(this._applications.keys()); };
  5464. /**
  5465. * Find testability of a node in the Tree
  5466. * @param elem node
  5467. * @param findInAncestors whether finding testability in ancestors if testability was not found in
  5468. * current node
  5469. */
  5470. /**
  5471. * Find testability of a node in the Tree
  5472. * @param {?} elem node
  5473. * @param {?=} findInAncestors whether finding testability in ancestors if testability was not found in
  5474. * current node
  5475. * @return {?}
  5476. */
  5477. TestabilityRegistry.prototype.findTestabilityInTree = /**
  5478. * Find testability of a node in the Tree
  5479. * @param {?} elem node
  5480. * @param {?=} findInAncestors whether finding testability in ancestors if testability was not found in
  5481. * current node
  5482. * @return {?}
  5483. */
  5484. function (elem, findInAncestors) {
  5485. if (findInAncestors === void 0) { findInAncestors = true; }
  5486. return _testabilityGetter.findTestabilityInTree(this, elem, findInAncestors);
  5487. };
  5488. TestabilityRegistry.decorators = [
  5489. { type: Injectable },
  5490. ];
  5491. /** @nocollapse */
  5492. TestabilityRegistry.ctorParameters = function () { return []; };
  5493. return TestabilityRegistry;
  5494. }());
  5495. /**
  5496. * Adapter interface for retrieving the `Testability` service associated for a
  5497. * particular context.
  5498. *
  5499. * \@experimental Testability apis are primarily intended to be used by e2e test tool vendors like
  5500. * the Protractor team.
  5501. * @record
  5502. */
  5503. var _NoopGetTestability = /** @class */ (function () {
  5504. function _NoopGetTestability() {
  5505. }
  5506. /**
  5507. * @param {?} registry
  5508. * @return {?}
  5509. */
  5510. _NoopGetTestability.prototype.addToWindow = /**
  5511. * @param {?} registry
  5512. * @return {?}
  5513. */
  5514. function (registry) { };
  5515. /**
  5516. * @param {?} registry
  5517. * @param {?} elem
  5518. * @param {?} findInAncestors
  5519. * @return {?}
  5520. */
  5521. _NoopGetTestability.prototype.findTestabilityInTree = /**
  5522. * @param {?} registry
  5523. * @param {?} elem
  5524. * @param {?} findInAncestors
  5525. * @return {?}
  5526. */
  5527. function (registry, elem, findInAncestors) {
  5528. return null;
  5529. };
  5530. return _NoopGetTestability;
  5531. }());
  5532. /**
  5533. * Set the {\@link GetTestability} implementation used by the Angular testing framework.
  5534. * \@experimental
  5535. * @param {?} getter
  5536. * @return {?}
  5537. */
  5538. function setTestabilityGetter(getter) {
  5539. _testabilityGetter = getter;
  5540. }
  5541. var _testabilityGetter = new _NoopGetTestability();
  5542. /**
  5543. * @fileoverview added by tsickle
  5544. * @suppress {checkTypes} checked by tsc
  5545. */
  5546. /**
  5547. * @license
  5548. * Copyright Google Inc. All Rights Reserved.
  5549. *
  5550. * Use of this source code is governed by an MIT-style license that can be
  5551. * found in the LICENSE file at https://angular.io/license
  5552. */
  5553. var _devMode = true;
  5554. var _runModeLocked = false;
  5555. var _platform;
  5556. var ALLOW_MULTIPLE_PLATFORMS = new InjectionToken('AllowMultipleToken');
  5557. /**
  5558. * Disable Angular's development mode, which turns off assertions and other
  5559. * checks within the framework.
  5560. *
  5561. * One important assertion this disables verifies that a change detection pass
  5562. * does not result in additional changes to any bindings (also known as
  5563. * unidirectional data flow).
  5564. *
  5565. * \@stable
  5566. * @return {?}
  5567. */
  5568. function enableProdMode() {
  5569. if (_runModeLocked) {
  5570. throw new Error('Cannot enable prod mode after platform setup.');
  5571. }
  5572. _devMode = false;
  5573. }
  5574. /**
  5575. * Returns whether Angular is in development mode. After called once,
  5576. * the value is locked and won't change any more.
  5577. *
  5578. * By default, this is true, unless a user calls `enableProdMode` before calling this.
  5579. *
  5580. * \@experimental APIs related to application bootstrap are currently under review.
  5581. * @return {?}
  5582. */
  5583. function isDevMode() {
  5584. _runModeLocked = true;
  5585. return _devMode;
  5586. }
  5587. /**
  5588. * A token for third-party components that can register themselves with NgProbe.
  5589. *
  5590. * \@experimental
  5591. */
  5592. var NgProbeToken = /** @class */ (function () {
  5593. function NgProbeToken(name, token) {
  5594. this.name = name;
  5595. this.token = token;
  5596. }
  5597. return NgProbeToken;
  5598. }());
  5599. /**
  5600. * Creates a platform.
  5601. * Platforms have to be eagerly created via this function.
  5602. *
  5603. * \@experimental APIs related to application bootstrap are currently under review.
  5604. * @param {?} injector
  5605. * @return {?}
  5606. */
  5607. function createPlatform(injector) {
  5608. if (_platform && !_platform.destroyed &&
  5609. !_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
  5610. throw new Error('There can be only one platform. Destroy the previous one to create a new one.');
  5611. }
  5612. _platform = injector.get(PlatformRef);
  5613. var /** @type {?} */ inits = injector.get(PLATFORM_INITIALIZER, null);
  5614. if (inits)
  5615. inits.forEach(function (init) { return init(); });
  5616. return _platform;
  5617. }
  5618. /**
  5619. * Creates a factory for a platform
  5620. *
  5621. * \@experimental APIs related to application bootstrap are currently under review.
  5622. * @param {?} parentPlatformFactory
  5623. * @param {?} name
  5624. * @param {?=} providers
  5625. * @return {?}
  5626. */
  5627. function createPlatformFactory(parentPlatformFactory, name, providers) {
  5628. if (providers === void 0) { providers = []; }
  5629. var /** @type {?} */ desc = "Platform: " + name;
  5630. var /** @type {?} */ marker = new InjectionToken(desc);
  5631. return function (extraProviders) {
  5632. if (extraProviders === void 0) { extraProviders = []; }
  5633. var /** @type {?} */ platform = getPlatform();
  5634. if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
  5635. if (parentPlatformFactory) {
  5636. parentPlatformFactory(providers.concat(extraProviders).concat({ provide: marker, useValue: true }));
  5637. }
  5638. else {
  5639. var /** @type {?} */ injectedProviders = providers.concat(extraProviders).concat({ provide: marker, useValue: true });
  5640. createPlatform(Injector.create({ providers: injectedProviders, name: desc }));
  5641. }
  5642. }
  5643. return assertPlatform(marker);
  5644. };
  5645. }
  5646. /**
  5647. * Checks that there currently is a platform which contains the given token as a provider.
  5648. *
  5649. * \@experimental APIs related to application bootstrap are currently under review.
  5650. * @param {?} requiredToken
  5651. * @return {?}
  5652. */
  5653. function assertPlatform(requiredToken) {
  5654. var /** @type {?} */ platform = getPlatform();
  5655. if (!platform) {
  5656. throw new Error('No platform exists!');
  5657. }
  5658. if (!platform.injector.get(requiredToken, null)) {
  5659. throw new Error('A platform with a different configuration has been created. Please destroy it first.');
  5660. }
  5661. return platform;
  5662. }
  5663. /**
  5664. * Destroy the existing platform.
  5665. *
  5666. * \@experimental APIs related to application bootstrap are currently under review.
  5667. * @return {?}
  5668. */
  5669. function destroyPlatform() {
  5670. if (_platform && !_platform.destroyed) {
  5671. _platform.destroy();
  5672. }
  5673. }
  5674. /**
  5675. * Returns the current platform.
  5676. *
  5677. * \@experimental APIs related to application bootstrap are currently under review.
  5678. * @return {?}
  5679. */
  5680. function getPlatform() {
  5681. return _platform && !_platform.destroyed ? _platform : null;
  5682. }
  5683. /**
  5684. * Provides additional options to the bootstraping process.
  5685. *
  5686. * \@stable
  5687. * @record
  5688. */
  5689. /**
  5690. * The Angular platform is the entry point for Angular on a web page. Each page
  5691. * has exactly one platform, and services (such as reflection) which are common
  5692. * to every Angular application running on the page are bound in its scope.
  5693. *
  5694. * A page's platform is initialized implicitly when a platform is created via a platform factory
  5695. * (e.g. {\@link platformBrowser}), or explicitly by calling the {\@link createPlatform} function.
  5696. *
  5697. * \@stable
  5698. */
  5699. var PlatformRef = /** @class */ (function () {
  5700. /** @internal */
  5701. function PlatformRef(_injector) {
  5702. this._injector = _injector;
  5703. this._modules = [];
  5704. this._destroyListeners = [];
  5705. this._destroyed = false;
  5706. }
  5707. /**
  5708. * Creates an instance of an `@NgModule` for the given platform
  5709. * for offline compilation.
  5710. *
  5711. * ## Simple Example
  5712. *
  5713. * ```typescript
  5714. * my_module.ts:
  5715. *
  5716. * @NgModule({
  5717. * imports: [BrowserModule]
  5718. * })
  5719. * class MyModule {}
  5720. *
  5721. * main.ts:
  5722. * import {MyModuleNgFactory} from './my_module.ngfactory';
  5723. * import {platformBrowser} from '@angular/platform-browser';
  5724. *
  5725. * let moduleRef = platformBrowser().bootstrapModuleFactory(MyModuleNgFactory);
  5726. * ```
  5727. *
  5728. * @experimental APIs related to application bootstrap are currently under review.
  5729. */
  5730. /**
  5731. * Creates an instance of an `\@NgModule` for the given platform
  5732. * for offline compilation.
  5733. *
  5734. * ## Simple Example
  5735. *
  5736. * ```typescript
  5737. * my_module.ts:
  5738. *
  5739. * \@NgModule({
  5740. * imports: [BrowserModule]
  5741. * })
  5742. * class MyModule {}
  5743. *
  5744. * main.ts:
  5745. * import {MyModuleNgFactory} from './my_module.ngfactory';
  5746. * import {platformBrowser} from '\@angular/platform-browser';
  5747. *
  5748. * let moduleRef = platformBrowser().bootstrapModuleFactory(MyModuleNgFactory);
  5749. * ```
  5750. *
  5751. * \@experimental APIs related to application bootstrap are currently under review.
  5752. * @template M
  5753. * @param {?} moduleFactory
  5754. * @param {?=} options
  5755. * @return {?}
  5756. */
  5757. PlatformRef.prototype.bootstrapModuleFactory = /**
  5758. * Creates an instance of an `\@NgModule` for the given platform
  5759. * for offline compilation.
  5760. *
  5761. * ## Simple Example
  5762. *
  5763. * ```typescript
  5764. * my_module.ts:
  5765. *
  5766. * \@NgModule({
  5767. * imports: [BrowserModule]
  5768. * })
  5769. * class MyModule {}
  5770. *
  5771. * main.ts:
  5772. * import {MyModuleNgFactory} from './my_module.ngfactory';
  5773. * import {platformBrowser} from '\@angular/platform-browser';
  5774. *
  5775. * let moduleRef = platformBrowser().bootstrapModuleFactory(MyModuleNgFactory);
  5776. * ```
  5777. *
  5778. * \@experimental APIs related to application bootstrap are currently under review.
  5779. * @template M
  5780. * @param {?} moduleFactory
  5781. * @param {?=} options
  5782. * @return {?}
  5783. */
  5784. function (moduleFactory, options) {
  5785. var _this = this;
  5786. // Note: We need to create the NgZone _before_ we instantiate the module,
  5787. // as instantiating the module creates some providers eagerly.
  5788. // So we create a mini parent injector that just contains the new NgZone and
  5789. // pass that as parent to the NgModuleFactory.
  5790. var /** @type {?} */ ngZoneOption = options ? options.ngZone : undefined;
  5791. var /** @type {?} */ ngZone = getNgZone(ngZoneOption);
  5792. var /** @type {?} */ providers = [{ provide: NgZone, useValue: ngZone }];
  5793. // Attention: Don't use ApplicationRef.run here,
  5794. // as we want to be sure that all possible constructor calls are inside `ngZone.run`!
  5795. return ngZone.run(function () {
  5796. var /** @type {?} */ ngZoneInjector = Injector.create({ providers: providers, parent: _this.injector, name: moduleFactory.moduleType.name });
  5797. var /** @type {?} */ moduleRef = /** @type {?} */ (moduleFactory.create(ngZoneInjector));
  5798. var /** @type {?} */ exceptionHandler = moduleRef.injector.get(ErrorHandler, null);
  5799. if (!exceptionHandler) {
  5800. throw new Error('No ErrorHandler. Is platform module (BrowserModule) included?');
  5801. }
  5802. moduleRef.onDestroy(function () { return remove(_this._modules, moduleRef); }); /** @type {?} */
  5803. ((ngZone)).runOutsideAngular(function () { return ((ngZone)).onError.subscribe({ next: function (error) { exceptionHandler.handleError(error); } }); });
  5804. return _callAndReportToErrorHandler(exceptionHandler, /** @type {?} */ ((ngZone)), function () {
  5805. var /** @type {?} */ initStatus = moduleRef.injector.get(ApplicationInitStatus);
  5806. initStatus.runInitializers();
  5807. return initStatus.donePromise.then(function () {
  5808. _this._moduleDoBootstrap(moduleRef);
  5809. return moduleRef;
  5810. });
  5811. });
  5812. });
  5813. };
  5814. /**
  5815. * Creates an instance of an `@NgModule` for a given platform using the given runtime compiler.
  5816. *
  5817. * ## Simple Example
  5818. *
  5819. * ```typescript
  5820. * @NgModule({
  5821. * imports: [BrowserModule]
  5822. * })
  5823. * class MyModule {}
  5824. *
  5825. * let moduleRef = platformBrowser().bootstrapModule(MyModule);
  5826. * ```
  5827. * @stable
  5828. */
  5829. /**
  5830. * Creates an instance of an `\@NgModule` for a given platform using the given runtime compiler.
  5831. *
  5832. * ## Simple Example
  5833. *
  5834. * ```typescript
  5835. * \@NgModule({
  5836. * imports: [BrowserModule]
  5837. * })
  5838. * class MyModule {}
  5839. *
  5840. * let moduleRef = platformBrowser().bootstrapModule(MyModule);
  5841. * ```
  5842. * \@stable
  5843. * @template M
  5844. * @param {?} moduleType
  5845. * @param {?=} compilerOptions
  5846. * @return {?}
  5847. */
  5848. PlatformRef.prototype.bootstrapModule = /**
  5849. * Creates an instance of an `\@NgModule` for a given platform using the given runtime compiler.
  5850. *
  5851. * ## Simple Example
  5852. *
  5853. * ```typescript
  5854. * \@NgModule({
  5855. * imports: [BrowserModule]
  5856. * })
  5857. * class MyModule {}
  5858. *
  5859. * let moduleRef = platformBrowser().bootstrapModule(MyModule);
  5860. * ```
  5861. * \@stable
  5862. * @template M
  5863. * @param {?} moduleType
  5864. * @param {?=} compilerOptions
  5865. * @return {?}
  5866. */
  5867. function (moduleType, compilerOptions) {
  5868. var _this = this;
  5869. if (compilerOptions === void 0) { compilerOptions = []; }
  5870. var /** @type {?} */ compilerFactory = this.injector.get(CompilerFactory);
  5871. var /** @type {?} */ options = optionsReducer({}, compilerOptions);
  5872. var /** @type {?} */ compiler = compilerFactory.createCompiler([options]);
  5873. return compiler.compileModuleAsync(moduleType)
  5874. .then(function (moduleFactory) { return _this.bootstrapModuleFactory(moduleFactory, options); });
  5875. };
  5876. /**
  5877. * @param {?} moduleRef
  5878. * @return {?}
  5879. */
  5880. PlatformRef.prototype._moduleDoBootstrap = /**
  5881. * @param {?} moduleRef
  5882. * @return {?}
  5883. */
  5884. function (moduleRef) {
  5885. var /** @type {?} */ appRef = /** @type {?} */ (moduleRef.injector.get(ApplicationRef));
  5886. if (moduleRef._bootstrapComponents.length > 0) {
  5887. moduleRef._bootstrapComponents.forEach(function (f) { return appRef.bootstrap(f); });
  5888. }
  5889. else if (moduleRef.instance.ngDoBootstrap) {
  5890. moduleRef.instance.ngDoBootstrap(appRef);
  5891. }
  5892. else {
  5893. throw new Error("The module " + stringify(moduleRef.instance.constructor) + " was bootstrapped, but it does not declare \"@NgModule.bootstrap\" components nor a \"ngDoBootstrap\" method. " +
  5894. "Please define one of these.");
  5895. }
  5896. this._modules.push(moduleRef);
  5897. };
  5898. /**
  5899. * Register a listener to be called when the platform is disposed.
  5900. */
  5901. /**
  5902. * Register a listener to be called when the platform is disposed.
  5903. * @param {?} callback
  5904. * @return {?}
  5905. */
  5906. PlatformRef.prototype.onDestroy = /**
  5907. * Register a listener to be called when the platform is disposed.
  5908. * @param {?} callback
  5909. * @return {?}
  5910. */
  5911. function (callback) { this._destroyListeners.push(callback); };
  5912. Object.defineProperty(PlatformRef.prototype, "injector", {
  5913. /**
  5914. * Retrieve the platform {@link Injector}, which is the parent injector for
  5915. * every Angular application on the page and provides singleton providers.
  5916. */
  5917. get: /**
  5918. * Retrieve the platform {\@link Injector}, which is the parent injector for
  5919. * every Angular application on the page and provides singleton providers.
  5920. * @return {?}
  5921. */
  5922. function () { return this._injector; },
  5923. enumerable: true,
  5924. configurable: true
  5925. });
  5926. /**
  5927. * Destroy the Angular platform and all Angular applications on the page.
  5928. */
  5929. /**
  5930. * Destroy the Angular platform and all Angular applications on the page.
  5931. * @return {?}
  5932. */
  5933. PlatformRef.prototype.destroy = /**
  5934. * Destroy the Angular platform and all Angular applications on the page.
  5935. * @return {?}
  5936. */
  5937. function () {
  5938. if (this._destroyed) {
  5939. throw new Error('The platform has already been destroyed!');
  5940. }
  5941. this._modules.slice().forEach(function (module) { return module.destroy(); });
  5942. this._destroyListeners.forEach(function (listener) { return listener(); });
  5943. this._destroyed = true;
  5944. };
  5945. Object.defineProperty(PlatformRef.prototype, "destroyed", {
  5946. get: /**
  5947. * @return {?}
  5948. */
  5949. function () { return this._destroyed; },
  5950. enumerable: true,
  5951. configurable: true
  5952. });
  5953. PlatformRef.decorators = [
  5954. { type: Injectable },
  5955. ];
  5956. /** @nocollapse */
  5957. PlatformRef.ctorParameters = function () { return [
  5958. { type: Injector, },
  5959. ]; };
  5960. return PlatformRef;
  5961. }());
  5962. /**
  5963. * @param {?=} ngZoneOption
  5964. * @return {?}
  5965. */
  5966. function getNgZone(ngZoneOption) {
  5967. var /** @type {?} */ ngZone;
  5968. if (ngZoneOption === 'noop') {
  5969. ngZone = new NoopNgZone();
  5970. }
  5971. else {
  5972. ngZone = (ngZoneOption === 'zone.js' ? undefined : ngZoneOption) ||
  5973. new NgZone({ enableLongStackTrace: isDevMode() });
  5974. }
  5975. return ngZone;
  5976. }
  5977. /**
  5978. * @param {?} errorHandler
  5979. * @param {?} ngZone
  5980. * @param {?} callback
  5981. * @return {?}
  5982. */
  5983. function _callAndReportToErrorHandler(errorHandler, ngZone, callback) {
  5984. try {
  5985. var /** @type {?} */ result = callback();
  5986. if (isPromise(result)) {
  5987. return result.catch(function (e) {
  5988. ngZone.runOutsideAngular(function () { return errorHandler.handleError(e); });
  5989. // rethrow as the exception handler might not do it
  5990. throw e;
  5991. });
  5992. }
  5993. return result;
  5994. }
  5995. catch (/** @type {?} */ e) {
  5996. ngZone.runOutsideAngular(function () { return errorHandler.handleError(e); });
  5997. // rethrow as the exception handler might not do it
  5998. throw e;
  5999. }
  6000. }
  6001. /**
  6002. * @template T
  6003. * @param {?} dst
  6004. * @param {?} objs
  6005. * @return {?}
  6006. */
  6007. function optionsReducer(dst, objs) {
  6008. if (Array.isArray(objs)) {
  6009. dst = objs.reduce(optionsReducer, dst);
  6010. }
  6011. else {
  6012. dst = Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */])({}, dst, (/** @type {?} */ (objs)));
  6013. }
  6014. return dst;
  6015. }
  6016. /**
  6017. * A reference to an Angular application running on a page.
  6018. *
  6019. * \@stable
  6020. */
  6021. var ApplicationRef = /** @class */ (function () {
  6022. /** @internal */
  6023. function ApplicationRef(_zone, _console, _injector, _exceptionHandler, _componentFactoryResolver, _initStatus) {
  6024. var _this = this;
  6025. this._zone = _zone;
  6026. this._console = _console;
  6027. this._injector = _injector;
  6028. this._exceptionHandler = _exceptionHandler;
  6029. this._componentFactoryResolver = _componentFactoryResolver;
  6030. this._initStatus = _initStatus;
  6031. this._bootstrapListeners = [];
  6032. this._views = [];
  6033. this._runningTick = false;
  6034. this._enforceNoNewChanges = false;
  6035. this._stable = true;
  6036. /**
  6037. * Get a list of component types registered to this application.
  6038. * This list is populated even before the component is created.
  6039. */
  6040. this.componentTypes = [];
  6041. /**
  6042. * Get a list of components registered to this application.
  6043. */
  6044. this.components = [];
  6045. this._enforceNoNewChanges = isDevMode();
  6046. this._zone.onMicrotaskEmpty.subscribe({ next: function () { _this._zone.run(function () { _this.tick(); }); } });
  6047. var /** @type {?} */ isCurrentlyStable = new __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__["Observable"](function (observer) {
  6048. _this._stable = _this._zone.isStable && !_this._zone.hasPendingMacrotasks &&
  6049. !_this._zone.hasPendingMicrotasks;
  6050. _this._zone.runOutsideAngular(function () {
  6051. observer.next(_this._stable);
  6052. observer.complete();
  6053. });
  6054. });
  6055. var /** @type {?} */ isStable = new __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__["Observable"](function (observer) {
  6056. // Create the subscription to onStable outside the Angular Zone so that
  6057. // the callback is run outside the Angular Zone.
  6058. var /** @type {?} */ stableSub;
  6059. _this._zone.runOutsideAngular(function () {
  6060. stableSub = _this._zone.onStable.subscribe(function () {
  6061. NgZone.assertNotInAngularZone();
  6062. // Check whether there are no pending macro/micro tasks in the next tick
  6063. // to allow for NgZone to update the state.
  6064. scheduleMicroTask(function () {
  6065. if (!_this._stable && !_this._zone.hasPendingMacrotasks &&
  6066. !_this._zone.hasPendingMicrotasks) {
  6067. _this._stable = true;
  6068. observer.next(true);
  6069. }
  6070. });
  6071. });
  6072. });
  6073. var /** @type {?} */ unstableSub = _this._zone.onUnstable.subscribe(function () {
  6074. NgZone.assertInAngularZone();
  6075. if (_this._stable) {
  6076. _this._stable = false;
  6077. _this._zone.runOutsideAngular(function () { observer.next(false); });
  6078. }
  6079. });
  6080. return function () {
  6081. stableSub.unsubscribe();
  6082. unstableSub.unsubscribe();
  6083. };
  6084. });
  6085. (/** @type {?} */ (this)).isStable =
  6086. Object(__WEBPACK_IMPORTED_MODULE_2_rxjs_observable_merge__["merge"])(isCurrentlyStable, __WEBPACK_IMPORTED_MODULE_3_rxjs_operator_share__["share"].call(isStable));
  6087. }
  6088. /**
  6089. * Bootstrap a new component at the root level of the application.
  6090. *
  6091. * ### Bootstrap process
  6092. *
  6093. * When bootstrapping a new root component into an application, Angular mounts the
  6094. * specified application component onto DOM elements identified by the [componentType]'s
  6095. * selector and kicks off automatic change detection to finish initializing the component.
  6096. *
  6097. * Optionally, a component can be mounted onto a DOM element that does not match the
  6098. * [componentType]'s selector.
  6099. *
  6100. * ### Example
  6101. * {@example core/ts/platform/platform.ts region='longform'}
  6102. */
  6103. /**
  6104. * Bootstrap a new component at the root level of the application.
  6105. *
  6106. * ### Bootstrap process
  6107. *
  6108. * When bootstrapping a new root component into an application, Angular mounts the
  6109. * specified application component onto DOM elements identified by the [componentType]'s
  6110. * selector and kicks off automatic change detection to finish initializing the component.
  6111. *
  6112. * Optionally, a component can be mounted onto a DOM element that does not match the
  6113. * [componentType]'s selector.
  6114. *
  6115. * ### Example
  6116. * {\@example core/ts/platform/platform.ts region='longform'}
  6117. * @template C
  6118. * @param {?} componentOrFactory
  6119. * @param {?=} rootSelectorOrNode
  6120. * @return {?}
  6121. */
  6122. ApplicationRef.prototype.bootstrap = /**
  6123. * Bootstrap a new component at the root level of the application.
  6124. *
  6125. * ### Bootstrap process
  6126. *
  6127. * When bootstrapping a new root component into an application, Angular mounts the
  6128. * specified application component onto DOM elements identified by the [componentType]'s
  6129. * selector and kicks off automatic change detection to finish initializing the component.
  6130. *
  6131. * Optionally, a component can be mounted onto a DOM element that does not match the
  6132. * [componentType]'s selector.
  6133. *
  6134. * ### Example
  6135. * {\@example core/ts/platform/platform.ts region='longform'}
  6136. * @template C
  6137. * @param {?} componentOrFactory
  6138. * @param {?=} rootSelectorOrNode
  6139. * @return {?}
  6140. */
  6141. function (componentOrFactory, rootSelectorOrNode) {
  6142. var _this = this;
  6143. if (!this._initStatus.done) {
  6144. throw new Error('Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.');
  6145. }
  6146. var /** @type {?} */ componentFactory;
  6147. if (componentOrFactory instanceof ComponentFactory) {
  6148. componentFactory = componentOrFactory;
  6149. }
  6150. else {
  6151. componentFactory =
  6152. /** @type {?} */ ((this._componentFactoryResolver.resolveComponentFactory(componentOrFactory)));
  6153. }
  6154. this.componentTypes.push(componentFactory.componentType);
  6155. // Create a factory associated with the current module if it's not bound to some other
  6156. var /** @type {?} */ ngModule = componentFactory instanceof ComponentFactoryBoundToModule ?
  6157. null :
  6158. this._injector.get(NgModuleRef);
  6159. var /** @type {?} */ selectorOrNode = rootSelectorOrNode || componentFactory.selector;
  6160. var /** @type {?} */ compRef = componentFactory.create(Injector.NULL, [], selectorOrNode, ngModule);
  6161. compRef.onDestroy(function () { _this._unloadComponent(compRef); });
  6162. var /** @type {?} */ testability = compRef.injector.get(Testability, null);
  6163. if (testability) {
  6164. compRef.injector.get(TestabilityRegistry)
  6165. .registerApplication(compRef.location.nativeElement, testability);
  6166. }
  6167. this._loadComponent(compRef);
  6168. if (isDevMode()) {
  6169. this._console.log("Angular is running in the development mode. Call enableProdMode() to enable the production mode.");
  6170. }
  6171. return compRef;
  6172. };
  6173. /**
  6174. * Invoke this method to explicitly process change detection and its side-effects.
  6175. *
  6176. * In development mode, `tick()` also performs a second change detection cycle to ensure that no
  6177. * further changes are detected. If additional changes are picked up during this second cycle,
  6178. * bindings in the app have side-effects that cannot be resolved in a single change detection
  6179. * pass.
  6180. * In this case, Angular throws an error, since an Angular application can only have one change
  6181. * detection pass during which all change detection must complete.
  6182. */
  6183. /**
  6184. * Invoke this method to explicitly process change detection and its side-effects.
  6185. *
  6186. * In development mode, `tick()` also performs a second change detection cycle to ensure that no
  6187. * further changes are detected. If additional changes are picked up during this second cycle,
  6188. * bindings in the app have side-effects that cannot be resolved in a single change detection
  6189. * pass.
  6190. * In this case, Angular throws an error, since an Angular application can only have one change
  6191. * detection pass during which all change detection must complete.
  6192. * @return {?}
  6193. */
  6194. ApplicationRef.prototype.tick = /**
  6195. * Invoke this method to explicitly process change detection and its side-effects.
  6196. *
  6197. * In development mode, `tick()` also performs a second change detection cycle to ensure that no
  6198. * further changes are detected. If additional changes are picked up during this second cycle,
  6199. * bindings in the app have side-effects that cannot be resolved in a single change detection
  6200. * pass.
  6201. * In this case, Angular throws an error, since an Angular application can only have one change
  6202. * detection pass during which all change detection must complete.
  6203. * @return {?}
  6204. */
  6205. function () {
  6206. var _this = this;
  6207. if (this._runningTick) {
  6208. throw new Error('ApplicationRef.tick is called recursively');
  6209. }
  6210. var /** @type {?} */ scope = ApplicationRef._tickScope();
  6211. try {
  6212. this._runningTick = true;
  6213. this._views.forEach(function (view) { return view.detectChanges(); });
  6214. if (this._enforceNoNewChanges) {
  6215. this._views.forEach(function (view) { return view.checkNoChanges(); });
  6216. }
  6217. }
  6218. catch (/** @type {?} */ e) {
  6219. // Attention: Don't rethrow as it could cancel subscriptions to Observables!
  6220. this._zone.runOutsideAngular(function () { return _this._exceptionHandler.handleError(e); });
  6221. }
  6222. finally {
  6223. this._runningTick = false;
  6224. wtfLeave(scope);
  6225. }
  6226. };
  6227. /**
  6228. * Attaches a view so that it will be dirty checked.
  6229. * The view will be automatically detached when it is destroyed.
  6230. * This will throw if the view is already attached to a ViewContainer.
  6231. */
  6232. /**
  6233. * Attaches a view so that it will be dirty checked.
  6234. * The view will be automatically detached when it is destroyed.
  6235. * This will throw if the view is already attached to a ViewContainer.
  6236. * @param {?} viewRef
  6237. * @return {?}
  6238. */
  6239. ApplicationRef.prototype.attachView = /**
  6240. * Attaches a view so that it will be dirty checked.
  6241. * The view will be automatically detached when it is destroyed.
  6242. * This will throw if the view is already attached to a ViewContainer.
  6243. * @param {?} viewRef
  6244. * @return {?}
  6245. */
  6246. function (viewRef) {
  6247. var /** @type {?} */ view = (/** @type {?} */ (viewRef));
  6248. this._views.push(view);
  6249. view.attachToAppRef(this);
  6250. };
  6251. /**
  6252. * Detaches a view from dirty checking again.
  6253. */
  6254. /**
  6255. * Detaches a view from dirty checking again.
  6256. * @param {?} viewRef
  6257. * @return {?}
  6258. */
  6259. ApplicationRef.prototype.detachView = /**
  6260. * Detaches a view from dirty checking again.
  6261. * @param {?} viewRef
  6262. * @return {?}
  6263. */
  6264. function (viewRef) {
  6265. var /** @type {?} */ view = (/** @type {?} */ (viewRef));
  6266. remove(this._views, view);
  6267. view.detachFromAppRef();
  6268. };
  6269. /**
  6270. * @param {?} componentRef
  6271. * @return {?}
  6272. */
  6273. ApplicationRef.prototype._loadComponent = /**
  6274. * @param {?} componentRef
  6275. * @return {?}
  6276. */
  6277. function (componentRef) {
  6278. this.attachView(componentRef.hostView);
  6279. this.tick();
  6280. this.components.push(componentRef);
  6281. // Get the listeners lazily to prevent DI cycles.
  6282. var /** @type {?} */ listeners = this._injector.get(APP_BOOTSTRAP_LISTENER, []).concat(this._bootstrapListeners);
  6283. listeners.forEach(function (listener) { return listener(componentRef); });
  6284. };
  6285. /**
  6286. * @param {?} componentRef
  6287. * @return {?}
  6288. */
  6289. ApplicationRef.prototype._unloadComponent = /**
  6290. * @param {?} componentRef
  6291. * @return {?}
  6292. */
  6293. function (componentRef) {
  6294. this.detachView(componentRef.hostView);
  6295. remove(this.components, componentRef);
  6296. };
  6297. /** @internal */
  6298. /**
  6299. * \@internal
  6300. * @return {?}
  6301. */
  6302. ApplicationRef.prototype.ngOnDestroy = /**
  6303. * \@internal
  6304. * @return {?}
  6305. */
  6306. function () {
  6307. // TODO(alxhub): Dispose of the NgZone.
  6308. this._views.slice().forEach(function (view) { return view.destroy(); });
  6309. };
  6310. Object.defineProperty(ApplicationRef.prototype, "viewCount", {
  6311. /**
  6312. * Returns the number of attached views.
  6313. */
  6314. get: /**
  6315. * Returns the number of attached views.
  6316. * @return {?}
  6317. */
  6318. function () { return this._views.length; },
  6319. enumerable: true,
  6320. configurable: true
  6321. });
  6322. /**
  6323. * \@internal
  6324. */
  6325. ApplicationRef._tickScope = wtfCreateScope('ApplicationRef#tick()');
  6326. ApplicationRef.decorators = [
  6327. { type: Injectable },
  6328. ];
  6329. /** @nocollapse */
  6330. ApplicationRef.ctorParameters = function () { return [
  6331. { type: NgZone, },
  6332. { type: Console, },
  6333. { type: Injector, },
  6334. { type: ErrorHandler, },
  6335. { type: ComponentFactoryResolver, },
  6336. { type: ApplicationInitStatus, },
  6337. ]; };
  6338. return ApplicationRef;
  6339. }());
  6340. /**
  6341. * @template T
  6342. * @param {?} list
  6343. * @param {?} el
  6344. * @return {?}
  6345. */
  6346. function remove(list, el) {
  6347. var /** @type {?} */ index = list.indexOf(el);
  6348. if (index > -1) {
  6349. list.splice(index, 1);
  6350. }
  6351. }
  6352. /**
  6353. * @fileoverview added by tsickle
  6354. * @suppress {checkTypes} checked by tsc
  6355. */
  6356. /**
  6357. * @license
  6358. * Copyright Google Inc. All Rights Reserved.
  6359. *
  6360. * Use of this source code is governed by an MIT-style license that can be
  6361. * found in the LICENSE file at https://angular.io/license
  6362. */
  6363. /**
  6364. * @fileoverview added by tsickle
  6365. * @suppress {checkTypes} checked by tsc
  6366. */
  6367. /**
  6368. * @license
  6369. * Copyright Google Inc. All Rights Reserved.
  6370. *
  6371. * Use of this source code is governed by an MIT-style license that can be
  6372. * found in the LICENSE file at https://angular.io/license
  6373. */
  6374. /**
  6375. * @deprecated Use `RendererType2` (and `Renderer2`) instead.
  6376. */
  6377. var RenderComponentType = /** @class */ (function () {
  6378. function RenderComponentType(id, templateUrl, slotCount, encapsulation, styles, animations) {
  6379. this.id = id;
  6380. this.templateUrl = templateUrl;
  6381. this.slotCount = slotCount;
  6382. this.encapsulation = encapsulation;
  6383. this.styles = styles;
  6384. this.animations = animations;
  6385. }
  6386. return RenderComponentType;
  6387. }());
  6388. /**
  6389. * @deprecated Debug info is handeled internally in the view engine now.
  6390. * @abstract
  6391. */
  6392. var RenderDebugInfo = /** @class */ (function () {
  6393. function RenderDebugInfo() {
  6394. }
  6395. return RenderDebugInfo;
  6396. }());
  6397. /**
  6398. * @deprecated Use the `Renderer2` instead.
  6399. * @record
  6400. */
  6401. /**
  6402. * @deprecated Use the `Renderer2` instead.
  6403. * @abstract
  6404. */
  6405. var Renderer = /** @class */ (function () {
  6406. function Renderer() {
  6407. }
  6408. return Renderer;
  6409. }());
  6410. var Renderer2Interceptor = new InjectionToken('Renderer2Interceptor');
  6411. /**
  6412. * Injectable service that provides a low-level interface for modifying the UI.
  6413. *
  6414. * Use this service to bypass Angular's templating and make custom UI changes that can't be
  6415. * expressed declaratively. For example if you need to set a property or an attribute whose name is
  6416. * not statically known, use {\@link Renderer#setElementProperty setElementProperty} or
  6417. * {\@link Renderer#setElementAttribute setElementAttribute} respectively.
  6418. *
  6419. * If you are implementing a custom renderer, you must implement this interface.
  6420. *
  6421. * The default Renderer implementation is `DomRenderer`. Also available is `WebWorkerRenderer`.
  6422. *
  6423. * @deprecated Use `RendererFactory2` instead.
  6424. * @abstract
  6425. */
  6426. var RootRenderer = /** @class */ (function () {
  6427. function RootRenderer() {
  6428. }
  6429. return RootRenderer;
  6430. }());
  6431. /**
  6432. * \@experimental
  6433. * @record
  6434. */
  6435. /**
  6436. * \@experimental
  6437. * @abstract
  6438. */
  6439. var RendererFactory2 = /** @class */ (function () {
  6440. function RendererFactory2() {
  6441. }
  6442. return RendererFactory2;
  6443. }());
  6444. /** @enum {number} */
  6445. var RendererStyleFlags2 = {
  6446. Important: 1,
  6447. DashCase: 2,
  6448. };
  6449. RendererStyleFlags2[RendererStyleFlags2.Important] = "Important";
  6450. RendererStyleFlags2[RendererStyleFlags2.DashCase] = "DashCase";
  6451. /**
  6452. * \@experimental
  6453. * @abstract
  6454. */
  6455. var Renderer2 = /** @class */ (function () {
  6456. function Renderer2() {
  6457. }
  6458. return Renderer2;
  6459. }());
  6460. /**
  6461. * @fileoverview added by tsickle
  6462. * @suppress {checkTypes} checked by tsc
  6463. */
  6464. /**
  6465. * @license
  6466. * Copyright Google Inc. All Rights Reserved.
  6467. *
  6468. * Use of this source code is governed by an MIT-style license that can be
  6469. * found in the LICENSE file at https://angular.io/license
  6470. */
  6471. /**
  6472. * @fileoverview added by tsickle
  6473. * @suppress {checkTypes} checked by tsc
  6474. */
  6475. /**
  6476. * @license
  6477. * Copyright Google Inc. All Rights Reserved.
  6478. *
  6479. * Use of this source code is governed by an MIT-style license that can be
  6480. * found in the LICENSE file at https://angular.io/license
  6481. */
  6482. /**
  6483. * A wrapper around a native element inside of a View.
  6484. *
  6485. * An `ElementRef` is backed by a render-specific element. In the browser, this is usually a DOM
  6486. * element.
  6487. *
  6488. * \@security Permitting direct access to the DOM can make your application more vulnerable to
  6489. * XSS attacks. Carefully review any use of `ElementRef` in your code. For more detail, see the
  6490. * [Security Guide](http://g.co/ng/security).
  6491. *
  6492. * \@stable
  6493. */
  6494. var ElementRef = /** @class */ (function () {
  6495. function ElementRef(nativeElement) {
  6496. this.nativeElement = nativeElement;
  6497. }
  6498. return ElementRef;
  6499. }());
  6500. /**
  6501. * @fileoverview added by tsickle
  6502. * @suppress {checkTypes} checked by tsc
  6503. */
  6504. /**
  6505. * @license
  6506. * Copyright Google Inc. All Rights Reserved.
  6507. *
  6508. * Use of this source code is governed by an MIT-style license that can be
  6509. * found in the LICENSE file at https://angular.io/license
  6510. */
  6511. /**
  6512. * Used to load ng module factories.
  6513. * \@stable
  6514. * @abstract
  6515. */
  6516. var NgModuleFactoryLoader = /** @class */ (function () {
  6517. function NgModuleFactoryLoader() {
  6518. }
  6519. return NgModuleFactoryLoader;
  6520. }());
  6521. var moduleFactories = new Map();
  6522. /**
  6523. * Registers a loaded module. Should only be called from generated NgModuleFactory code.
  6524. * \@experimental
  6525. * @param {?} id
  6526. * @param {?} factory
  6527. * @return {?}
  6528. */
  6529. function registerModuleFactory(id, factory) {
  6530. var /** @type {?} */ existing = moduleFactories.get(id);
  6531. if (existing) {
  6532. throw new Error("Duplicate module registered for " + id + " - " + existing.moduleType.name + " vs " + factory.moduleType.name);
  6533. }
  6534. moduleFactories.set(id, factory);
  6535. }
  6536. /**
  6537. * @return {?}
  6538. */
  6539. /**
  6540. * Returns the NgModuleFactory with the given id, if it exists and has been loaded.
  6541. * Factories for modules that do not specify an `id` cannot be retrieved. Throws if the module
  6542. * cannot be found.
  6543. * \@experimental
  6544. * @param {?} id
  6545. * @return {?}
  6546. */
  6547. function getModuleFactory(id) {
  6548. var /** @type {?} */ factory = moduleFactories.get(id);
  6549. if (!factory)
  6550. throw new Error("No module with ID " + id + " loaded");
  6551. return factory;
  6552. }
  6553. /**
  6554. * @fileoverview added by tsickle
  6555. * @suppress {checkTypes} checked by tsc
  6556. */
  6557. /**
  6558. * @license
  6559. * Copyright Google Inc. All Rights Reserved.
  6560. *
  6561. * Use of this source code is governed by an MIT-style license that can be
  6562. * found in the LICENSE file at https://angular.io/license
  6563. */
  6564. /**
  6565. * An unmodifiable list of items that Angular keeps up to date when the state
  6566. * of the application changes.
  6567. *
  6568. * The type of object that {\@link ViewChildren}, {\@link ContentChildren}, and {\@link QueryList}
  6569. * provide.
  6570. *
  6571. * Implements an iterable interface, therefore it can be used in both ES6
  6572. * javascript `for (var i of items)` loops as well as in Angular templates with
  6573. * `*ngFor="let i of myList"`.
  6574. *
  6575. * Changes can be observed by subscribing to the changes `Observable`.
  6576. *
  6577. * NOTE: In the future this class will implement an `Observable` interface.
  6578. *
  6579. * ### Example ([live demo](http://plnkr.co/edit/RX8sJnQYl9FWuSCWme5z?p=preview))
  6580. * ```typescript
  6581. * \@Component({...})
  6582. * class Container {
  6583. * \@ViewChildren(Item) items:QueryList<Item>;
  6584. * }
  6585. * ```
  6586. * \@stable
  6587. * @template T
  6588. */
  6589. var QueryList = /** @class */ (function () {
  6590. function QueryList() {
  6591. this.dirty = true;
  6592. this._results = [];
  6593. this.changes = new EventEmitter();
  6594. this.length = 0;
  6595. }
  6596. /**
  6597. * See
  6598. * [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)
  6599. */
  6600. /**
  6601. * See
  6602. * [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)
  6603. * @template U
  6604. * @param {?} fn
  6605. * @return {?}
  6606. */
  6607. QueryList.prototype.map = /**
  6608. * See
  6609. * [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)
  6610. * @template U
  6611. * @param {?} fn
  6612. * @return {?}
  6613. */
  6614. function (fn) { return this._results.map(fn); };
  6615. /**
  6616. * See
  6617. * [Array.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)
  6618. */
  6619. /**
  6620. * See
  6621. * [Array.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)
  6622. * @param {?} fn
  6623. * @return {?}
  6624. */
  6625. QueryList.prototype.filter = /**
  6626. * See
  6627. * [Array.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)
  6628. * @param {?} fn
  6629. * @return {?}
  6630. */
  6631. function (fn) {
  6632. return this._results.filter(fn);
  6633. };
  6634. /**
  6635. * See
  6636. * [Array.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)
  6637. */
  6638. /**
  6639. * See
  6640. * [Array.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)
  6641. * @param {?} fn
  6642. * @return {?}
  6643. */
  6644. QueryList.prototype.find = /**
  6645. * See
  6646. * [Array.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)
  6647. * @param {?} fn
  6648. * @return {?}
  6649. */
  6650. function (fn) {
  6651. return this._results.find(fn);
  6652. };
  6653. /**
  6654. * See
  6655. * [Array.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)
  6656. */
  6657. /**
  6658. * See
  6659. * [Array.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)
  6660. * @template U
  6661. * @param {?} fn
  6662. * @param {?} init
  6663. * @return {?}
  6664. */
  6665. QueryList.prototype.reduce = /**
  6666. * See
  6667. * [Array.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)
  6668. * @template U
  6669. * @param {?} fn
  6670. * @param {?} init
  6671. * @return {?}
  6672. */
  6673. function (fn, init) {
  6674. return this._results.reduce(fn, init);
  6675. };
  6676. /**
  6677. * See
  6678. * [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)
  6679. */
  6680. /**
  6681. * See
  6682. * [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)
  6683. * @param {?} fn
  6684. * @return {?}
  6685. */
  6686. QueryList.prototype.forEach = /**
  6687. * See
  6688. * [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)
  6689. * @param {?} fn
  6690. * @return {?}
  6691. */
  6692. function (fn) { this._results.forEach(fn); };
  6693. /**
  6694. * See
  6695. * [Array.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some)
  6696. */
  6697. /**
  6698. * See
  6699. * [Array.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some)
  6700. * @param {?} fn
  6701. * @return {?}
  6702. */
  6703. QueryList.prototype.some = /**
  6704. * See
  6705. * [Array.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some)
  6706. * @param {?} fn
  6707. * @return {?}
  6708. */
  6709. function (fn) {
  6710. return this._results.some(fn);
  6711. };
  6712. /**
  6713. * @return {?}
  6714. */
  6715. QueryList.prototype.toArray = /**
  6716. * @return {?}
  6717. */
  6718. function () { return this._results.slice(); };
  6719. /**
  6720. * @return {?}
  6721. */
  6722. QueryList.prototype[getSymbolIterator()] = /**
  6723. * @return {?}
  6724. */
  6725. function () { return (/** @type {?} */ (this._results))[getSymbolIterator()](); };
  6726. /**
  6727. * @return {?}
  6728. */
  6729. QueryList.prototype.toString = /**
  6730. * @return {?}
  6731. */
  6732. function () { return this._results.toString(); };
  6733. /**
  6734. * @param {?} res
  6735. * @return {?}
  6736. */
  6737. QueryList.prototype.reset = /**
  6738. * @param {?} res
  6739. * @return {?}
  6740. */
  6741. function (res) {
  6742. this._results = flatten(res);
  6743. (/** @type {?} */ (this)).dirty = false;
  6744. (/** @type {?} */ (this)).length = this._results.length;
  6745. (/** @type {?} */ (this)).last = this._results[this.length - 1];
  6746. (/** @type {?} */ (this)).first = this._results[0];
  6747. };
  6748. /**
  6749. * @return {?}
  6750. */
  6751. QueryList.prototype.notifyOnChanges = /**
  6752. * @return {?}
  6753. */
  6754. function () { (/** @type {?} */ (this.changes)).emit(this); };
  6755. /** internal */
  6756. /**
  6757. * internal
  6758. * @return {?}
  6759. */
  6760. QueryList.prototype.setDirty = /**
  6761. * internal
  6762. * @return {?}
  6763. */
  6764. function () { (/** @type {?} */ (this)).dirty = true; };
  6765. /** internal */
  6766. /**
  6767. * internal
  6768. * @return {?}
  6769. */
  6770. QueryList.prototype.destroy = /**
  6771. * internal
  6772. * @return {?}
  6773. */
  6774. function () {
  6775. (/** @type {?} */ (this.changes)).complete();
  6776. (/** @type {?} */ (this.changes)).unsubscribe();
  6777. };
  6778. return QueryList;
  6779. }());
  6780. /**
  6781. * @template T
  6782. * @param {?} list
  6783. * @return {?}
  6784. */
  6785. function flatten(list) {
  6786. return list.reduce(function (flat, item) {
  6787. var /** @type {?} */ flatItem = Array.isArray(item) ? flatten(item) : item;
  6788. return (/** @type {?} */ (flat)).concat(flatItem);
  6789. }, []);
  6790. }
  6791. /**
  6792. * @fileoverview added by tsickle
  6793. * @suppress {checkTypes} checked by tsc
  6794. */
  6795. /**
  6796. * @license
  6797. * Copyright Google Inc. All Rights Reserved.
  6798. *
  6799. * Use of this source code is governed by an MIT-style license that can be
  6800. * found in the LICENSE file at https://angular.io/license
  6801. */
  6802. var _SEPARATOR = '#';
  6803. var FACTORY_CLASS_SUFFIX = 'NgFactory';
  6804. /**
  6805. * Configuration for SystemJsNgModuleLoader.
  6806. * token.
  6807. *
  6808. * \@experimental
  6809. * @abstract
  6810. */
  6811. var SystemJsNgModuleLoaderConfig = /** @class */ (function () {
  6812. function SystemJsNgModuleLoaderConfig() {
  6813. }
  6814. return SystemJsNgModuleLoaderConfig;
  6815. }());
  6816. var DEFAULT_CONFIG = {
  6817. factoryPathPrefix: '',
  6818. factoryPathSuffix: '.ngfactory',
  6819. };
  6820. /**
  6821. * NgModuleFactoryLoader that uses SystemJS to load NgModuleFactory
  6822. * \@experimental
  6823. */
  6824. var SystemJsNgModuleLoader = /** @class */ (function () {
  6825. function SystemJsNgModuleLoader(_compiler, config) {
  6826. this._compiler = _compiler;
  6827. this._config = config || DEFAULT_CONFIG;
  6828. }
  6829. /**
  6830. * @param {?} path
  6831. * @return {?}
  6832. */
  6833. SystemJsNgModuleLoader.prototype.load = /**
  6834. * @param {?} path
  6835. * @return {?}
  6836. */
  6837. function (path) {
  6838. var /** @type {?} */ offlineMode = this._compiler instanceof Compiler;
  6839. return offlineMode ? this.loadFactory(path) : this.loadAndCompile(path);
  6840. };
  6841. /**
  6842. * @param {?} path
  6843. * @return {?}
  6844. */
  6845. SystemJsNgModuleLoader.prototype.loadAndCompile = /**
  6846. * @param {?} path
  6847. * @return {?}
  6848. */
  6849. function (path) {
  6850. var _this = this;
  6851. var _a = path.split(_SEPARATOR), module = _a[0], exportName = _a[1];
  6852. if (exportName === undefined) {
  6853. exportName = 'default';
  6854. }
  6855. return __webpack_require__(114)(module)
  6856. .then(function (module) { return module[exportName]; })
  6857. .then(function (type) { return checkNotEmpty(type, module, exportName); })
  6858. .then(function (type) { return _this._compiler.compileModuleAsync(type); });
  6859. };
  6860. /**
  6861. * @param {?} path
  6862. * @return {?}
  6863. */
  6864. SystemJsNgModuleLoader.prototype.loadFactory = /**
  6865. * @param {?} path
  6866. * @return {?}
  6867. */
  6868. function (path) {
  6869. var _a = path.split(_SEPARATOR), module = _a[0], exportName = _a[1];
  6870. var /** @type {?} */ factoryClassSuffix = FACTORY_CLASS_SUFFIX;
  6871. if (exportName === undefined) {
  6872. exportName = 'default';
  6873. factoryClassSuffix = '';
  6874. }
  6875. return __webpack_require__(114)(this._config.factoryPathPrefix + module + this._config.factoryPathSuffix)
  6876. .then(function (module) { return module[exportName + factoryClassSuffix]; })
  6877. .then(function (factory) { return checkNotEmpty(factory, module, exportName); });
  6878. };
  6879. SystemJsNgModuleLoader.decorators = [
  6880. { type: Injectable },
  6881. ];
  6882. /** @nocollapse */
  6883. SystemJsNgModuleLoader.ctorParameters = function () { return [
  6884. { type: Compiler, },
  6885. { type: SystemJsNgModuleLoaderConfig, decorators: [{ type: Optional },] },
  6886. ]; };
  6887. return SystemJsNgModuleLoader;
  6888. }());
  6889. /**
  6890. * @param {?} value
  6891. * @param {?} modulePath
  6892. * @param {?} exportName
  6893. * @return {?}
  6894. */
  6895. function checkNotEmpty(value, modulePath, exportName) {
  6896. if (!value) {
  6897. throw new Error("Cannot find '" + exportName + "' in '" + modulePath + "'");
  6898. }
  6899. return value;
  6900. }
  6901. /**
  6902. * @fileoverview added by tsickle
  6903. * @suppress {checkTypes} checked by tsc
  6904. */
  6905. /**
  6906. * @license
  6907. * Copyright Google Inc. All Rights Reserved.
  6908. *
  6909. * Use of this source code is governed by an MIT-style license that can be
  6910. * found in the LICENSE file at https://angular.io/license
  6911. */
  6912. /**
  6913. * Represents an Embedded Template that can be used to instantiate Embedded Views.
  6914. *
  6915. * You can access a `TemplateRef`, in two ways. Via a directive placed on a `<ng-template>` element
  6916. * (or directive prefixed with `*`) and have the `TemplateRef` for this Embedded View injected into
  6917. * the constructor of the directive using the `TemplateRef` Token. Alternatively you can query for
  6918. * the `TemplateRef` from a Component or a Directive via {\@link Query}.
  6919. *
  6920. * To instantiate Embedded Views based on a Template, use {\@link ViewContainerRef#
  6921. * createEmbeddedView}, which will create the View and attach it to the View Container.
  6922. * \@stable
  6923. * @abstract
  6924. * @template C
  6925. */
  6926. var TemplateRef = /** @class */ (function () {
  6927. function TemplateRef() {
  6928. }
  6929. return TemplateRef;
  6930. }());
  6931. /**
  6932. * @fileoverview added by tsickle
  6933. * @suppress {checkTypes} checked by tsc
  6934. */
  6935. /**
  6936. * @license
  6937. * Copyright Google Inc. All Rights Reserved.
  6938. *
  6939. * Use of this source code is governed by an MIT-style license that can be
  6940. * found in the LICENSE file at https://angular.io/license
  6941. */
  6942. /**
  6943. * Represents a container where one or more Views can be attached.
  6944. *
  6945. * The container can contain two kinds of Views. Host Views, created by instantiating a
  6946. * {\@link Component} via {\@link #createComponent}, and Embedded Views, created by instantiating an
  6947. * {\@link TemplateRef Embedded Template} via {\@link #createEmbeddedView}.
  6948. *
  6949. * The location of the View Container within the containing View is specified by the Anchor
  6950. * `element`. Each View Container can have only one Anchor Element and each Anchor Element can only
  6951. * have a single View Container.
  6952. *
  6953. * Root elements of Views attached to this container become siblings of the Anchor Element in
  6954. * the Rendered View.
  6955. *
  6956. * To access a `ViewContainerRef` of an Element, you can either place a {\@link Directive} injected
  6957. * with `ViewContainerRef` on the Element, or you obtain it via a {\@link ViewChild} query.
  6958. * \@stable
  6959. * @abstract
  6960. */
  6961. var ViewContainerRef = /** @class */ (function () {
  6962. function ViewContainerRef() {
  6963. }
  6964. return ViewContainerRef;
  6965. }());
  6966. /**
  6967. * @fileoverview added by tsickle
  6968. * @suppress {checkTypes} checked by tsc
  6969. */
  6970. /**
  6971. * @license
  6972. * Copyright Google Inc. All Rights Reserved.
  6973. *
  6974. * Use of this source code is governed by an MIT-style license that can be
  6975. * found in the LICENSE file at https://angular.io/license
  6976. */
  6977. /**
  6978. * \@stable
  6979. * @abstract
  6980. */
  6981. var ChangeDetectorRef = /** @class */ (function () {
  6982. function ChangeDetectorRef() {
  6983. }
  6984. return ChangeDetectorRef;
  6985. }());
  6986. /**
  6987. * @fileoverview added by tsickle
  6988. * @suppress {checkTypes} checked by tsc
  6989. */
  6990. /**
  6991. * @license
  6992. * Copyright Google Inc. All Rights Reserved.
  6993. *
  6994. * Use of this source code is governed by an MIT-style license that can be
  6995. * found in the LICENSE file at https://angular.io/license
  6996. */
  6997. /**
  6998. * \@stable
  6999. * @abstract
  7000. */
  7001. var ViewRef = /** @class */ (function (_super) {
  7002. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(ViewRef, _super);
  7003. function ViewRef() {
  7004. return _super !== null && _super.apply(this, arguments) || this;
  7005. }
  7006. return ViewRef;
  7007. }(ChangeDetectorRef));
  7008. /**
  7009. * Represents an Angular View.
  7010. *
  7011. * <!-- TODO: move the next two paragraphs to the dev guide -->
  7012. * A View is a fundamental building block of the application UI. It is the smallest grouping of
  7013. * Elements which are created and destroyed together.
  7014. *
  7015. * Properties of elements in a View can change, but the structure (number and order) of elements in
  7016. * a View cannot. Changing the structure of Elements can only be done by inserting, moving or
  7017. * removing nested Views via a {\@link ViewContainerRef}. Each View can contain many View Containers.
  7018. * <!-- /TODO -->
  7019. *
  7020. * ### Example
  7021. *
  7022. * Given this template...
  7023. *
  7024. * ```
  7025. * Count: {{items.length}}
  7026. * <ul>
  7027. * <li *ngFor="let item of items">{{item}}</li>
  7028. * </ul>
  7029. * ```
  7030. *
  7031. * We have two {\@link TemplateRef}s:
  7032. *
  7033. * Outer {\@link TemplateRef}:
  7034. * ```
  7035. * Count: {{items.length}}
  7036. * <ul>
  7037. * <ng-template ngFor let-item [ngForOf]="items"></ng-template>
  7038. * </ul>
  7039. * ```
  7040. *
  7041. * Inner {\@link TemplateRef}:
  7042. * ```
  7043. * <li>{{item}}</li>
  7044. * ```
  7045. *
  7046. * Notice that the original template is broken down into two separate {\@link TemplateRef}s.
  7047. *
  7048. * The outer/inner {\@link TemplateRef}s are then assembled into views like so:
  7049. *
  7050. * ```
  7051. * <!-- ViewRef: outer-0 -->
  7052. * Count: 2
  7053. * <ul>
  7054. * <ng-template view-container-ref></ng-template>
  7055. * <!-- ViewRef: inner-1 --><li>first</li><!-- /ViewRef: inner-1 -->
  7056. * <!-- ViewRef: inner-2 --><li>second</li><!-- /ViewRef: inner-2 -->
  7057. * </ul>
  7058. * <!-- /ViewRef: outer-0 -->
  7059. * ```
  7060. * \@experimental
  7061. * @abstract
  7062. * @template C
  7063. */
  7064. var EmbeddedViewRef = /** @class */ (function (_super) {
  7065. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(EmbeddedViewRef, _super);
  7066. function EmbeddedViewRef() {
  7067. return _super !== null && _super.apply(this, arguments) || this;
  7068. }
  7069. return EmbeddedViewRef;
  7070. }(ViewRef));
  7071. /**
  7072. * @record
  7073. */
  7074. /**
  7075. * @fileoverview added by tsickle
  7076. * @suppress {checkTypes} checked by tsc
  7077. */
  7078. /**
  7079. * @license
  7080. * Copyright Google Inc. All Rights Reserved.
  7081. *
  7082. * Use of this source code is governed by an MIT-style license that can be
  7083. * found in the LICENSE file at https://angular.io/license
  7084. */
  7085. /**
  7086. * @fileoverview added by tsickle
  7087. * @suppress {checkTypes} checked by tsc
  7088. */
  7089. /**
  7090. * @license
  7091. * Copyright Google Inc. All Rights Reserved.
  7092. *
  7093. * Use of this source code is governed by an MIT-style license that can be
  7094. * found in the LICENSE file at https://angular.io/license
  7095. */
  7096. var EventListener = /** @class */ (function () {
  7097. function EventListener(name, callback) {
  7098. this.name = name;
  7099. this.callback = callback;
  7100. }
  7101. return EventListener;
  7102. }());
  7103. /**
  7104. * \@experimental All debugging apis are currently experimental.
  7105. */
  7106. var DebugNode = /** @class */ (function () {
  7107. function DebugNode(nativeNode, parent, _debugContext) {
  7108. this._debugContext = _debugContext;
  7109. this.nativeNode = nativeNode;
  7110. if (parent && parent instanceof DebugElement) {
  7111. parent.addChild(this);
  7112. }
  7113. else {
  7114. this.parent = null;
  7115. }
  7116. this.listeners = [];
  7117. }
  7118. Object.defineProperty(DebugNode.prototype, "injector", {
  7119. get: /**
  7120. * @return {?}
  7121. */
  7122. function () { return this._debugContext.injector; },
  7123. enumerable: true,
  7124. configurable: true
  7125. });
  7126. Object.defineProperty(DebugNode.prototype, "componentInstance", {
  7127. get: /**
  7128. * @return {?}
  7129. */
  7130. function () { return this._debugContext.component; },
  7131. enumerable: true,
  7132. configurable: true
  7133. });
  7134. Object.defineProperty(DebugNode.prototype, "context", {
  7135. get: /**
  7136. * @return {?}
  7137. */
  7138. function () { return this._debugContext.context; },
  7139. enumerable: true,
  7140. configurable: true
  7141. });
  7142. Object.defineProperty(DebugNode.prototype, "references", {
  7143. get: /**
  7144. * @return {?}
  7145. */
  7146. function () { return this._debugContext.references; },
  7147. enumerable: true,
  7148. configurable: true
  7149. });
  7150. Object.defineProperty(DebugNode.prototype, "providerTokens", {
  7151. get: /**
  7152. * @return {?}
  7153. */
  7154. function () { return this._debugContext.providerTokens; },
  7155. enumerable: true,
  7156. configurable: true
  7157. });
  7158. return DebugNode;
  7159. }());
  7160. /**
  7161. * \@experimental All debugging apis are currently experimental.
  7162. */
  7163. var DebugElement = /** @class */ (function (_super) {
  7164. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(DebugElement, _super);
  7165. function DebugElement(nativeNode, parent, _debugContext) {
  7166. var _this = _super.call(this, nativeNode, parent, _debugContext) || this;
  7167. _this.properties = {};
  7168. _this.attributes = {};
  7169. _this.classes = {};
  7170. _this.styles = {};
  7171. _this.childNodes = [];
  7172. _this.nativeElement = nativeNode;
  7173. return _this;
  7174. }
  7175. /**
  7176. * @param {?} child
  7177. * @return {?}
  7178. */
  7179. DebugElement.prototype.addChild = /**
  7180. * @param {?} child
  7181. * @return {?}
  7182. */
  7183. function (child) {
  7184. if (child) {
  7185. this.childNodes.push(child);
  7186. child.parent = this;
  7187. }
  7188. };
  7189. /**
  7190. * @param {?} child
  7191. * @return {?}
  7192. */
  7193. DebugElement.prototype.removeChild = /**
  7194. * @param {?} child
  7195. * @return {?}
  7196. */
  7197. function (child) {
  7198. var /** @type {?} */ childIndex = this.childNodes.indexOf(child);
  7199. if (childIndex !== -1) {
  7200. child.parent = null;
  7201. this.childNodes.splice(childIndex, 1);
  7202. }
  7203. };
  7204. /**
  7205. * @param {?} child
  7206. * @param {?} newChildren
  7207. * @return {?}
  7208. */
  7209. DebugElement.prototype.insertChildrenAfter = /**
  7210. * @param {?} child
  7211. * @param {?} newChildren
  7212. * @return {?}
  7213. */
  7214. function (child, newChildren) {
  7215. var _this = this;
  7216. var /** @type {?} */ siblingIndex = this.childNodes.indexOf(child);
  7217. if (siblingIndex !== -1) {
  7218. (_a = this.childNodes).splice.apply(_a, [siblingIndex + 1, 0].concat(newChildren));
  7219. newChildren.forEach(function (c) {
  7220. if (c.parent) {
  7221. c.parent.removeChild(c);
  7222. }
  7223. c.parent = _this;
  7224. });
  7225. }
  7226. var _a;
  7227. };
  7228. /**
  7229. * @param {?} refChild
  7230. * @param {?} newChild
  7231. * @return {?}
  7232. */
  7233. DebugElement.prototype.insertBefore = /**
  7234. * @param {?} refChild
  7235. * @param {?} newChild
  7236. * @return {?}
  7237. */
  7238. function (refChild, newChild) {
  7239. var /** @type {?} */ refIndex = this.childNodes.indexOf(refChild);
  7240. if (refIndex === -1) {
  7241. this.addChild(newChild);
  7242. }
  7243. else {
  7244. if (newChild.parent) {
  7245. newChild.parent.removeChild(newChild);
  7246. }
  7247. newChild.parent = this;
  7248. this.childNodes.splice(refIndex, 0, newChild);
  7249. }
  7250. };
  7251. /**
  7252. * @param {?} predicate
  7253. * @return {?}
  7254. */
  7255. DebugElement.prototype.query = /**
  7256. * @param {?} predicate
  7257. * @return {?}
  7258. */
  7259. function (predicate) {
  7260. var /** @type {?} */ results = this.queryAll(predicate);
  7261. return results[0] || null;
  7262. };
  7263. /**
  7264. * @param {?} predicate
  7265. * @return {?}
  7266. */
  7267. DebugElement.prototype.queryAll = /**
  7268. * @param {?} predicate
  7269. * @return {?}
  7270. */
  7271. function (predicate) {
  7272. var /** @type {?} */ matches = [];
  7273. _queryElementChildren(this, predicate, matches);
  7274. return matches;
  7275. };
  7276. /**
  7277. * @param {?} predicate
  7278. * @return {?}
  7279. */
  7280. DebugElement.prototype.queryAllNodes = /**
  7281. * @param {?} predicate
  7282. * @return {?}
  7283. */
  7284. function (predicate) {
  7285. var /** @type {?} */ matches = [];
  7286. _queryNodeChildren(this, predicate, matches);
  7287. return matches;
  7288. };
  7289. Object.defineProperty(DebugElement.prototype, "children", {
  7290. get: /**
  7291. * @return {?}
  7292. */
  7293. function () {
  7294. return /** @type {?} */ (this.childNodes.filter(function (node) { return node instanceof DebugElement; }));
  7295. },
  7296. enumerable: true,
  7297. configurable: true
  7298. });
  7299. /**
  7300. * @param {?} eventName
  7301. * @param {?} eventObj
  7302. * @return {?}
  7303. */
  7304. DebugElement.prototype.triggerEventHandler = /**
  7305. * @param {?} eventName
  7306. * @param {?} eventObj
  7307. * @return {?}
  7308. */
  7309. function (eventName, eventObj) {
  7310. this.listeners.forEach(function (listener) {
  7311. if (listener.name == eventName) {
  7312. listener.callback(eventObj);
  7313. }
  7314. });
  7315. };
  7316. return DebugElement;
  7317. }(DebugNode));
  7318. /**
  7319. * \@experimental
  7320. * @param {?} debugEls
  7321. * @return {?}
  7322. */
  7323. function asNativeElements(debugEls) {
  7324. return debugEls.map(function (el) { return el.nativeElement; });
  7325. }
  7326. /**
  7327. * @param {?} element
  7328. * @param {?} predicate
  7329. * @param {?} matches
  7330. * @return {?}
  7331. */
  7332. function _queryElementChildren(element, predicate, matches) {
  7333. element.childNodes.forEach(function (node) {
  7334. if (node instanceof DebugElement) {
  7335. if (predicate(node)) {
  7336. matches.push(node);
  7337. }
  7338. _queryElementChildren(node, predicate, matches);
  7339. }
  7340. });
  7341. }
  7342. /**
  7343. * @param {?} parentNode
  7344. * @param {?} predicate
  7345. * @param {?} matches
  7346. * @return {?}
  7347. */
  7348. function _queryNodeChildren(parentNode, predicate, matches) {
  7349. if (parentNode instanceof DebugElement) {
  7350. parentNode.childNodes.forEach(function (node) {
  7351. if (predicate(node)) {
  7352. matches.push(node);
  7353. }
  7354. if (node instanceof DebugElement) {
  7355. _queryNodeChildren(node, predicate, matches);
  7356. }
  7357. });
  7358. }
  7359. }
  7360. // Need to keep the nodes in a global Map so that multiple angular apps are supported.
  7361. var _nativeNodeToDebugNode = new Map();
  7362. /**
  7363. * \@experimental
  7364. * @param {?} nativeNode
  7365. * @return {?}
  7366. */
  7367. function getDebugNode(nativeNode) {
  7368. return _nativeNodeToDebugNode.get(nativeNode) || null;
  7369. }
  7370. /**
  7371. * @return {?}
  7372. */
  7373. /**
  7374. * @param {?} node
  7375. * @return {?}
  7376. */
  7377. function indexDebugNode(node) {
  7378. _nativeNodeToDebugNode.set(node.nativeNode, node);
  7379. }
  7380. /**
  7381. * @param {?} node
  7382. * @return {?}
  7383. */
  7384. function removeDebugNodeFromIndex(node) {
  7385. _nativeNodeToDebugNode.delete(node.nativeNode);
  7386. }
  7387. /**
  7388. * A boolean-valued function over a value, possibly including context information
  7389. * regarding that value's position in an array.
  7390. *
  7391. * \@experimental All debugging apis are currently experimental.
  7392. * @record
  7393. * @template T
  7394. */
  7395. /**
  7396. * @fileoverview added by tsickle
  7397. * @suppress {checkTypes} checked by tsc
  7398. */
  7399. /**
  7400. * @license
  7401. * Copyright Google Inc. All Rights Reserved.
  7402. *
  7403. * Use of this source code is governed by an MIT-style license that can be
  7404. * found in the LICENSE file at https://angular.io/license
  7405. */
  7406. /**
  7407. * @param {?} a
  7408. * @param {?} b
  7409. * @return {?}
  7410. */
  7411. function devModeEqual(a, b) {
  7412. var /** @type {?} */ isListLikeIterableA = isListLikeIterable(a);
  7413. var /** @type {?} */ isListLikeIterableB = isListLikeIterable(b);
  7414. if (isListLikeIterableA && isListLikeIterableB) {
  7415. return areIterablesEqual(a, b, devModeEqual);
  7416. }
  7417. else {
  7418. var /** @type {?} */ isAObject = a && (typeof a === 'object' || typeof a === 'function');
  7419. var /** @type {?} */ isBObject = b && (typeof b === 'object' || typeof b === 'function');
  7420. if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {
  7421. return true;
  7422. }
  7423. else {
  7424. return looseIdentical(a, b);
  7425. }
  7426. }
  7427. }
  7428. /**
  7429. * Indicates that the result of a {\@link Pipe} transformation has changed even though the
  7430. * reference has not changed.
  7431. *
  7432. * Wrapped values are unwrapped automatically during the change detection, and the unwrapped value
  7433. * is stored.
  7434. *
  7435. * Example:
  7436. *
  7437. * ```
  7438. * if (this._latestValue === this._latestReturnedValue) {
  7439. * return this._latestReturnedValue;
  7440. * } else {
  7441. * this._latestReturnedValue = this._latestValue;
  7442. * return WrappedValue.wrap(this._latestValue); // this will force update
  7443. * }
  7444. * ```
  7445. * \@stable
  7446. */
  7447. var WrappedValue = /** @class */ (function () {
  7448. function WrappedValue(value) {
  7449. this.wrapped = value;
  7450. }
  7451. /** Creates a wrapped value. */
  7452. /**
  7453. * Creates a wrapped value.
  7454. * @param {?} value
  7455. * @return {?}
  7456. */
  7457. WrappedValue.wrap = /**
  7458. * Creates a wrapped value.
  7459. * @param {?} value
  7460. * @return {?}
  7461. */
  7462. function (value) { return new WrappedValue(value); };
  7463. /**
  7464. * Returns the underlying value of a wrapped value.
  7465. * Returns the given `value` when it is not wrapped.
  7466. **/
  7467. /**
  7468. * Returns the underlying value of a wrapped value.
  7469. * Returns the given `value` when it is not wrapped.
  7470. *
  7471. * @param {?} value
  7472. * @return {?}
  7473. */
  7474. WrappedValue.unwrap = /**
  7475. * Returns the underlying value of a wrapped value.
  7476. * Returns the given `value` when it is not wrapped.
  7477. *
  7478. * @param {?} value
  7479. * @return {?}
  7480. */
  7481. function (value) { return WrappedValue.isWrapped(value) ? value.wrapped : value; };
  7482. /** Returns true if `value` is a wrapped value. */
  7483. /**
  7484. * Returns true if `value` is a wrapped value.
  7485. * @param {?} value
  7486. * @return {?}
  7487. */
  7488. WrappedValue.isWrapped = /**
  7489. * Returns true if `value` is a wrapped value.
  7490. * @param {?} value
  7491. * @return {?}
  7492. */
  7493. function (value) { return value instanceof WrappedValue; };
  7494. return WrappedValue;
  7495. }());
  7496. /**
  7497. * Represents a basic change from a previous to a new value.
  7498. * \@stable
  7499. */
  7500. var SimpleChange = /** @class */ (function () {
  7501. function SimpleChange(previousValue, currentValue, firstChange) {
  7502. this.previousValue = previousValue;
  7503. this.currentValue = currentValue;
  7504. this.firstChange = firstChange;
  7505. }
  7506. /**
  7507. * Check whether the new value is the first value assigned.
  7508. */
  7509. /**
  7510. * Check whether the new value is the first value assigned.
  7511. * @return {?}
  7512. */
  7513. SimpleChange.prototype.isFirstChange = /**
  7514. * Check whether the new value is the first value assigned.
  7515. * @return {?}
  7516. */
  7517. function () { return this.firstChange; };
  7518. return SimpleChange;
  7519. }());
  7520. /**
  7521. * @param {?} obj
  7522. * @return {?}
  7523. */
  7524. function isListLikeIterable(obj) {
  7525. if (!isJsObject(obj))
  7526. return false;
  7527. return Array.isArray(obj) ||
  7528. (!(obj instanceof Map) && // JS Map are iterables but return entries as [k, v]
  7529. // JS Map are iterables but return entries as [k, v]
  7530. getSymbolIterator() in obj); // JS Iterable have a Symbol.iterator prop
  7531. }
  7532. /**
  7533. * @param {?} a
  7534. * @param {?} b
  7535. * @param {?} comparator
  7536. * @return {?}
  7537. */
  7538. function areIterablesEqual(a, b, comparator) {
  7539. var /** @type {?} */ iterator1 = a[getSymbolIterator()]();
  7540. var /** @type {?} */ iterator2 = b[getSymbolIterator()]();
  7541. while (true) {
  7542. var /** @type {?} */ item1 = iterator1.next();
  7543. var /** @type {?} */ item2 = iterator2.next();
  7544. if (item1.done && item2.done)
  7545. return true;
  7546. if (item1.done || item2.done)
  7547. return false;
  7548. if (!comparator(item1.value, item2.value))
  7549. return false;
  7550. }
  7551. }
  7552. /**
  7553. * @param {?} obj
  7554. * @param {?} fn
  7555. * @return {?}
  7556. */
  7557. function iterateListLike(obj, fn) {
  7558. if (Array.isArray(obj)) {
  7559. for (var /** @type {?} */ i = 0; i < obj.length; i++) {
  7560. fn(obj[i]);
  7561. }
  7562. }
  7563. else {
  7564. var /** @type {?} */ iterator = obj[getSymbolIterator()]();
  7565. var /** @type {?} */ item = void 0;
  7566. while (!((item = iterator.next()).done)) {
  7567. fn(item.value);
  7568. }
  7569. }
  7570. }
  7571. /**
  7572. * @param {?} o
  7573. * @return {?}
  7574. */
  7575. function isJsObject(o) {
  7576. return o !== null && (typeof o === 'function' || typeof o === 'object');
  7577. }
  7578. /**
  7579. * @fileoverview added by tsickle
  7580. * @suppress {checkTypes} checked by tsc
  7581. */
  7582. /**
  7583. * @license
  7584. * Copyright Google Inc. All Rights Reserved.
  7585. *
  7586. * Use of this source code is governed by an MIT-style license that can be
  7587. * found in the LICENSE file at https://angular.io/license
  7588. */
  7589. var DefaultIterableDifferFactory = /** @class */ (function () {
  7590. function DefaultIterableDifferFactory() {
  7591. }
  7592. /**
  7593. * @param {?} obj
  7594. * @return {?}
  7595. */
  7596. DefaultIterableDifferFactory.prototype.supports = /**
  7597. * @param {?} obj
  7598. * @return {?}
  7599. */
  7600. function (obj) { return isListLikeIterable(obj); };
  7601. /**
  7602. * @template V
  7603. * @param {?=} trackByFn
  7604. * @return {?}
  7605. */
  7606. DefaultIterableDifferFactory.prototype.create = /**
  7607. * @template V
  7608. * @param {?=} trackByFn
  7609. * @return {?}
  7610. */
  7611. function (trackByFn) {
  7612. return new DefaultIterableDiffer(trackByFn);
  7613. };
  7614. return DefaultIterableDifferFactory;
  7615. }());
  7616. var trackByIdentity = function (index, item) { return item; };
  7617. /**
  7618. * @deprecated v4.0.0 - Should not be part of public API.
  7619. * @template V
  7620. */
  7621. var DefaultIterableDiffer = /** @class */ (function () {
  7622. function DefaultIterableDiffer(trackByFn) {
  7623. this.length = 0;
  7624. this._linkedRecords = null;
  7625. this._unlinkedRecords = null;
  7626. this._previousItHead = null;
  7627. this._itHead = null;
  7628. this._itTail = null;
  7629. this._additionsHead = null;
  7630. this._additionsTail = null;
  7631. this._movesHead = null;
  7632. this._movesTail = null;
  7633. this._removalsHead = null;
  7634. this._removalsTail = null;
  7635. this._identityChangesHead = null;
  7636. this._identityChangesTail = null;
  7637. this._trackByFn = trackByFn || trackByIdentity;
  7638. }
  7639. /**
  7640. * @param {?} fn
  7641. * @return {?}
  7642. */
  7643. DefaultIterableDiffer.prototype.forEachItem = /**
  7644. * @param {?} fn
  7645. * @return {?}
  7646. */
  7647. function (fn) {
  7648. var /** @type {?} */ record;
  7649. for (record = this._itHead; record !== null; record = record._next) {
  7650. fn(record);
  7651. }
  7652. };
  7653. /**
  7654. * @param {?} fn
  7655. * @return {?}
  7656. */
  7657. DefaultIterableDiffer.prototype.forEachOperation = /**
  7658. * @param {?} fn
  7659. * @return {?}
  7660. */
  7661. function (fn) {
  7662. var /** @type {?} */ nextIt = this._itHead;
  7663. var /** @type {?} */ nextRemove = this._removalsHead;
  7664. var /** @type {?} */ addRemoveOffset = 0;
  7665. var /** @type {?} */ moveOffsets = null;
  7666. while (nextIt || nextRemove) {
  7667. // Figure out which is the next record to process
  7668. // Order: remove, add, move
  7669. var /** @type {?} */ record = !nextRemove ||
  7670. nextIt && /** @type {?} */ ((nextIt.currentIndex)) < getPreviousIndex(nextRemove, addRemoveOffset, moveOffsets) ? /** @type {?} */
  7671. ((nextIt)) :
  7672. nextRemove;
  7673. var /** @type {?} */ adjPreviousIndex = getPreviousIndex(record, addRemoveOffset, moveOffsets);
  7674. var /** @type {?} */ currentIndex = record.currentIndex;
  7675. // consume the item, and adjust the addRemoveOffset and update moveDistance if necessary
  7676. if (record === nextRemove) {
  7677. addRemoveOffset--;
  7678. nextRemove = nextRemove._nextRemoved;
  7679. }
  7680. else {
  7681. nextIt = /** @type {?} */ ((nextIt))._next;
  7682. if (record.previousIndex == null) {
  7683. addRemoveOffset++;
  7684. }
  7685. else {
  7686. // INVARIANT: currentIndex < previousIndex
  7687. if (!moveOffsets)
  7688. moveOffsets = [];
  7689. var /** @type {?} */ localMovePreviousIndex = adjPreviousIndex - addRemoveOffset;
  7690. var /** @type {?} */ localCurrentIndex = /** @type {?} */ ((currentIndex)) - addRemoveOffset;
  7691. if (localMovePreviousIndex != localCurrentIndex) {
  7692. for (var /** @type {?} */ i = 0; i < localMovePreviousIndex; i++) {
  7693. var /** @type {?} */ offset = i < moveOffsets.length ? moveOffsets[i] : (moveOffsets[i] = 0);
  7694. var /** @type {?} */ index = offset + i;
  7695. if (localCurrentIndex <= index && index < localMovePreviousIndex) {
  7696. moveOffsets[i] = offset + 1;
  7697. }
  7698. }
  7699. var /** @type {?} */ previousIndex = record.previousIndex;
  7700. moveOffsets[previousIndex] = localCurrentIndex - localMovePreviousIndex;
  7701. }
  7702. }
  7703. }
  7704. if (adjPreviousIndex !== currentIndex) {
  7705. fn(record, adjPreviousIndex, currentIndex);
  7706. }
  7707. }
  7708. };
  7709. /**
  7710. * @param {?} fn
  7711. * @return {?}
  7712. */
  7713. DefaultIterableDiffer.prototype.forEachPreviousItem = /**
  7714. * @param {?} fn
  7715. * @return {?}
  7716. */
  7717. function (fn) {
  7718. var /** @type {?} */ record;
  7719. for (record = this._previousItHead; record !== null; record = record._nextPrevious) {
  7720. fn(record);
  7721. }
  7722. };
  7723. /**
  7724. * @param {?} fn
  7725. * @return {?}
  7726. */
  7727. DefaultIterableDiffer.prototype.forEachAddedItem = /**
  7728. * @param {?} fn
  7729. * @return {?}
  7730. */
  7731. function (fn) {
  7732. var /** @type {?} */ record;
  7733. for (record = this._additionsHead; record !== null; record = record._nextAdded) {
  7734. fn(record);
  7735. }
  7736. };
  7737. /**
  7738. * @param {?} fn
  7739. * @return {?}
  7740. */
  7741. DefaultIterableDiffer.prototype.forEachMovedItem = /**
  7742. * @param {?} fn
  7743. * @return {?}
  7744. */
  7745. function (fn) {
  7746. var /** @type {?} */ record;
  7747. for (record = this._movesHead; record !== null; record = record._nextMoved) {
  7748. fn(record);
  7749. }
  7750. };
  7751. /**
  7752. * @param {?} fn
  7753. * @return {?}
  7754. */
  7755. DefaultIterableDiffer.prototype.forEachRemovedItem = /**
  7756. * @param {?} fn
  7757. * @return {?}
  7758. */
  7759. function (fn) {
  7760. var /** @type {?} */ record;
  7761. for (record = this._removalsHead; record !== null; record = record._nextRemoved) {
  7762. fn(record);
  7763. }
  7764. };
  7765. /**
  7766. * @param {?} fn
  7767. * @return {?}
  7768. */
  7769. DefaultIterableDiffer.prototype.forEachIdentityChange = /**
  7770. * @param {?} fn
  7771. * @return {?}
  7772. */
  7773. function (fn) {
  7774. var /** @type {?} */ record;
  7775. for (record = this._identityChangesHead; record !== null; record = record._nextIdentityChange) {
  7776. fn(record);
  7777. }
  7778. };
  7779. /**
  7780. * @param {?} collection
  7781. * @return {?}
  7782. */
  7783. DefaultIterableDiffer.prototype.diff = /**
  7784. * @param {?} collection
  7785. * @return {?}
  7786. */
  7787. function (collection) {
  7788. if (collection == null)
  7789. collection = [];
  7790. if (!isListLikeIterable(collection)) {
  7791. throw new Error("Error trying to diff '" + stringify(collection) + "'. Only arrays and iterables are allowed");
  7792. }
  7793. if (this.check(collection)) {
  7794. return this;
  7795. }
  7796. else {
  7797. return null;
  7798. }
  7799. };
  7800. /**
  7801. * @return {?}
  7802. */
  7803. DefaultIterableDiffer.prototype.onDestroy = /**
  7804. * @return {?}
  7805. */
  7806. function () { };
  7807. /**
  7808. * @param {?} collection
  7809. * @return {?}
  7810. */
  7811. DefaultIterableDiffer.prototype.check = /**
  7812. * @param {?} collection
  7813. * @return {?}
  7814. */
  7815. function (collection) {
  7816. var _this = this;
  7817. this._reset();
  7818. var /** @type {?} */ record = this._itHead;
  7819. var /** @type {?} */ mayBeDirty = false;
  7820. var /** @type {?} */ index;
  7821. var /** @type {?} */ item;
  7822. var /** @type {?} */ itemTrackBy;
  7823. if (Array.isArray(collection)) {
  7824. (/** @type {?} */ (this)).length = collection.length;
  7825. for (var /** @type {?} */ index_1 = 0; index_1 < this.length; index_1++) {
  7826. item = collection[index_1];
  7827. itemTrackBy = this._trackByFn(index_1, item);
  7828. if (record === null || !looseIdentical(record.trackById, itemTrackBy)) {
  7829. record = this._mismatch(record, item, itemTrackBy, index_1);
  7830. mayBeDirty = true;
  7831. }
  7832. else {
  7833. if (mayBeDirty) {
  7834. // TODO(misko): can we limit this to duplicates only?
  7835. record = this._verifyReinsertion(record, item, itemTrackBy, index_1);
  7836. }
  7837. if (!looseIdentical(record.item, item))
  7838. this._addIdentityChange(record, item);
  7839. }
  7840. record = record._next;
  7841. }
  7842. }
  7843. else {
  7844. index = 0;
  7845. iterateListLike(collection, function (item) {
  7846. itemTrackBy = _this._trackByFn(index, item);
  7847. if (record === null || !looseIdentical(record.trackById, itemTrackBy)) {
  7848. record = _this._mismatch(record, item, itemTrackBy, index);
  7849. mayBeDirty = true;
  7850. }
  7851. else {
  7852. if (mayBeDirty) {
  7853. // TODO(misko): can we limit this to duplicates only?
  7854. record = _this._verifyReinsertion(record, item, itemTrackBy, index);
  7855. }
  7856. if (!looseIdentical(record.item, item))
  7857. _this._addIdentityChange(record, item);
  7858. }
  7859. record = record._next;
  7860. index++;
  7861. });
  7862. (/** @type {?} */ (this)).length = index;
  7863. }
  7864. this._truncate(record);
  7865. (/** @type {?} */ (this)).collection = collection;
  7866. return this.isDirty;
  7867. };
  7868. Object.defineProperty(DefaultIterableDiffer.prototype, "isDirty", {
  7869. /* CollectionChanges is considered dirty if it has any additions, moves, removals, or identity
  7870. * changes.
  7871. */
  7872. get: /**
  7873. * @return {?}
  7874. */
  7875. function () {
  7876. return this._additionsHead !== null || this._movesHead !== null ||
  7877. this._removalsHead !== null || this._identityChangesHead !== null;
  7878. },
  7879. enumerable: true,
  7880. configurable: true
  7881. });
  7882. /**
  7883. * Reset the state of the change objects to show no changes. This means set previousKey to
  7884. * currentKey, and clear all of the queues (additions, moves, removals).
  7885. * Set the previousIndexes of moved and added items to their currentIndexes
  7886. * Reset the list of additions, moves and removals
  7887. *
  7888. * @internal
  7889. */
  7890. /**
  7891. * Reset the state of the change objects to show no changes. This means set previousKey to
  7892. * currentKey, and clear all of the queues (additions, moves, removals).
  7893. * Set the previousIndexes of moved and added items to their currentIndexes
  7894. * Reset the list of additions, moves and removals
  7895. *
  7896. * \@internal
  7897. * @return {?}
  7898. */
  7899. DefaultIterableDiffer.prototype._reset = /**
  7900. * Reset the state of the change objects to show no changes. This means set previousKey to
  7901. * currentKey, and clear all of the queues (additions, moves, removals).
  7902. * Set the previousIndexes of moved and added items to their currentIndexes
  7903. * Reset the list of additions, moves and removals
  7904. *
  7905. * \@internal
  7906. * @return {?}
  7907. */
  7908. function () {
  7909. if (this.isDirty) {
  7910. var /** @type {?} */ record = void 0;
  7911. var /** @type {?} */ nextRecord = void 0;
  7912. for (record = this._previousItHead = this._itHead; record !== null; record = record._next) {
  7913. record._nextPrevious = record._next;
  7914. }
  7915. for (record = this._additionsHead; record !== null; record = record._nextAdded) {
  7916. record.previousIndex = record.currentIndex;
  7917. }
  7918. this._additionsHead = this._additionsTail = null;
  7919. for (record = this._movesHead; record !== null; record = nextRecord) {
  7920. record.previousIndex = record.currentIndex;
  7921. nextRecord = record._nextMoved;
  7922. }
  7923. this._movesHead = this._movesTail = null;
  7924. this._removalsHead = this._removalsTail = null;
  7925. this._identityChangesHead = this._identityChangesTail = null;
  7926. // TODO(vicb): when assert gets supported
  7927. // assert(!this.isDirty);
  7928. }
  7929. };
  7930. /**
  7931. * This is the core function which handles differences between collections.
  7932. *
  7933. * - `record` is the record which we saw at this position last time. If null then it is a new
  7934. * item.
  7935. * - `item` is the current item in the collection
  7936. * - `index` is the position of the item in the collection
  7937. *
  7938. * @internal
  7939. */
  7940. /**
  7941. * This is the core function which handles differences between collections.
  7942. *
  7943. * - `record` is the record which we saw at this position last time. If null then it is a new
  7944. * item.
  7945. * - `item` is the current item in the collection
  7946. * - `index` is the position of the item in the collection
  7947. *
  7948. * \@internal
  7949. * @param {?} record
  7950. * @param {?} item
  7951. * @param {?} itemTrackBy
  7952. * @param {?} index
  7953. * @return {?}
  7954. */
  7955. DefaultIterableDiffer.prototype._mismatch = /**
  7956. * This is the core function which handles differences between collections.
  7957. *
  7958. * - `record` is the record which we saw at this position last time. If null then it is a new
  7959. * item.
  7960. * - `item` is the current item in the collection
  7961. * - `index` is the position of the item in the collection
  7962. *
  7963. * \@internal
  7964. * @param {?} record
  7965. * @param {?} item
  7966. * @param {?} itemTrackBy
  7967. * @param {?} index
  7968. * @return {?}
  7969. */
  7970. function (record, item, itemTrackBy, index) {
  7971. // The previous record after which we will append the current one.
  7972. var /** @type {?} */ previousRecord;
  7973. if (record === null) {
  7974. previousRecord = this._itTail;
  7975. }
  7976. else {
  7977. previousRecord = record._prev;
  7978. // Remove the record from the collection since we know it does not match the item.
  7979. this._remove(record);
  7980. }
  7981. // Attempt to see if we have seen the item before.
  7982. record = this._linkedRecords === null ? null : this._linkedRecords.get(itemTrackBy, index);
  7983. if (record !== null) {
  7984. // We have seen this before, we need to move it forward in the collection.
  7985. // But first we need to check if identity changed, so we can update in view if necessary
  7986. if (!looseIdentical(record.item, item))
  7987. this._addIdentityChange(record, item);
  7988. this._moveAfter(record, previousRecord, index);
  7989. }
  7990. else {
  7991. // Never seen it, check evicted list.
  7992. record = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);
  7993. if (record !== null) {
  7994. // It is an item which we have evicted earlier: reinsert it back into the list.
  7995. // But first we need to check if identity changed, so we can update in view if necessary
  7996. if (!looseIdentical(record.item, item))
  7997. this._addIdentityChange(record, item);
  7998. this._reinsertAfter(record, previousRecord, index);
  7999. }
  8000. else {
  8001. // It is a new item: add it.
  8002. record =
  8003. this._addAfter(new IterableChangeRecord_(item, itemTrackBy), previousRecord, index);
  8004. }
  8005. }
  8006. return record;
  8007. };
  8008. /**
  8009. * This check is only needed if an array contains duplicates. (Short circuit of nothing dirty)
  8010. *
  8011. * Use case: `[a, a]` => `[b, a, a]`
  8012. *
  8013. * If we did not have this check then the insertion of `b` would:
  8014. * 1) evict first `a`
  8015. * 2) insert `b` at `0` index.
  8016. * 3) leave `a` at index `1` as is. <-- this is wrong!
  8017. * 3) reinsert `a` at index 2. <-- this is wrong!
  8018. *
  8019. * The correct behavior is:
  8020. * 1) evict first `a`
  8021. * 2) insert `b` at `0` index.
  8022. * 3) reinsert `a` at index 1.
  8023. * 3) move `a` at from `1` to `2`.
  8024. *
  8025. *
  8026. * Double check that we have not evicted a duplicate item. We need to check if the item type may
  8027. * have already been removed:
  8028. * The insertion of b will evict the first 'a'. If we don't reinsert it now it will be reinserted
  8029. * at the end. Which will show up as the two 'a's switching position. This is incorrect, since a
  8030. * better way to think of it is as insert of 'b' rather then switch 'a' with 'b' and then add 'a'
  8031. * at the end.
  8032. *
  8033. * @internal
  8034. */
  8035. /**
  8036. * This check is only needed if an array contains duplicates. (Short circuit of nothing dirty)
  8037. *
  8038. * Use case: `[a, a]` => `[b, a, a]`
  8039. *
  8040. * If we did not have this check then the insertion of `b` would:
  8041. * 1) evict first `a`
  8042. * 2) insert `b` at `0` index.
  8043. * 3) leave `a` at index `1` as is. <-- this is wrong!
  8044. * 3) reinsert `a` at index 2. <-- this is wrong!
  8045. *
  8046. * The correct behavior is:
  8047. * 1) evict first `a`
  8048. * 2) insert `b` at `0` index.
  8049. * 3) reinsert `a` at index 1.
  8050. * 3) move `a` at from `1` to `2`.
  8051. *
  8052. *
  8053. * Double check that we have not evicted a duplicate item. We need to check if the item type may
  8054. * have already been removed:
  8055. * The insertion of b will evict the first 'a'. If we don't reinsert it now it will be reinserted
  8056. * at the end. Which will show up as the two 'a's switching position. This is incorrect, since a
  8057. * better way to think of it is as insert of 'b' rather then switch 'a' with 'b' and then add 'a'
  8058. * at the end.
  8059. *
  8060. * \@internal
  8061. * @param {?} record
  8062. * @param {?} item
  8063. * @param {?} itemTrackBy
  8064. * @param {?} index
  8065. * @return {?}
  8066. */
  8067. DefaultIterableDiffer.prototype._verifyReinsertion = /**
  8068. * This check is only needed if an array contains duplicates. (Short circuit of nothing dirty)
  8069. *
  8070. * Use case: `[a, a]` => `[b, a, a]`
  8071. *
  8072. * If we did not have this check then the insertion of `b` would:
  8073. * 1) evict first `a`
  8074. * 2) insert `b` at `0` index.
  8075. * 3) leave `a` at index `1` as is. <-- this is wrong!
  8076. * 3) reinsert `a` at index 2. <-- this is wrong!
  8077. *
  8078. * The correct behavior is:
  8079. * 1) evict first `a`
  8080. * 2) insert `b` at `0` index.
  8081. * 3) reinsert `a` at index 1.
  8082. * 3) move `a` at from `1` to `2`.
  8083. *
  8084. *
  8085. * Double check that we have not evicted a duplicate item. We need to check if the item type may
  8086. * have already been removed:
  8087. * The insertion of b will evict the first 'a'. If we don't reinsert it now it will be reinserted
  8088. * at the end. Which will show up as the two 'a's switching position. This is incorrect, since a
  8089. * better way to think of it is as insert of 'b' rather then switch 'a' with 'b' and then add 'a'
  8090. * at the end.
  8091. *
  8092. * \@internal
  8093. * @param {?} record
  8094. * @param {?} item
  8095. * @param {?} itemTrackBy
  8096. * @param {?} index
  8097. * @return {?}
  8098. */
  8099. function (record, item, itemTrackBy, index) {
  8100. var /** @type {?} */ reinsertRecord = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);
  8101. if (reinsertRecord !== null) {
  8102. record = this._reinsertAfter(reinsertRecord, /** @type {?} */ ((record._prev)), index);
  8103. }
  8104. else if (record.currentIndex != index) {
  8105. record.currentIndex = index;
  8106. this._addToMoves(record, index);
  8107. }
  8108. return record;
  8109. };
  8110. /**
  8111. * Get rid of any excess {@link IterableChangeRecord_}s from the previous collection
  8112. *
  8113. * - `record` The first excess {@link IterableChangeRecord_}.
  8114. *
  8115. * @internal
  8116. */
  8117. /**
  8118. * Get rid of any excess {\@link IterableChangeRecord_}s from the previous collection
  8119. *
  8120. * - `record` The first excess {\@link IterableChangeRecord_}.
  8121. *
  8122. * \@internal
  8123. * @param {?} record
  8124. * @return {?}
  8125. */
  8126. DefaultIterableDiffer.prototype._truncate = /**
  8127. * Get rid of any excess {\@link IterableChangeRecord_}s from the previous collection
  8128. *
  8129. * - `record` The first excess {\@link IterableChangeRecord_}.
  8130. *
  8131. * \@internal
  8132. * @param {?} record
  8133. * @return {?}
  8134. */
  8135. function (record) {
  8136. // Anything after that needs to be removed;
  8137. while (record !== null) {
  8138. var /** @type {?} */ nextRecord = record._next;
  8139. this._addToRemovals(this._unlink(record));
  8140. record = nextRecord;
  8141. }
  8142. if (this._unlinkedRecords !== null) {
  8143. this._unlinkedRecords.clear();
  8144. }
  8145. if (this._additionsTail !== null) {
  8146. this._additionsTail._nextAdded = null;
  8147. }
  8148. if (this._movesTail !== null) {
  8149. this._movesTail._nextMoved = null;
  8150. }
  8151. if (this._itTail !== null) {
  8152. this._itTail._next = null;
  8153. }
  8154. if (this._removalsTail !== null) {
  8155. this._removalsTail._nextRemoved = null;
  8156. }
  8157. if (this._identityChangesTail !== null) {
  8158. this._identityChangesTail._nextIdentityChange = null;
  8159. }
  8160. };
  8161. /** @internal */
  8162. /**
  8163. * \@internal
  8164. * @param {?} record
  8165. * @param {?} prevRecord
  8166. * @param {?} index
  8167. * @return {?}
  8168. */
  8169. DefaultIterableDiffer.prototype._reinsertAfter = /**
  8170. * \@internal
  8171. * @param {?} record
  8172. * @param {?} prevRecord
  8173. * @param {?} index
  8174. * @return {?}
  8175. */
  8176. function (record, prevRecord, index) {
  8177. if (this._unlinkedRecords !== null) {
  8178. this._unlinkedRecords.remove(record);
  8179. }
  8180. var /** @type {?} */ prev = record._prevRemoved;
  8181. var /** @type {?} */ next = record._nextRemoved;
  8182. if (prev === null) {
  8183. this._removalsHead = next;
  8184. }
  8185. else {
  8186. prev._nextRemoved = next;
  8187. }
  8188. if (next === null) {
  8189. this._removalsTail = prev;
  8190. }
  8191. else {
  8192. next._prevRemoved = prev;
  8193. }
  8194. this._insertAfter(record, prevRecord, index);
  8195. this._addToMoves(record, index);
  8196. return record;
  8197. };
  8198. /** @internal */
  8199. /**
  8200. * \@internal
  8201. * @param {?} record
  8202. * @param {?} prevRecord
  8203. * @param {?} index
  8204. * @return {?}
  8205. */
  8206. DefaultIterableDiffer.prototype._moveAfter = /**
  8207. * \@internal
  8208. * @param {?} record
  8209. * @param {?} prevRecord
  8210. * @param {?} index
  8211. * @return {?}
  8212. */
  8213. function (record, prevRecord, index) {
  8214. this._unlink(record);
  8215. this._insertAfter(record, prevRecord, index);
  8216. this._addToMoves(record, index);
  8217. return record;
  8218. };
  8219. /** @internal */
  8220. /**
  8221. * \@internal
  8222. * @param {?} record
  8223. * @param {?} prevRecord
  8224. * @param {?} index
  8225. * @return {?}
  8226. */
  8227. DefaultIterableDiffer.prototype._addAfter = /**
  8228. * \@internal
  8229. * @param {?} record
  8230. * @param {?} prevRecord
  8231. * @param {?} index
  8232. * @return {?}
  8233. */
  8234. function (record, prevRecord, index) {
  8235. this._insertAfter(record, prevRecord, index);
  8236. if (this._additionsTail === null) {
  8237. // TODO(vicb):
  8238. // assert(this._additionsHead === null);
  8239. this._additionsTail = this._additionsHead = record;
  8240. }
  8241. else {
  8242. // TODO(vicb):
  8243. // assert(_additionsTail._nextAdded === null);
  8244. // assert(record._nextAdded === null);
  8245. this._additionsTail = this._additionsTail._nextAdded = record;
  8246. }
  8247. return record;
  8248. };
  8249. /** @internal */
  8250. /**
  8251. * \@internal
  8252. * @param {?} record
  8253. * @param {?} prevRecord
  8254. * @param {?} index
  8255. * @return {?}
  8256. */
  8257. DefaultIterableDiffer.prototype._insertAfter = /**
  8258. * \@internal
  8259. * @param {?} record
  8260. * @param {?} prevRecord
  8261. * @param {?} index
  8262. * @return {?}
  8263. */
  8264. function (record, prevRecord, index) {
  8265. // TODO(vicb):
  8266. // assert(record != prevRecord);
  8267. // assert(record._next === null);
  8268. // assert(record._prev === null);
  8269. var /** @type {?} */ next = prevRecord === null ? this._itHead : prevRecord._next;
  8270. // TODO(vicb):
  8271. // assert(next != record);
  8272. // assert(prevRecord != record);
  8273. record._next = next;
  8274. record._prev = prevRecord;
  8275. if (next === null) {
  8276. this._itTail = record;
  8277. }
  8278. else {
  8279. next._prev = record;
  8280. }
  8281. if (prevRecord === null) {
  8282. this._itHead = record;
  8283. }
  8284. else {
  8285. prevRecord._next = record;
  8286. }
  8287. if (this._linkedRecords === null) {
  8288. this._linkedRecords = new _DuplicateMap();
  8289. }
  8290. this._linkedRecords.put(record);
  8291. record.currentIndex = index;
  8292. return record;
  8293. };
  8294. /** @internal */
  8295. /**
  8296. * \@internal
  8297. * @param {?} record
  8298. * @return {?}
  8299. */
  8300. DefaultIterableDiffer.prototype._remove = /**
  8301. * \@internal
  8302. * @param {?} record
  8303. * @return {?}
  8304. */
  8305. function (record) {
  8306. return this._addToRemovals(this._unlink(record));
  8307. };
  8308. /** @internal */
  8309. /**
  8310. * \@internal
  8311. * @param {?} record
  8312. * @return {?}
  8313. */
  8314. DefaultIterableDiffer.prototype._unlink = /**
  8315. * \@internal
  8316. * @param {?} record
  8317. * @return {?}
  8318. */
  8319. function (record) {
  8320. if (this._linkedRecords !== null) {
  8321. this._linkedRecords.remove(record);
  8322. }
  8323. var /** @type {?} */ prev = record._prev;
  8324. var /** @type {?} */ next = record._next;
  8325. // TODO(vicb):
  8326. // assert((record._prev = null) === null);
  8327. // assert((record._next = null) === null);
  8328. if (prev === null) {
  8329. this._itHead = next;
  8330. }
  8331. else {
  8332. prev._next = next;
  8333. }
  8334. if (next === null) {
  8335. this._itTail = prev;
  8336. }
  8337. else {
  8338. next._prev = prev;
  8339. }
  8340. return record;
  8341. };
  8342. /** @internal */
  8343. /**
  8344. * \@internal
  8345. * @param {?} record
  8346. * @param {?} toIndex
  8347. * @return {?}
  8348. */
  8349. DefaultIterableDiffer.prototype._addToMoves = /**
  8350. * \@internal
  8351. * @param {?} record
  8352. * @param {?} toIndex
  8353. * @return {?}
  8354. */
  8355. function (record, toIndex) {
  8356. // TODO(vicb):
  8357. // assert(record._nextMoved === null);
  8358. if (record.previousIndex === toIndex) {
  8359. return record;
  8360. }
  8361. if (this._movesTail === null) {
  8362. // TODO(vicb):
  8363. // assert(_movesHead === null);
  8364. this._movesTail = this._movesHead = record;
  8365. }
  8366. else {
  8367. // TODO(vicb):
  8368. // assert(_movesTail._nextMoved === null);
  8369. this._movesTail = this._movesTail._nextMoved = record;
  8370. }
  8371. return record;
  8372. };
  8373. /**
  8374. * @param {?} record
  8375. * @return {?}
  8376. */
  8377. DefaultIterableDiffer.prototype._addToRemovals = /**
  8378. * @param {?} record
  8379. * @return {?}
  8380. */
  8381. function (record) {
  8382. if (this._unlinkedRecords === null) {
  8383. this._unlinkedRecords = new _DuplicateMap();
  8384. }
  8385. this._unlinkedRecords.put(record);
  8386. record.currentIndex = null;
  8387. record._nextRemoved = null;
  8388. if (this._removalsTail === null) {
  8389. // TODO(vicb):
  8390. // assert(_removalsHead === null);
  8391. this._removalsTail = this._removalsHead = record;
  8392. record._prevRemoved = null;
  8393. }
  8394. else {
  8395. // TODO(vicb):
  8396. // assert(_removalsTail._nextRemoved === null);
  8397. // assert(record._nextRemoved === null);
  8398. record._prevRemoved = this._removalsTail;
  8399. this._removalsTail = this._removalsTail._nextRemoved = record;
  8400. }
  8401. return record;
  8402. };
  8403. /** @internal */
  8404. /**
  8405. * \@internal
  8406. * @param {?} record
  8407. * @param {?} item
  8408. * @return {?}
  8409. */
  8410. DefaultIterableDiffer.prototype._addIdentityChange = /**
  8411. * \@internal
  8412. * @param {?} record
  8413. * @param {?} item
  8414. * @return {?}
  8415. */
  8416. function (record, item) {
  8417. record.item = item;
  8418. if (this._identityChangesTail === null) {
  8419. this._identityChangesTail = this._identityChangesHead = record;
  8420. }
  8421. else {
  8422. this._identityChangesTail = this._identityChangesTail._nextIdentityChange = record;
  8423. }
  8424. return record;
  8425. };
  8426. return DefaultIterableDiffer;
  8427. }());
  8428. /**
  8429. * \@stable
  8430. * @template V
  8431. */
  8432. var IterableChangeRecord_ = /** @class */ (function () {
  8433. function IterableChangeRecord_(item, trackById) {
  8434. this.item = item;
  8435. this.trackById = trackById;
  8436. this.currentIndex = null;
  8437. this.previousIndex = null;
  8438. /**
  8439. * \@internal
  8440. */
  8441. this._nextPrevious = null;
  8442. /**
  8443. * \@internal
  8444. */
  8445. this._prev = null;
  8446. /**
  8447. * \@internal
  8448. */
  8449. this._next = null;
  8450. /**
  8451. * \@internal
  8452. */
  8453. this._prevDup = null;
  8454. /**
  8455. * \@internal
  8456. */
  8457. this._nextDup = null;
  8458. /**
  8459. * \@internal
  8460. */
  8461. this._prevRemoved = null;
  8462. /**
  8463. * \@internal
  8464. */
  8465. this._nextRemoved = null;
  8466. /**
  8467. * \@internal
  8468. */
  8469. this._nextAdded = null;
  8470. /**
  8471. * \@internal
  8472. */
  8473. this._nextMoved = null;
  8474. /**
  8475. * \@internal
  8476. */
  8477. this._nextIdentityChange = null;
  8478. }
  8479. return IterableChangeRecord_;
  8480. }());
  8481. /**
  8482. * @template V
  8483. */
  8484. var _DuplicateItemRecordList = /** @class */ (function () {
  8485. function _DuplicateItemRecordList() {
  8486. /**
  8487. * \@internal
  8488. */
  8489. this._head = null;
  8490. /**
  8491. * \@internal
  8492. */
  8493. this._tail = null;
  8494. }
  8495. /**
  8496. * Append the record to the list of duplicates.
  8497. *
  8498. * Note: by design all records in the list of duplicates hold the same value in record.item.
  8499. */
  8500. /**
  8501. * Append the record to the list of duplicates.
  8502. *
  8503. * Note: by design all records in the list of duplicates hold the same value in record.item.
  8504. * @param {?} record
  8505. * @return {?}
  8506. */
  8507. _DuplicateItemRecordList.prototype.add = /**
  8508. * Append the record to the list of duplicates.
  8509. *
  8510. * Note: by design all records in the list of duplicates hold the same value in record.item.
  8511. * @param {?} record
  8512. * @return {?}
  8513. */
  8514. function (record) {
  8515. if (this._head === null) {
  8516. this._head = this._tail = record;
  8517. record._nextDup = null;
  8518. record._prevDup = null;
  8519. }
  8520. else {
  8521. /** @type {?} */ ((
  8522. // TODO(vicb):
  8523. // assert(record.item == _head.item ||
  8524. // record.item is num && record.item.isNaN && _head.item is num && _head.item.isNaN);
  8525. this._tail))._nextDup = record;
  8526. record._prevDup = this._tail;
  8527. record._nextDup = null;
  8528. this._tail = record;
  8529. }
  8530. };
  8531. // Returns a IterableChangeRecord_ having IterableChangeRecord_.trackById == trackById and
  8532. // IterableChangeRecord_.currentIndex >= atOrAfterIndex
  8533. /**
  8534. * @param {?} trackById
  8535. * @param {?} atOrAfterIndex
  8536. * @return {?}
  8537. */
  8538. _DuplicateItemRecordList.prototype.get = /**
  8539. * @param {?} trackById
  8540. * @param {?} atOrAfterIndex
  8541. * @return {?}
  8542. */
  8543. function (trackById, atOrAfterIndex) {
  8544. var /** @type {?} */ record;
  8545. for (record = this._head; record !== null; record = record._nextDup) {
  8546. if ((atOrAfterIndex === null || atOrAfterIndex <= /** @type {?} */ ((record.currentIndex))) &&
  8547. looseIdentical(record.trackById, trackById)) {
  8548. return record;
  8549. }
  8550. }
  8551. return null;
  8552. };
  8553. /**
  8554. * Remove one {@link IterableChangeRecord_} from the list of duplicates.
  8555. *
  8556. * Returns whether the list of duplicates is empty.
  8557. */
  8558. /**
  8559. * Remove one {\@link IterableChangeRecord_} from the list of duplicates.
  8560. *
  8561. * Returns whether the list of duplicates is empty.
  8562. * @param {?} record
  8563. * @return {?}
  8564. */
  8565. _DuplicateItemRecordList.prototype.remove = /**
  8566. * Remove one {\@link IterableChangeRecord_} from the list of duplicates.
  8567. *
  8568. * Returns whether the list of duplicates is empty.
  8569. * @param {?} record
  8570. * @return {?}
  8571. */
  8572. function (record) {
  8573. // TODO(vicb):
  8574. // assert(() {
  8575. // // verify that the record being removed is in the list.
  8576. // for (IterableChangeRecord_ cursor = _head; cursor != null; cursor = cursor._nextDup) {
  8577. // if (identical(cursor, record)) return true;
  8578. // }
  8579. // return false;
  8580. //});
  8581. var /** @type {?} */ prev = record._prevDup;
  8582. var /** @type {?} */ next = record._nextDup;
  8583. if (prev === null) {
  8584. this._head = next;
  8585. }
  8586. else {
  8587. prev._nextDup = next;
  8588. }
  8589. if (next === null) {
  8590. this._tail = prev;
  8591. }
  8592. else {
  8593. next._prevDup = prev;
  8594. }
  8595. return this._head === null;
  8596. };
  8597. return _DuplicateItemRecordList;
  8598. }());
  8599. /**
  8600. * @template V
  8601. */
  8602. var _DuplicateMap = /** @class */ (function () {
  8603. function _DuplicateMap() {
  8604. this.map = new Map();
  8605. }
  8606. /**
  8607. * @param {?} record
  8608. * @return {?}
  8609. */
  8610. _DuplicateMap.prototype.put = /**
  8611. * @param {?} record
  8612. * @return {?}
  8613. */
  8614. function (record) {
  8615. var /** @type {?} */ key = record.trackById;
  8616. var /** @type {?} */ duplicates = this.map.get(key);
  8617. if (!duplicates) {
  8618. duplicates = new _DuplicateItemRecordList();
  8619. this.map.set(key, duplicates);
  8620. }
  8621. duplicates.add(record);
  8622. };
  8623. /**
  8624. * Retrieve the `value` using key. Because the IterableChangeRecord_ value may be one which we
  8625. * have already iterated over, we use the `atOrAfterIndex` to pretend it is not there.
  8626. *
  8627. * Use case: `[a, b, c, a, a]` if we are at index `3` which is the second `a` then asking if we
  8628. * have any more `a`s needs to return the second `a`.
  8629. */
  8630. /**
  8631. * Retrieve the `value` using key. Because the IterableChangeRecord_ value may be one which we
  8632. * have already iterated over, we use the `atOrAfterIndex` to pretend it is not there.
  8633. *
  8634. * Use case: `[a, b, c, a, a]` if we are at index `3` which is the second `a` then asking if we
  8635. * have any more `a`s needs to return the second `a`.
  8636. * @param {?} trackById
  8637. * @param {?} atOrAfterIndex
  8638. * @return {?}
  8639. */
  8640. _DuplicateMap.prototype.get = /**
  8641. * Retrieve the `value` using key. Because the IterableChangeRecord_ value may be one which we
  8642. * have already iterated over, we use the `atOrAfterIndex` to pretend it is not there.
  8643. *
  8644. * Use case: `[a, b, c, a, a]` if we are at index `3` which is the second `a` then asking if we
  8645. * have any more `a`s needs to return the second `a`.
  8646. * @param {?} trackById
  8647. * @param {?} atOrAfterIndex
  8648. * @return {?}
  8649. */
  8650. function (trackById, atOrAfterIndex) {
  8651. var /** @type {?} */ key = trackById;
  8652. var /** @type {?} */ recordList = this.map.get(key);
  8653. return recordList ? recordList.get(trackById, atOrAfterIndex) : null;
  8654. };
  8655. /**
  8656. * Removes a {@link IterableChangeRecord_} from the list of duplicates.
  8657. *
  8658. * The list of duplicates also is removed from the map if it gets empty.
  8659. */
  8660. /**
  8661. * Removes a {\@link IterableChangeRecord_} from the list of duplicates.
  8662. *
  8663. * The list of duplicates also is removed from the map if it gets empty.
  8664. * @param {?} record
  8665. * @return {?}
  8666. */
  8667. _DuplicateMap.prototype.remove = /**
  8668. * Removes a {\@link IterableChangeRecord_} from the list of duplicates.
  8669. *
  8670. * The list of duplicates also is removed from the map if it gets empty.
  8671. * @param {?} record
  8672. * @return {?}
  8673. */
  8674. function (record) {
  8675. var /** @type {?} */ key = record.trackById;
  8676. var /** @type {?} */ recordList = /** @type {?} */ ((this.map.get(key)));
  8677. // Remove the list of duplicates when it gets empty
  8678. if (recordList.remove(record)) {
  8679. this.map.delete(key);
  8680. }
  8681. return record;
  8682. };
  8683. Object.defineProperty(_DuplicateMap.prototype, "isEmpty", {
  8684. get: /**
  8685. * @return {?}
  8686. */
  8687. function () { return this.map.size === 0; },
  8688. enumerable: true,
  8689. configurable: true
  8690. });
  8691. /**
  8692. * @return {?}
  8693. */
  8694. _DuplicateMap.prototype.clear = /**
  8695. * @return {?}
  8696. */
  8697. function () { this.map.clear(); };
  8698. return _DuplicateMap;
  8699. }());
  8700. /**
  8701. * @param {?} item
  8702. * @param {?} addRemoveOffset
  8703. * @param {?} moveOffsets
  8704. * @return {?}
  8705. */
  8706. function getPreviousIndex(item, addRemoveOffset, moveOffsets) {
  8707. var /** @type {?} */ previousIndex = item.previousIndex;
  8708. if (previousIndex === null)
  8709. return previousIndex;
  8710. var /** @type {?} */ moveOffset = 0;
  8711. if (moveOffsets && previousIndex < moveOffsets.length) {
  8712. moveOffset = moveOffsets[previousIndex];
  8713. }
  8714. return previousIndex + addRemoveOffset + moveOffset;
  8715. }
  8716. /**
  8717. * @fileoverview added by tsickle
  8718. * @suppress {checkTypes} checked by tsc
  8719. */
  8720. /**
  8721. * @license
  8722. * Copyright Google Inc. All Rights Reserved.
  8723. *
  8724. * Use of this source code is governed by an MIT-style license that can be
  8725. * found in the LICENSE file at https://angular.io/license
  8726. */
  8727. /**
  8728. * @template K, V
  8729. */
  8730. var DefaultKeyValueDifferFactory = /** @class */ (function () {
  8731. function DefaultKeyValueDifferFactory() {
  8732. }
  8733. /**
  8734. * @param {?} obj
  8735. * @return {?}
  8736. */
  8737. DefaultKeyValueDifferFactory.prototype.supports = /**
  8738. * @param {?} obj
  8739. * @return {?}
  8740. */
  8741. function (obj) { return obj instanceof Map || isJsObject(obj); };
  8742. /**
  8743. * @template K, V
  8744. * @return {?}
  8745. */
  8746. DefaultKeyValueDifferFactory.prototype.create = /**
  8747. * @template K, V
  8748. * @return {?}
  8749. */
  8750. function () { return new DefaultKeyValueDiffer(); };
  8751. return DefaultKeyValueDifferFactory;
  8752. }());
  8753. /**
  8754. * @template K, V
  8755. */
  8756. var DefaultKeyValueDiffer = /** @class */ (function () {
  8757. function DefaultKeyValueDiffer() {
  8758. this._records = new Map();
  8759. this._mapHead = null;
  8760. this._appendAfter = null;
  8761. this._previousMapHead = null;
  8762. this._changesHead = null;
  8763. this._changesTail = null;
  8764. this._additionsHead = null;
  8765. this._additionsTail = null;
  8766. this._removalsHead = null;
  8767. this._removalsTail = null;
  8768. }
  8769. Object.defineProperty(DefaultKeyValueDiffer.prototype, "isDirty", {
  8770. get: /**
  8771. * @return {?}
  8772. */
  8773. function () {
  8774. return this._additionsHead !== null || this._changesHead !== null ||
  8775. this._removalsHead !== null;
  8776. },
  8777. enumerable: true,
  8778. configurable: true
  8779. });
  8780. /**
  8781. * @param {?} fn
  8782. * @return {?}
  8783. */
  8784. DefaultKeyValueDiffer.prototype.forEachItem = /**
  8785. * @param {?} fn
  8786. * @return {?}
  8787. */
  8788. function (fn) {
  8789. var /** @type {?} */ record;
  8790. for (record = this._mapHead; record !== null; record = record._next) {
  8791. fn(record);
  8792. }
  8793. };
  8794. /**
  8795. * @param {?} fn
  8796. * @return {?}
  8797. */
  8798. DefaultKeyValueDiffer.prototype.forEachPreviousItem = /**
  8799. * @param {?} fn
  8800. * @return {?}
  8801. */
  8802. function (fn) {
  8803. var /** @type {?} */ record;
  8804. for (record = this._previousMapHead; record !== null; record = record._nextPrevious) {
  8805. fn(record);
  8806. }
  8807. };
  8808. /**
  8809. * @param {?} fn
  8810. * @return {?}
  8811. */
  8812. DefaultKeyValueDiffer.prototype.forEachChangedItem = /**
  8813. * @param {?} fn
  8814. * @return {?}
  8815. */
  8816. function (fn) {
  8817. var /** @type {?} */ record;
  8818. for (record = this._changesHead; record !== null; record = record._nextChanged) {
  8819. fn(record);
  8820. }
  8821. };
  8822. /**
  8823. * @param {?} fn
  8824. * @return {?}
  8825. */
  8826. DefaultKeyValueDiffer.prototype.forEachAddedItem = /**
  8827. * @param {?} fn
  8828. * @return {?}
  8829. */
  8830. function (fn) {
  8831. var /** @type {?} */ record;
  8832. for (record = this._additionsHead; record !== null; record = record._nextAdded) {
  8833. fn(record);
  8834. }
  8835. };
  8836. /**
  8837. * @param {?} fn
  8838. * @return {?}
  8839. */
  8840. DefaultKeyValueDiffer.prototype.forEachRemovedItem = /**
  8841. * @param {?} fn
  8842. * @return {?}
  8843. */
  8844. function (fn) {
  8845. var /** @type {?} */ record;
  8846. for (record = this._removalsHead; record !== null; record = record._nextRemoved) {
  8847. fn(record);
  8848. }
  8849. };
  8850. /**
  8851. * @param {?=} map
  8852. * @return {?}
  8853. */
  8854. DefaultKeyValueDiffer.prototype.diff = /**
  8855. * @param {?=} map
  8856. * @return {?}
  8857. */
  8858. function (map) {
  8859. if (!map) {
  8860. map = new Map();
  8861. }
  8862. else if (!(map instanceof Map || isJsObject(map))) {
  8863. throw new Error("Error trying to diff '" + stringify(map) + "'. Only maps and objects are allowed");
  8864. }
  8865. return this.check(map) ? this : null;
  8866. };
  8867. /**
  8868. * @return {?}
  8869. */
  8870. DefaultKeyValueDiffer.prototype.onDestroy = /**
  8871. * @return {?}
  8872. */
  8873. function () { };
  8874. /**
  8875. * Check the current state of the map vs the previous.
  8876. * The algorithm is optimised for when the keys do no change.
  8877. */
  8878. /**
  8879. * Check the current state of the map vs the previous.
  8880. * The algorithm is optimised for when the keys do no change.
  8881. * @param {?} map
  8882. * @return {?}
  8883. */
  8884. DefaultKeyValueDiffer.prototype.check = /**
  8885. * Check the current state of the map vs the previous.
  8886. * The algorithm is optimised for when the keys do no change.
  8887. * @param {?} map
  8888. * @return {?}
  8889. */
  8890. function (map) {
  8891. var _this = this;
  8892. this._reset();
  8893. var /** @type {?} */ insertBefore = this._mapHead;
  8894. this._appendAfter = null;
  8895. this._forEach(map, function (value, key) {
  8896. if (insertBefore && insertBefore.key === key) {
  8897. _this._maybeAddToChanges(insertBefore, value);
  8898. _this._appendAfter = insertBefore;
  8899. insertBefore = insertBefore._next;
  8900. }
  8901. else {
  8902. var /** @type {?} */ record = _this._getOrCreateRecordForKey(key, value);
  8903. insertBefore = _this._insertBeforeOrAppend(insertBefore, record);
  8904. }
  8905. });
  8906. // Items remaining at the end of the list have been deleted
  8907. if (insertBefore) {
  8908. if (insertBefore._prev) {
  8909. insertBefore._prev._next = null;
  8910. }
  8911. this._removalsHead = insertBefore;
  8912. for (var /** @type {?} */ record = insertBefore; record !== null; record = record._nextRemoved) {
  8913. if (record === this._mapHead) {
  8914. this._mapHead = null;
  8915. }
  8916. this._records.delete(record.key);
  8917. record._nextRemoved = record._next;
  8918. record.previousValue = record.currentValue;
  8919. record.currentValue = null;
  8920. record._prev = null;
  8921. record._next = null;
  8922. }
  8923. }
  8924. // Make sure tails have no next records from previous runs
  8925. if (this._changesTail)
  8926. this._changesTail._nextChanged = null;
  8927. if (this._additionsTail)
  8928. this._additionsTail._nextAdded = null;
  8929. return this.isDirty;
  8930. };
  8931. /**
  8932. * Inserts a record before `before` or append at the end of the list when `before` is null.
  8933. *
  8934. * Notes:
  8935. * - This method appends at `this._appendAfter`,
  8936. * - This method updates `this._appendAfter`,
  8937. * - The return value is the new value for the insertion pointer.
  8938. * @param {?} before
  8939. * @param {?} record
  8940. * @return {?}
  8941. */
  8942. DefaultKeyValueDiffer.prototype._insertBeforeOrAppend = /**
  8943. * Inserts a record before `before` or append at the end of the list when `before` is null.
  8944. *
  8945. * Notes:
  8946. * - This method appends at `this._appendAfter`,
  8947. * - This method updates `this._appendAfter`,
  8948. * - The return value is the new value for the insertion pointer.
  8949. * @param {?} before
  8950. * @param {?} record
  8951. * @return {?}
  8952. */
  8953. function (before, record) {
  8954. if (before) {
  8955. var /** @type {?} */ prev = before._prev;
  8956. record._next = before;
  8957. record._prev = prev;
  8958. before._prev = record;
  8959. if (prev) {
  8960. prev._next = record;
  8961. }
  8962. if (before === this._mapHead) {
  8963. this._mapHead = record;
  8964. }
  8965. this._appendAfter = before;
  8966. return before;
  8967. }
  8968. if (this._appendAfter) {
  8969. this._appendAfter._next = record;
  8970. record._prev = this._appendAfter;
  8971. }
  8972. else {
  8973. this._mapHead = record;
  8974. }
  8975. this._appendAfter = record;
  8976. return null;
  8977. };
  8978. /**
  8979. * @param {?} key
  8980. * @param {?} value
  8981. * @return {?}
  8982. */
  8983. DefaultKeyValueDiffer.prototype._getOrCreateRecordForKey = /**
  8984. * @param {?} key
  8985. * @param {?} value
  8986. * @return {?}
  8987. */
  8988. function (key, value) {
  8989. if (this._records.has(key)) {
  8990. var /** @type {?} */ record_1 = /** @type {?} */ ((this._records.get(key)));
  8991. this._maybeAddToChanges(record_1, value);
  8992. var /** @type {?} */ prev = record_1._prev;
  8993. var /** @type {?} */ next = record_1._next;
  8994. if (prev) {
  8995. prev._next = next;
  8996. }
  8997. if (next) {
  8998. next._prev = prev;
  8999. }
  9000. record_1._next = null;
  9001. record_1._prev = null;
  9002. return record_1;
  9003. }
  9004. var /** @type {?} */ record = new KeyValueChangeRecord_(key);
  9005. this._records.set(key, record);
  9006. record.currentValue = value;
  9007. this._addToAdditions(record);
  9008. return record;
  9009. };
  9010. /** @internal */
  9011. /**
  9012. * \@internal
  9013. * @return {?}
  9014. */
  9015. DefaultKeyValueDiffer.prototype._reset = /**
  9016. * \@internal
  9017. * @return {?}
  9018. */
  9019. function () {
  9020. if (this.isDirty) {
  9021. var /** @type {?} */ record = void 0;
  9022. // let `_previousMapHead` contain the state of the map before the changes
  9023. this._previousMapHead = this._mapHead;
  9024. for (record = this._previousMapHead; record !== null; record = record._next) {
  9025. record._nextPrevious = record._next;
  9026. }
  9027. // Update `record.previousValue` with the value of the item before the changes
  9028. // We need to update all changed items (that's those which have been added and changed)
  9029. for (record = this._changesHead; record !== null; record = record._nextChanged) {
  9030. record.previousValue = record.currentValue;
  9031. }
  9032. for (record = this._additionsHead; record != null; record = record._nextAdded) {
  9033. record.previousValue = record.currentValue;
  9034. }
  9035. this._changesHead = this._changesTail = null;
  9036. this._additionsHead = this._additionsTail = null;
  9037. this._removalsHead = null;
  9038. }
  9039. };
  9040. /**
  9041. * @param {?} record
  9042. * @param {?} newValue
  9043. * @return {?}
  9044. */
  9045. DefaultKeyValueDiffer.prototype._maybeAddToChanges = /**
  9046. * @param {?} record
  9047. * @param {?} newValue
  9048. * @return {?}
  9049. */
  9050. function (record, newValue) {
  9051. if (!looseIdentical(newValue, record.currentValue)) {
  9052. record.previousValue = record.currentValue;
  9053. record.currentValue = newValue;
  9054. this._addToChanges(record);
  9055. }
  9056. };
  9057. /**
  9058. * @param {?} record
  9059. * @return {?}
  9060. */
  9061. DefaultKeyValueDiffer.prototype._addToAdditions = /**
  9062. * @param {?} record
  9063. * @return {?}
  9064. */
  9065. function (record) {
  9066. if (this._additionsHead === null) {
  9067. this._additionsHead = this._additionsTail = record;
  9068. }
  9069. else {
  9070. /** @type {?} */ ((this._additionsTail))._nextAdded = record;
  9071. this._additionsTail = record;
  9072. }
  9073. };
  9074. /**
  9075. * @param {?} record
  9076. * @return {?}
  9077. */
  9078. DefaultKeyValueDiffer.prototype._addToChanges = /**
  9079. * @param {?} record
  9080. * @return {?}
  9081. */
  9082. function (record) {
  9083. if (this._changesHead === null) {
  9084. this._changesHead = this._changesTail = record;
  9085. }
  9086. else {
  9087. /** @type {?} */ ((this._changesTail))._nextChanged = record;
  9088. this._changesTail = record;
  9089. }
  9090. };
  9091. /**
  9092. * \@internal
  9093. * @template K, V
  9094. * @param {?} obj
  9095. * @param {?} fn
  9096. * @return {?}
  9097. */
  9098. DefaultKeyValueDiffer.prototype._forEach = /**
  9099. * \@internal
  9100. * @template K, V
  9101. * @param {?} obj
  9102. * @param {?} fn
  9103. * @return {?}
  9104. */
  9105. function (obj, fn) {
  9106. if (obj instanceof Map) {
  9107. obj.forEach(fn);
  9108. }
  9109. else {
  9110. Object.keys(obj).forEach(function (k) { return fn(obj[k], k); });
  9111. }
  9112. };
  9113. return DefaultKeyValueDiffer;
  9114. }());
  9115. /**
  9116. * \@stable
  9117. * @template K, V
  9118. */
  9119. var KeyValueChangeRecord_ = /** @class */ (function () {
  9120. function KeyValueChangeRecord_(key) {
  9121. this.key = key;
  9122. this.previousValue = null;
  9123. this.currentValue = null;
  9124. /**
  9125. * \@internal
  9126. */
  9127. this._nextPrevious = null;
  9128. /**
  9129. * \@internal
  9130. */
  9131. this._next = null;
  9132. /**
  9133. * \@internal
  9134. */
  9135. this._prev = null;
  9136. /**
  9137. * \@internal
  9138. */
  9139. this._nextAdded = null;
  9140. /**
  9141. * \@internal
  9142. */
  9143. this._nextRemoved = null;
  9144. /**
  9145. * \@internal
  9146. */
  9147. this._nextChanged = null;
  9148. }
  9149. return KeyValueChangeRecord_;
  9150. }());
  9151. /**
  9152. * @fileoverview added by tsickle
  9153. * @suppress {checkTypes} checked by tsc
  9154. */
  9155. /**
  9156. * @license
  9157. * Copyright Google Inc. All Rights Reserved.
  9158. *
  9159. * Use of this source code is governed by an MIT-style license that can be
  9160. * found in the LICENSE file at https://angular.io/license
  9161. */
  9162. /**
  9163. * A strategy for tracking changes over time to an iterable. Used by {\@link NgForOf} to
  9164. * respond to changes in an iterable by effecting equivalent changes in the DOM.
  9165. *
  9166. * \@stable
  9167. * @record
  9168. * @template V
  9169. */
  9170. /**
  9171. * An object describing the changes in the `Iterable` collection since last time
  9172. * `IterableDiffer#diff()` was invoked.
  9173. *
  9174. * \@stable
  9175. * @record
  9176. * @template V
  9177. */
  9178. /**
  9179. * Record representing the item change information.
  9180. *
  9181. * \@stable
  9182. * @record
  9183. * @template V
  9184. */
  9185. /**
  9186. * @deprecated v4.0.0 - Use IterableChangeRecord instead.
  9187. * @record
  9188. * @template V
  9189. */
  9190. /**
  9191. * An optional function passed into {\@link NgForOf} that defines how to track
  9192. * items in an iterable (e.g. fby index or id)
  9193. *
  9194. * \@stable
  9195. * @record
  9196. * @template T
  9197. */
  9198. /**
  9199. * Provides a factory for {\@link IterableDiffer}.
  9200. *
  9201. * \@stable
  9202. * @record
  9203. */
  9204. /**
  9205. * A repository of different iterable diffing strategies used by NgFor, NgClass, and others.
  9206. * \@stable
  9207. */
  9208. var IterableDiffers = /** @class */ (function () {
  9209. function IterableDiffers(factories) {
  9210. this.factories = factories;
  9211. }
  9212. /**
  9213. * @param {?} factories
  9214. * @param {?=} parent
  9215. * @return {?}
  9216. */
  9217. IterableDiffers.create = /**
  9218. * @param {?} factories
  9219. * @param {?=} parent
  9220. * @return {?}
  9221. */
  9222. function (factories, parent) {
  9223. if (parent != null) {
  9224. var /** @type {?} */ copied = parent.factories.slice();
  9225. factories = factories.concat(copied);
  9226. return new IterableDiffers(factories);
  9227. }
  9228. else {
  9229. return new IterableDiffers(factories);
  9230. }
  9231. };
  9232. /**
  9233. * Takes an array of {@link IterableDifferFactory} and returns a provider used to extend the
  9234. * inherited {@link IterableDiffers} instance with the provided factories and return a new
  9235. * {@link IterableDiffers} instance.
  9236. *
  9237. * The following example shows how to extend an existing list of factories,
  9238. * which will only be applied to the injector for this component and its children.
  9239. * This step is all that's required to make a new {@link IterableDiffer} available.
  9240. *
  9241. * ### Example
  9242. *
  9243. * ```
  9244. * @Component({
  9245. * viewProviders: [
  9246. * IterableDiffers.extend([new ImmutableListDiffer()])
  9247. * ]
  9248. * })
  9249. * ```
  9250. */
  9251. /**
  9252. * Takes an array of {\@link IterableDifferFactory} and returns a provider used to extend the
  9253. * inherited {\@link IterableDiffers} instance with the provided factories and return a new
  9254. * {\@link IterableDiffers} instance.
  9255. *
  9256. * The following example shows how to extend an existing list of factories,
  9257. * which will only be applied to the injector for this component and its children.
  9258. * This step is all that's required to make a new {\@link IterableDiffer} available.
  9259. *
  9260. * ### Example
  9261. *
  9262. * ```
  9263. * \@Component({
  9264. * viewProviders: [
  9265. * IterableDiffers.extend([new ImmutableListDiffer()])
  9266. * ]
  9267. * })
  9268. * ```
  9269. * @param {?} factories
  9270. * @return {?}
  9271. */
  9272. IterableDiffers.extend = /**
  9273. * Takes an array of {\@link IterableDifferFactory} and returns a provider used to extend the
  9274. * inherited {\@link IterableDiffers} instance with the provided factories and return a new
  9275. * {\@link IterableDiffers} instance.
  9276. *
  9277. * The following example shows how to extend an existing list of factories,
  9278. * which will only be applied to the injector for this component and its children.
  9279. * This step is all that's required to make a new {\@link IterableDiffer} available.
  9280. *
  9281. * ### Example
  9282. *
  9283. * ```
  9284. * \@Component({
  9285. * viewProviders: [
  9286. * IterableDiffers.extend([new ImmutableListDiffer()])
  9287. * ]
  9288. * })
  9289. * ```
  9290. * @param {?} factories
  9291. * @return {?}
  9292. */
  9293. function (factories) {
  9294. return {
  9295. provide: IterableDiffers,
  9296. useFactory: function (parent) {
  9297. if (!parent) {
  9298. // Typically would occur when calling IterableDiffers.extend inside of dependencies passed
  9299. // to
  9300. // bootstrap(), which would override default pipes instead of extending them.
  9301. throw new Error('Cannot extend IterableDiffers without a parent injector');
  9302. }
  9303. return IterableDiffers.create(factories, parent);
  9304. },
  9305. // Dependency technically isn't optional, but we can provide a better error message this way.
  9306. deps: [[IterableDiffers, new SkipSelf(), new Optional()]]
  9307. };
  9308. };
  9309. /**
  9310. * @param {?} iterable
  9311. * @return {?}
  9312. */
  9313. IterableDiffers.prototype.find = /**
  9314. * @param {?} iterable
  9315. * @return {?}
  9316. */
  9317. function (iterable) {
  9318. var /** @type {?} */ factory = this.factories.find(function (f) { return f.supports(iterable); });
  9319. if (factory != null) {
  9320. return factory;
  9321. }
  9322. else {
  9323. throw new Error("Cannot find a differ supporting object '" + iterable + "' of type '" + getTypeNameForDebugging(iterable) + "'");
  9324. }
  9325. };
  9326. return IterableDiffers;
  9327. }());
  9328. /**
  9329. * @param {?} type
  9330. * @return {?}
  9331. */
  9332. function getTypeNameForDebugging(type) {
  9333. return type['name'] || typeof type;
  9334. }
  9335. /**
  9336. * @fileoverview added by tsickle
  9337. * @suppress {checkTypes} checked by tsc
  9338. */
  9339. /**
  9340. * @license
  9341. * Copyright Google Inc. All Rights Reserved.
  9342. *
  9343. * Use of this source code is governed by an MIT-style license that can be
  9344. * found in the LICENSE file at https://angular.io/license
  9345. */
  9346. /**
  9347. * A differ that tracks changes made to an object over time.
  9348. *
  9349. * \@stable
  9350. * @record
  9351. * @template K, V
  9352. */
  9353. /**
  9354. * An object describing the changes in the `Map` or `{[k:string]: string}` since last time
  9355. * `KeyValueDiffer#diff()` was invoked.
  9356. *
  9357. * \@stable
  9358. * @record
  9359. * @template K, V
  9360. */
  9361. /**
  9362. * Record representing the item change information.
  9363. *
  9364. * \@stable
  9365. * @record
  9366. * @template K, V
  9367. */
  9368. /**
  9369. * Provides a factory for {\@link KeyValueDiffer}.
  9370. *
  9371. * \@stable
  9372. * @record
  9373. */
  9374. /**
  9375. * A repository of different Map diffing strategies used by NgClass, NgStyle, and others.
  9376. * \@stable
  9377. */
  9378. var KeyValueDiffers = /** @class */ (function () {
  9379. function KeyValueDiffers(factories) {
  9380. this.factories = factories;
  9381. }
  9382. /**
  9383. * @template S
  9384. * @param {?} factories
  9385. * @param {?=} parent
  9386. * @return {?}
  9387. */
  9388. KeyValueDiffers.create = /**
  9389. * @template S
  9390. * @param {?} factories
  9391. * @param {?=} parent
  9392. * @return {?}
  9393. */
  9394. function (factories, parent) {
  9395. if (parent) {
  9396. var /** @type {?} */ copied = parent.factories.slice();
  9397. factories = factories.concat(copied);
  9398. }
  9399. return new KeyValueDiffers(factories);
  9400. };
  9401. /**
  9402. * Takes an array of {@link KeyValueDifferFactory} and returns a provider used to extend the
  9403. * inherited {@link KeyValueDiffers} instance with the provided factories and return a new
  9404. * {@link KeyValueDiffers} instance.
  9405. *
  9406. * The following example shows how to extend an existing list of factories,
  9407. * which will only be applied to the injector for this component and its children.
  9408. * This step is all that's required to make a new {@link KeyValueDiffer} available.
  9409. *
  9410. * ### Example
  9411. *
  9412. * ```
  9413. * @Component({
  9414. * viewProviders: [
  9415. * KeyValueDiffers.extend([new ImmutableMapDiffer()])
  9416. * ]
  9417. * })
  9418. * ```
  9419. */
  9420. /**
  9421. * Takes an array of {\@link KeyValueDifferFactory} and returns a provider used to extend the
  9422. * inherited {\@link KeyValueDiffers} instance with the provided factories and return a new
  9423. * {\@link KeyValueDiffers} instance.
  9424. *
  9425. * The following example shows how to extend an existing list of factories,
  9426. * which will only be applied to the injector for this component and its children.
  9427. * This step is all that's required to make a new {\@link KeyValueDiffer} available.
  9428. *
  9429. * ### Example
  9430. *
  9431. * ```
  9432. * \@Component({
  9433. * viewProviders: [
  9434. * KeyValueDiffers.extend([new ImmutableMapDiffer()])
  9435. * ]
  9436. * })
  9437. * ```
  9438. * @template S
  9439. * @param {?} factories
  9440. * @return {?}
  9441. */
  9442. KeyValueDiffers.extend = /**
  9443. * Takes an array of {\@link KeyValueDifferFactory} and returns a provider used to extend the
  9444. * inherited {\@link KeyValueDiffers} instance with the provided factories and return a new
  9445. * {\@link KeyValueDiffers} instance.
  9446. *
  9447. * The following example shows how to extend an existing list of factories,
  9448. * which will only be applied to the injector for this component and its children.
  9449. * This step is all that's required to make a new {\@link KeyValueDiffer} available.
  9450. *
  9451. * ### Example
  9452. *
  9453. * ```
  9454. * \@Component({
  9455. * viewProviders: [
  9456. * KeyValueDiffers.extend([new ImmutableMapDiffer()])
  9457. * ]
  9458. * })
  9459. * ```
  9460. * @template S
  9461. * @param {?} factories
  9462. * @return {?}
  9463. */
  9464. function (factories) {
  9465. return {
  9466. provide: KeyValueDiffers,
  9467. useFactory: function (parent) {
  9468. if (!parent) {
  9469. // Typically would occur when calling KeyValueDiffers.extend inside of dependencies passed
  9470. // to bootstrap(), which would override default pipes instead of extending them.
  9471. throw new Error('Cannot extend KeyValueDiffers without a parent injector');
  9472. }
  9473. return KeyValueDiffers.create(factories, parent);
  9474. },
  9475. // Dependency technically isn't optional, but we can provide a better error message this way.
  9476. deps: [[KeyValueDiffers, new SkipSelf(), new Optional()]]
  9477. };
  9478. };
  9479. /**
  9480. * @param {?} kv
  9481. * @return {?}
  9482. */
  9483. KeyValueDiffers.prototype.find = /**
  9484. * @param {?} kv
  9485. * @return {?}
  9486. */
  9487. function (kv) {
  9488. var /** @type {?} */ factory = this.factories.find(function (f) { return f.supports(kv); });
  9489. if (factory) {
  9490. return factory;
  9491. }
  9492. throw new Error("Cannot find a differ supporting object '" + kv + "'");
  9493. };
  9494. return KeyValueDiffers;
  9495. }());
  9496. /**
  9497. * @fileoverview added by tsickle
  9498. * @suppress {checkTypes} checked by tsc
  9499. */
  9500. /**
  9501. * @license
  9502. * Copyright Google Inc. All Rights Reserved.
  9503. *
  9504. * Use of this source code is governed by an MIT-style license that can be
  9505. * found in the LICENSE file at https://angular.io/license
  9506. */
  9507. /**
  9508. * Structural diffing for `Object`s and `Map`s.
  9509. */
  9510. var keyValDiff = [new DefaultKeyValueDifferFactory()];
  9511. /**
  9512. * Structural diffing for `Iterable` types such as `Array`s.
  9513. */
  9514. var iterableDiff = [new DefaultIterableDifferFactory()];
  9515. var defaultIterableDiffers = new IterableDiffers(iterableDiff);
  9516. var defaultKeyValueDiffers = new KeyValueDiffers(keyValDiff);
  9517. /**
  9518. * @fileoverview added by tsickle
  9519. * @suppress {checkTypes} checked by tsc
  9520. */
  9521. /**
  9522. * @license
  9523. * Copyright Google Inc. All Rights Reserved.
  9524. *
  9525. * Use of this source code is governed by an MIT-style license that can be
  9526. * found in the LICENSE file at https://angular.io/license
  9527. */
  9528. /**
  9529. * @fileoverview added by tsickle
  9530. * @suppress {checkTypes} checked by tsc
  9531. */
  9532. /**
  9533. * @license
  9534. * Copyright Google Inc. All Rights Reserved.
  9535. *
  9536. * Use of this source code is governed by an MIT-style license that can be
  9537. * found in the LICENSE file at https://angular.io/license
  9538. */
  9539. var _CORE_PLATFORM_PROVIDERS = [
  9540. // Set a default platform name for platforms that don't set it explicitly.
  9541. { provide: PLATFORM_ID, useValue: 'unknown' },
  9542. { provide: PlatformRef, deps: [Injector] },
  9543. { provide: TestabilityRegistry, deps: [] },
  9544. { provide: Console, deps: [] },
  9545. ];
  9546. /**
  9547. * This platform has to be included in any other platform
  9548. *
  9549. * \@experimental
  9550. */
  9551. var platformCore = createPlatformFactory(null, 'core', _CORE_PLATFORM_PROVIDERS);
  9552. /**
  9553. * @fileoverview added by tsickle
  9554. * @suppress {checkTypes} checked by tsc
  9555. */
  9556. /**
  9557. * @license
  9558. * Copyright Google Inc. All Rights Reserved.
  9559. *
  9560. * Use of this source code is governed by an MIT-style license that can be
  9561. * found in the LICENSE file at https://angular.io/license
  9562. */
  9563. /**
  9564. * Provide this token to set the locale of your application.
  9565. * It is used for i18n extraction, by i18n pipes (DatePipe, I18nPluralPipe, CurrencyPipe,
  9566. * DecimalPipe and PercentPipe) and by ICU expressions.
  9567. *
  9568. * See the {\@linkDocs guide/i18n#setting-up-locale i18n guide} for more information.
  9569. *
  9570. * ### Example
  9571. *
  9572. * ```typescript
  9573. * import { LOCALE_ID } from '\@angular/core';
  9574. * import { platformBrowserDynamic } from '\@angular/platform-browser-dynamic';
  9575. * import { AppModule } from './app/app.module';
  9576. *
  9577. * platformBrowserDynamic().bootstrapModule(AppModule, {
  9578. * providers: [{provide: LOCALE_ID, useValue: 'en-US' }]
  9579. * });
  9580. * ```
  9581. *
  9582. * \@experimental i18n support is experimental.
  9583. */
  9584. var LOCALE_ID = new InjectionToken('LocaleId');
  9585. /**
  9586. * Use this token at bootstrap to provide the content of your translation file (`xtb`,
  9587. * `xlf` or `xlf2`) when you want to translate your application in another language.
  9588. *
  9589. * See the {\@linkDocs guide/i18n#merge i18n guide} for more information.
  9590. *
  9591. * ### Example
  9592. *
  9593. * ```typescript
  9594. * import { TRANSLATIONS } from '\@angular/core';
  9595. * import { platformBrowserDynamic } from '\@angular/platform-browser-dynamic';
  9596. * import { AppModule } from './app/app.module';
  9597. *
  9598. * // content of your translation file
  9599. * const translations = '....';
  9600. *
  9601. * platformBrowserDynamic().bootstrapModule(AppModule, {
  9602. * providers: [{provide: TRANSLATIONS, useValue: translations }]
  9603. * });
  9604. * ```
  9605. *
  9606. * \@experimental i18n support is experimental.
  9607. */
  9608. var TRANSLATIONS = new InjectionToken('Translations');
  9609. /**
  9610. * Provide this token at bootstrap to set the format of your {\@link TRANSLATIONS}: `xtb`,
  9611. * `xlf` or `xlf2`.
  9612. *
  9613. * See the {\@linkDocs guide/i18n#merge i18n guide} for more information.
  9614. *
  9615. * ### Example
  9616. *
  9617. * ```typescript
  9618. * import { TRANSLATIONS_FORMAT } from '\@angular/core';
  9619. * import { platformBrowserDynamic } from '\@angular/platform-browser-dynamic';
  9620. * import { AppModule } from './app/app.module';
  9621. *
  9622. * platformBrowserDynamic().bootstrapModule(AppModule, {
  9623. * providers: [{provide: TRANSLATIONS_FORMAT, useValue: 'xlf' }]
  9624. * });
  9625. * ```
  9626. *
  9627. * \@experimental i18n support is experimental.
  9628. */
  9629. var TRANSLATIONS_FORMAT = new InjectionToken('TranslationsFormat');
  9630. /** @enum {number} */
  9631. var MissingTranslationStrategy = {
  9632. Error: 0,
  9633. Warning: 1,
  9634. Ignore: 2,
  9635. };
  9636. MissingTranslationStrategy[MissingTranslationStrategy.Error] = "Error";
  9637. MissingTranslationStrategy[MissingTranslationStrategy.Warning] = "Warning";
  9638. MissingTranslationStrategy[MissingTranslationStrategy.Ignore] = "Ignore";
  9639. /**
  9640. * @fileoverview added by tsickle
  9641. * @suppress {checkTypes} checked by tsc
  9642. */
  9643. /**
  9644. * @license
  9645. * Copyright Google Inc. All Rights Reserved.
  9646. *
  9647. * Use of this source code is governed by an MIT-style license that can be
  9648. * found in the LICENSE file at https://angular.io/license
  9649. */
  9650. /**
  9651. * @return {?}
  9652. */
  9653. function _iterableDiffersFactory() {
  9654. return defaultIterableDiffers;
  9655. }
  9656. /**
  9657. * @return {?}
  9658. */
  9659. function _keyValueDiffersFactory() {
  9660. return defaultKeyValueDiffers;
  9661. }
  9662. /**
  9663. * @param {?=} locale
  9664. * @return {?}
  9665. */
  9666. function _localeFactory(locale) {
  9667. return locale || 'en-US';
  9668. }
  9669. /**
  9670. * This module includes the providers of \@angular/core that are needed
  9671. * to bootstrap components via `ApplicationRef`.
  9672. *
  9673. * \@experimental
  9674. */
  9675. var ApplicationModule = /** @class */ (function () {
  9676. // Inject ApplicationRef to make it eager...
  9677. function ApplicationModule(appRef) {
  9678. }
  9679. ApplicationModule.decorators = [
  9680. { type: NgModule, args: [{
  9681. providers: [
  9682. ApplicationRef,
  9683. ApplicationInitStatus,
  9684. Compiler,
  9685. APP_ID_RANDOM_PROVIDER,
  9686. { provide: IterableDiffers, useFactory: _iterableDiffersFactory },
  9687. { provide: KeyValueDiffers, useFactory: _keyValueDiffersFactory },
  9688. {
  9689. provide: LOCALE_ID,
  9690. useFactory: _localeFactory,
  9691. deps: [[new Inject(LOCALE_ID), new Optional(), new SkipSelf()]]
  9692. },
  9693. ]
  9694. },] },
  9695. ];
  9696. /** @nocollapse */
  9697. ApplicationModule.ctorParameters = function () { return [
  9698. { type: ApplicationRef, },
  9699. ]; };
  9700. return ApplicationModule;
  9701. }());
  9702. /**
  9703. * @fileoverview added by tsickle
  9704. * @suppress {checkTypes} checked by tsc
  9705. */
  9706. /**
  9707. * @license
  9708. * Copyright Google Inc. All Rights Reserved.
  9709. *
  9710. * Use of this source code is governed by an MIT-style license that can be
  9711. * found in the LICENSE file at https://angular.io/license
  9712. */
  9713. /** @enum {number} */
  9714. var SecurityContext = {
  9715. NONE: 0,
  9716. HTML: 1,
  9717. STYLE: 2,
  9718. SCRIPT: 3,
  9719. URL: 4,
  9720. RESOURCE_URL: 5,
  9721. };
  9722. SecurityContext[SecurityContext.NONE] = "NONE";
  9723. SecurityContext[SecurityContext.HTML] = "HTML";
  9724. SecurityContext[SecurityContext.STYLE] = "STYLE";
  9725. SecurityContext[SecurityContext.SCRIPT] = "SCRIPT";
  9726. SecurityContext[SecurityContext.URL] = "URL";
  9727. SecurityContext[SecurityContext.RESOURCE_URL] = "RESOURCE_URL";
  9728. /**
  9729. * Sanitizer is used by the views to sanitize potentially dangerous values.
  9730. *
  9731. * \@stable
  9732. * @abstract
  9733. */
  9734. var Sanitizer = /** @class */ (function () {
  9735. function Sanitizer() {
  9736. }
  9737. return Sanitizer;
  9738. }());
  9739. /**
  9740. * @fileoverview added by tsickle
  9741. * @suppress {checkTypes} checked by tsc
  9742. */
  9743. /**
  9744. * @license
  9745. * Copyright Google Inc. All Rights Reserved.
  9746. *
  9747. * Use of this source code is governed by an MIT-style license that can be
  9748. * found in the LICENSE file at https://angular.io/license
  9749. */
  9750. // unsupported: template constraints.
  9751. /**
  9752. * Factory for ViewDefinitions/NgModuleDefinitions.
  9753. * We use a function so we can reexeute it in case an error happens and use the given logger
  9754. * function to log the error from the definition of the node, which is shown in all browser
  9755. * logs.
  9756. * @record
  9757. * @template D
  9758. */
  9759. /**
  9760. * Function to call console.error at the right source location. This is an indirection
  9761. * via another function as browser will log the location that actually called
  9762. * `console.error`.
  9763. * @record
  9764. */
  9765. // unsupported: template constraints.
  9766. /**
  9767. * @record
  9768. * @template DF
  9769. */
  9770. /**
  9771. * @record
  9772. */
  9773. /**
  9774. * @record
  9775. */
  9776. /**
  9777. * @record
  9778. */
  9779. /**
  9780. * @record
  9781. */
  9782. /**
  9783. * @record
  9784. */
  9785. /**
  9786. * @record
  9787. */
  9788. /**
  9789. * @record
  9790. */
  9791. /**
  9792. * A node definition in the view.
  9793. *
  9794. * Note: We use one type for all nodes so that loops that loop over all nodes
  9795. * of a ViewDefinition stay monomorphic!
  9796. * @record
  9797. */
  9798. /**
  9799. * @record
  9800. */
  9801. /**
  9802. * @record
  9803. */
  9804. /**
  9805. * @record
  9806. */
  9807. /**
  9808. * @record
  9809. */
  9810. /**
  9811. * @record
  9812. */
  9813. /**
  9814. * @record
  9815. */
  9816. /**
  9817. * @record
  9818. */
  9819. /**
  9820. * @record
  9821. */
  9822. /**
  9823. * @record
  9824. */
  9825. /**
  9826. * @record
  9827. */
  9828. /**
  9829. * @record
  9830. */
  9831. /**
  9832. * @record
  9833. */
  9834. /**
  9835. * View instance data.
  9836. * Attention: Adding fields to this is performance sensitive!
  9837. * @record
  9838. */
  9839. /**
  9840. * @param {?} view
  9841. * @param {?} priorInitState
  9842. * @param {?} newInitState
  9843. * @return {?}
  9844. */
  9845. function shiftInitState(view, priorInitState, newInitState) {
  9846. // Only update the InitState if we are currently in the prior state.
  9847. // For example, only move into CallingInit if we are in BeforeInit. Only
  9848. // move into CallingContentInit if we are in CallingInit. Normally this will
  9849. // always be true because of how checkCycle is called in checkAndUpdateView.
  9850. // However, if checkAndUpdateView is called recursively or if an exception is
  9851. // thrown while checkAndUpdateView is running, checkAndUpdateView starts over
  9852. // from the beginning. This ensures the state is monotonically increasing,
  9853. // terminating in the AfterInit state, which ensures the Init methods are called
  9854. // at least once and only once.
  9855. var /** @type {?} */ state = view.state;
  9856. var /** @type {?} */ initState = state & 1792;
  9857. if (initState === priorInitState) {
  9858. view.state = (state & ~1792 /* InitState_Mask */) | newInitState;
  9859. view.initIndex = -1;
  9860. return true;
  9861. }
  9862. return initState === newInitState;
  9863. }
  9864. /**
  9865. * @param {?} view
  9866. * @param {?} initState
  9867. * @param {?} index
  9868. * @return {?}
  9869. */
  9870. function shouldCallLifecycleInitHook(view, initState, index) {
  9871. if ((view.state & 1792 /* InitState_Mask */) === initState && view.initIndex <= index) {
  9872. view.initIndex = index + 1;
  9873. return true;
  9874. }
  9875. return false;
  9876. }
  9877. /**
  9878. * @record
  9879. */
  9880. /**
  9881. * Data for an instantiated NodeType.Text.
  9882. *
  9883. * Attention: Adding fields to this is performance sensitive!
  9884. * @record
  9885. */
  9886. /**
  9887. * Accessor for view.nodes, enforcing that every usage site stays monomorphic.
  9888. * @param {?} view
  9889. * @param {?} index
  9890. * @return {?}
  9891. */
  9892. function asTextData(view, index) {
  9893. return /** @type {?} */ (view.nodes[index]);
  9894. }
  9895. /**
  9896. * Data for an instantiated NodeType.Element.
  9897. *
  9898. * Attention: Adding fields to this is performance sensitive!
  9899. * @record
  9900. */
  9901. /**
  9902. * @record
  9903. */
  9904. /**
  9905. * @record
  9906. */
  9907. /**
  9908. * Accessor for view.nodes, enforcing that every usage site stays monomorphic.
  9909. * @param {?} view
  9910. * @param {?} index
  9911. * @return {?}
  9912. */
  9913. function asElementData(view, index) {
  9914. return /** @type {?} */ (view.nodes[index]);
  9915. }
  9916. /**
  9917. * Data for an instantiated NodeType.Provider.
  9918. *
  9919. * Attention: Adding fields to this is performance sensitive!
  9920. * @record
  9921. */
  9922. /**
  9923. * Accessor for view.nodes, enforcing that every usage site stays monomorphic.
  9924. * @param {?} view
  9925. * @param {?} index
  9926. * @return {?}
  9927. */
  9928. function asProviderData(view, index) {
  9929. return /** @type {?} */ (view.nodes[index]);
  9930. }
  9931. /**
  9932. * Data for an instantiated NodeType.PureExpression.
  9933. *
  9934. * Attention: Adding fields to this is performance sensitive!
  9935. * @record
  9936. */
  9937. /**
  9938. * Accessor for view.nodes, enforcing that every usage site stays monomorphic.
  9939. * @param {?} view
  9940. * @param {?} index
  9941. * @return {?}
  9942. */
  9943. function asPureExpressionData(view, index) {
  9944. return /** @type {?} */ (view.nodes[index]);
  9945. }
  9946. /**
  9947. * Accessor for view.nodes, enforcing that every usage site stays monomorphic.
  9948. * @param {?} view
  9949. * @param {?} index
  9950. * @return {?}
  9951. */
  9952. function asQueryList(view, index) {
  9953. return /** @type {?} */ (view.nodes[index]);
  9954. }
  9955. /**
  9956. * @record
  9957. */
  9958. /**
  9959. * @abstract
  9960. */
  9961. var DebugContext = /** @class */ (function () {
  9962. function DebugContext() {
  9963. }
  9964. return DebugContext;
  9965. }());
  9966. /**
  9967. * @record
  9968. */
  9969. /**
  9970. * This object is used to prevent cycles in the source files and to have a place where
  9971. * debug mode can hook it. It is lazily filled when `isDevMode` is known.
  9972. */
  9973. var Services = {
  9974. setCurrentNode: /** @type {?} */ ((undefined)),
  9975. createRootView: /** @type {?} */ ((undefined)),
  9976. createEmbeddedView: /** @type {?} */ ((undefined)),
  9977. createComponentView: /** @type {?} */ ((undefined)),
  9978. createNgModuleRef: /** @type {?} */ ((undefined)),
  9979. overrideProvider: /** @type {?} */ ((undefined)),
  9980. overrideComponentView: /** @type {?} */ ((undefined)),
  9981. clearOverrides: /** @type {?} */ ((undefined)),
  9982. checkAndUpdateView: /** @type {?} */ ((undefined)),
  9983. checkNoChangesView: /** @type {?} */ ((undefined)),
  9984. destroyView: /** @type {?} */ ((undefined)),
  9985. resolveDep: /** @type {?} */ ((undefined)),
  9986. createDebugContext: /** @type {?} */ ((undefined)),
  9987. handleEvent: /** @type {?} */ ((undefined)),
  9988. updateDirectives: /** @type {?} */ ((undefined)),
  9989. updateRenderer: /** @type {?} */ ((undefined)),
  9990. dirtyParentQueries: /** @type {?} */ ((undefined)),
  9991. };
  9992. /**
  9993. * @fileoverview added by tsickle
  9994. * @suppress {checkTypes} checked by tsc
  9995. */
  9996. /**
  9997. * @license
  9998. * Copyright Google Inc. All Rights Reserved.
  9999. *
  10000. * Use of this source code is governed by an MIT-style license that can be
  10001. * found in the LICENSE file at https://angular.io/license
  10002. */
  10003. /**
  10004. * @param {?} context
  10005. * @param {?} oldValue
  10006. * @param {?} currValue
  10007. * @param {?} isFirstCheck
  10008. * @return {?}
  10009. */
  10010. function expressionChangedAfterItHasBeenCheckedError(context, oldValue, currValue, isFirstCheck) {
  10011. var /** @type {?} */ msg = "ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '" + oldValue + "'. Current value: '" + currValue + "'.";
  10012. if (isFirstCheck) {
  10013. msg +=
  10014. " It seems like the view has been created after its parent and its children have been dirty checked." +
  10015. " Has it been created in a change detection hook ?";
  10016. }
  10017. return viewDebugError(msg, context);
  10018. }
  10019. /**
  10020. * @param {?} err
  10021. * @param {?} context
  10022. * @return {?}
  10023. */
  10024. function viewWrappedDebugError(err, context) {
  10025. if (!(err instanceof Error)) {
  10026. // errors that are not Error instances don't have a stack,
  10027. // so it is ok to wrap them into a new Error object...
  10028. err = new Error(err.toString());
  10029. }
  10030. _addDebugContext(err, context);
  10031. return err;
  10032. }
  10033. /**
  10034. * @param {?} msg
  10035. * @param {?} context
  10036. * @return {?}
  10037. */
  10038. function viewDebugError(msg, context) {
  10039. var /** @type {?} */ err = new Error(msg);
  10040. _addDebugContext(err, context);
  10041. return err;
  10042. }
  10043. /**
  10044. * @param {?} err
  10045. * @param {?} context
  10046. * @return {?}
  10047. */
  10048. function _addDebugContext(err, context) {
  10049. (/** @type {?} */ (err))[ERROR_DEBUG_CONTEXT] = context;
  10050. (/** @type {?} */ (err))[ERROR_LOGGER] = context.logError.bind(context);
  10051. }
  10052. /**
  10053. * @param {?} err
  10054. * @return {?}
  10055. */
  10056. function isViewDebugError(err) {
  10057. return !!getDebugContext(err);
  10058. }
  10059. /**
  10060. * @param {?} action
  10061. * @return {?}
  10062. */
  10063. function viewDestroyedError(action) {
  10064. return new Error("ViewDestroyedError: Attempt to use a destroyed view: " + action);
  10065. }
  10066. /**
  10067. * @fileoverview added by tsickle
  10068. * @suppress {checkTypes} checked by tsc
  10069. */
  10070. /**
  10071. * @license
  10072. * Copyright Google Inc. All Rights Reserved.
  10073. *
  10074. * Use of this source code is governed by an MIT-style license that can be
  10075. * found in the LICENSE file at https://angular.io/license
  10076. */
  10077. var NOOP = function () { };
  10078. var _tokenKeyCache = new Map();
  10079. /**
  10080. * @param {?} token
  10081. * @return {?}
  10082. */
  10083. function tokenKey(token) {
  10084. var /** @type {?} */ key = _tokenKeyCache.get(token);
  10085. if (!key) {
  10086. key = stringify(token) + '_' + _tokenKeyCache.size;
  10087. _tokenKeyCache.set(token, key);
  10088. }
  10089. return key;
  10090. }
  10091. /**
  10092. * @param {?} view
  10093. * @param {?} nodeIdx
  10094. * @param {?} bindingIdx
  10095. * @param {?} value
  10096. * @return {?}
  10097. */
  10098. function unwrapValue(view, nodeIdx, bindingIdx, value) {
  10099. if (WrappedValue.isWrapped(value)) {
  10100. value = WrappedValue.unwrap(value);
  10101. var /** @type {?} */ globalBindingIdx = view.def.nodes[nodeIdx].bindingIndex + bindingIdx;
  10102. var /** @type {?} */ oldValue = WrappedValue.unwrap(view.oldValues[globalBindingIdx]);
  10103. view.oldValues[globalBindingIdx] = new WrappedValue(oldValue);
  10104. }
  10105. return value;
  10106. }
  10107. var UNDEFINED_RENDERER_TYPE_ID = '$$undefined';
  10108. var EMPTY_RENDERER_TYPE_ID = '$$empty';
  10109. /**
  10110. * @param {?} values
  10111. * @return {?}
  10112. */
  10113. function createRendererType2(values) {
  10114. return {
  10115. id: UNDEFINED_RENDERER_TYPE_ID,
  10116. styles: values.styles,
  10117. encapsulation: values.encapsulation,
  10118. data: values.data
  10119. };
  10120. }
  10121. var _renderCompCount = 0;
  10122. /**
  10123. * @param {?=} type
  10124. * @return {?}
  10125. */
  10126. function resolveRendererType2(type) {
  10127. if (type && type.id === UNDEFINED_RENDERER_TYPE_ID) {
  10128. // first time we see this RendererType2. Initialize it...
  10129. var /** @type {?} */ isFilled = ((type.encapsulation != null && type.encapsulation !== ViewEncapsulation.None) ||
  10130. type.styles.length || Object.keys(type.data).length);
  10131. if (isFilled) {
  10132. type.id = "c" + _renderCompCount++;
  10133. }
  10134. else {
  10135. type.id = EMPTY_RENDERER_TYPE_ID;
  10136. }
  10137. }
  10138. if (type && type.id === EMPTY_RENDERER_TYPE_ID) {
  10139. type = null;
  10140. }
  10141. return type || null;
  10142. }
  10143. /**
  10144. * @param {?} view
  10145. * @param {?} def
  10146. * @param {?} bindingIdx
  10147. * @param {?} value
  10148. * @return {?}
  10149. */
  10150. function checkBinding(view, def, bindingIdx, value) {
  10151. var /** @type {?} */ oldValues = view.oldValues;
  10152. if ((view.state & 2 /* FirstCheck */) ||
  10153. !looseIdentical(oldValues[def.bindingIndex + bindingIdx], value)) {
  10154. return true;
  10155. }
  10156. return false;
  10157. }
  10158. /**
  10159. * @param {?} view
  10160. * @param {?} def
  10161. * @param {?} bindingIdx
  10162. * @param {?} value
  10163. * @return {?}
  10164. */
  10165. function checkAndUpdateBinding(view, def, bindingIdx, value) {
  10166. if (checkBinding(view, def, bindingIdx, value)) {
  10167. view.oldValues[def.bindingIndex + bindingIdx] = value;
  10168. return true;
  10169. }
  10170. return false;
  10171. }
  10172. /**
  10173. * @param {?} view
  10174. * @param {?} def
  10175. * @param {?} bindingIdx
  10176. * @param {?} value
  10177. * @return {?}
  10178. */
  10179. function checkBindingNoChanges(view, def, bindingIdx, value) {
  10180. var /** @type {?} */ oldValue = view.oldValues[def.bindingIndex + bindingIdx];
  10181. if ((view.state & 1 /* BeforeFirstCheck */) || !devModeEqual(oldValue, value)) {
  10182. var /** @type {?} */ bindingName = def.bindings[bindingIdx].name;
  10183. throw expressionChangedAfterItHasBeenCheckedError(Services.createDebugContext(view, def.nodeIndex), bindingName + ": " + oldValue, bindingName + ": " + value, (view.state & 1 /* BeforeFirstCheck */) !== 0);
  10184. }
  10185. }
  10186. /**
  10187. * @param {?} view
  10188. * @return {?}
  10189. */
  10190. function markParentViewsForCheck(view) {
  10191. var /** @type {?} */ currView = view;
  10192. while (currView) {
  10193. if (currView.def.flags & 2 /* OnPush */) {
  10194. currView.state |= 8 /* ChecksEnabled */;
  10195. }
  10196. currView = currView.viewContainerParent || currView.parent;
  10197. }
  10198. }
  10199. /**
  10200. * @param {?} view
  10201. * @param {?} endView
  10202. * @return {?}
  10203. */
  10204. function markParentViewsForCheckProjectedViews(view, endView) {
  10205. var /** @type {?} */ currView = view;
  10206. while (currView && currView !== endView) {
  10207. currView.state |= 64 /* CheckProjectedViews */;
  10208. currView = currView.viewContainerParent || currView.parent;
  10209. }
  10210. }
  10211. /**
  10212. * @param {?} view
  10213. * @param {?} nodeIndex
  10214. * @param {?} eventName
  10215. * @param {?} event
  10216. * @return {?}
  10217. */
  10218. function dispatchEvent(view, nodeIndex, eventName, event) {
  10219. try {
  10220. var /** @type {?} */ nodeDef = view.def.nodes[nodeIndex];
  10221. var /** @type {?} */ startView = nodeDef.flags & 33554432 /* ComponentView */ ?
  10222. asElementData(view, nodeIndex).componentView :
  10223. view;
  10224. markParentViewsForCheck(startView);
  10225. return Services.handleEvent(view, nodeIndex, eventName, event);
  10226. }
  10227. catch (/** @type {?} */ e) {
  10228. // Attention: Don't rethrow, as it would cancel Observable subscriptions!
  10229. view.root.errorHandler.handleError(e);
  10230. }
  10231. }
  10232. /**
  10233. * @param {?} view
  10234. * @return {?}
  10235. */
  10236. function declaredViewContainer(view) {
  10237. if (view.parent) {
  10238. var /** @type {?} */ parentView = view.parent;
  10239. return asElementData(parentView, /** @type {?} */ ((view.parentNodeDef)).nodeIndex);
  10240. }
  10241. return null;
  10242. }
  10243. /**
  10244. * for component views, this is the host element.
  10245. * for embedded views, this is the index of the parent node
  10246. * that contains the view container.
  10247. * @param {?} view
  10248. * @return {?}
  10249. */
  10250. function viewParentEl(view) {
  10251. var /** @type {?} */ parentView = view.parent;
  10252. if (parentView) {
  10253. return /** @type {?} */ ((view.parentNodeDef)).parent;
  10254. }
  10255. else {
  10256. return null;
  10257. }
  10258. }
  10259. /**
  10260. * @param {?} view
  10261. * @param {?} def
  10262. * @return {?}
  10263. */
  10264. function renderNode(view, def) {
  10265. switch (def.flags & 201347067 /* Types */) {
  10266. case 1 /* TypeElement */:
  10267. return asElementData(view, def.nodeIndex).renderElement;
  10268. case 2 /* TypeText */:
  10269. return asTextData(view, def.nodeIndex).renderText;
  10270. }
  10271. }
  10272. /**
  10273. * @param {?} target
  10274. * @param {?} name
  10275. * @return {?}
  10276. */
  10277. function elementEventFullName(target, name) {
  10278. return target ? target + ":" + name : name;
  10279. }
  10280. /**
  10281. * @param {?} view
  10282. * @return {?}
  10283. */
  10284. function isComponentView(view) {
  10285. return !!view.parent && !!(/** @type {?} */ ((view.parentNodeDef)).flags & 32768 /* Component */);
  10286. }
  10287. /**
  10288. * @param {?} view
  10289. * @return {?}
  10290. */
  10291. function isEmbeddedView(view) {
  10292. return !!view.parent && !(/** @type {?} */ ((view.parentNodeDef)).flags & 32768 /* Component */);
  10293. }
  10294. /**
  10295. * @param {?} queryId
  10296. * @return {?}
  10297. */
  10298. function filterQueryId(queryId) {
  10299. return 1 << (queryId % 32);
  10300. }
  10301. /**
  10302. * @param {?} matchedQueriesDsl
  10303. * @return {?}
  10304. */
  10305. function splitMatchedQueriesDsl(matchedQueriesDsl) {
  10306. var /** @type {?} */ matchedQueries = {};
  10307. var /** @type {?} */ matchedQueryIds = 0;
  10308. var /** @type {?} */ references = {};
  10309. if (matchedQueriesDsl) {
  10310. matchedQueriesDsl.forEach(function (_a) {
  10311. var queryId = _a[0], valueType = _a[1];
  10312. if (typeof queryId === 'number') {
  10313. matchedQueries[queryId] = valueType;
  10314. matchedQueryIds |= filterQueryId(queryId);
  10315. }
  10316. else {
  10317. references[queryId] = valueType;
  10318. }
  10319. });
  10320. }
  10321. return { matchedQueries: matchedQueries, references: references, matchedQueryIds: matchedQueryIds };
  10322. }
  10323. /**
  10324. * @param {?} deps
  10325. * @param {?=} sourceName
  10326. * @return {?}
  10327. */
  10328. function splitDepsDsl(deps, sourceName) {
  10329. return deps.map(function (value) {
  10330. var /** @type {?} */ token;
  10331. var /** @type {?} */ flags;
  10332. if (Array.isArray(value)) {
  10333. flags = value[0], token = value[1];
  10334. }
  10335. else {
  10336. flags = 0 /* None */;
  10337. token = value;
  10338. }
  10339. if (token && (typeof token === 'function' || typeof token === 'object') && sourceName) {
  10340. Object.defineProperty(token, SOURCE, { value: sourceName, configurable: true });
  10341. }
  10342. return { flags: flags, token: token, tokenKey: tokenKey(token) };
  10343. });
  10344. }
  10345. /**
  10346. * @param {?} view
  10347. * @param {?} renderHost
  10348. * @param {?} def
  10349. * @return {?}
  10350. */
  10351. function getParentRenderElement(view, renderHost, def) {
  10352. var /** @type {?} */ renderParent = def.renderParent;
  10353. if (renderParent) {
  10354. if ((renderParent.flags & 1 /* TypeElement */) === 0 ||
  10355. (renderParent.flags & 33554432 /* ComponentView */) === 0 ||
  10356. (/** @type {?} */ ((renderParent.element)).componentRendererType && /** @type {?} */ ((/** @type {?} */ ((renderParent.element)).componentRendererType)).encapsulation === ViewEncapsulation.Native)) {
  10357. // only children of non components, or children of components with native encapsulation should
  10358. // be attached.
  10359. return asElementData(view, /** @type {?} */ ((def.renderParent)).nodeIndex).renderElement;
  10360. }
  10361. }
  10362. else {
  10363. return renderHost;
  10364. }
  10365. }
  10366. var DEFINITION_CACHE = new WeakMap();
  10367. /**
  10368. * @template D
  10369. * @param {?} factory
  10370. * @return {?}
  10371. */
  10372. function resolveDefinition(factory) {
  10373. var /** @type {?} */ value = /** @type {?} */ (((DEFINITION_CACHE.get(factory))));
  10374. if (!value) {
  10375. value = factory(function () { return NOOP; });
  10376. value.factory = factory;
  10377. DEFINITION_CACHE.set(factory, value);
  10378. }
  10379. return value;
  10380. }
  10381. /**
  10382. * @param {?} view
  10383. * @return {?}
  10384. */
  10385. function rootRenderNodes(view) {
  10386. var /** @type {?} */ renderNodes = [];
  10387. visitRootRenderNodes(view, 0 /* Collect */, undefined, undefined, renderNodes);
  10388. return renderNodes;
  10389. }
  10390. /**
  10391. * @param {?} view
  10392. * @param {?} action
  10393. * @param {?} parentNode
  10394. * @param {?} nextSibling
  10395. * @param {?=} target
  10396. * @return {?}
  10397. */
  10398. function visitRootRenderNodes(view, action, parentNode, nextSibling, target) {
  10399. // We need to re-compute the parent node in case the nodes have been moved around manually
  10400. if (action === 3 /* RemoveChild */) {
  10401. parentNode = view.renderer.parentNode(renderNode(view, /** @type {?} */ ((view.def.lastRenderRootNode))));
  10402. }
  10403. visitSiblingRenderNodes(view, action, 0, view.def.nodes.length - 1, parentNode, nextSibling, target);
  10404. }
  10405. /**
  10406. * @param {?} view
  10407. * @param {?} action
  10408. * @param {?} startIndex
  10409. * @param {?} endIndex
  10410. * @param {?} parentNode
  10411. * @param {?} nextSibling
  10412. * @param {?=} target
  10413. * @return {?}
  10414. */
  10415. function visitSiblingRenderNodes(view, action, startIndex, endIndex, parentNode, nextSibling, target) {
  10416. for (var /** @type {?} */ i = startIndex; i <= endIndex; i++) {
  10417. var /** @type {?} */ nodeDef = view.def.nodes[i];
  10418. if (nodeDef.flags & (1 /* TypeElement */ | 2 /* TypeText */ | 8 /* TypeNgContent */)) {
  10419. visitRenderNode(view, nodeDef, action, parentNode, nextSibling, target);
  10420. }
  10421. // jump to next sibling
  10422. i += nodeDef.childCount;
  10423. }
  10424. }
  10425. /**
  10426. * @param {?} view
  10427. * @param {?} ngContentIndex
  10428. * @param {?} action
  10429. * @param {?} parentNode
  10430. * @param {?} nextSibling
  10431. * @param {?=} target
  10432. * @return {?}
  10433. */
  10434. function visitProjectedRenderNodes(view, ngContentIndex, action, parentNode, nextSibling, target) {
  10435. var /** @type {?} */ compView = view;
  10436. while (compView && !isComponentView(compView)) {
  10437. compView = compView.parent;
  10438. }
  10439. var /** @type {?} */ hostView = /** @type {?} */ ((compView)).parent;
  10440. var /** @type {?} */ hostElDef = viewParentEl(/** @type {?} */ ((compView)));
  10441. var /** @type {?} */ startIndex = /** @type {?} */ ((hostElDef)).nodeIndex + 1;
  10442. var /** @type {?} */ endIndex = /** @type {?} */ ((hostElDef)).nodeIndex + /** @type {?} */ ((hostElDef)).childCount;
  10443. for (var /** @type {?} */ i = startIndex; i <= endIndex; i++) {
  10444. var /** @type {?} */ nodeDef = /** @type {?} */ ((hostView)).def.nodes[i];
  10445. if (nodeDef.ngContentIndex === ngContentIndex) {
  10446. visitRenderNode(/** @type {?} */ ((hostView)), nodeDef, action, parentNode, nextSibling, target);
  10447. }
  10448. // jump to next sibling
  10449. i += nodeDef.childCount;
  10450. }
  10451. if (!/** @type {?} */ ((hostView)).parent) {
  10452. // a root view
  10453. var /** @type {?} */ projectedNodes = view.root.projectableNodes[ngContentIndex];
  10454. if (projectedNodes) {
  10455. for (var /** @type {?} */ i = 0; i < projectedNodes.length; i++) {
  10456. execRenderNodeAction(view, projectedNodes[i], action, parentNode, nextSibling, target);
  10457. }
  10458. }
  10459. }
  10460. }
  10461. /**
  10462. * @param {?} view
  10463. * @param {?} nodeDef
  10464. * @param {?} action
  10465. * @param {?} parentNode
  10466. * @param {?} nextSibling
  10467. * @param {?=} target
  10468. * @return {?}
  10469. */
  10470. function visitRenderNode(view, nodeDef, action, parentNode, nextSibling, target) {
  10471. if (nodeDef.flags & 8 /* TypeNgContent */) {
  10472. visitProjectedRenderNodes(view, /** @type {?} */ ((nodeDef.ngContent)).index, action, parentNode, nextSibling, target);
  10473. }
  10474. else {
  10475. var /** @type {?} */ rn = renderNode(view, nodeDef);
  10476. if (action === 3 /* RemoveChild */ && (nodeDef.flags & 33554432 /* ComponentView */) &&
  10477. (nodeDef.bindingFlags & 48 /* CatSyntheticProperty */)) {
  10478. // Note: we might need to do both actions.
  10479. if (nodeDef.bindingFlags & (16 /* SyntheticProperty */)) {
  10480. execRenderNodeAction(view, rn, action, parentNode, nextSibling, target);
  10481. }
  10482. if (nodeDef.bindingFlags & (32 /* SyntheticHostProperty */)) {
  10483. var /** @type {?} */ compView = asElementData(view, nodeDef.nodeIndex).componentView;
  10484. execRenderNodeAction(compView, rn, action, parentNode, nextSibling, target);
  10485. }
  10486. }
  10487. else {
  10488. execRenderNodeAction(view, rn, action, parentNode, nextSibling, target);
  10489. }
  10490. if (nodeDef.flags & 16777216 /* EmbeddedViews */) {
  10491. var /** @type {?} */ embeddedViews = /** @type {?} */ ((asElementData(view, nodeDef.nodeIndex).viewContainer))._embeddedViews;
  10492. for (var /** @type {?} */ k = 0; k < embeddedViews.length; k++) {
  10493. visitRootRenderNodes(embeddedViews[k], action, parentNode, nextSibling, target);
  10494. }
  10495. }
  10496. if (nodeDef.flags & 1 /* TypeElement */ && !/** @type {?} */ ((nodeDef.element)).name) {
  10497. visitSiblingRenderNodes(view, action, nodeDef.nodeIndex + 1, nodeDef.nodeIndex + nodeDef.childCount, parentNode, nextSibling, target);
  10498. }
  10499. }
  10500. }
  10501. /**
  10502. * @param {?} view
  10503. * @param {?} renderNode
  10504. * @param {?} action
  10505. * @param {?} parentNode
  10506. * @param {?} nextSibling
  10507. * @param {?=} target
  10508. * @return {?}
  10509. */
  10510. function execRenderNodeAction(view, renderNode, action, parentNode, nextSibling, target) {
  10511. var /** @type {?} */ renderer = view.renderer;
  10512. switch (action) {
  10513. case 1 /* AppendChild */:
  10514. renderer.appendChild(parentNode, renderNode);
  10515. break;
  10516. case 2 /* InsertBefore */:
  10517. renderer.insertBefore(parentNode, renderNode, nextSibling);
  10518. break;
  10519. case 3 /* RemoveChild */:
  10520. renderer.removeChild(parentNode, renderNode);
  10521. break;
  10522. case 0 /* Collect */:
  10523. /** @type {?} */ ((target)).push(renderNode);
  10524. break;
  10525. }
  10526. }
  10527. var NS_PREFIX_RE = /^:([^:]+):(.+)$/;
  10528. /**
  10529. * @param {?} name
  10530. * @return {?}
  10531. */
  10532. function splitNamespace(name) {
  10533. if (name[0] === ':') {
  10534. var /** @type {?} */ match = /** @type {?} */ ((name.match(NS_PREFIX_RE)));
  10535. return [match[1], match[2]];
  10536. }
  10537. return ['', name];
  10538. }
  10539. /**
  10540. * @param {?} bindings
  10541. * @return {?}
  10542. */
  10543. function calcBindingFlags(bindings) {
  10544. var /** @type {?} */ flags = 0;
  10545. for (var /** @type {?} */ i = 0; i < bindings.length; i++) {
  10546. flags |= bindings[i].flags;
  10547. }
  10548. return flags;
  10549. }
  10550. /**
  10551. * @param {?} valueCount
  10552. * @param {?} constAndInterp
  10553. * @return {?}
  10554. */
  10555. function interpolate(valueCount, constAndInterp) {
  10556. var /** @type {?} */ result = '';
  10557. for (var /** @type {?} */ i = 0; i < valueCount * 2; i = i + 2) {
  10558. result = result + constAndInterp[i] + _toStringWithNull(constAndInterp[i + 1]);
  10559. }
  10560. return result + constAndInterp[valueCount * 2];
  10561. }
  10562. /**
  10563. * @param {?} valueCount
  10564. * @param {?} c0
  10565. * @param {?} a1
  10566. * @param {?} c1
  10567. * @param {?=} a2
  10568. * @param {?=} c2
  10569. * @param {?=} a3
  10570. * @param {?=} c3
  10571. * @param {?=} a4
  10572. * @param {?=} c4
  10573. * @param {?=} a5
  10574. * @param {?=} c5
  10575. * @param {?=} a6
  10576. * @param {?=} c6
  10577. * @param {?=} a7
  10578. * @param {?=} c7
  10579. * @param {?=} a8
  10580. * @param {?=} c8
  10581. * @param {?=} a9
  10582. * @param {?=} c9
  10583. * @return {?}
  10584. */
  10585. function inlineInterpolate(valueCount, c0, a1, c1, a2, c2, a3, c3, a4, c4, a5, c5, a6, c6, a7, c7, a8, c8, a9, c9) {
  10586. switch (valueCount) {
  10587. case 1:
  10588. return c0 + _toStringWithNull(a1) + c1;
  10589. case 2:
  10590. return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2;
  10591. case 3:
  10592. return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +
  10593. c3;
  10594. case 4:
  10595. return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +
  10596. c3 + _toStringWithNull(a4) + c4;
  10597. case 5:
  10598. return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +
  10599. c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5;
  10600. case 6:
  10601. return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +
  10602. c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) + c6;
  10603. case 7:
  10604. return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +
  10605. c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) +
  10606. c6 + _toStringWithNull(a7) + c7;
  10607. case 8:
  10608. return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +
  10609. c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) +
  10610. c6 + _toStringWithNull(a7) + c7 + _toStringWithNull(a8) + c8;
  10611. case 9:
  10612. return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +
  10613. c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) +
  10614. c6 + _toStringWithNull(a7) + c7 + _toStringWithNull(a8) + c8 + _toStringWithNull(a9) + c9;
  10615. default:
  10616. throw new Error("Does not support more than 9 expressions");
  10617. }
  10618. }
  10619. /**
  10620. * @param {?} v
  10621. * @return {?}
  10622. */
  10623. function _toStringWithNull(v) {
  10624. return v != null ? v.toString() : '';
  10625. }
  10626. var EMPTY_ARRAY = [];
  10627. var EMPTY_MAP = {};
  10628. /**
  10629. * @fileoverview added by tsickle
  10630. * @suppress {checkTypes} checked by tsc
  10631. */
  10632. /**
  10633. * @license
  10634. * Copyright Google Inc. All Rights Reserved.
  10635. *
  10636. * Use of this source code is governed by an MIT-style license that can be
  10637. * found in the LICENSE file at https://angular.io/license
  10638. */
  10639. /**
  10640. * @param {?} flags
  10641. * @param {?} matchedQueriesDsl
  10642. * @param {?} ngContentIndex
  10643. * @param {?} childCount
  10644. * @param {?=} handleEvent
  10645. * @param {?=} templateFactory
  10646. * @return {?}
  10647. */
  10648. function anchorDef(flags, matchedQueriesDsl, ngContentIndex, childCount, handleEvent, templateFactory) {
  10649. flags |= 1 /* TypeElement */;
  10650. var _a = splitMatchedQueriesDsl(matchedQueriesDsl), matchedQueries = _a.matchedQueries, references = _a.references, matchedQueryIds = _a.matchedQueryIds;
  10651. var /** @type {?} */ template = templateFactory ? resolveDefinition(templateFactory) : null;
  10652. return {
  10653. // will bet set by the view definition
  10654. nodeIndex: -1,
  10655. parent: null,
  10656. renderParent: null,
  10657. bindingIndex: -1,
  10658. outputIndex: -1,
  10659. // regular values
  10660. flags: flags,
  10661. checkIndex: -1,
  10662. childFlags: 0,
  10663. directChildFlags: 0,
  10664. childMatchedQueries: 0, matchedQueries: matchedQueries, matchedQueryIds: matchedQueryIds, references: references, ngContentIndex: ngContentIndex, childCount: childCount,
  10665. bindings: [],
  10666. bindingFlags: 0,
  10667. outputs: [],
  10668. element: {
  10669. ns: null,
  10670. name: null,
  10671. attrs: null, template: template,
  10672. componentProvider: null,
  10673. componentView: null,
  10674. componentRendererType: null,
  10675. publicProviders: null,
  10676. allProviders: null,
  10677. handleEvent: handleEvent || NOOP
  10678. },
  10679. provider: null,
  10680. text: null,
  10681. query: null,
  10682. ngContent: null
  10683. };
  10684. }
  10685. /**
  10686. * @param {?} checkIndex
  10687. * @param {?} flags
  10688. * @param {?} matchedQueriesDsl
  10689. * @param {?} ngContentIndex
  10690. * @param {?} childCount
  10691. * @param {?} namespaceAndName
  10692. * @param {?=} fixedAttrs
  10693. * @param {?=} bindings
  10694. * @param {?=} outputs
  10695. * @param {?=} handleEvent
  10696. * @param {?=} componentView
  10697. * @param {?=} componentRendererType
  10698. * @return {?}
  10699. */
  10700. function elementDef(checkIndex, flags, matchedQueriesDsl, ngContentIndex, childCount, namespaceAndName, fixedAttrs, bindings, outputs, handleEvent, componentView, componentRendererType) {
  10701. if (fixedAttrs === void 0) { fixedAttrs = []; }
  10702. if (!handleEvent) {
  10703. handleEvent = NOOP;
  10704. }
  10705. var _a = splitMatchedQueriesDsl(matchedQueriesDsl), matchedQueries = _a.matchedQueries, references = _a.references, matchedQueryIds = _a.matchedQueryIds;
  10706. var /** @type {?} */ ns = /** @type {?} */ ((null));
  10707. var /** @type {?} */ name = /** @type {?} */ ((null));
  10708. if (namespaceAndName) {
  10709. _b = splitNamespace(namespaceAndName), ns = _b[0], name = _b[1];
  10710. }
  10711. bindings = bindings || [];
  10712. var /** @type {?} */ bindingDefs = new Array(bindings.length);
  10713. for (var /** @type {?} */ i = 0; i < bindings.length; i++) {
  10714. var _c = bindings[i], bindingFlags = _c[0], namespaceAndName_1 = _c[1], suffixOrSecurityContext = _c[2];
  10715. var _d = splitNamespace(namespaceAndName_1), ns_1 = _d[0], name_1 = _d[1];
  10716. var /** @type {?} */ securityContext = /** @type {?} */ ((undefined));
  10717. var /** @type {?} */ suffix = /** @type {?} */ ((undefined));
  10718. switch (bindingFlags & 15 /* Types */) {
  10719. case 4 /* TypeElementStyle */:
  10720. suffix = /** @type {?} */ (suffixOrSecurityContext);
  10721. break;
  10722. case 1 /* TypeElementAttribute */:
  10723. case 8 /* TypeProperty */:
  10724. securityContext = /** @type {?} */ (suffixOrSecurityContext);
  10725. break;
  10726. }
  10727. bindingDefs[i] =
  10728. { flags: bindingFlags, ns: ns_1, name: name_1, nonMinifiedName: name_1, securityContext: securityContext, suffix: suffix };
  10729. }
  10730. outputs = outputs || [];
  10731. var /** @type {?} */ outputDefs = new Array(outputs.length);
  10732. for (var /** @type {?} */ i = 0; i < outputs.length; i++) {
  10733. var _e = outputs[i], target = _e[0], eventName = _e[1];
  10734. outputDefs[i] = {
  10735. type: 0 /* ElementOutput */,
  10736. target: /** @type {?} */ (target), eventName: eventName,
  10737. propName: null
  10738. };
  10739. }
  10740. fixedAttrs = fixedAttrs || [];
  10741. var /** @type {?} */ attrs = /** @type {?} */ (fixedAttrs.map(function (_a) {
  10742. var namespaceAndName = _a[0], value = _a[1];
  10743. var _b = splitNamespace(namespaceAndName), ns = _b[0], name = _b[1];
  10744. return [ns, name, value];
  10745. }));
  10746. componentRendererType = resolveRendererType2(componentRendererType);
  10747. if (componentView) {
  10748. flags |= 33554432 /* ComponentView */;
  10749. }
  10750. flags |= 1 /* TypeElement */;
  10751. return {
  10752. // will bet set by the view definition
  10753. nodeIndex: -1,
  10754. parent: null,
  10755. renderParent: null,
  10756. bindingIndex: -1,
  10757. outputIndex: -1,
  10758. // regular values
  10759. checkIndex: checkIndex,
  10760. flags: flags,
  10761. childFlags: 0,
  10762. directChildFlags: 0,
  10763. childMatchedQueries: 0, matchedQueries: matchedQueries, matchedQueryIds: matchedQueryIds, references: references, ngContentIndex: ngContentIndex, childCount: childCount,
  10764. bindings: bindingDefs,
  10765. bindingFlags: calcBindingFlags(bindingDefs),
  10766. outputs: outputDefs,
  10767. element: {
  10768. ns: ns,
  10769. name: name,
  10770. attrs: attrs,
  10771. template: null,
  10772. // will bet set by the view definition
  10773. componentProvider: null,
  10774. componentView: componentView || null,
  10775. componentRendererType: componentRendererType,
  10776. publicProviders: null,
  10777. allProviders: null,
  10778. handleEvent: handleEvent || NOOP,
  10779. },
  10780. provider: null,
  10781. text: null,
  10782. query: null,
  10783. ngContent: null
  10784. };
  10785. var _b;
  10786. }
  10787. /**
  10788. * @param {?} view
  10789. * @param {?} renderHost
  10790. * @param {?} def
  10791. * @return {?}
  10792. */
  10793. function createElement(view, renderHost, def) {
  10794. var /** @type {?} */ elDef = /** @type {?} */ ((def.element));
  10795. var /** @type {?} */ rootSelectorOrNode = view.root.selectorOrNode;
  10796. var /** @type {?} */ renderer = view.renderer;
  10797. var /** @type {?} */ el;
  10798. if (view.parent || !rootSelectorOrNode) {
  10799. if (elDef.name) {
  10800. el = renderer.createElement(elDef.name, elDef.ns);
  10801. }
  10802. else {
  10803. el = renderer.createComment('');
  10804. }
  10805. var /** @type {?} */ parentEl = getParentRenderElement(view, renderHost, def);
  10806. if (parentEl) {
  10807. renderer.appendChild(parentEl, el);
  10808. }
  10809. }
  10810. else {
  10811. el = renderer.selectRootElement(rootSelectorOrNode);
  10812. }
  10813. if (elDef.attrs) {
  10814. for (var /** @type {?} */ i = 0; i < elDef.attrs.length; i++) {
  10815. var _a = elDef.attrs[i], ns = _a[0], name_2 = _a[1], value = _a[2];
  10816. renderer.setAttribute(el, name_2, value, ns);
  10817. }
  10818. }
  10819. return el;
  10820. }
  10821. /**
  10822. * @param {?} view
  10823. * @param {?} compView
  10824. * @param {?} def
  10825. * @param {?} el
  10826. * @return {?}
  10827. */
  10828. function listenToElementOutputs(view, compView, def, el) {
  10829. for (var /** @type {?} */ i = 0; i < def.outputs.length; i++) {
  10830. var /** @type {?} */ output = def.outputs[i];
  10831. var /** @type {?} */ handleEventClosure = renderEventHandlerClosure(view, def.nodeIndex, elementEventFullName(output.target, output.eventName));
  10832. var /** @type {?} */ listenTarget = output.target;
  10833. var /** @type {?} */ listenerView = view;
  10834. if (output.target === 'component') {
  10835. listenTarget = null;
  10836. listenerView = compView;
  10837. }
  10838. var /** @type {?} */ disposable = /** @type {?} */ (listenerView.renderer.listen(listenTarget || el, output.eventName, handleEventClosure)); /** @type {?} */
  10839. ((view.disposables))[def.outputIndex + i] = disposable;
  10840. }
  10841. }
  10842. /**
  10843. * @param {?} view
  10844. * @param {?} index
  10845. * @param {?} eventName
  10846. * @return {?}
  10847. */
  10848. function renderEventHandlerClosure(view, index, eventName) {
  10849. return function (event) { return dispatchEvent(view, index, eventName, event); };
  10850. }
  10851. /**
  10852. * @param {?} view
  10853. * @param {?} def
  10854. * @param {?} v0
  10855. * @param {?} v1
  10856. * @param {?} v2
  10857. * @param {?} v3
  10858. * @param {?} v4
  10859. * @param {?} v5
  10860. * @param {?} v6
  10861. * @param {?} v7
  10862. * @param {?} v8
  10863. * @param {?} v9
  10864. * @return {?}
  10865. */
  10866. function checkAndUpdateElementInline(view, def, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {
  10867. var /** @type {?} */ bindLen = def.bindings.length;
  10868. var /** @type {?} */ changed = false;
  10869. if (bindLen > 0 && checkAndUpdateElementValue(view, def, 0, v0))
  10870. changed = true;
  10871. if (bindLen > 1 && checkAndUpdateElementValue(view, def, 1, v1))
  10872. changed = true;
  10873. if (bindLen > 2 && checkAndUpdateElementValue(view, def, 2, v2))
  10874. changed = true;
  10875. if (bindLen > 3 && checkAndUpdateElementValue(view, def, 3, v3))
  10876. changed = true;
  10877. if (bindLen > 4 && checkAndUpdateElementValue(view, def, 4, v4))
  10878. changed = true;
  10879. if (bindLen > 5 && checkAndUpdateElementValue(view, def, 5, v5))
  10880. changed = true;
  10881. if (bindLen > 6 && checkAndUpdateElementValue(view, def, 6, v6))
  10882. changed = true;
  10883. if (bindLen > 7 && checkAndUpdateElementValue(view, def, 7, v7))
  10884. changed = true;
  10885. if (bindLen > 8 && checkAndUpdateElementValue(view, def, 8, v8))
  10886. changed = true;
  10887. if (bindLen > 9 && checkAndUpdateElementValue(view, def, 9, v9))
  10888. changed = true;
  10889. return changed;
  10890. }
  10891. /**
  10892. * @param {?} view
  10893. * @param {?} def
  10894. * @param {?} values
  10895. * @return {?}
  10896. */
  10897. function checkAndUpdateElementDynamic(view, def, values) {
  10898. var /** @type {?} */ changed = false;
  10899. for (var /** @type {?} */ i = 0; i < values.length; i++) {
  10900. if (checkAndUpdateElementValue(view, def, i, values[i]))
  10901. changed = true;
  10902. }
  10903. return changed;
  10904. }
  10905. /**
  10906. * @param {?} view
  10907. * @param {?} def
  10908. * @param {?} bindingIdx
  10909. * @param {?} value
  10910. * @return {?}
  10911. */
  10912. function checkAndUpdateElementValue(view, def, bindingIdx, value) {
  10913. if (!checkAndUpdateBinding(view, def, bindingIdx, value)) {
  10914. return false;
  10915. }
  10916. var /** @type {?} */ binding = def.bindings[bindingIdx];
  10917. var /** @type {?} */ elData = asElementData(view, def.nodeIndex);
  10918. var /** @type {?} */ renderNode$$1 = elData.renderElement;
  10919. var /** @type {?} */ name = /** @type {?} */ ((binding.name));
  10920. switch (binding.flags & 15 /* Types */) {
  10921. case 1 /* TypeElementAttribute */:
  10922. setElementAttribute(view, binding, renderNode$$1, binding.ns, name, value);
  10923. break;
  10924. case 2 /* TypeElementClass */:
  10925. setElementClass(view, renderNode$$1, name, value);
  10926. break;
  10927. case 4 /* TypeElementStyle */:
  10928. setElementStyle(view, binding, renderNode$$1, name, value);
  10929. break;
  10930. case 8 /* TypeProperty */:
  10931. var /** @type {?} */ bindView = (def.flags & 33554432 /* ComponentView */ &&
  10932. binding.flags & 32 /* SyntheticHostProperty */) ?
  10933. elData.componentView :
  10934. view;
  10935. setElementProperty(bindView, binding, renderNode$$1, name, value);
  10936. break;
  10937. }
  10938. return true;
  10939. }
  10940. /**
  10941. * @param {?} view
  10942. * @param {?} binding
  10943. * @param {?} renderNode
  10944. * @param {?} ns
  10945. * @param {?} name
  10946. * @param {?} value
  10947. * @return {?}
  10948. */
  10949. function setElementAttribute(view, binding, renderNode$$1, ns, name, value) {
  10950. var /** @type {?} */ securityContext = binding.securityContext;
  10951. var /** @type {?} */ renderValue = securityContext ? view.root.sanitizer.sanitize(securityContext, value) : value;
  10952. renderValue = renderValue != null ? renderValue.toString() : null;
  10953. var /** @type {?} */ renderer = view.renderer;
  10954. if (value != null) {
  10955. renderer.setAttribute(renderNode$$1, name, renderValue, ns);
  10956. }
  10957. else {
  10958. renderer.removeAttribute(renderNode$$1, name, ns);
  10959. }
  10960. }
  10961. /**
  10962. * @param {?} view
  10963. * @param {?} renderNode
  10964. * @param {?} name
  10965. * @param {?} value
  10966. * @return {?}
  10967. */
  10968. function setElementClass(view, renderNode$$1, name, value) {
  10969. var /** @type {?} */ renderer = view.renderer;
  10970. if (value) {
  10971. renderer.addClass(renderNode$$1, name);
  10972. }
  10973. else {
  10974. renderer.removeClass(renderNode$$1, name);
  10975. }
  10976. }
  10977. /**
  10978. * @param {?} view
  10979. * @param {?} binding
  10980. * @param {?} renderNode
  10981. * @param {?} name
  10982. * @param {?} value
  10983. * @return {?}
  10984. */
  10985. function setElementStyle(view, binding, renderNode$$1, name, value) {
  10986. var /** @type {?} */ renderValue = view.root.sanitizer.sanitize(SecurityContext.STYLE, /** @type {?} */ (value));
  10987. if (renderValue != null) {
  10988. renderValue = renderValue.toString();
  10989. var /** @type {?} */ unit = binding.suffix;
  10990. if (unit != null) {
  10991. renderValue = renderValue + unit;
  10992. }
  10993. }
  10994. else {
  10995. renderValue = null;
  10996. }
  10997. var /** @type {?} */ renderer = view.renderer;
  10998. if (renderValue != null) {
  10999. renderer.setStyle(renderNode$$1, name, renderValue);
  11000. }
  11001. else {
  11002. renderer.removeStyle(renderNode$$1, name);
  11003. }
  11004. }
  11005. /**
  11006. * @param {?} view
  11007. * @param {?} binding
  11008. * @param {?} renderNode
  11009. * @param {?} name
  11010. * @param {?} value
  11011. * @return {?}
  11012. */
  11013. function setElementProperty(view, binding, renderNode$$1, name, value) {
  11014. var /** @type {?} */ securityContext = binding.securityContext;
  11015. var /** @type {?} */ renderValue = securityContext ? view.root.sanitizer.sanitize(securityContext, value) : value;
  11016. view.renderer.setProperty(renderNode$$1, name, renderValue);
  11017. }
  11018. /**
  11019. * @fileoverview added by tsickle
  11020. * @suppress {checkTypes} checked by tsc
  11021. */
  11022. /**
  11023. * @license
  11024. * Copyright Google Inc. All Rights Reserved.
  11025. *
  11026. * Use of this source code is governed by an MIT-style license that can be
  11027. * found in the LICENSE file at https://angular.io/license
  11028. */
  11029. var UNDEFINED_VALUE = new Object();
  11030. var InjectorRefTokenKey$1 = tokenKey(Injector);
  11031. var NgModuleRefTokenKey = tokenKey(NgModuleRef);
  11032. /**
  11033. * @param {?} flags
  11034. * @param {?} token
  11035. * @param {?} value
  11036. * @param {?} deps
  11037. * @return {?}
  11038. */
  11039. function moduleProvideDef(flags, token, value, deps) {
  11040. // Need to resolve forwardRefs as e.g. for `useValue` we
  11041. // lowered the expression and then stopped evaluating it,
  11042. // i.e. also didn't unwrap it.
  11043. value = resolveForwardRef(value);
  11044. var /** @type {?} */ depDefs = splitDepsDsl(deps, stringify(token));
  11045. return {
  11046. // will bet set by the module definition
  11047. index: -1,
  11048. deps: depDefs, flags: flags, token: token, value: value
  11049. };
  11050. }
  11051. /**
  11052. * @param {?} providers
  11053. * @return {?}
  11054. */
  11055. function moduleDef(providers) {
  11056. var /** @type {?} */ providersByKey = {};
  11057. for (var /** @type {?} */ i = 0; i < providers.length; i++) {
  11058. var /** @type {?} */ provider = providers[i];
  11059. provider.index = i;
  11060. providersByKey[tokenKey(provider.token)] = provider;
  11061. }
  11062. return {
  11063. // Will be filled later...
  11064. factory: null,
  11065. providersByKey: providersByKey,
  11066. providers: providers
  11067. };
  11068. }
  11069. /**
  11070. * @param {?} data
  11071. * @return {?}
  11072. */
  11073. function initNgModule(data) {
  11074. var /** @type {?} */ def = data._def;
  11075. var /** @type {?} */ providers = data._providers = new Array(def.providers.length);
  11076. for (var /** @type {?} */ i = 0; i < def.providers.length; i++) {
  11077. var /** @type {?} */ provDef = def.providers[i];
  11078. if (!(provDef.flags & 4096 /* LazyProvider */)) {
  11079. providers[i] = _createProviderInstance$1(data, provDef);
  11080. }
  11081. }
  11082. }
  11083. /**
  11084. * @param {?} data
  11085. * @param {?} depDef
  11086. * @param {?=} notFoundValue
  11087. * @return {?}
  11088. */
  11089. function resolveNgModuleDep(data, depDef, notFoundValue) {
  11090. if (notFoundValue === void 0) { notFoundValue = Injector.THROW_IF_NOT_FOUND; }
  11091. if (depDef.flags & 8 /* Value */) {
  11092. return depDef.token;
  11093. }
  11094. if (depDef.flags & 2 /* Optional */) {
  11095. notFoundValue = null;
  11096. }
  11097. if (depDef.flags & 1 /* SkipSelf */) {
  11098. return data._parent.get(depDef.token, notFoundValue);
  11099. }
  11100. var /** @type {?} */ tokenKey$$1 = depDef.tokenKey;
  11101. switch (tokenKey$$1) {
  11102. case InjectorRefTokenKey$1:
  11103. case NgModuleRefTokenKey:
  11104. return data;
  11105. }
  11106. var /** @type {?} */ providerDef = data._def.providersByKey[tokenKey$$1];
  11107. if (providerDef) {
  11108. var /** @type {?} */ providerInstance = data._providers[providerDef.index];
  11109. if (providerInstance === undefined) {
  11110. providerInstance = data._providers[providerDef.index] =
  11111. _createProviderInstance$1(data, providerDef);
  11112. }
  11113. return providerInstance === UNDEFINED_VALUE ? undefined : providerInstance;
  11114. }
  11115. return data._parent.get(depDef.token, notFoundValue);
  11116. }
  11117. /**
  11118. * @param {?} ngModule
  11119. * @param {?} providerDef
  11120. * @return {?}
  11121. */
  11122. function _createProviderInstance$1(ngModule, providerDef) {
  11123. var /** @type {?} */ injectable;
  11124. switch (providerDef.flags & 201347067 /* Types */) {
  11125. case 512 /* TypeClassProvider */:
  11126. injectable = _createClass(ngModule, providerDef.value, providerDef.deps);
  11127. break;
  11128. case 1024 /* TypeFactoryProvider */:
  11129. injectable = _callFactory(ngModule, providerDef.value, providerDef.deps);
  11130. break;
  11131. case 2048 /* TypeUseExistingProvider */:
  11132. injectable = resolveNgModuleDep(ngModule, providerDef.deps[0]);
  11133. break;
  11134. case 256 /* TypeValueProvider */:
  11135. injectable = providerDef.value;
  11136. break;
  11137. }
  11138. return injectable === undefined ? UNDEFINED_VALUE : injectable;
  11139. }
  11140. /**
  11141. * @param {?} ngModule
  11142. * @param {?} ctor
  11143. * @param {?} deps
  11144. * @return {?}
  11145. */
  11146. function _createClass(ngModule, ctor, deps) {
  11147. var /** @type {?} */ len = deps.length;
  11148. switch (len) {
  11149. case 0:
  11150. return new ctor();
  11151. case 1:
  11152. return new ctor(resolveNgModuleDep(ngModule, deps[0]));
  11153. case 2:
  11154. return new ctor(resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1]));
  11155. case 3:
  11156. return new ctor(resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1]), resolveNgModuleDep(ngModule, deps[2]));
  11157. default:
  11158. var /** @type {?} */ depValues = new Array(len);
  11159. for (var /** @type {?} */ i = 0; i < len; i++) {
  11160. depValues[i] = resolveNgModuleDep(ngModule, deps[i]);
  11161. }
  11162. return new (ctor.bind.apply(ctor, [void 0].concat(depValues)))();
  11163. }
  11164. }
  11165. /**
  11166. * @param {?} ngModule
  11167. * @param {?} factory
  11168. * @param {?} deps
  11169. * @return {?}
  11170. */
  11171. function _callFactory(ngModule, factory, deps) {
  11172. var /** @type {?} */ len = deps.length;
  11173. switch (len) {
  11174. case 0:
  11175. return factory();
  11176. case 1:
  11177. return factory(resolveNgModuleDep(ngModule, deps[0]));
  11178. case 2:
  11179. return factory(resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1]));
  11180. case 3:
  11181. return factory(resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1]), resolveNgModuleDep(ngModule, deps[2]));
  11182. default:
  11183. var /** @type {?} */ depValues = Array(len);
  11184. for (var /** @type {?} */ i = 0; i < len; i++) {
  11185. depValues[i] = resolveNgModuleDep(ngModule, deps[i]);
  11186. }
  11187. return factory.apply(void 0, depValues);
  11188. }
  11189. }
  11190. /**
  11191. * @param {?} ngModule
  11192. * @param {?} lifecycles
  11193. * @return {?}
  11194. */
  11195. function callNgModuleLifecycle(ngModule, lifecycles) {
  11196. var /** @type {?} */ def = ngModule._def;
  11197. for (var /** @type {?} */ i = 0; i < def.providers.length; i++) {
  11198. var /** @type {?} */ provDef = def.providers[i];
  11199. if (provDef.flags & 131072 /* OnDestroy */) {
  11200. var /** @type {?} */ instance = ngModule._providers[i];
  11201. if (instance && instance !== UNDEFINED_VALUE) {
  11202. instance.ngOnDestroy();
  11203. }
  11204. }
  11205. }
  11206. }
  11207. /**
  11208. * @fileoverview added by tsickle
  11209. * @suppress {checkTypes} checked by tsc
  11210. */
  11211. /**
  11212. * @license
  11213. * Copyright Google Inc. All Rights Reserved.
  11214. *
  11215. * Use of this source code is governed by an MIT-style license that can be
  11216. * found in the LICENSE file at https://angular.io/license
  11217. */
  11218. /**
  11219. * @param {?} parentView
  11220. * @param {?} elementData
  11221. * @param {?} viewIndex
  11222. * @param {?} view
  11223. * @return {?}
  11224. */
  11225. function attachEmbeddedView(parentView, elementData, viewIndex, view) {
  11226. var /** @type {?} */ embeddedViews = /** @type {?} */ ((elementData.viewContainer))._embeddedViews;
  11227. if (viewIndex === null || viewIndex === undefined) {
  11228. viewIndex = embeddedViews.length;
  11229. }
  11230. view.viewContainerParent = parentView;
  11231. addToArray(embeddedViews, /** @type {?} */ ((viewIndex)), view);
  11232. attachProjectedView(elementData, view);
  11233. Services.dirtyParentQueries(view);
  11234. var /** @type {?} */ prevView = /** @type {?} */ ((viewIndex)) > 0 ? embeddedViews[/** @type {?} */ ((viewIndex)) - 1] : null;
  11235. renderAttachEmbeddedView(elementData, prevView, view);
  11236. }
  11237. /**
  11238. * @param {?} vcElementData
  11239. * @param {?} view
  11240. * @return {?}
  11241. */
  11242. function attachProjectedView(vcElementData, view) {
  11243. var /** @type {?} */ dvcElementData = declaredViewContainer(view);
  11244. if (!dvcElementData || dvcElementData === vcElementData ||
  11245. view.state & 16 /* IsProjectedView */) {
  11246. return;
  11247. }
  11248. // Note: For performance reasons, we
  11249. // - add a view to template._projectedViews only 1x throughout its lifetime,
  11250. // and remove it not until the view is destroyed.
  11251. // (hard, as when a parent view is attached/detached we would need to attach/detach all
  11252. // nested projected views as well, even accross component boundaries).
  11253. // - don't track the insertion order of views in the projected views array
  11254. // (hard, as when the views of the same template are inserted different view containers)
  11255. view.state |= 16 /* IsProjectedView */;
  11256. var /** @type {?} */ projectedViews = dvcElementData.template._projectedViews;
  11257. if (!projectedViews) {
  11258. projectedViews = dvcElementData.template._projectedViews = [];
  11259. }
  11260. projectedViews.push(view);
  11261. // Note: we are changing the NodeDef here as we cannot calculate
  11262. // the fact whether a template is used for projection during compilation.
  11263. markNodeAsProjectedTemplate(/** @type {?} */ ((view.parent)).def, /** @type {?} */ ((view.parentNodeDef)));
  11264. }
  11265. /**
  11266. * @param {?} viewDef
  11267. * @param {?} nodeDef
  11268. * @return {?}
  11269. */
  11270. function markNodeAsProjectedTemplate(viewDef, nodeDef) {
  11271. if (nodeDef.flags & 4 /* ProjectedTemplate */) {
  11272. return;
  11273. }
  11274. viewDef.nodeFlags |= 4 /* ProjectedTemplate */;
  11275. nodeDef.flags |= 4 /* ProjectedTemplate */;
  11276. var /** @type {?} */ parentNodeDef = nodeDef.parent;
  11277. while (parentNodeDef) {
  11278. parentNodeDef.childFlags |= 4 /* ProjectedTemplate */;
  11279. parentNodeDef = parentNodeDef.parent;
  11280. }
  11281. }
  11282. /**
  11283. * @param {?} elementData
  11284. * @param {?=} viewIndex
  11285. * @return {?}
  11286. */
  11287. function detachEmbeddedView(elementData, viewIndex) {
  11288. var /** @type {?} */ embeddedViews = /** @type {?} */ ((elementData.viewContainer))._embeddedViews;
  11289. if (viewIndex == null || viewIndex >= embeddedViews.length) {
  11290. viewIndex = embeddedViews.length - 1;
  11291. }
  11292. if (viewIndex < 0) {
  11293. return null;
  11294. }
  11295. var /** @type {?} */ view = embeddedViews[viewIndex];
  11296. view.viewContainerParent = null;
  11297. removeFromArray(embeddedViews, viewIndex);
  11298. // See attachProjectedView for why we don't update projectedViews here.
  11299. Services.dirtyParentQueries(view);
  11300. renderDetachView(view);
  11301. return view;
  11302. }
  11303. /**
  11304. * @param {?} view
  11305. * @return {?}
  11306. */
  11307. function detachProjectedView(view) {
  11308. if (!(view.state & 16 /* IsProjectedView */)) {
  11309. return;
  11310. }
  11311. var /** @type {?} */ dvcElementData = declaredViewContainer(view);
  11312. if (dvcElementData) {
  11313. var /** @type {?} */ projectedViews = dvcElementData.template._projectedViews;
  11314. if (projectedViews) {
  11315. removeFromArray(projectedViews, projectedViews.indexOf(view));
  11316. Services.dirtyParentQueries(view);
  11317. }
  11318. }
  11319. }
  11320. /**
  11321. * @param {?} elementData
  11322. * @param {?} oldViewIndex
  11323. * @param {?} newViewIndex
  11324. * @return {?}
  11325. */
  11326. function moveEmbeddedView(elementData, oldViewIndex, newViewIndex) {
  11327. var /** @type {?} */ embeddedViews = /** @type {?} */ ((elementData.viewContainer))._embeddedViews;
  11328. var /** @type {?} */ view = embeddedViews[oldViewIndex];
  11329. removeFromArray(embeddedViews, oldViewIndex);
  11330. if (newViewIndex == null) {
  11331. newViewIndex = embeddedViews.length;
  11332. }
  11333. addToArray(embeddedViews, newViewIndex, view);
  11334. // Note: Don't need to change projectedViews as the order in there
  11335. // as always invalid...
  11336. Services.dirtyParentQueries(view);
  11337. renderDetachView(view);
  11338. var /** @type {?} */ prevView = newViewIndex > 0 ? embeddedViews[newViewIndex - 1] : null;
  11339. renderAttachEmbeddedView(elementData, prevView, view);
  11340. return view;
  11341. }
  11342. /**
  11343. * @param {?} elementData
  11344. * @param {?} prevView
  11345. * @param {?} view
  11346. * @return {?}
  11347. */
  11348. function renderAttachEmbeddedView(elementData, prevView, view) {
  11349. var /** @type {?} */ prevRenderNode = prevView ? renderNode(prevView, /** @type {?} */ ((prevView.def.lastRenderRootNode))) :
  11350. elementData.renderElement;
  11351. var /** @type {?} */ parentNode = view.renderer.parentNode(prevRenderNode);
  11352. var /** @type {?} */ nextSibling = view.renderer.nextSibling(prevRenderNode);
  11353. // Note: We can't check if `nextSibling` is present, as on WebWorkers it will always be!
  11354. // However, browsers automatically do `appendChild` when there is no `nextSibling`.
  11355. visitRootRenderNodes(view, 2 /* InsertBefore */, parentNode, nextSibling, undefined);
  11356. }
  11357. /**
  11358. * @param {?} view
  11359. * @return {?}
  11360. */
  11361. function renderDetachView(view) {
  11362. visitRootRenderNodes(view, 3 /* RemoveChild */, null, null, undefined);
  11363. }
  11364. /**
  11365. * @param {?} arr
  11366. * @param {?} index
  11367. * @param {?} value
  11368. * @return {?}
  11369. */
  11370. function addToArray(arr, index, value) {
  11371. // perf: array.push is faster than array.splice!
  11372. if (index >= arr.length) {
  11373. arr.push(value);
  11374. }
  11375. else {
  11376. arr.splice(index, 0, value);
  11377. }
  11378. }
  11379. /**
  11380. * @param {?} arr
  11381. * @param {?} index
  11382. * @return {?}
  11383. */
  11384. function removeFromArray(arr, index) {
  11385. // perf: array.pop is faster than array.splice!
  11386. if (index >= arr.length - 1) {
  11387. arr.pop();
  11388. }
  11389. else {
  11390. arr.splice(index, 1);
  11391. }
  11392. }
  11393. /**
  11394. * @fileoverview added by tsickle
  11395. * @suppress {checkTypes} checked by tsc
  11396. */
  11397. /**
  11398. * @license
  11399. * Copyright Google Inc. All Rights Reserved.
  11400. *
  11401. * Use of this source code is governed by an MIT-style license that can be
  11402. * found in the LICENSE file at https://angular.io/license
  11403. */
  11404. var EMPTY_CONTEXT = new Object();
  11405. /**
  11406. * @param {?} selector
  11407. * @param {?} componentType
  11408. * @param {?} viewDefFactory
  11409. * @param {?} inputs
  11410. * @param {?} outputs
  11411. * @param {?} ngContentSelectors
  11412. * @return {?}
  11413. */
  11414. function createComponentFactory(selector, componentType, viewDefFactory, inputs, outputs, ngContentSelectors) {
  11415. return new ComponentFactory_(selector, componentType, viewDefFactory, inputs, outputs, ngContentSelectors);
  11416. }
  11417. /**
  11418. * @param {?} componentFactory
  11419. * @return {?}
  11420. */
  11421. function getComponentViewDefinitionFactory(componentFactory) {
  11422. return (/** @type {?} */ (componentFactory)).viewDefFactory;
  11423. }
  11424. var ComponentFactory_ = /** @class */ (function (_super) {
  11425. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(ComponentFactory_, _super);
  11426. function ComponentFactory_(selector, componentType, viewDefFactory, _inputs, _outputs, ngContentSelectors) {
  11427. var _this =
  11428. // Attention: this ctor is called as top level function.
  11429. // Putting any logic in here will destroy closure tree shaking!
  11430. _super.call(this) || this;
  11431. _this.selector = selector;
  11432. _this.componentType = componentType;
  11433. _this._inputs = _inputs;
  11434. _this._outputs = _outputs;
  11435. _this.ngContentSelectors = ngContentSelectors;
  11436. _this.viewDefFactory = viewDefFactory;
  11437. return _this;
  11438. }
  11439. Object.defineProperty(ComponentFactory_.prototype, "inputs", {
  11440. get: /**
  11441. * @return {?}
  11442. */
  11443. function () {
  11444. var /** @type {?} */ inputsArr = [];
  11445. var /** @type {?} */ inputs = /** @type {?} */ ((this._inputs));
  11446. for (var /** @type {?} */ propName in inputs) {
  11447. var /** @type {?} */ templateName = inputs[propName];
  11448. inputsArr.push({ propName: propName, templateName: templateName });
  11449. }
  11450. return inputsArr;
  11451. },
  11452. enumerable: true,
  11453. configurable: true
  11454. });
  11455. Object.defineProperty(ComponentFactory_.prototype, "outputs", {
  11456. get: /**
  11457. * @return {?}
  11458. */
  11459. function () {
  11460. var /** @type {?} */ outputsArr = [];
  11461. for (var /** @type {?} */ propName in this._outputs) {
  11462. var /** @type {?} */ templateName = this._outputs[propName];
  11463. outputsArr.push({ propName: propName, templateName: templateName });
  11464. }
  11465. return outputsArr;
  11466. },
  11467. enumerable: true,
  11468. configurable: true
  11469. });
  11470. /**
  11471. * Creates a new component.
  11472. */
  11473. /**
  11474. * Creates a new component.
  11475. * @param {?} injector
  11476. * @param {?=} projectableNodes
  11477. * @param {?=} rootSelectorOrNode
  11478. * @param {?=} ngModule
  11479. * @return {?}
  11480. */
  11481. ComponentFactory_.prototype.create = /**
  11482. * Creates a new component.
  11483. * @param {?} injector
  11484. * @param {?=} projectableNodes
  11485. * @param {?=} rootSelectorOrNode
  11486. * @param {?=} ngModule
  11487. * @return {?}
  11488. */
  11489. function (injector, projectableNodes, rootSelectorOrNode, ngModule) {
  11490. if (!ngModule) {
  11491. throw new Error('ngModule should be provided');
  11492. }
  11493. var /** @type {?} */ viewDef = resolveDefinition(this.viewDefFactory);
  11494. var /** @type {?} */ componentNodeIndex = /** @type {?} */ ((/** @type {?} */ ((viewDef.nodes[0].element)).componentProvider)).nodeIndex;
  11495. var /** @type {?} */ view = Services.createRootView(injector, projectableNodes || [], rootSelectorOrNode, viewDef, ngModule, EMPTY_CONTEXT);
  11496. var /** @type {?} */ component = asProviderData(view, componentNodeIndex).instance;
  11497. if (rootSelectorOrNode) {
  11498. view.renderer.setAttribute(asElementData(view, 0).renderElement, 'ng-version', VERSION.full);
  11499. }
  11500. return new ComponentRef_(view, new ViewRef_(view), component);
  11501. };
  11502. return ComponentFactory_;
  11503. }(ComponentFactory));
  11504. var ComponentRef_ = /** @class */ (function (_super) {
  11505. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(ComponentRef_, _super);
  11506. function ComponentRef_(_view, _viewRef, _component) {
  11507. var _this = _super.call(this) || this;
  11508. _this._view = _view;
  11509. _this._viewRef = _viewRef;
  11510. _this._component = _component;
  11511. _this._elDef = _this._view.def.nodes[0];
  11512. _this.hostView = _viewRef;
  11513. _this.changeDetectorRef = _viewRef;
  11514. _this.instance = _component;
  11515. return _this;
  11516. }
  11517. Object.defineProperty(ComponentRef_.prototype, "location", {
  11518. get: /**
  11519. * @return {?}
  11520. */
  11521. function () {
  11522. return new ElementRef(asElementData(this._view, this._elDef.nodeIndex).renderElement);
  11523. },
  11524. enumerable: true,
  11525. configurable: true
  11526. });
  11527. Object.defineProperty(ComponentRef_.prototype, "injector", {
  11528. get: /**
  11529. * @return {?}
  11530. */
  11531. function () { return new Injector_(this._view, this._elDef); },
  11532. enumerable: true,
  11533. configurable: true
  11534. });
  11535. Object.defineProperty(ComponentRef_.prototype, "componentType", {
  11536. get: /**
  11537. * @return {?}
  11538. */
  11539. function () { return /** @type {?} */ (this._component.constructor); },
  11540. enumerable: true,
  11541. configurable: true
  11542. });
  11543. /**
  11544. * @return {?}
  11545. */
  11546. ComponentRef_.prototype.destroy = /**
  11547. * @return {?}
  11548. */
  11549. function () { this._viewRef.destroy(); };
  11550. /**
  11551. * @param {?} callback
  11552. * @return {?}
  11553. */
  11554. ComponentRef_.prototype.onDestroy = /**
  11555. * @param {?} callback
  11556. * @return {?}
  11557. */
  11558. function (callback) { this._viewRef.onDestroy(callback); };
  11559. return ComponentRef_;
  11560. }(ComponentRef));
  11561. /**
  11562. * @param {?} view
  11563. * @param {?} elDef
  11564. * @param {?} elData
  11565. * @return {?}
  11566. */
  11567. function createViewContainerData(view, elDef, elData) {
  11568. return new ViewContainerRef_(view, elDef, elData);
  11569. }
  11570. var ViewContainerRef_ = /** @class */ (function () {
  11571. function ViewContainerRef_(_view, _elDef, _data) {
  11572. this._view = _view;
  11573. this._elDef = _elDef;
  11574. this._data = _data;
  11575. /**
  11576. * \@internal
  11577. */
  11578. this._embeddedViews = [];
  11579. }
  11580. Object.defineProperty(ViewContainerRef_.prototype, "element", {
  11581. get: /**
  11582. * @return {?}
  11583. */
  11584. function () { return new ElementRef(this._data.renderElement); },
  11585. enumerable: true,
  11586. configurable: true
  11587. });
  11588. Object.defineProperty(ViewContainerRef_.prototype, "injector", {
  11589. get: /**
  11590. * @return {?}
  11591. */
  11592. function () { return new Injector_(this._view, this._elDef); },
  11593. enumerable: true,
  11594. configurable: true
  11595. });
  11596. Object.defineProperty(ViewContainerRef_.prototype, "parentInjector", {
  11597. get: /**
  11598. * @return {?}
  11599. */
  11600. function () {
  11601. var /** @type {?} */ view = this._view;
  11602. var /** @type {?} */ elDef = this._elDef.parent;
  11603. while (!elDef && view) {
  11604. elDef = viewParentEl(view);
  11605. view = /** @type {?} */ ((view.parent));
  11606. }
  11607. return view ? new Injector_(view, elDef) : new Injector_(this._view, null);
  11608. },
  11609. enumerable: true,
  11610. configurable: true
  11611. });
  11612. /**
  11613. * @return {?}
  11614. */
  11615. ViewContainerRef_.prototype.clear = /**
  11616. * @return {?}
  11617. */
  11618. function () {
  11619. var /** @type {?} */ len = this._embeddedViews.length;
  11620. for (var /** @type {?} */ i = len - 1; i >= 0; i--) {
  11621. var /** @type {?} */ view = /** @type {?} */ ((detachEmbeddedView(this._data, i)));
  11622. Services.destroyView(view);
  11623. }
  11624. };
  11625. /**
  11626. * @param {?} index
  11627. * @return {?}
  11628. */
  11629. ViewContainerRef_.prototype.get = /**
  11630. * @param {?} index
  11631. * @return {?}
  11632. */
  11633. function (index) {
  11634. var /** @type {?} */ view = this._embeddedViews[index];
  11635. if (view) {
  11636. var /** @type {?} */ ref = new ViewRef_(view);
  11637. ref.attachToViewContainerRef(this);
  11638. return ref;
  11639. }
  11640. return null;
  11641. };
  11642. Object.defineProperty(ViewContainerRef_.prototype, "length", {
  11643. get: /**
  11644. * @return {?}
  11645. */
  11646. function () { return this._embeddedViews.length; },
  11647. enumerable: true,
  11648. configurable: true
  11649. });
  11650. /**
  11651. * @template C
  11652. * @param {?} templateRef
  11653. * @param {?=} context
  11654. * @param {?=} index
  11655. * @return {?}
  11656. */
  11657. ViewContainerRef_.prototype.createEmbeddedView = /**
  11658. * @template C
  11659. * @param {?} templateRef
  11660. * @param {?=} context
  11661. * @param {?=} index
  11662. * @return {?}
  11663. */
  11664. function (templateRef, context, index) {
  11665. var /** @type {?} */ viewRef = templateRef.createEmbeddedView(context || /** @type {?} */ ({}));
  11666. this.insert(viewRef, index);
  11667. return viewRef;
  11668. };
  11669. /**
  11670. * @template C
  11671. * @param {?} componentFactory
  11672. * @param {?=} index
  11673. * @param {?=} injector
  11674. * @param {?=} projectableNodes
  11675. * @param {?=} ngModuleRef
  11676. * @return {?}
  11677. */
  11678. ViewContainerRef_.prototype.createComponent = /**
  11679. * @template C
  11680. * @param {?} componentFactory
  11681. * @param {?=} index
  11682. * @param {?=} injector
  11683. * @param {?=} projectableNodes
  11684. * @param {?=} ngModuleRef
  11685. * @return {?}
  11686. */
  11687. function (componentFactory, index, injector, projectableNodes, ngModuleRef) {
  11688. var /** @type {?} */ contextInjector = injector || this.parentInjector;
  11689. if (!ngModuleRef && !(componentFactory instanceof ComponentFactoryBoundToModule)) {
  11690. ngModuleRef = contextInjector.get(NgModuleRef);
  11691. }
  11692. var /** @type {?} */ componentRef = componentFactory.create(contextInjector, projectableNodes, undefined, ngModuleRef);
  11693. this.insert(componentRef.hostView, index);
  11694. return componentRef;
  11695. };
  11696. /**
  11697. * @param {?} viewRef
  11698. * @param {?=} index
  11699. * @return {?}
  11700. */
  11701. ViewContainerRef_.prototype.insert = /**
  11702. * @param {?} viewRef
  11703. * @param {?=} index
  11704. * @return {?}
  11705. */
  11706. function (viewRef, index) {
  11707. if (viewRef.destroyed) {
  11708. throw new Error('Cannot insert a destroyed View in a ViewContainer!');
  11709. }
  11710. var /** @type {?} */ viewRef_ = /** @type {?} */ (viewRef);
  11711. var /** @type {?} */ viewData = viewRef_._view;
  11712. attachEmbeddedView(this._view, this._data, index, viewData);
  11713. viewRef_.attachToViewContainerRef(this);
  11714. return viewRef;
  11715. };
  11716. /**
  11717. * @param {?} viewRef
  11718. * @param {?} currentIndex
  11719. * @return {?}
  11720. */
  11721. ViewContainerRef_.prototype.move = /**
  11722. * @param {?} viewRef
  11723. * @param {?} currentIndex
  11724. * @return {?}
  11725. */
  11726. function (viewRef, currentIndex) {
  11727. if (viewRef.destroyed) {
  11728. throw new Error('Cannot move a destroyed View in a ViewContainer!');
  11729. }
  11730. var /** @type {?} */ previousIndex = this._embeddedViews.indexOf(viewRef._view);
  11731. moveEmbeddedView(this._data, previousIndex, currentIndex);
  11732. return viewRef;
  11733. };
  11734. /**
  11735. * @param {?} viewRef
  11736. * @return {?}
  11737. */
  11738. ViewContainerRef_.prototype.indexOf = /**
  11739. * @param {?} viewRef
  11740. * @return {?}
  11741. */
  11742. function (viewRef) {
  11743. return this._embeddedViews.indexOf((/** @type {?} */ (viewRef))._view);
  11744. };
  11745. /**
  11746. * @param {?=} index
  11747. * @return {?}
  11748. */
  11749. ViewContainerRef_.prototype.remove = /**
  11750. * @param {?=} index
  11751. * @return {?}
  11752. */
  11753. function (index) {
  11754. var /** @type {?} */ viewData = detachEmbeddedView(this._data, index);
  11755. if (viewData) {
  11756. Services.destroyView(viewData);
  11757. }
  11758. };
  11759. /**
  11760. * @param {?=} index
  11761. * @return {?}
  11762. */
  11763. ViewContainerRef_.prototype.detach = /**
  11764. * @param {?=} index
  11765. * @return {?}
  11766. */
  11767. function (index) {
  11768. var /** @type {?} */ view = detachEmbeddedView(this._data, index);
  11769. return view ? new ViewRef_(view) : null;
  11770. };
  11771. return ViewContainerRef_;
  11772. }());
  11773. /**
  11774. * @param {?} view
  11775. * @return {?}
  11776. */
  11777. function createChangeDetectorRef(view) {
  11778. return new ViewRef_(view);
  11779. }
  11780. var ViewRef_ = /** @class */ (function () {
  11781. function ViewRef_(_view) {
  11782. this._view = _view;
  11783. this._viewContainerRef = null;
  11784. this._appRef = null;
  11785. }
  11786. Object.defineProperty(ViewRef_.prototype, "rootNodes", {
  11787. get: /**
  11788. * @return {?}
  11789. */
  11790. function () { return rootRenderNodes(this._view); },
  11791. enumerable: true,
  11792. configurable: true
  11793. });
  11794. Object.defineProperty(ViewRef_.prototype, "context", {
  11795. get: /**
  11796. * @return {?}
  11797. */
  11798. function () { return this._view.context; },
  11799. enumerable: true,
  11800. configurable: true
  11801. });
  11802. Object.defineProperty(ViewRef_.prototype, "destroyed", {
  11803. get: /**
  11804. * @return {?}
  11805. */
  11806. function () { return (this._view.state & 128 /* Destroyed */) !== 0; },
  11807. enumerable: true,
  11808. configurable: true
  11809. });
  11810. /**
  11811. * @return {?}
  11812. */
  11813. ViewRef_.prototype.markForCheck = /**
  11814. * @return {?}
  11815. */
  11816. function () { markParentViewsForCheck(this._view); };
  11817. /**
  11818. * @return {?}
  11819. */
  11820. ViewRef_.prototype.detach = /**
  11821. * @return {?}
  11822. */
  11823. function () { this._view.state &= ~4 /* Attached */; };
  11824. /**
  11825. * @return {?}
  11826. */
  11827. ViewRef_.prototype.detectChanges = /**
  11828. * @return {?}
  11829. */
  11830. function () {
  11831. var /** @type {?} */ fs = this._view.root.rendererFactory;
  11832. if (fs.begin) {
  11833. fs.begin();
  11834. }
  11835. try {
  11836. Services.checkAndUpdateView(this._view);
  11837. }
  11838. finally {
  11839. if (fs.end) {
  11840. fs.end();
  11841. }
  11842. }
  11843. };
  11844. /**
  11845. * @return {?}
  11846. */
  11847. ViewRef_.prototype.checkNoChanges = /**
  11848. * @return {?}
  11849. */
  11850. function () { Services.checkNoChangesView(this._view); };
  11851. /**
  11852. * @return {?}
  11853. */
  11854. ViewRef_.prototype.reattach = /**
  11855. * @return {?}
  11856. */
  11857. function () { this._view.state |= 4 /* Attached */; };
  11858. /**
  11859. * @param {?} callback
  11860. * @return {?}
  11861. */
  11862. ViewRef_.prototype.onDestroy = /**
  11863. * @param {?} callback
  11864. * @return {?}
  11865. */
  11866. function (callback) {
  11867. if (!this._view.disposables) {
  11868. this._view.disposables = [];
  11869. }
  11870. this._view.disposables.push(/** @type {?} */ (callback));
  11871. };
  11872. /**
  11873. * @return {?}
  11874. */
  11875. ViewRef_.prototype.destroy = /**
  11876. * @return {?}
  11877. */
  11878. function () {
  11879. if (this._appRef) {
  11880. this._appRef.detachView(this);
  11881. }
  11882. else if (this._viewContainerRef) {
  11883. this._viewContainerRef.detach(this._viewContainerRef.indexOf(this));
  11884. }
  11885. Services.destroyView(this._view);
  11886. };
  11887. /**
  11888. * @return {?}
  11889. */
  11890. ViewRef_.prototype.detachFromAppRef = /**
  11891. * @return {?}
  11892. */
  11893. function () {
  11894. this._appRef = null;
  11895. renderDetachView(this._view);
  11896. Services.dirtyParentQueries(this._view);
  11897. };
  11898. /**
  11899. * @param {?} appRef
  11900. * @return {?}
  11901. */
  11902. ViewRef_.prototype.attachToAppRef = /**
  11903. * @param {?} appRef
  11904. * @return {?}
  11905. */
  11906. function (appRef) {
  11907. if (this._viewContainerRef) {
  11908. throw new Error('This view is already attached to a ViewContainer!');
  11909. }
  11910. this._appRef = appRef;
  11911. };
  11912. /**
  11913. * @param {?} vcRef
  11914. * @return {?}
  11915. */
  11916. ViewRef_.prototype.attachToViewContainerRef = /**
  11917. * @param {?} vcRef
  11918. * @return {?}
  11919. */
  11920. function (vcRef) {
  11921. if (this._appRef) {
  11922. throw new Error('This view is already attached directly to the ApplicationRef!');
  11923. }
  11924. this._viewContainerRef = vcRef;
  11925. };
  11926. return ViewRef_;
  11927. }());
  11928. /**
  11929. * @param {?} view
  11930. * @param {?} def
  11931. * @return {?}
  11932. */
  11933. function createTemplateData(view, def) {
  11934. return new TemplateRef_(view, def);
  11935. }
  11936. var TemplateRef_ = /** @class */ (function (_super) {
  11937. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(TemplateRef_, _super);
  11938. function TemplateRef_(_parentView, _def) {
  11939. var _this = _super.call(this) || this;
  11940. _this._parentView = _parentView;
  11941. _this._def = _def;
  11942. return _this;
  11943. }
  11944. /**
  11945. * @param {?} context
  11946. * @return {?}
  11947. */
  11948. TemplateRef_.prototype.createEmbeddedView = /**
  11949. * @param {?} context
  11950. * @return {?}
  11951. */
  11952. function (context) {
  11953. return new ViewRef_(Services.createEmbeddedView(this._parentView, this._def, /** @type {?} */ ((/** @type {?} */ ((this._def.element)).template)), context));
  11954. };
  11955. Object.defineProperty(TemplateRef_.prototype, "elementRef", {
  11956. get: /**
  11957. * @return {?}
  11958. */
  11959. function () {
  11960. return new ElementRef(asElementData(this._parentView, this._def.nodeIndex).renderElement);
  11961. },
  11962. enumerable: true,
  11963. configurable: true
  11964. });
  11965. return TemplateRef_;
  11966. }(TemplateRef));
  11967. /**
  11968. * @param {?} view
  11969. * @param {?} elDef
  11970. * @return {?}
  11971. */
  11972. function createInjector(view, elDef) {
  11973. return new Injector_(view, elDef);
  11974. }
  11975. var Injector_ = /** @class */ (function () {
  11976. function Injector_(view, elDef) {
  11977. this.view = view;
  11978. this.elDef = elDef;
  11979. }
  11980. /**
  11981. * @param {?} token
  11982. * @param {?=} notFoundValue
  11983. * @return {?}
  11984. */
  11985. Injector_.prototype.get = /**
  11986. * @param {?} token
  11987. * @param {?=} notFoundValue
  11988. * @return {?}
  11989. */
  11990. function (token, notFoundValue) {
  11991. if (notFoundValue === void 0) { notFoundValue = Injector.THROW_IF_NOT_FOUND; }
  11992. var /** @type {?} */ allowPrivateServices = this.elDef ? (this.elDef.flags & 33554432 /* ComponentView */) !== 0 : false;
  11993. return Services.resolveDep(this.view, this.elDef, allowPrivateServices, { flags: 0 /* None */, token: token, tokenKey: tokenKey(token) }, notFoundValue);
  11994. };
  11995. return Injector_;
  11996. }());
  11997. /**
  11998. * @param {?} view
  11999. * @param {?} index
  12000. * @return {?}
  12001. */
  12002. function nodeValue(view, index) {
  12003. var /** @type {?} */ def = view.def.nodes[index];
  12004. if (def.flags & 1 /* TypeElement */) {
  12005. var /** @type {?} */ elData = asElementData(view, def.nodeIndex);
  12006. return /** @type {?} */ ((def.element)).template ? elData.template : elData.renderElement;
  12007. }
  12008. else if (def.flags & 2 /* TypeText */) {
  12009. return asTextData(view, def.nodeIndex).renderText;
  12010. }
  12011. else if (def.flags & (20224 /* CatProvider */ | 16 /* TypePipe */)) {
  12012. return asProviderData(view, def.nodeIndex).instance;
  12013. }
  12014. throw new Error("Illegal state: read nodeValue for node index " + index);
  12015. }
  12016. /**
  12017. * @param {?} view
  12018. * @return {?}
  12019. */
  12020. function createRendererV1(view) {
  12021. return new RendererAdapter(view.renderer);
  12022. }
  12023. var RendererAdapter = /** @class */ (function () {
  12024. function RendererAdapter(delegate) {
  12025. this.delegate = delegate;
  12026. }
  12027. /**
  12028. * @param {?} selectorOrNode
  12029. * @return {?}
  12030. */
  12031. RendererAdapter.prototype.selectRootElement = /**
  12032. * @param {?} selectorOrNode
  12033. * @return {?}
  12034. */
  12035. function (selectorOrNode) {
  12036. return this.delegate.selectRootElement(selectorOrNode);
  12037. };
  12038. /**
  12039. * @param {?} parent
  12040. * @param {?} namespaceAndName
  12041. * @return {?}
  12042. */
  12043. RendererAdapter.prototype.createElement = /**
  12044. * @param {?} parent
  12045. * @param {?} namespaceAndName
  12046. * @return {?}
  12047. */
  12048. function (parent, namespaceAndName) {
  12049. var _a = splitNamespace(namespaceAndName), ns = _a[0], name = _a[1];
  12050. var /** @type {?} */ el = this.delegate.createElement(name, ns);
  12051. if (parent) {
  12052. this.delegate.appendChild(parent, el);
  12053. }
  12054. return el;
  12055. };
  12056. /**
  12057. * @param {?} hostElement
  12058. * @return {?}
  12059. */
  12060. RendererAdapter.prototype.createViewRoot = /**
  12061. * @param {?} hostElement
  12062. * @return {?}
  12063. */
  12064. function (hostElement) { return hostElement; };
  12065. /**
  12066. * @param {?} parentElement
  12067. * @return {?}
  12068. */
  12069. RendererAdapter.prototype.createTemplateAnchor = /**
  12070. * @param {?} parentElement
  12071. * @return {?}
  12072. */
  12073. function (parentElement) {
  12074. var /** @type {?} */ comment = this.delegate.createComment('');
  12075. if (parentElement) {
  12076. this.delegate.appendChild(parentElement, comment);
  12077. }
  12078. return comment;
  12079. };
  12080. /**
  12081. * @param {?} parentElement
  12082. * @param {?} value
  12083. * @return {?}
  12084. */
  12085. RendererAdapter.prototype.createText = /**
  12086. * @param {?} parentElement
  12087. * @param {?} value
  12088. * @return {?}
  12089. */
  12090. function (parentElement, value) {
  12091. var /** @type {?} */ node = this.delegate.createText(value);
  12092. if (parentElement) {
  12093. this.delegate.appendChild(parentElement, node);
  12094. }
  12095. return node;
  12096. };
  12097. /**
  12098. * @param {?} parentElement
  12099. * @param {?} nodes
  12100. * @return {?}
  12101. */
  12102. RendererAdapter.prototype.projectNodes = /**
  12103. * @param {?} parentElement
  12104. * @param {?} nodes
  12105. * @return {?}
  12106. */
  12107. function (parentElement, nodes) {
  12108. for (var /** @type {?} */ i = 0; i < nodes.length; i++) {
  12109. this.delegate.appendChild(parentElement, nodes[i]);
  12110. }
  12111. };
  12112. /**
  12113. * @param {?} node
  12114. * @param {?} viewRootNodes
  12115. * @return {?}
  12116. */
  12117. RendererAdapter.prototype.attachViewAfter = /**
  12118. * @param {?} node
  12119. * @param {?} viewRootNodes
  12120. * @return {?}
  12121. */
  12122. function (node, viewRootNodes) {
  12123. var /** @type {?} */ parentElement = this.delegate.parentNode(node);
  12124. var /** @type {?} */ nextSibling = this.delegate.nextSibling(node);
  12125. for (var /** @type {?} */ i = 0; i < viewRootNodes.length; i++) {
  12126. this.delegate.insertBefore(parentElement, viewRootNodes[i], nextSibling);
  12127. }
  12128. };
  12129. /**
  12130. * @param {?} viewRootNodes
  12131. * @return {?}
  12132. */
  12133. RendererAdapter.prototype.detachView = /**
  12134. * @param {?} viewRootNodes
  12135. * @return {?}
  12136. */
  12137. function (viewRootNodes) {
  12138. for (var /** @type {?} */ i = 0; i < viewRootNodes.length; i++) {
  12139. var /** @type {?} */ node = viewRootNodes[i];
  12140. var /** @type {?} */ parentElement = this.delegate.parentNode(node);
  12141. this.delegate.removeChild(parentElement, node);
  12142. }
  12143. };
  12144. /**
  12145. * @param {?} hostElement
  12146. * @param {?} viewAllNodes
  12147. * @return {?}
  12148. */
  12149. RendererAdapter.prototype.destroyView = /**
  12150. * @param {?} hostElement
  12151. * @param {?} viewAllNodes
  12152. * @return {?}
  12153. */
  12154. function (hostElement, viewAllNodes) {
  12155. for (var /** @type {?} */ i = 0; i < viewAllNodes.length; i++) {
  12156. /** @type {?} */ ((this.delegate.destroyNode))(viewAllNodes[i]);
  12157. }
  12158. };
  12159. /**
  12160. * @param {?} renderElement
  12161. * @param {?} name
  12162. * @param {?} callback
  12163. * @return {?}
  12164. */
  12165. RendererAdapter.prototype.listen = /**
  12166. * @param {?} renderElement
  12167. * @param {?} name
  12168. * @param {?} callback
  12169. * @return {?}
  12170. */
  12171. function (renderElement, name, callback) {
  12172. return this.delegate.listen(renderElement, name, /** @type {?} */ (callback));
  12173. };
  12174. /**
  12175. * @param {?} target
  12176. * @param {?} name
  12177. * @param {?} callback
  12178. * @return {?}
  12179. */
  12180. RendererAdapter.prototype.listenGlobal = /**
  12181. * @param {?} target
  12182. * @param {?} name
  12183. * @param {?} callback
  12184. * @return {?}
  12185. */
  12186. function (target, name, callback) {
  12187. return this.delegate.listen(target, name, /** @type {?} */ (callback));
  12188. };
  12189. /**
  12190. * @param {?} renderElement
  12191. * @param {?} propertyName
  12192. * @param {?} propertyValue
  12193. * @return {?}
  12194. */
  12195. RendererAdapter.prototype.setElementProperty = /**
  12196. * @param {?} renderElement
  12197. * @param {?} propertyName
  12198. * @param {?} propertyValue
  12199. * @return {?}
  12200. */
  12201. function (renderElement, propertyName, propertyValue) {
  12202. this.delegate.setProperty(renderElement, propertyName, propertyValue);
  12203. };
  12204. /**
  12205. * @param {?} renderElement
  12206. * @param {?} namespaceAndName
  12207. * @param {?} attributeValue
  12208. * @return {?}
  12209. */
  12210. RendererAdapter.prototype.setElementAttribute = /**
  12211. * @param {?} renderElement
  12212. * @param {?} namespaceAndName
  12213. * @param {?} attributeValue
  12214. * @return {?}
  12215. */
  12216. function (renderElement, namespaceAndName, attributeValue) {
  12217. var _a = splitNamespace(namespaceAndName), ns = _a[0], name = _a[1];
  12218. if (attributeValue != null) {
  12219. this.delegate.setAttribute(renderElement, name, attributeValue, ns);
  12220. }
  12221. else {
  12222. this.delegate.removeAttribute(renderElement, name, ns);
  12223. }
  12224. };
  12225. /**
  12226. * @param {?} renderElement
  12227. * @param {?} propertyName
  12228. * @param {?} propertyValue
  12229. * @return {?}
  12230. */
  12231. RendererAdapter.prototype.setBindingDebugInfo = /**
  12232. * @param {?} renderElement
  12233. * @param {?} propertyName
  12234. * @param {?} propertyValue
  12235. * @return {?}
  12236. */
  12237. function (renderElement, propertyName, propertyValue) { };
  12238. /**
  12239. * @param {?} renderElement
  12240. * @param {?} className
  12241. * @param {?} isAdd
  12242. * @return {?}
  12243. */
  12244. RendererAdapter.prototype.setElementClass = /**
  12245. * @param {?} renderElement
  12246. * @param {?} className
  12247. * @param {?} isAdd
  12248. * @return {?}
  12249. */
  12250. function (renderElement, className, isAdd) {
  12251. if (isAdd) {
  12252. this.delegate.addClass(renderElement, className);
  12253. }
  12254. else {
  12255. this.delegate.removeClass(renderElement, className);
  12256. }
  12257. };
  12258. /**
  12259. * @param {?} renderElement
  12260. * @param {?} styleName
  12261. * @param {?} styleValue
  12262. * @return {?}
  12263. */
  12264. RendererAdapter.prototype.setElementStyle = /**
  12265. * @param {?} renderElement
  12266. * @param {?} styleName
  12267. * @param {?} styleValue
  12268. * @return {?}
  12269. */
  12270. function (renderElement, styleName, styleValue) {
  12271. if (styleValue != null) {
  12272. this.delegate.setStyle(renderElement, styleName, styleValue);
  12273. }
  12274. else {
  12275. this.delegate.removeStyle(renderElement, styleName);
  12276. }
  12277. };
  12278. /**
  12279. * @param {?} renderElement
  12280. * @param {?} methodName
  12281. * @param {?} args
  12282. * @return {?}
  12283. */
  12284. RendererAdapter.prototype.invokeElementMethod = /**
  12285. * @param {?} renderElement
  12286. * @param {?} methodName
  12287. * @param {?} args
  12288. * @return {?}
  12289. */
  12290. function (renderElement, methodName, args) {
  12291. (/** @type {?} */ (renderElement))[methodName].apply(renderElement, args);
  12292. };
  12293. /**
  12294. * @param {?} renderNode
  12295. * @param {?} text
  12296. * @return {?}
  12297. */
  12298. RendererAdapter.prototype.setText = /**
  12299. * @param {?} renderNode
  12300. * @param {?} text
  12301. * @return {?}
  12302. */
  12303. function (renderNode$$1, text) { this.delegate.setValue(renderNode$$1, text); };
  12304. /**
  12305. * @return {?}
  12306. */
  12307. RendererAdapter.prototype.animate = /**
  12308. * @return {?}
  12309. */
  12310. function () { throw new Error('Renderer.animate is no longer supported!'); };
  12311. return RendererAdapter;
  12312. }());
  12313. /**
  12314. * @param {?} moduleType
  12315. * @param {?} parent
  12316. * @param {?} bootstrapComponents
  12317. * @param {?} def
  12318. * @return {?}
  12319. */
  12320. function createNgModuleRef(moduleType, parent, bootstrapComponents, def) {
  12321. return new NgModuleRef_(moduleType, parent, bootstrapComponents, def);
  12322. }
  12323. var NgModuleRef_ = /** @class */ (function () {
  12324. function NgModuleRef_(_moduleType, _parent, _bootstrapComponents, _def) {
  12325. this._moduleType = _moduleType;
  12326. this._parent = _parent;
  12327. this._bootstrapComponents = _bootstrapComponents;
  12328. this._def = _def;
  12329. this._destroyListeners = [];
  12330. this._destroyed = false;
  12331. this.injector = this;
  12332. initNgModule(this);
  12333. }
  12334. /**
  12335. * @param {?} token
  12336. * @param {?=} notFoundValue
  12337. * @return {?}
  12338. */
  12339. NgModuleRef_.prototype.get = /**
  12340. * @param {?} token
  12341. * @param {?=} notFoundValue
  12342. * @return {?}
  12343. */
  12344. function (token, notFoundValue) {
  12345. if (notFoundValue === void 0) { notFoundValue = Injector.THROW_IF_NOT_FOUND; }
  12346. return resolveNgModuleDep(this, { token: token, tokenKey: tokenKey(token), flags: 0 /* None */ }, notFoundValue);
  12347. };
  12348. Object.defineProperty(NgModuleRef_.prototype, "instance", {
  12349. get: /**
  12350. * @return {?}
  12351. */
  12352. function () { return this.get(this._moduleType); },
  12353. enumerable: true,
  12354. configurable: true
  12355. });
  12356. Object.defineProperty(NgModuleRef_.prototype, "componentFactoryResolver", {
  12357. get: /**
  12358. * @return {?}
  12359. */
  12360. function () { return this.get(ComponentFactoryResolver); },
  12361. enumerable: true,
  12362. configurable: true
  12363. });
  12364. /**
  12365. * @return {?}
  12366. */
  12367. NgModuleRef_.prototype.destroy = /**
  12368. * @return {?}
  12369. */
  12370. function () {
  12371. if (this._destroyed) {
  12372. throw new Error("The ng module " + stringify(this.instance.constructor) + " has already been destroyed.");
  12373. }
  12374. this._destroyed = true;
  12375. callNgModuleLifecycle(this, 131072 /* OnDestroy */);
  12376. this._destroyListeners.forEach(function (listener) { return listener(); });
  12377. };
  12378. /**
  12379. * @param {?} callback
  12380. * @return {?}
  12381. */
  12382. NgModuleRef_.prototype.onDestroy = /**
  12383. * @param {?} callback
  12384. * @return {?}
  12385. */
  12386. function (callback) { this._destroyListeners.push(callback); };
  12387. return NgModuleRef_;
  12388. }());
  12389. /**
  12390. * @fileoverview added by tsickle
  12391. * @suppress {checkTypes} checked by tsc
  12392. */
  12393. /**
  12394. * @license
  12395. * Copyright Google Inc. All Rights Reserved.
  12396. *
  12397. * Use of this source code is governed by an MIT-style license that can be
  12398. * found in the LICENSE file at https://angular.io/license
  12399. */
  12400. var RendererV1TokenKey = tokenKey(Renderer);
  12401. var Renderer2TokenKey = tokenKey(Renderer2);
  12402. var ElementRefTokenKey = tokenKey(ElementRef);
  12403. var ViewContainerRefTokenKey = tokenKey(ViewContainerRef);
  12404. var TemplateRefTokenKey = tokenKey(TemplateRef);
  12405. var ChangeDetectorRefTokenKey = tokenKey(ChangeDetectorRef);
  12406. var InjectorRefTokenKey = tokenKey(Injector);
  12407. /**
  12408. * @param {?} checkIndex
  12409. * @param {?} flags
  12410. * @param {?} matchedQueries
  12411. * @param {?} childCount
  12412. * @param {?} ctor
  12413. * @param {?} deps
  12414. * @param {?=} props
  12415. * @param {?=} outputs
  12416. * @return {?}
  12417. */
  12418. function directiveDef(checkIndex, flags, matchedQueries, childCount, ctor, deps, props, outputs) {
  12419. var /** @type {?} */ bindings = [];
  12420. if (props) {
  12421. for (var /** @type {?} */ prop in props) {
  12422. var _a = props[prop], bindingIndex = _a[0], nonMinifiedName = _a[1];
  12423. bindings[bindingIndex] = {
  12424. flags: 8 /* TypeProperty */,
  12425. name: prop, nonMinifiedName: nonMinifiedName,
  12426. ns: null,
  12427. securityContext: null,
  12428. suffix: null
  12429. };
  12430. }
  12431. }
  12432. var /** @type {?} */ outputDefs = [];
  12433. if (outputs) {
  12434. for (var /** @type {?} */ propName in outputs) {
  12435. outputDefs.push({ type: 1 /* DirectiveOutput */, propName: propName, target: null, eventName: outputs[propName] });
  12436. }
  12437. }
  12438. flags |= 16384 /* TypeDirective */;
  12439. return _def(checkIndex, flags, matchedQueries, childCount, ctor, ctor, deps, bindings, outputDefs);
  12440. }
  12441. /**
  12442. * @param {?} flags
  12443. * @param {?} ctor
  12444. * @param {?} deps
  12445. * @return {?}
  12446. */
  12447. function pipeDef(flags, ctor, deps) {
  12448. flags |= 16 /* TypePipe */;
  12449. return _def(-1, flags, null, 0, ctor, ctor, deps);
  12450. }
  12451. /**
  12452. * @param {?} flags
  12453. * @param {?} matchedQueries
  12454. * @param {?} token
  12455. * @param {?} value
  12456. * @param {?} deps
  12457. * @return {?}
  12458. */
  12459. function providerDef(flags, matchedQueries, token, value, deps) {
  12460. return _def(-1, flags, matchedQueries, 0, token, value, deps);
  12461. }
  12462. /**
  12463. * @param {?} checkIndex
  12464. * @param {?} flags
  12465. * @param {?} matchedQueriesDsl
  12466. * @param {?} childCount
  12467. * @param {?} token
  12468. * @param {?} value
  12469. * @param {?} deps
  12470. * @param {?=} bindings
  12471. * @param {?=} outputs
  12472. * @return {?}
  12473. */
  12474. function _def(checkIndex, flags, matchedQueriesDsl, childCount, token, value, deps, bindings, outputs) {
  12475. var _a = splitMatchedQueriesDsl(matchedQueriesDsl), matchedQueries = _a.matchedQueries, references = _a.references, matchedQueryIds = _a.matchedQueryIds;
  12476. if (!outputs) {
  12477. outputs = [];
  12478. }
  12479. if (!bindings) {
  12480. bindings = [];
  12481. }
  12482. // Need to resolve forwardRefs as e.g. for `useValue` we
  12483. // lowered the expression and then stopped evaluating it,
  12484. // i.e. also didn't unwrap it.
  12485. value = resolveForwardRef(value);
  12486. var /** @type {?} */ depDefs = splitDepsDsl(deps, stringify(token));
  12487. return {
  12488. // will bet set by the view definition
  12489. nodeIndex: -1,
  12490. parent: null,
  12491. renderParent: null,
  12492. bindingIndex: -1,
  12493. outputIndex: -1,
  12494. // regular values
  12495. checkIndex: checkIndex,
  12496. flags: flags,
  12497. childFlags: 0,
  12498. directChildFlags: 0,
  12499. childMatchedQueries: 0, matchedQueries: matchedQueries, matchedQueryIds: matchedQueryIds, references: references,
  12500. ngContentIndex: -1, childCount: childCount, bindings: bindings,
  12501. bindingFlags: calcBindingFlags(bindings), outputs: outputs,
  12502. element: null,
  12503. provider: { token: token, value: value, deps: depDefs },
  12504. text: null,
  12505. query: null,
  12506. ngContent: null
  12507. };
  12508. }
  12509. /**
  12510. * @param {?} view
  12511. * @param {?} def
  12512. * @return {?}
  12513. */
  12514. function createProviderInstance(view, def) {
  12515. return _createProviderInstance(view, def);
  12516. }
  12517. /**
  12518. * @param {?} view
  12519. * @param {?} def
  12520. * @return {?}
  12521. */
  12522. function createPipeInstance(view, def) {
  12523. // deps are looked up from component.
  12524. var /** @type {?} */ compView = view;
  12525. while (compView.parent && !isComponentView(compView)) {
  12526. compView = compView.parent;
  12527. }
  12528. // pipes can see the private services of the component
  12529. var /** @type {?} */ allowPrivateServices = true;
  12530. // pipes are always eager and classes!
  12531. return createClass(/** @type {?} */ ((compView.parent)), /** @type {?} */ ((viewParentEl(compView))), allowPrivateServices, /** @type {?} */ ((def.provider)).value, /** @type {?} */ ((def.provider)).deps);
  12532. }
  12533. /**
  12534. * @param {?} view
  12535. * @param {?} def
  12536. * @return {?}
  12537. */
  12538. function createDirectiveInstance(view, def) {
  12539. // components can see other private services, other directives can't.
  12540. var /** @type {?} */ allowPrivateServices = (def.flags & 32768 /* Component */) > 0;
  12541. // directives are always eager and classes!
  12542. var /** @type {?} */ instance = createClass(view, /** @type {?} */ ((def.parent)), allowPrivateServices, /** @type {?} */ ((def.provider)).value, /** @type {?} */ ((def.provider)).deps);
  12543. if (def.outputs.length) {
  12544. for (var /** @type {?} */ i = 0; i < def.outputs.length; i++) {
  12545. var /** @type {?} */ output = def.outputs[i];
  12546. var /** @type {?} */ subscription = instance[/** @type {?} */ ((output.propName))].subscribe(eventHandlerClosure(view, /** @type {?} */ ((def.parent)).nodeIndex, output.eventName)); /** @type {?} */
  12547. ((view.disposables))[def.outputIndex + i] = subscription.unsubscribe.bind(subscription);
  12548. }
  12549. }
  12550. return instance;
  12551. }
  12552. /**
  12553. * @param {?} view
  12554. * @param {?} index
  12555. * @param {?} eventName
  12556. * @return {?}
  12557. */
  12558. function eventHandlerClosure(view, index, eventName) {
  12559. return function (event) { return dispatchEvent(view, index, eventName, event); };
  12560. }
  12561. /**
  12562. * @param {?} view
  12563. * @param {?} def
  12564. * @param {?} v0
  12565. * @param {?} v1
  12566. * @param {?} v2
  12567. * @param {?} v3
  12568. * @param {?} v4
  12569. * @param {?} v5
  12570. * @param {?} v6
  12571. * @param {?} v7
  12572. * @param {?} v8
  12573. * @param {?} v9
  12574. * @return {?}
  12575. */
  12576. function checkAndUpdateDirectiveInline(view, def, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {
  12577. var /** @type {?} */ providerData = asProviderData(view, def.nodeIndex);
  12578. var /** @type {?} */ directive = providerData.instance;
  12579. var /** @type {?} */ changed = false;
  12580. var /** @type {?} */ changes = /** @type {?} */ ((undefined));
  12581. var /** @type {?} */ bindLen = def.bindings.length;
  12582. if (bindLen > 0 && checkBinding(view, def, 0, v0)) {
  12583. changed = true;
  12584. changes = updateProp(view, providerData, def, 0, v0, changes);
  12585. }
  12586. if (bindLen > 1 && checkBinding(view, def, 1, v1)) {
  12587. changed = true;
  12588. changes = updateProp(view, providerData, def, 1, v1, changes);
  12589. }
  12590. if (bindLen > 2 && checkBinding(view, def, 2, v2)) {
  12591. changed = true;
  12592. changes = updateProp(view, providerData, def, 2, v2, changes);
  12593. }
  12594. if (bindLen > 3 && checkBinding(view, def, 3, v3)) {
  12595. changed = true;
  12596. changes = updateProp(view, providerData, def, 3, v3, changes);
  12597. }
  12598. if (bindLen > 4 && checkBinding(view, def, 4, v4)) {
  12599. changed = true;
  12600. changes = updateProp(view, providerData, def, 4, v4, changes);
  12601. }
  12602. if (bindLen > 5 && checkBinding(view, def, 5, v5)) {
  12603. changed = true;
  12604. changes = updateProp(view, providerData, def, 5, v5, changes);
  12605. }
  12606. if (bindLen > 6 && checkBinding(view, def, 6, v6)) {
  12607. changed = true;
  12608. changes = updateProp(view, providerData, def, 6, v6, changes);
  12609. }
  12610. if (bindLen > 7 && checkBinding(view, def, 7, v7)) {
  12611. changed = true;
  12612. changes = updateProp(view, providerData, def, 7, v7, changes);
  12613. }
  12614. if (bindLen > 8 && checkBinding(view, def, 8, v8)) {
  12615. changed = true;
  12616. changes = updateProp(view, providerData, def, 8, v8, changes);
  12617. }
  12618. if (bindLen > 9 && checkBinding(view, def, 9, v9)) {
  12619. changed = true;
  12620. changes = updateProp(view, providerData, def, 9, v9, changes);
  12621. }
  12622. if (changes) {
  12623. directive.ngOnChanges(changes);
  12624. }
  12625. if ((def.flags & 65536 /* OnInit */) &&
  12626. shouldCallLifecycleInitHook(view, 256 /* InitState_CallingOnInit */, def.nodeIndex)) {
  12627. directive.ngOnInit();
  12628. }
  12629. if (def.flags & 262144 /* DoCheck */) {
  12630. directive.ngDoCheck();
  12631. }
  12632. return changed;
  12633. }
  12634. /**
  12635. * @param {?} view
  12636. * @param {?} def
  12637. * @param {?} values
  12638. * @return {?}
  12639. */
  12640. function checkAndUpdateDirectiveDynamic(view, def, values) {
  12641. var /** @type {?} */ providerData = asProviderData(view, def.nodeIndex);
  12642. var /** @type {?} */ directive = providerData.instance;
  12643. var /** @type {?} */ changed = false;
  12644. var /** @type {?} */ changes = /** @type {?} */ ((undefined));
  12645. for (var /** @type {?} */ i = 0; i < values.length; i++) {
  12646. if (checkBinding(view, def, i, values[i])) {
  12647. changed = true;
  12648. changes = updateProp(view, providerData, def, i, values[i], changes);
  12649. }
  12650. }
  12651. if (changes) {
  12652. directive.ngOnChanges(changes);
  12653. }
  12654. if ((def.flags & 65536 /* OnInit */) &&
  12655. shouldCallLifecycleInitHook(view, 256 /* InitState_CallingOnInit */, def.nodeIndex)) {
  12656. directive.ngOnInit();
  12657. }
  12658. if (def.flags & 262144 /* DoCheck */) {
  12659. directive.ngDoCheck();
  12660. }
  12661. return changed;
  12662. }
  12663. /**
  12664. * @param {?} view
  12665. * @param {?} def
  12666. * @return {?}
  12667. */
  12668. function _createProviderInstance(view, def) {
  12669. // private services can see other private services
  12670. var /** @type {?} */ allowPrivateServices = (def.flags & 8192 /* PrivateProvider */) > 0;
  12671. var /** @type {?} */ providerDef = def.provider;
  12672. switch (def.flags & 201347067 /* Types */) {
  12673. case 512 /* TypeClassProvider */:
  12674. return createClass(view, /** @type {?} */ ((def.parent)), allowPrivateServices, /** @type {?} */ ((providerDef)).value, /** @type {?} */ ((providerDef)).deps);
  12675. case 1024 /* TypeFactoryProvider */:
  12676. return callFactory(view, /** @type {?} */ ((def.parent)), allowPrivateServices, /** @type {?} */ ((providerDef)).value, /** @type {?} */ ((providerDef)).deps);
  12677. case 2048 /* TypeUseExistingProvider */:
  12678. return resolveDep(view, /** @type {?} */ ((def.parent)), allowPrivateServices, /** @type {?} */ ((providerDef)).deps[0]);
  12679. case 256 /* TypeValueProvider */:
  12680. return /** @type {?} */ ((providerDef)).value;
  12681. }
  12682. }
  12683. /**
  12684. * @param {?} view
  12685. * @param {?} elDef
  12686. * @param {?} allowPrivateServices
  12687. * @param {?} ctor
  12688. * @param {?} deps
  12689. * @return {?}
  12690. */
  12691. function createClass(view, elDef, allowPrivateServices, ctor, deps) {
  12692. var /** @type {?} */ len = deps.length;
  12693. switch (len) {
  12694. case 0:
  12695. return new ctor();
  12696. case 1:
  12697. return new ctor(resolveDep(view, elDef, allowPrivateServices, deps[0]));
  12698. case 2:
  12699. return new ctor(resolveDep(view, elDef, allowPrivateServices, deps[0]), resolveDep(view, elDef, allowPrivateServices, deps[1]));
  12700. case 3:
  12701. return new ctor(resolveDep(view, elDef, allowPrivateServices, deps[0]), resolveDep(view, elDef, allowPrivateServices, deps[1]), resolveDep(view, elDef, allowPrivateServices, deps[2]));
  12702. default:
  12703. var /** @type {?} */ depValues = new Array(len);
  12704. for (var /** @type {?} */ i = 0; i < len; i++) {
  12705. depValues[i] = resolveDep(view, elDef, allowPrivateServices, deps[i]);
  12706. }
  12707. return new (ctor.bind.apply(ctor, [void 0].concat(depValues)))();
  12708. }
  12709. }
  12710. /**
  12711. * @param {?} view
  12712. * @param {?} elDef
  12713. * @param {?} allowPrivateServices
  12714. * @param {?} factory
  12715. * @param {?} deps
  12716. * @return {?}
  12717. */
  12718. function callFactory(view, elDef, allowPrivateServices, factory, deps) {
  12719. var /** @type {?} */ len = deps.length;
  12720. switch (len) {
  12721. case 0:
  12722. return factory();
  12723. case 1:
  12724. return factory(resolveDep(view, elDef, allowPrivateServices, deps[0]));
  12725. case 2:
  12726. return factory(resolveDep(view, elDef, allowPrivateServices, deps[0]), resolveDep(view, elDef, allowPrivateServices, deps[1]));
  12727. case 3:
  12728. return factory(resolveDep(view, elDef, allowPrivateServices, deps[0]), resolveDep(view, elDef, allowPrivateServices, deps[1]), resolveDep(view, elDef, allowPrivateServices, deps[2]));
  12729. default:
  12730. var /** @type {?} */ depValues = Array(len);
  12731. for (var /** @type {?} */ i = 0; i < len; i++) {
  12732. depValues[i] = resolveDep(view, elDef, allowPrivateServices, deps[i]);
  12733. }
  12734. return factory.apply(void 0, depValues);
  12735. }
  12736. }
  12737. // This default value is when checking the hierarchy for a token.
  12738. //
  12739. // It means both:
  12740. // - the token is not provided by the current injector,
  12741. // - only the element injectors should be checked (ie do not check module injectors
  12742. //
  12743. // mod1
  12744. // /
  12745. // el1 mod2
  12746. // \ /
  12747. // el2
  12748. //
  12749. // When requesting el2.injector.get(token), we should check in the following order and return the
  12750. // first found value:
  12751. // - el2.injector.get(token, default)
  12752. // - el1.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) -> do not check the module
  12753. // - mod2.injector.get(token, default)
  12754. var NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR = {};
  12755. /**
  12756. * @param {?} view
  12757. * @param {?} elDef
  12758. * @param {?} allowPrivateServices
  12759. * @param {?} depDef
  12760. * @param {?=} notFoundValue
  12761. * @return {?}
  12762. */
  12763. function resolveDep(view, elDef, allowPrivateServices, depDef, notFoundValue) {
  12764. if (notFoundValue === void 0) { notFoundValue = Injector.THROW_IF_NOT_FOUND; }
  12765. if (depDef.flags & 8 /* Value */) {
  12766. return depDef.token;
  12767. }
  12768. var /** @type {?} */ startView = view;
  12769. if (depDef.flags & 2 /* Optional */) {
  12770. notFoundValue = null;
  12771. }
  12772. var /** @type {?} */ tokenKey$$1 = depDef.tokenKey;
  12773. if (tokenKey$$1 === ChangeDetectorRefTokenKey) {
  12774. // directives on the same element as a component should be able to control the change detector
  12775. // of that component as well.
  12776. allowPrivateServices = !!(elDef && /** @type {?} */ ((elDef.element)).componentView);
  12777. }
  12778. if (elDef && (depDef.flags & 1 /* SkipSelf */)) {
  12779. allowPrivateServices = false;
  12780. elDef = /** @type {?} */ ((elDef.parent));
  12781. }
  12782. while (view) {
  12783. if (elDef) {
  12784. switch (tokenKey$$1) {
  12785. case RendererV1TokenKey: {
  12786. var /** @type {?} */ compView = findCompView(view, elDef, allowPrivateServices);
  12787. return createRendererV1(compView);
  12788. }
  12789. case Renderer2TokenKey: {
  12790. var /** @type {?} */ compView = findCompView(view, elDef, allowPrivateServices);
  12791. return compView.renderer;
  12792. }
  12793. case ElementRefTokenKey:
  12794. return new ElementRef(asElementData(view, elDef.nodeIndex).renderElement);
  12795. case ViewContainerRefTokenKey:
  12796. return asElementData(view, elDef.nodeIndex).viewContainer;
  12797. case TemplateRefTokenKey: {
  12798. if (/** @type {?} */ ((elDef.element)).template) {
  12799. return asElementData(view, elDef.nodeIndex).template;
  12800. }
  12801. break;
  12802. }
  12803. case ChangeDetectorRefTokenKey: {
  12804. var /** @type {?} */ cdView = findCompView(view, elDef, allowPrivateServices);
  12805. return createChangeDetectorRef(cdView);
  12806. }
  12807. case InjectorRefTokenKey:
  12808. return createInjector(view, elDef);
  12809. default:
  12810. var /** @type {?} */ providerDef_1 = /** @type {?} */ (((allowPrivateServices ? /** @type {?} */ ((elDef.element)).allProviders : /** @type {?} */ ((elDef.element)).publicProviders)))[tokenKey$$1];
  12811. if (providerDef_1) {
  12812. var /** @type {?} */ providerData = asProviderData(view, providerDef_1.nodeIndex);
  12813. if (!providerData) {
  12814. providerData = { instance: _createProviderInstance(view, providerDef_1) };
  12815. view.nodes[providerDef_1.nodeIndex] = /** @type {?} */ (providerData);
  12816. }
  12817. return providerData.instance;
  12818. }
  12819. }
  12820. }
  12821. allowPrivateServices = isComponentView(view);
  12822. elDef = /** @type {?} */ ((viewParentEl(view)));
  12823. view = /** @type {?} */ ((view.parent));
  12824. }
  12825. var /** @type {?} */ value = startView.root.injector.get(depDef.token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR);
  12826. if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR ||
  12827. notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {
  12828. // Return the value from the root element injector when
  12829. // - it provides it
  12830. // (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
  12831. // - the module injector should not be checked
  12832. // (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
  12833. return value;
  12834. }
  12835. return startView.root.ngModule.injector.get(depDef.token, notFoundValue);
  12836. }
  12837. /**
  12838. * @param {?} view
  12839. * @param {?} elDef
  12840. * @param {?} allowPrivateServices
  12841. * @return {?}
  12842. */
  12843. function findCompView(view, elDef, allowPrivateServices) {
  12844. var /** @type {?} */ compView;
  12845. if (allowPrivateServices) {
  12846. compView = asElementData(view, elDef.nodeIndex).componentView;
  12847. }
  12848. else {
  12849. compView = view;
  12850. while (compView.parent && !isComponentView(compView)) {
  12851. compView = compView.parent;
  12852. }
  12853. }
  12854. return compView;
  12855. }
  12856. /**
  12857. * @param {?} view
  12858. * @param {?} providerData
  12859. * @param {?} def
  12860. * @param {?} bindingIdx
  12861. * @param {?} value
  12862. * @param {?} changes
  12863. * @return {?}
  12864. */
  12865. function updateProp(view, providerData, def, bindingIdx, value, changes) {
  12866. if (def.flags & 32768 /* Component */) {
  12867. var /** @type {?} */ compView = asElementData(view, /** @type {?} */ ((def.parent)).nodeIndex).componentView;
  12868. if (compView.def.flags & 2 /* OnPush */) {
  12869. compView.state |= 8 /* ChecksEnabled */;
  12870. }
  12871. }
  12872. var /** @type {?} */ binding = def.bindings[bindingIdx];
  12873. var /** @type {?} */ propName = /** @type {?} */ ((binding.name));
  12874. // Note: This is still safe with Closure Compiler as
  12875. // the user passed in the property name as an object has to `providerDef`,
  12876. // so Closure Compiler will have renamed the property correctly already.
  12877. providerData.instance[propName] = value;
  12878. if (def.flags & 524288 /* OnChanges */) {
  12879. changes = changes || {};
  12880. var /** @type {?} */ oldValue = WrappedValue.unwrap(view.oldValues[def.bindingIndex + bindingIdx]);
  12881. var /** @type {?} */ binding_1 = def.bindings[bindingIdx];
  12882. changes[/** @type {?} */ ((binding_1.nonMinifiedName))] =
  12883. new SimpleChange(oldValue, value, (view.state & 2 /* FirstCheck */) !== 0);
  12884. }
  12885. view.oldValues[def.bindingIndex + bindingIdx] = value;
  12886. return changes;
  12887. }
  12888. /**
  12889. * @param {?} view
  12890. * @param {?} lifecycles
  12891. * @return {?}
  12892. */
  12893. function callLifecycleHooksChildrenFirst(view, lifecycles) {
  12894. if (!(view.def.nodeFlags & lifecycles)) {
  12895. return;
  12896. }
  12897. var /** @type {?} */ nodes = view.def.nodes;
  12898. var /** @type {?} */ initIndex = 0;
  12899. for (var /** @type {?} */ i = 0; i < nodes.length; i++) {
  12900. var /** @type {?} */ nodeDef = nodes[i];
  12901. var /** @type {?} */ parent_1 = nodeDef.parent;
  12902. if (!parent_1 && nodeDef.flags & lifecycles) {
  12903. // matching root node (e.g. a pipe)
  12904. callProviderLifecycles(view, i, nodeDef.flags & lifecycles, initIndex++);
  12905. }
  12906. if ((nodeDef.childFlags & lifecycles) === 0) {
  12907. // no child matches one of the lifecycles
  12908. i += nodeDef.childCount;
  12909. }
  12910. while (parent_1 && (parent_1.flags & 1 /* TypeElement */) &&
  12911. i === parent_1.nodeIndex + parent_1.childCount) {
  12912. // last child of an element
  12913. if (parent_1.directChildFlags & lifecycles) {
  12914. initIndex = callElementProvidersLifecycles(view, parent_1, lifecycles, initIndex);
  12915. }
  12916. parent_1 = parent_1.parent;
  12917. }
  12918. }
  12919. }
  12920. /**
  12921. * @param {?} view
  12922. * @param {?} elDef
  12923. * @param {?} lifecycles
  12924. * @param {?} initIndex
  12925. * @return {?}
  12926. */
  12927. function callElementProvidersLifecycles(view, elDef, lifecycles, initIndex) {
  12928. for (var /** @type {?} */ i = elDef.nodeIndex + 1; i <= elDef.nodeIndex + elDef.childCount; i++) {
  12929. var /** @type {?} */ nodeDef = view.def.nodes[i];
  12930. if (nodeDef.flags & lifecycles) {
  12931. callProviderLifecycles(view, i, nodeDef.flags & lifecycles, initIndex++);
  12932. }
  12933. // only visit direct children
  12934. i += nodeDef.childCount;
  12935. }
  12936. return initIndex;
  12937. }
  12938. /**
  12939. * @param {?} view
  12940. * @param {?} index
  12941. * @param {?} lifecycles
  12942. * @param {?} initIndex
  12943. * @return {?}
  12944. */
  12945. function callProviderLifecycles(view, index, lifecycles, initIndex) {
  12946. var /** @type {?} */ providerData = asProviderData(view, index);
  12947. if (!providerData) {
  12948. return;
  12949. }
  12950. var /** @type {?} */ provider = providerData.instance;
  12951. if (!provider) {
  12952. return;
  12953. }
  12954. Services.setCurrentNode(view, index);
  12955. if (lifecycles & 1048576 /* AfterContentInit */ &&
  12956. shouldCallLifecycleInitHook(view, 512 /* InitState_CallingAfterContentInit */, initIndex)) {
  12957. provider.ngAfterContentInit();
  12958. }
  12959. if (lifecycles & 2097152 /* AfterContentChecked */) {
  12960. provider.ngAfterContentChecked();
  12961. }
  12962. if (lifecycles & 4194304 /* AfterViewInit */ &&
  12963. shouldCallLifecycleInitHook(view, 768 /* InitState_CallingAfterViewInit */, initIndex)) {
  12964. provider.ngAfterViewInit();
  12965. }
  12966. if (lifecycles & 8388608 /* AfterViewChecked */) {
  12967. provider.ngAfterViewChecked();
  12968. }
  12969. if (lifecycles & 131072 /* OnDestroy */) {
  12970. provider.ngOnDestroy();
  12971. }
  12972. }
  12973. /**
  12974. * @fileoverview added by tsickle
  12975. * @suppress {checkTypes} checked by tsc
  12976. */
  12977. /**
  12978. * @license
  12979. * Copyright Google Inc. All Rights Reserved.
  12980. *
  12981. * Use of this source code is governed by an MIT-style license that can be
  12982. * found in the LICENSE file at https://angular.io/license
  12983. */
  12984. /**
  12985. * @param {?} flags
  12986. * @param {?} id
  12987. * @param {?} bindings
  12988. * @return {?}
  12989. */
  12990. function queryDef(flags, id, bindings) {
  12991. var /** @type {?} */ bindingDefs = [];
  12992. for (var /** @type {?} */ propName in bindings) {
  12993. var /** @type {?} */ bindingType = bindings[propName];
  12994. bindingDefs.push({ propName: propName, bindingType: bindingType });
  12995. }
  12996. return {
  12997. // will bet set by the view definition
  12998. nodeIndex: -1,
  12999. parent: null,
  13000. renderParent: null,
  13001. bindingIndex: -1,
  13002. outputIndex: -1,
  13003. // regular values
  13004. // TODO(vicb): check
  13005. checkIndex: -1, flags: flags,
  13006. childFlags: 0,
  13007. directChildFlags: 0,
  13008. childMatchedQueries: 0,
  13009. ngContentIndex: -1,
  13010. matchedQueries: {},
  13011. matchedQueryIds: 0,
  13012. references: {},
  13013. childCount: 0,
  13014. bindings: [],
  13015. bindingFlags: 0,
  13016. outputs: [],
  13017. element: null,
  13018. provider: null,
  13019. text: null,
  13020. query: { id: id, filterId: filterQueryId(id), bindings: bindingDefs },
  13021. ngContent: null
  13022. };
  13023. }
  13024. /**
  13025. * @return {?}
  13026. */
  13027. function createQuery() {
  13028. return new QueryList();
  13029. }
  13030. /**
  13031. * @param {?} view
  13032. * @return {?}
  13033. */
  13034. function dirtyParentQueries(view) {
  13035. var /** @type {?} */ queryIds = view.def.nodeMatchedQueries;
  13036. while (view.parent && isEmbeddedView(view)) {
  13037. var /** @type {?} */ tplDef = /** @type {?} */ ((view.parentNodeDef));
  13038. view = view.parent;
  13039. // content queries
  13040. var /** @type {?} */ end = tplDef.nodeIndex + tplDef.childCount;
  13041. for (var /** @type {?} */ i = 0; i <= end; i++) {
  13042. var /** @type {?} */ nodeDef = view.def.nodes[i];
  13043. if ((nodeDef.flags & 67108864 /* TypeContentQuery */) &&
  13044. (nodeDef.flags & 536870912 /* DynamicQuery */) &&
  13045. (/** @type {?} */ ((nodeDef.query)).filterId & queryIds) === /** @type {?} */ ((nodeDef.query)).filterId) {
  13046. asQueryList(view, i).setDirty();
  13047. }
  13048. if ((nodeDef.flags & 1 /* TypeElement */ && i + nodeDef.childCount < tplDef.nodeIndex) ||
  13049. !(nodeDef.childFlags & 67108864 /* TypeContentQuery */) ||
  13050. !(nodeDef.childFlags & 536870912 /* DynamicQuery */)) {
  13051. // skip elements that don't contain the template element or no query.
  13052. i += nodeDef.childCount;
  13053. }
  13054. }
  13055. }
  13056. // view queries
  13057. if (view.def.nodeFlags & 134217728 /* TypeViewQuery */) {
  13058. for (var /** @type {?} */ i = 0; i < view.def.nodes.length; i++) {
  13059. var /** @type {?} */ nodeDef = view.def.nodes[i];
  13060. if ((nodeDef.flags & 134217728 /* TypeViewQuery */) && (nodeDef.flags & 536870912 /* DynamicQuery */)) {
  13061. asQueryList(view, i).setDirty();
  13062. }
  13063. // only visit the root nodes
  13064. i += nodeDef.childCount;
  13065. }
  13066. }
  13067. }
  13068. /**
  13069. * @param {?} view
  13070. * @param {?} nodeDef
  13071. * @return {?}
  13072. */
  13073. function checkAndUpdateQuery(view, nodeDef) {
  13074. var /** @type {?} */ queryList = asQueryList(view, nodeDef.nodeIndex);
  13075. if (!queryList.dirty) {
  13076. return;
  13077. }
  13078. var /** @type {?} */ directiveInstance;
  13079. var /** @type {?} */ newValues = /** @type {?} */ ((undefined));
  13080. if (nodeDef.flags & 67108864 /* TypeContentQuery */) {
  13081. var /** @type {?} */ elementDef = /** @type {?} */ ((/** @type {?} */ ((nodeDef.parent)).parent));
  13082. newValues = calcQueryValues(view, elementDef.nodeIndex, elementDef.nodeIndex + elementDef.childCount, /** @type {?} */ ((nodeDef.query)), []);
  13083. directiveInstance = asProviderData(view, /** @type {?} */ ((nodeDef.parent)).nodeIndex).instance;
  13084. }
  13085. else if (nodeDef.flags & 134217728 /* TypeViewQuery */) {
  13086. newValues = calcQueryValues(view, 0, view.def.nodes.length - 1, /** @type {?} */ ((nodeDef.query)), []);
  13087. directiveInstance = view.component;
  13088. }
  13089. queryList.reset(newValues);
  13090. var /** @type {?} */ bindings = /** @type {?} */ ((nodeDef.query)).bindings;
  13091. var /** @type {?} */ notify = false;
  13092. for (var /** @type {?} */ i = 0; i < bindings.length; i++) {
  13093. var /** @type {?} */ binding = bindings[i];
  13094. var /** @type {?} */ boundValue = void 0;
  13095. switch (binding.bindingType) {
  13096. case 0 /* First */:
  13097. boundValue = queryList.first;
  13098. break;
  13099. case 1 /* All */:
  13100. boundValue = queryList;
  13101. notify = true;
  13102. break;
  13103. }
  13104. directiveInstance[binding.propName] = boundValue;
  13105. }
  13106. if (notify) {
  13107. queryList.notifyOnChanges();
  13108. }
  13109. }
  13110. /**
  13111. * @param {?} view
  13112. * @param {?} startIndex
  13113. * @param {?} endIndex
  13114. * @param {?} queryDef
  13115. * @param {?} values
  13116. * @return {?}
  13117. */
  13118. function calcQueryValues(view, startIndex, endIndex, queryDef, values) {
  13119. for (var /** @type {?} */ i = startIndex; i <= endIndex; i++) {
  13120. var /** @type {?} */ nodeDef = view.def.nodes[i];
  13121. var /** @type {?} */ valueType = nodeDef.matchedQueries[queryDef.id];
  13122. if (valueType != null) {
  13123. values.push(getQueryValue(view, nodeDef, valueType));
  13124. }
  13125. if (nodeDef.flags & 1 /* TypeElement */ && /** @type {?} */ ((nodeDef.element)).template &&
  13126. (/** @type {?} */ ((/** @type {?} */ ((nodeDef.element)).template)).nodeMatchedQueries & queryDef.filterId) ===
  13127. queryDef.filterId) {
  13128. var /** @type {?} */ elementData = asElementData(view, i);
  13129. // check embedded views that were attached at the place of their template,
  13130. // but process child nodes first if some match the query (see issue #16568)
  13131. if ((nodeDef.childMatchedQueries & queryDef.filterId) === queryDef.filterId) {
  13132. calcQueryValues(view, i + 1, i + nodeDef.childCount, queryDef, values);
  13133. i += nodeDef.childCount;
  13134. }
  13135. if (nodeDef.flags & 16777216 /* EmbeddedViews */) {
  13136. var /** @type {?} */ embeddedViews = /** @type {?} */ ((elementData.viewContainer))._embeddedViews;
  13137. for (var /** @type {?} */ k = 0; k < embeddedViews.length; k++) {
  13138. var /** @type {?} */ embeddedView = embeddedViews[k];
  13139. var /** @type {?} */ dvc = declaredViewContainer(embeddedView);
  13140. if (dvc && dvc === elementData) {
  13141. calcQueryValues(embeddedView, 0, embeddedView.def.nodes.length - 1, queryDef, values);
  13142. }
  13143. }
  13144. }
  13145. var /** @type {?} */ projectedViews = elementData.template._projectedViews;
  13146. if (projectedViews) {
  13147. for (var /** @type {?} */ k = 0; k < projectedViews.length; k++) {
  13148. var /** @type {?} */ projectedView = projectedViews[k];
  13149. calcQueryValues(projectedView, 0, projectedView.def.nodes.length - 1, queryDef, values);
  13150. }
  13151. }
  13152. }
  13153. if ((nodeDef.childMatchedQueries & queryDef.filterId) !== queryDef.filterId) {
  13154. // if no child matches the query, skip the children.
  13155. i += nodeDef.childCount;
  13156. }
  13157. }
  13158. return values;
  13159. }
  13160. /**
  13161. * @param {?} view
  13162. * @param {?} nodeDef
  13163. * @param {?} queryValueType
  13164. * @return {?}
  13165. */
  13166. function getQueryValue(view, nodeDef, queryValueType) {
  13167. if (queryValueType != null) {
  13168. // a match
  13169. switch (queryValueType) {
  13170. case 1 /* RenderElement */:
  13171. return asElementData(view, nodeDef.nodeIndex).renderElement;
  13172. case 0 /* ElementRef */:
  13173. return new ElementRef(asElementData(view, nodeDef.nodeIndex).renderElement);
  13174. case 2 /* TemplateRef */:
  13175. return asElementData(view, nodeDef.nodeIndex).template;
  13176. case 3 /* ViewContainerRef */:
  13177. return asElementData(view, nodeDef.nodeIndex).viewContainer;
  13178. case 4 /* Provider */:
  13179. return asProviderData(view, nodeDef.nodeIndex).instance;
  13180. }
  13181. }
  13182. }
  13183. /**
  13184. * @fileoverview added by tsickle
  13185. * @suppress {checkTypes} checked by tsc
  13186. */
  13187. /**
  13188. * @license
  13189. * Copyright Google Inc. All Rights Reserved.
  13190. *
  13191. * Use of this source code is governed by an MIT-style license that can be
  13192. * found in the LICENSE file at https://angular.io/license
  13193. */
  13194. /**
  13195. * @param {?} ngContentIndex
  13196. * @param {?} index
  13197. * @return {?}
  13198. */
  13199. function ngContentDef(ngContentIndex, index) {
  13200. return {
  13201. // will bet set by the view definition
  13202. nodeIndex: -1,
  13203. parent: null,
  13204. renderParent: null,
  13205. bindingIndex: -1,
  13206. outputIndex: -1,
  13207. // regular values
  13208. checkIndex: -1,
  13209. flags: 8 /* TypeNgContent */,
  13210. childFlags: 0,
  13211. directChildFlags: 0,
  13212. childMatchedQueries: 0,
  13213. matchedQueries: {},
  13214. matchedQueryIds: 0,
  13215. references: {}, ngContentIndex: ngContentIndex,
  13216. childCount: 0,
  13217. bindings: [],
  13218. bindingFlags: 0,
  13219. outputs: [],
  13220. element: null,
  13221. provider: null,
  13222. text: null,
  13223. query: null,
  13224. ngContent: { index: index }
  13225. };
  13226. }
  13227. /**
  13228. * @param {?} view
  13229. * @param {?} renderHost
  13230. * @param {?} def
  13231. * @return {?}
  13232. */
  13233. function appendNgContent(view, renderHost, def) {
  13234. var /** @type {?} */ parentEl = getParentRenderElement(view, renderHost, def);
  13235. if (!parentEl) {
  13236. // Nothing to do if there is no parent element.
  13237. return;
  13238. }
  13239. var /** @type {?} */ ngContentIndex = /** @type {?} */ ((def.ngContent)).index;
  13240. visitProjectedRenderNodes(view, ngContentIndex, 1 /* AppendChild */, parentEl, null, undefined);
  13241. }
  13242. /**
  13243. * @fileoverview added by tsickle
  13244. * @suppress {checkTypes} checked by tsc
  13245. */
  13246. /**
  13247. * @license
  13248. * Copyright Google Inc. All Rights Reserved.
  13249. *
  13250. * Use of this source code is governed by an MIT-style license that can be
  13251. * found in the LICENSE file at https://angular.io/license
  13252. */
  13253. /**
  13254. * @param {?} checkIndex
  13255. * @param {?} argCount
  13256. * @return {?}
  13257. */
  13258. function purePipeDef(checkIndex, argCount) {
  13259. // argCount + 1 to include the pipe as first arg
  13260. return _pureExpressionDef(128 /* TypePurePipe */, checkIndex, new Array(argCount + 1));
  13261. }
  13262. /**
  13263. * @param {?} checkIndex
  13264. * @param {?} argCount
  13265. * @return {?}
  13266. */
  13267. function pureArrayDef(checkIndex, argCount) {
  13268. return _pureExpressionDef(32 /* TypePureArray */, checkIndex, new Array(argCount));
  13269. }
  13270. /**
  13271. * @param {?} checkIndex
  13272. * @param {?} propToIndex
  13273. * @return {?}
  13274. */
  13275. function pureObjectDef(checkIndex, propToIndex) {
  13276. var /** @type {?} */ keys = Object.keys(propToIndex);
  13277. var /** @type {?} */ nbKeys = keys.length;
  13278. var /** @type {?} */ propertyNames = new Array(nbKeys);
  13279. for (var /** @type {?} */ i = 0; i < nbKeys; i++) {
  13280. var /** @type {?} */ key = keys[i];
  13281. var /** @type {?} */ index = propToIndex[key];
  13282. propertyNames[index] = key;
  13283. }
  13284. return _pureExpressionDef(64 /* TypePureObject */, checkIndex, propertyNames);
  13285. }
  13286. /**
  13287. * @param {?} flags
  13288. * @param {?} checkIndex
  13289. * @param {?} propertyNames
  13290. * @return {?}
  13291. */
  13292. function _pureExpressionDef(flags, checkIndex, propertyNames) {
  13293. var /** @type {?} */ bindings = new Array(propertyNames.length);
  13294. for (var /** @type {?} */ i = 0; i < propertyNames.length; i++) {
  13295. var /** @type {?} */ prop = propertyNames[i];
  13296. bindings[i] = {
  13297. flags: 8 /* TypeProperty */,
  13298. name: prop,
  13299. ns: null,
  13300. nonMinifiedName: prop,
  13301. securityContext: null,
  13302. suffix: null
  13303. };
  13304. }
  13305. return {
  13306. // will bet set by the view definition
  13307. nodeIndex: -1,
  13308. parent: null,
  13309. renderParent: null,
  13310. bindingIndex: -1,
  13311. outputIndex: -1,
  13312. // regular values
  13313. checkIndex: checkIndex,
  13314. flags: flags,
  13315. childFlags: 0,
  13316. directChildFlags: 0,
  13317. childMatchedQueries: 0,
  13318. matchedQueries: {},
  13319. matchedQueryIds: 0,
  13320. references: {},
  13321. ngContentIndex: -1,
  13322. childCount: 0, bindings: bindings,
  13323. bindingFlags: calcBindingFlags(bindings),
  13324. outputs: [],
  13325. element: null,
  13326. provider: null,
  13327. text: null,
  13328. query: null,
  13329. ngContent: null
  13330. };
  13331. }
  13332. /**
  13333. * @param {?} view
  13334. * @param {?} def
  13335. * @return {?}
  13336. */
  13337. function createPureExpression(view, def) {
  13338. return { value: undefined };
  13339. }
  13340. /**
  13341. * @param {?} view
  13342. * @param {?} def
  13343. * @param {?} v0
  13344. * @param {?} v1
  13345. * @param {?} v2
  13346. * @param {?} v3
  13347. * @param {?} v4
  13348. * @param {?} v5
  13349. * @param {?} v6
  13350. * @param {?} v7
  13351. * @param {?} v8
  13352. * @param {?} v9
  13353. * @return {?}
  13354. */
  13355. function checkAndUpdatePureExpressionInline(view, def, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {
  13356. var /** @type {?} */ bindings = def.bindings;
  13357. var /** @type {?} */ changed = false;
  13358. var /** @type {?} */ bindLen = bindings.length;
  13359. if (bindLen > 0 && checkAndUpdateBinding(view, def, 0, v0))
  13360. changed = true;
  13361. if (bindLen > 1 && checkAndUpdateBinding(view, def, 1, v1))
  13362. changed = true;
  13363. if (bindLen > 2 && checkAndUpdateBinding(view, def, 2, v2))
  13364. changed = true;
  13365. if (bindLen > 3 && checkAndUpdateBinding(view, def, 3, v3))
  13366. changed = true;
  13367. if (bindLen > 4 && checkAndUpdateBinding(view, def, 4, v4))
  13368. changed = true;
  13369. if (bindLen > 5 && checkAndUpdateBinding(view, def, 5, v5))
  13370. changed = true;
  13371. if (bindLen > 6 && checkAndUpdateBinding(view, def, 6, v6))
  13372. changed = true;
  13373. if (bindLen > 7 && checkAndUpdateBinding(view, def, 7, v7))
  13374. changed = true;
  13375. if (bindLen > 8 && checkAndUpdateBinding(view, def, 8, v8))
  13376. changed = true;
  13377. if (bindLen > 9 && checkAndUpdateBinding(view, def, 9, v9))
  13378. changed = true;
  13379. if (changed) {
  13380. var /** @type {?} */ data = asPureExpressionData(view, def.nodeIndex);
  13381. var /** @type {?} */ value = void 0;
  13382. switch (def.flags & 201347067 /* Types */) {
  13383. case 32 /* TypePureArray */:
  13384. value = new Array(bindings.length);
  13385. if (bindLen > 0)
  13386. value[0] = v0;
  13387. if (bindLen > 1)
  13388. value[1] = v1;
  13389. if (bindLen > 2)
  13390. value[2] = v2;
  13391. if (bindLen > 3)
  13392. value[3] = v3;
  13393. if (bindLen > 4)
  13394. value[4] = v4;
  13395. if (bindLen > 5)
  13396. value[5] = v5;
  13397. if (bindLen > 6)
  13398. value[6] = v6;
  13399. if (bindLen > 7)
  13400. value[7] = v7;
  13401. if (bindLen > 8)
  13402. value[8] = v8;
  13403. if (bindLen > 9)
  13404. value[9] = v9;
  13405. break;
  13406. case 64 /* TypePureObject */:
  13407. value = {};
  13408. if (bindLen > 0)
  13409. value[/** @type {?} */ ((bindings[0].name))] = v0;
  13410. if (bindLen > 1)
  13411. value[/** @type {?} */ ((bindings[1].name))] = v1;
  13412. if (bindLen > 2)
  13413. value[/** @type {?} */ ((bindings[2].name))] = v2;
  13414. if (bindLen > 3)
  13415. value[/** @type {?} */ ((bindings[3].name))] = v3;
  13416. if (bindLen > 4)
  13417. value[/** @type {?} */ ((bindings[4].name))] = v4;
  13418. if (bindLen > 5)
  13419. value[/** @type {?} */ ((bindings[5].name))] = v5;
  13420. if (bindLen > 6)
  13421. value[/** @type {?} */ ((bindings[6].name))] = v6;
  13422. if (bindLen > 7)
  13423. value[/** @type {?} */ ((bindings[7].name))] = v7;
  13424. if (bindLen > 8)
  13425. value[/** @type {?} */ ((bindings[8].name))] = v8;
  13426. if (bindLen > 9)
  13427. value[/** @type {?} */ ((bindings[9].name))] = v9;
  13428. break;
  13429. case 128 /* TypePurePipe */:
  13430. var /** @type {?} */ pipe = v0;
  13431. switch (bindLen) {
  13432. case 1:
  13433. value = pipe.transform(v0);
  13434. break;
  13435. case 2:
  13436. value = pipe.transform(v1);
  13437. break;
  13438. case 3:
  13439. value = pipe.transform(v1, v2);
  13440. break;
  13441. case 4:
  13442. value = pipe.transform(v1, v2, v3);
  13443. break;
  13444. case 5:
  13445. value = pipe.transform(v1, v2, v3, v4);
  13446. break;
  13447. case 6:
  13448. value = pipe.transform(v1, v2, v3, v4, v5);
  13449. break;
  13450. case 7:
  13451. value = pipe.transform(v1, v2, v3, v4, v5, v6);
  13452. break;
  13453. case 8:
  13454. value = pipe.transform(v1, v2, v3, v4, v5, v6, v7);
  13455. break;
  13456. case 9:
  13457. value = pipe.transform(v1, v2, v3, v4, v5, v6, v7, v8);
  13458. break;
  13459. case 10:
  13460. value = pipe.transform(v1, v2, v3, v4, v5, v6, v7, v8, v9);
  13461. break;
  13462. }
  13463. break;
  13464. }
  13465. data.value = value;
  13466. }
  13467. return changed;
  13468. }
  13469. /**
  13470. * @param {?} view
  13471. * @param {?} def
  13472. * @param {?} values
  13473. * @return {?}
  13474. */
  13475. function checkAndUpdatePureExpressionDynamic(view, def, values) {
  13476. var /** @type {?} */ bindings = def.bindings;
  13477. var /** @type {?} */ changed = false;
  13478. for (var /** @type {?} */ i = 0; i < values.length; i++) {
  13479. // Note: We need to loop over all values, so that
  13480. // the old values are updates as well!
  13481. if (checkAndUpdateBinding(view, def, i, values[i])) {
  13482. changed = true;
  13483. }
  13484. }
  13485. if (changed) {
  13486. var /** @type {?} */ data = asPureExpressionData(view, def.nodeIndex);
  13487. var /** @type {?} */ value = void 0;
  13488. switch (def.flags & 201347067 /* Types */) {
  13489. case 32 /* TypePureArray */:
  13490. value = values;
  13491. break;
  13492. case 64 /* TypePureObject */:
  13493. value = {};
  13494. for (var /** @type {?} */ i = 0; i < values.length; i++) {
  13495. value[/** @type {?} */ ((bindings[i].name))] = values[i];
  13496. }
  13497. break;
  13498. case 128 /* TypePurePipe */:
  13499. var /** @type {?} */ pipe = values[0];
  13500. var /** @type {?} */ params = values.slice(1);
  13501. value = pipe.transform.apply(pipe, params);
  13502. break;
  13503. }
  13504. data.value = value;
  13505. }
  13506. return changed;
  13507. }
  13508. /**
  13509. * @fileoverview added by tsickle
  13510. * @suppress {checkTypes} checked by tsc
  13511. */
  13512. /**
  13513. * @license
  13514. * Copyright Google Inc. All Rights Reserved.
  13515. *
  13516. * Use of this source code is governed by an MIT-style license that can be
  13517. * found in the LICENSE file at https://angular.io/license
  13518. */
  13519. /**
  13520. * @param {?} checkIndex
  13521. * @param {?} ngContentIndex
  13522. * @param {?} staticText
  13523. * @return {?}
  13524. */
  13525. function textDef(checkIndex, ngContentIndex, staticText) {
  13526. var /** @type {?} */ bindings = new Array(staticText.length - 1);
  13527. for (var /** @type {?} */ i = 1; i < staticText.length; i++) {
  13528. bindings[i - 1] = {
  13529. flags: 8 /* TypeProperty */,
  13530. name: null,
  13531. ns: null,
  13532. nonMinifiedName: null,
  13533. securityContext: null,
  13534. suffix: staticText[i],
  13535. };
  13536. }
  13537. return {
  13538. // will bet set by the view definition
  13539. nodeIndex: -1,
  13540. parent: null,
  13541. renderParent: null,
  13542. bindingIndex: -1,
  13543. outputIndex: -1,
  13544. // regular values
  13545. checkIndex: checkIndex,
  13546. flags: 2 /* TypeText */,
  13547. childFlags: 0,
  13548. directChildFlags: 0,
  13549. childMatchedQueries: 0,
  13550. matchedQueries: {},
  13551. matchedQueryIds: 0,
  13552. references: {}, ngContentIndex: ngContentIndex,
  13553. childCount: 0, bindings: bindings,
  13554. bindingFlags: 8 /* TypeProperty */,
  13555. outputs: [],
  13556. element: null,
  13557. provider: null,
  13558. text: { prefix: staticText[0] },
  13559. query: null,
  13560. ngContent: null,
  13561. };
  13562. }
  13563. /**
  13564. * @param {?} view
  13565. * @param {?} renderHost
  13566. * @param {?} def
  13567. * @return {?}
  13568. */
  13569. function createText(view, renderHost, def) {
  13570. var /** @type {?} */ renderNode$$1;
  13571. var /** @type {?} */ renderer = view.renderer;
  13572. renderNode$$1 = renderer.createText(/** @type {?} */ ((def.text)).prefix);
  13573. var /** @type {?} */ parentEl = getParentRenderElement(view, renderHost, def);
  13574. if (parentEl) {
  13575. renderer.appendChild(parentEl, renderNode$$1);
  13576. }
  13577. return { renderText: renderNode$$1 };
  13578. }
  13579. /**
  13580. * @param {?} view
  13581. * @param {?} def
  13582. * @param {?} v0
  13583. * @param {?} v1
  13584. * @param {?} v2
  13585. * @param {?} v3
  13586. * @param {?} v4
  13587. * @param {?} v5
  13588. * @param {?} v6
  13589. * @param {?} v7
  13590. * @param {?} v8
  13591. * @param {?} v9
  13592. * @return {?}
  13593. */
  13594. function checkAndUpdateTextInline(view, def, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {
  13595. var /** @type {?} */ changed = false;
  13596. var /** @type {?} */ bindings = def.bindings;
  13597. var /** @type {?} */ bindLen = bindings.length;
  13598. if (bindLen > 0 && checkAndUpdateBinding(view, def, 0, v0))
  13599. changed = true;
  13600. if (bindLen > 1 && checkAndUpdateBinding(view, def, 1, v1))
  13601. changed = true;
  13602. if (bindLen > 2 && checkAndUpdateBinding(view, def, 2, v2))
  13603. changed = true;
  13604. if (bindLen > 3 && checkAndUpdateBinding(view, def, 3, v3))
  13605. changed = true;
  13606. if (bindLen > 4 && checkAndUpdateBinding(view, def, 4, v4))
  13607. changed = true;
  13608. if (bindLen > 5 && checkAndUpdateBinding(view, def, 5, v5))
  13609. changed = true;
  13610. if (bindLen > 6 && checkAndUpdateBinding(view, def, 6, v6))
  13611. changed = true;
  13612. if (bindLen > 7 && checkAndUpdateBinding(view, def, 7, v7))
  13613. changed = true;
  13614. if (bindLen > 8 && checkAndUpdateBinding(view, def, 8, v8))
  13615. changed = true;
  13616. if (bindLen > 9 && checkAndUpdateBinding(view, def, 9, v9))
  13617. changed = true;
  13618. if (changed) {
  13619. var /** @type {?} */ value = /** @type {?} */ ((def.text)).prefix;
  13620. if (bindLen > 0)
  13621. value += _addInterpolationPart(v0, bindings[0]);
  13622. if (bindLen > 1)
  13623. value += _addInterpolationPart(v1, bindings[1]);
  13624. if (bindLen > 2)
  13625. value += _addInterpolationPart(v2, bindings[2]);
  13626. if (bindLen > 3)
  13627. value += _addInterpolationPart(v3, bindings[3]);
  13628. if (bindLen > 4)
  13629. value += _addInterpolationPart(v4, bindings[4]);
  13630. if (bindLen > 5)
  13631. value += _addInterpolationPart(v5, bindings[5]);
  13632. if (bindLen > 6)
  13633. value += _addInterpolationPart(v6, bindings[6]);
  13634. if (bindLen > 7)
  13635. value += _addInterpolationPart(v7, bindings[7]);
  13636. if (bindLen > 8)
  13637. value += _addInterpolationPart(v8, bindings[8]);
  13638. if (bindLen > 9)
  13639. value += _addInterpolationPart(v9, bindings[9]);
  13640. var /** @type {?} */ renderNode$$1 = asTextData(view, def.nodeIndex).renderText;
  13641. view.renderer.setValue(renderNode$$1, value);
  13642. }
  13643. return changed;
  13644. }
  13645. /**
  13646. * @param {?} view
  13647. * @param {?} def
  13648. * @param {?} values
  13649. * @return {?}
  13650. */
  13651. function checkAndUpdateTextDynamic(view, def, values) {
  13652. var /** @type {?} */ bindings = def.bindings;
  13653. var /** @type {?} */ changed = false;
  13654. for (var /** @type {?} */ i = 0; i < values.length; i++) {
  13655. // Note: We need to loop over all values, so that
  13656. // the old values are updates as well!
  13657. if (checkAndUpdateBinding(view, def, i, values[i])) {
  13658. changed = true;
  13659. }
  13660. }
  13661. if (changed) {
  13662. var /** @type {?} */ value = '';
  13663. for (var /** @type {?} */ i = 0; i < values.length; i++) {
  13664. value = value + _addInterpolationPart(values[i], bindings[i]);
  13665. }
  13666. value = /** @type {?} */ ((def.text)).prefix + value;
  13667. var /** @type {?} */ renderNode$$1 = asTextData(view, def.nodeIndex).renderText;
  13668. view.renderer.setValue(renderNode$$1, value);
  13669. }
  13670. return changed;
  13671. }
  13672. /**
  13673. * @param {?} value
  13674. * @param {?} binding
  13675. * @return {?}
  13676. */
  13677. function _addInterpolationPart(value, binding) {
  13678. var /** @type {?} */ valueStr = value != null ? value.toString() : '';
  13679. return valueStr + binding.suffix;
  13680. }
  13681. /**
  13682. * @fileoverview added by tsickle
  13683. * @suppress {checkTypes} checked by tsc
  13684. */
  13685. /**
  13686. * @license
  13687. * Copyright Google Inc. All Rights Reserved.
  13688. *
  13689. * Use of this source code is governed by an MIT-style license that can be
  13690. * found in the LICENSE file at https://angular.io/license
  13691. */
  13692. /**
  13693. * @param {?} flags
  13694. * @param {?} nodes
  13695. * @param {?=} updateDirectives
  13696. * @param {?=} updateRenderer
  13697. * @return {?}
  13698. */
  13699. function viewDef(flags, nodes, updateDirectives, updateRenderer) {
  13700. // clone nodes and set auto calculated values
  13701. var /** @type {?} */ viewBindingCount = 0;
  13702. var /** @type {?} */ viewDisposableCount = 0;
  13703. var /** @type {?} */ viewNodeFlags = 0;
  13704. var /** @type {?} */ viewRootNodeFlags = 0;
  13705. var /** @type {?} */ viewMatchedQueries = 0;
  13706. var /** @type {?} */ currentParent = null;
  13707. var /** @type {?} */ currentRenderParent = null;
  13708. var /** @type {?} */ currentElementHasPublicProviders = false;
  13709. var /** @type {?} */ currentElementHasPrivateProviders = false;
  13710. var /** @type {?} */ lastRenderRootNode = null;
  13711. for (var /** @type {?} */ i = 0; i < nodes.length; i++) {
  13712. var /** @type {?} */ node = nodes[i];
  13713. node.nodeIndex = i;
  13714. node.parent = currentParent;
  13715. node.bindingIndex = viewBindingCount;
  13716. node.outputIndex = viewDisposableCount;
  13717. node.renderParent = currentRenderParent;
  13718. viewNodeFlags |= node.flags;
  13719. viewMatchedQueries |= node.matchedQueryIds;
  13720. if (node.element) {
  13721. var /** @type {?} */ elDef = node.element;
  13722. elDef.publicProviders =
  13723. currentParent ? /** @type {?} */ ((currentParent.element)).publicProviders : Object.create(null);
  13724. elDef.allProviders = elDef.publicProviders;
  13725. // Note: We assume that all providers of an element are before any child element!
  13726. currentElementHasPublicProviders = false;
  13727. currentElementHasPrivateProviders = false;
  13728. if (node.element.template) {
  13729. viewMatchedQueries |= node.element.template.nodeMatchedQueries;
  13730. }
  13731. }
  13732. validateNode(currentParent, node, nodes.length);
  13733. viewBindingCount += node.bindings.length;
  13734. viewDisposableCount += node.outputs.length;
  13735. if (!currentRenderParent && (node.flags & 3 /* CatRenderNode */)) {
  13736. lastRenderRootNode = node;
  13737. }
  13738. if (node.flags & 20224 /* CatProvider */) {
  13739. if (!currentElementHasPublicProviders) {
  13740. currentElementHasPublicProviders = true; /** @type {?} */
  13741. ((/** @type {?} */ ((currentParent)).element)).publicProviders = Object.create(/** @type {?} */ ((/** @type {?} */ ((currentParent)).element)).publicProviders); /** @type {?} */
  13742. ((/** @type {?} */ ((currentParent)).element)).allProviders = /** @type {?} */ ((/** @type {?} */ ((currentParent)).element)).publicProviders;
  13743. }
  13744. var /** @type {?} */ isPrivateService = (node.flags & 8192 /* PrivateProvider */) !== 0;
  13745. var /** @type {?} */ isComponent = (node.flags & 32768 /* Component */) !== 0;
  13746. if (!isPrivateService || isComponent) {
  13747. /** @type {?} */ ((/** @type {?} */ ((/** @type {?} */ ((currentParent)).element)).publicProviders))[tokenKey(/** @type {?} */ ((node.provider)).token)] = node;
  13748. }
  13749. else {
  13750. if (!currentElementHasPrivateProviders) {
  13751. currentElementHasPrivateProviders = true; /** @type {?} */
  13752. ((/** @type {?} */ ((currentParent)).element)).allProviders = Object.create(/** @type {?} */ ((/** @type {?} */ ((currentParent)).element)).publicProviders);
  13753. } /** @type {?} */
  13754. ((/** @type {?} */ ((/** @type {?} */ ((currentParent)).element)).allProviders))[tokenKey(/** @type {?} */ ((node.provider)).token)] = node;
  13755. }
  13756. if (isComponent) {
  13757. /** @type {?} */ ((/** @type {?} */ ((currentParent)).element)).componentProvider = node;
  13758. }
  13759. }
  13760. if (currentParent) {
  13761. currentParent.childFlags |= node.flags;
  13762. currentParent.directChildFlags |= node.flags;
  13763. currentParent.childMatchedQueries |= node.matchedQueryIds;
  13764. if (node.element && node.element.template) {
  13765. currentParent.childMatchedQueries |= node.element.template.nodeMatchedQueries;
  13766. }
  13767. }
  13768. else {
  13769. viewRootNodeFlags |= node.flags;
  13770. }
  13771. if (node.childCount > 0) {
  13772. currentParent = node;
  13773. if (!isNgContainer(node)) {
  13774. currentRenderParent = node;
  13775. }
  13776. }
  13777. else {
  13778. // When the current node has no children, check if it is the last children of its parent.
  13779. // When it is, propagate the flags up.
  13780. // The loop is required because an element could be the last transitive children of several
  13781. // elements. We loop to either the root or the highest opened element (= with remaining
  13782. // children)
  13783. while (currentParent && i === currentParent.nodeIndex + currentParent.childCount) {
  13784. var /** @type {?} */ newParent = currentParent.parent;
  13785. if (newParent) {
  13786. newParent.childFlags |= currentParent.childFlags;
  13787. newParent.childMatchedQueries |= currentParent.childMatchedQueries;
  13788. }
  13789. currentParent = newParent;
  13790. // We also need to update the render parent & account for ng-container
  13791. if (currentParent && isNgContainer(currentParent)) {
  13792. currentRenderParent = currentParent.renderParent;
  13793. }
  13794. else {
  13795. currentRenderParent = currentParent;
  13796. }
  13797. }
  13798. }
  13799. }
  13800. var /** @type {?} */ handleEvent = function (view, nodeIndex, eventName, event) { return ((/** @type {?} */ ((nodes[nodeIndex].element)).handleEvent))(view, eventName, event); };
  13801. return {
  13802. // Will be filled later...
  13803. factory: null,
  13804. nodeFlags: viewNodeFlags,
  13805. rootNodeFlags: viewRootNodeFlags,
  13806. nodeMatchedQueries: viewMatchedQueries, flags: flags,
  13807. nodes: nodes,
  13808. updateDirectives: updateDirectives || NOOP,
  13809. updateRenderer: updateRenderer || NOOP, handleEvent: handleEvent,
  13810. bindingCount: viewBindingCount,
  13811. outputCount: viewDisposableCount, lastRenderRootNode: lastRenderRootNode
  13812. };
  13813. }
  13814. /**
  13815. * @param {?} node
  13816. * @return {?}
  13817. */
  13818. function isNgContainer(node) {
  13819. return (node.flags & 1 /* TypeElement */) !== 0 && /** @type {?} */ ((node.element)).name === null;
  13820. }
  13821. /**
  13822. * @param {?} parent
  13823. * @param {?} node
  13824. * @param {?} nodeCount
  13825. * @return {?}
  13826. */
  13827. function validateNode(parent, node, nodeCount) {
  13828. var /** @type {?} */ template = node.element && node.element.template;
  13829. if (template) {
  13830. if (!template.lastRenderRootNode) {
  13831. throw new Error("Illegal State: Embedded templates without nodes are not allowed!");
  13832. }
  13833. if (template.lastRenderRootNode &&
  13834. template.lastRenderRootNode.flags & 16777216 /* EmbeddedViews */) {
  13835. throw new Error("Illegal State: Last root node of a template can't have embedded views, at index " + node.nodeIndex + "!");
  13836. }
  13837. }
  13838. if (node.flags & 20224 /* CatProvider */) {
  13839. var /** @type {?} */ parentFlags = parent ? parent.flags : 0;
  13840. if ((parentFlags & 1 /* TypeElement */) === 0) {
  13841. throw new Error("Illegal State: StaticProvider/Directive nodes need to be children of elements or anchors, at index " + node.nodeIndex + "!");
  13842. }
  13843. }
  13844. if (node.query) {
  13845. if (node.flags & 67108864 /* TypeContentQuery */ &&
  13846. (!parent || (parent.flags & 16384 /* TypeDirective */) === 0)) {
  13847. throw new Error("Illegal State: Content Query nodes need to be children of directives, at index " + node.nodeIndex + "!");
  13848. }
  13849. if (node.flags & 134217728 /* TypeViewQuery */ && parent) {
  13850. throw new Error("Illegal State: View Query nodes have to be top level nodes, at index " + node.nodeIndex + "!");
  13851. }
  13852. }
  13853. if (node.childCount) {
  13854. var /** @type {?} */ parentEnd = parent ? parent.nodeIndex + parent.childCount : nodeCount - 1;
  13855. if (node.nodeIndex <= parentEnd && node.nodeIndex + node.childCount > parentEnd) {
  13856. throw new Error("Illegal State: childCount of node leads outside of parent, at index " + node.nodeIndex + "!");
  13857. }
  13858. }
  13859. }
  13860. /**
  13861. * @param {?} parent
  13862. * @param {?} anchorDef
  13863. * @param {?} viewDef
  13864. * @param {?=} context
  13865. * @return {?}
  13866. */
  13867. function createEmbeddedView(parent, anchorDef$$1, viewDef, context) {
  13868. // embedded views are seen as siblings to the anchor, so we need
  13869. // to get the parent of the anchor and use it as parentIndex.
  13870. var /** @type {?} */ view = createView(parent.root, parent.renderer, parent, anchorDef$$1, viewDef);
  13871. initView(view, parent.component, context);
  13872. createViewNodes(view);
  13873. return view;
  13874. }
  13875. /**
  13876. * @param {?} root
  13877. * @param {?} def
  13878. * @param {?=} context
  13879. * @return {?}
  13880. */
  13881. function createRootView(root, def, context) {
  13882. var /** @type {?} */ view = createView(root, root.renderer, null, null, def);
  13883. initView(view, context, context);
  13884. createViewNodes(view);
  13885. return view;
  13886. }
  13887. /**
  13888. * @param {?} parentView
  13889. * @param {?} nodeDef
  13890. * @param {?} viewDef
  13891. * @param {?} hostElement
  13892. * @return {?}
  13893. */
  13894. function createComponentView(parentView, nodeDef, viewDef, hostElement) {
  13895. var /** @type {?} */ rendererType = /** @type {?} */ ((nodeDef.element)).componentRendererType;
  13896. var /** @type {?} */ compRenderer;
  13897. if (!rendererType) {
  13898. compRenderer = parentView.root.renderer;
  13899. }
  13900. else {
  13901. compRenderer = parentView.root.rendererFactory.createRenderer(hostElement, rendererType);
  13902. }
  13903. return createView(parentView.root, compRenderer, parentView, /** @type {?} */ ((nodeDef.element)).componentProvider, viewDef);
  13904. }
  13905. /**
  13906. * @param {?} root
  13907. * @param {?} renderer
  13908. * @param {?} parent
  13909. * @param {?} parentNodeDef
  13910. * @param {?} def
  13911. * @return {?}
  13912. */
  13913. function createView(root, renderer, parent, parentNodeDef, def) {
  13914. var /** @type {?} */ nodes = new Array(def.nodes.length);
  13915. var /** @type {?} */ disposables = def.outputCount ? new Array(def.outputCount) : null;
  13916. var /** @type {?} */ view = {
  13917. def: def,
  13918. parent: parent,
  13919. viewContainerParent: null, parentNodeDef: parentNodeDef,
  13920. context: null,
  13921. component: null, nodes: nodes,
  13922. state: 13 /* CatInit */, root: root, renderer: renderer,
  13923. oldValues: new Array(def.bindingCount), disposables: disposables,
  13924. initIndex: -1
  13925. };
  13926. return view;
  13927. }
  13928. /**
  13929. * @param {?} view
  13930. * @param {?} component
  13931. * @param {?} context
  13932. * @return {?}
  13933. */
  13934. function initView(view, component, context) {
  13935. view.component = component;
  13936. view.context = context;
  13937. }
  13938. /**
  13939. * @param {?} view
  13940. * @return {?}
  13941. */
  13942. function createViewNodes(view) {
  13943. var /** @type {?} */ renderHost;
  13944. if (isComponentView(view)) {
  13945. var /** @type {?} */ hostDef = view.parentNodeDef;
  13946. renderHost = asElementData(/** @type {?} */ ((view.parent)), /** @type {?} */ ((/** @type {?} */ ((hostDef)).parent)).nodeIndex).renderElement;
  13947. }
  13948. var /** @type {?} */ def = view.def;
  13949. var /** @type {?} */ nodes = view.nodes;
  13950. for (var /** @type {?} */ i = 0; i < def.nodes.length; i++) {
  13951. var /** @type {?} */ nodeDef = def.nodes[i];
  13952. Services.setCurrentNode(view, i);
  13953. var /** @type {?} */ nodeData = void 0;
  13954. switch (nodeDef.flags & 201347067 /* Types */) {
  13955. case 1 /* TypeElement */:
  13956. var /** @type {?} */ el = /** @type {?} */ (createElement(view, renderHost, nodeDef));
  13957. var /** @type {?} */ componentView = /** @type {?} */ ((undefined));
  13958. if (nodeDef.flags & 33554432 /* ComponentView */) {
  13959. var /** @type {?} */ compViewDef = resolveDefinition(/** @type {?} */ ((/** @type {?} */ ((nodeDef.element)).componentView)));
  13960. componentView = Services.createComponentView(view, nodeDef, compViewDef, el);
  13961. }
  13962. listenToElementOutputs(view, componentView, nodeDef, el);
  13963. nodeData = /** @type {?} */ ({
  13964. renderElement: el,
  13965. componentView: componentView,
  13966. viewContainer: null,
  13967. template: /** @type {?} */ ((nodeDef.element)).template ? createTemplateData(view, nodeDef) : undefined
  13968. });
  13969. if (nodeDef.flags & 16777216 /* EmbeddedViews */) {
  13970. nodeData.viewContainer = createViewContainerData(view, nodeDef, nodeData);
  13971. }
  13972. break;
  13973. case 2 /* TypeText */:
  13974. nodeData = /** @type {?} */ (createText(view, renderHost, nodeDef));
  13975. break;
  13976. case 512 /* TypeClassProvider */:
  13977. case 1024 /* TypeFactoryProvider */:
  13978. case 2048 /* TypeUseExistingProvider */:
  13979. case 256 /* TypeValueProvider */: {
  13980. nodeData = nodes[i];
  13981. if (!nodeData && !(nodeDef.flags & 4096 /* LazyProvider */)) {
  13982. var /** @type {?} */ instance = createProviderInstance(view, nodeDef);
  13983. nodeData = /** @type {?} */ ({ instance: instance });
  13984. }
  13985. break;
  13986. }
  13987. case 16 /* TypePipe */: {
  13988. var /** @type {?} */ instance = createPipeInstance(view, nodeDef);
  13989. nodeData = /** @type {?} */ ({ instance: instance });
  13990. break;
  13991. }
  13992. case 16384 /* TypeDirective */: {
  13993. nodeData = nodes[i];
  13994. if (!nodeData) {
  13995. var /** @type {?} */ instance = createDirectiveInstance(view, nodeDef);
  13996. nodeData = /** @type {?} */ ({ instance: instance });
  13997. }
  13998. if (nodeDef.flags & 32768 /* Component */) {
  13999. var /** @type {?} */ compView = asElementData(view, /** @type {?} */ ((nodeDef.parent)).nodeIndex).componentView;
  14000. initView(compView, nodeData.instance, nodeData.instance);
  14001. }
  14002. break;
  14003. }
  14004. case 32 /* TypePureArray */:
  14005. case 64 /* TypePureObject */:
  14006. case 128 /* TypePurePipe */:
  14007. nodeData = /** @type {?} */ (createPureExpression(view, nodeDef));
  14008. break;
  14009. case 67108864 /* TypeContentQuery */:
  14010. case 134217728 /* TypeViewQuery */:
  14011. nodeData = /** @type {?} */ (createQuery());
  14012. break;
  14013. case 8 /* TypeNgContent */:
  14014. appendNgContent(view, renderHost, nodeDef);
  14015. // no runtime data needed for NgContent...
  14016. nodeData = undefined;
  14017. break;
  14018. }
  14019. nodes[i] = nodeData;
  14020. }
  14021. // Create the ViewData.nodes of component views after we created everything else,
  14022. // so that e.g. ng-content works
  14023. execComponentViewsAction(view, ViewAction.CreateViewNodes);
  14024. // fill static content and view queries
  14025. execQueriesAction(view, 67108864 /* TypeContentQuery */ | 134217728 /* TypeViewQuery */, 268435456 /* StaticQuery */, 0 /* CheckAndUpdate */);
  14026. }
  14027. /**
  14028. * @param {?} view
  14029. * @return {?}
  14030. */
  14031. function checkNoChangesView(view) {
  14032. markProjectedViewsForCheck(view);
  14033. Services.updateDirectives(view, 1 /* CheckNoChanges */);
  14034. execEmbeddedViewsAction(view, ViewAction.CheckNoChanges);
  14035. Services.updateRenderer(view, 1 /* CheckNoChanges */);
  14036. execComponentViewsAction(view, ViewAction.CheckNoChanges);
  14037. // Note: We don't check queries for changes as we didn't do this in v2.x.
  14038. // TODO(tbosch): investigate if we can enable the check again in v5.x with a nicer error message.
  14039. view.state &= ~(64 /* CheckProjectedViews */ | 32 /* CheckProjectedView */);
  14040. }
  14041. /**
  14042. * @param {?} view
  14043. * @return {?}
  14044. */
  14045. function checkAndUpdateView(view) {
  14046. if (view.state & 1 /* BeforeFirstCheck */) {
  14047. view.state &= ~1 /* BeforeFirstCheck */;
  14048. view.state |= 2 /* FirstCheck */;
  14049. }
  14050. else {
  14051. view.state &= ~2 /* FirstCheck */;
  14052. }
  14053. shiftInitState(view, 0 /* InitState_BeforeInit */, 256 /* InitState_CallingOnInit */);
  14054. markProjectedViewsForCheck(view);
  14055. Services.updateDirectives(view, 0 /* CheckAndUpdate */);
  14056. execEmbeddedViewsAction(view, ViewAction.CheckAndUpdate);
  14057. execQueriesAction(view, 67108864 /* TypeContentQuery */, 536870912 /* DynamicQuery */, 0 /* CheckAndUpdate */);
  14058. var /** @type {?} */ callInit = shiftInitState(view, 256 /* InitState_CallingOnInit */, 512 /* InitState_CallingAfterContentInit */);
  14059. callLifecycleHooksChildrenFirst(view, 2097152 /* AfterContentChecked */ | (callInit ? 1048576 /* AfterContentInit */ : 0));
  14060. Services.updateRenderer(view, 0 /* CheckAndUpdate */);
  14061. execComponentViewsAction(view, ViewAction.CheckAndUpdate);
  14062. execQueriesAction(view, 134217728 /* TypeViewQuery */, 536870912 /* DynamicQuery */, 0 /* CheckAndUpdate */);
  14063. callInit = shiftInitState(view, 512 /* InitState_CallingAfterContentInit */, 768 /* InitState_CallingAfterViewInit */);
  14064. callLifecycleHooksChildrenFirst(view, 8388608 /* AfterViewChecked */ | (callInit ? 4194304 /* AfterViewInit */ : 0));
  14065. if (view.def.flags & 2 /* OnPush */) {
  14066. view.state &= ~8 /* ChecksEnabled */;
  14067. }
  14068. view.state &= ~(64 /* CheckProjectedViews */ | 32 /* CheckProjectedView */);
  14069. shiftInitState(view, 768 /* InitState_CallingAfterViewInit */, 1024 /* InitState_AfterInit */);
  14070. }
  14071. /**
  14072. * @param {?} view
  14073. * @param {?} nodeDef
  14074. * @param {?} argStyle
  14075. * @param {?=} v0
  14076. * @param {?=} v1
  14077. * @param {?=} v2
  14078. * @param {?=} v3
  14079. * @param {?=} v4
  14080. * @param {?=} v5
  14081. * @param {?=} v6
  14082. * @param {?=} v7
  14083. * @param {?=} v8
  14084. * @param {?=} v9
  14085. * @return {?}
  14086. */
  14087. function checkAndUpdateNode(view, nodeDef, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {
  14088. if (argStyle === 0 /* Inline */) {
  14089. return checkAndUpdateNodeInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
  14090. }
  14091. else {
  14092. return checkAndUpdateNodeDynamic(view, nodeDef, v0);
  14093. }
  14094. }
  14095. /**
  14096. * @param {?} view
  14097. * @return {?}
  14098. */
  14099. function markProjectedViewsForCheck(view) {
  14100. var /** @type {?} */ def = view.def;
  14101. if (!(def.nodeFlags & 4 /* ProjectedTemplate */)) {
  14102. return;
  14103. }
  14104. for (var /** @type {?} */ i = 0; i < def.nodes.length; i++) {
  14105. var /** @type {?} */ nodeDef = def.nodes[i];
  14106. if (nodeDef.flags & 4 /* ProjectedTemplate */) {
  14107. var /** @type {?} */ projectedViews = asElementData(view, i).template._projectedViews;
  14108. if (projectedViews) {
  14109. for (var /** @type {?} */ i_1 = 0; i_1 < projectedViews.length; i_1++) {
  14110. var /** @type {?} */ projectedView = projectedViews[i_1];
  14111. projectedView.state |= 32 /* CheckProjectedView */;
  14112. markParentViewsForCheckProjectedViews(projectedView, view);
  14113. }
  14114. }
  14115. }
  14116. else if ((nodeDef.childFlags & 4 /* ProjectedTemplate */) === 0) {
  14117. // a parent with leafs
  14118. // no child is a component,
  14119. // then skip the children
  14120. i += nodeDef.childCount;
  14121. }
  14122. }
  14123. }
  14124. /**
  14125. * @param {?} view
  14126. * @param {?} nodeDef
  14127. * @param {?=} v0
  14128. * @param {?=} v1
  14129. * @param {?=} v2
  14130. * @param {?=} v3
  14131. * @param {?=} v4
  14132. * @param {?=} v5
  14133. * @param {?=} v6
  14134. * @param {?=} v7
  14135. * @param {?=} v8
  14136. * @param {?=} v9
  14137. * @return {?}
  14138. */
  14139. function checkAndUpdateNodeInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {
  14140. switch (nodeDef.flags & 201347067 /* Types */) {
  14141. case 1 /* TypeElement */:
  14142. return checkAndUpdateElementInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
  14143. case 2 /* TypeText */:
  14144. return checkAndUpdateTextInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
  14145. case 16384 /* TypeDirective */:
  14146. return checkAndUpdateDirectiveInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
  14147. case 32 /* TypePureArray */:
  14148. case 64 /* TypePureObject */:
  14149. case 128 /* TypePurePipe */:
  14150. return checkAndUpdatePureExpressionInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
  14151. default:
  14152. throw 'unreachable';
  14153. }
  14154. }
  14155. /**
  14156. * @param {?} view
  14157. * @param {?} nodeDef
  14158. * @param {?} values
  14159. * @return {?}
  14160. */
  14161. function checkAndUpdateNodeDynamic(view, nodeDef, values) {
  14162. switch (nodeDef.flags & 201347067 /* Types */) {
  14163. case 1 /* TypeElement */:
  14164. return checkAndUpdateElementDynamic(view, nodeDef, values);
  14165. case 2 /* TypeText */:
  14166. return checkAndUpdateTextDynamic(view, nodeDef, values);
  14167. case 16384 /* TypeDirective */:
  14168. return checkAndUpdateDirectiveDynamic(view, nodeDef, values);
  14169. case 32 /* TypePureArray */:
  14170. case 64 /* TypePureObject */:
  14171. case 128 /* TypePurePipe */:
  14172. return checkAndUpdatePureExpressionDynamic(view, nodeDef, values);
  14173. default:
  14174. throw 'unreachable';
  14175. }
  14176. }
  14177. /**
  14178. * @param {?} view
  14179. * @param {?} nodeDef
  14180. * @param {?} argStyle
  14181. * @param {?=} v0
  14182. * @param {?=} v1
  14183. * @param {?=} v2
  14184. * @param {?=} v3
  14185. * @param {?=} v4
  14186. * @param {?=} v5
  14187. * @param {?=} v6
  14188. * @param {?=} v7
  14189. * @param {?=} v8
  14190. * @param {?=} v9
  14191. * @return {?}
  14192. */
  14193. function checkNoChangesNode(view, nodeDef, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {
  14194. if (argStyle === 0 /* Inline */) {
  14195. checkNoChangesNodeInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
  14196. }
  14197. else {
  14198. checkNoChangesNodeDynamic(view, nodeDef, v0);
  14199. }
  14200. // Returning false is ok here as we would have thrown in case of a change.
  14201. return false;
  14202. }
  14203. /**
  14204. * @param {?} view
  14205. * @param {?} nodeDef
  14206. * @param {?} v0
  14207. * @param {?} v1
  14208. * @param {?} v2
  14209. * @param {?} v3
  14210. * @param {?} v4
  14211. * @param {?} v5
  14212. * @param {?} v6
  14213. * @param {?} v7
  14214. * @param {?} v8
  14215. * @param {?} v9
  14216. * @return {?}
  14217. */
  14218. function checkNoChangesNodeInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {
  14219. var /** @type {?} */ bindLen = nodeDef.bindings.length;
  14220. if (bindLen > 0)
  14221. checkBindingNoChanges(view, nodeDef, 0, v0);
  14222. if (bindLen > 1)
  14223. checkBindingNoChanges(view, nodeDef, 1, v1);
  14224. if (bindLen > 2)
  14225. checkBindingNoChanges(view, nodeDef, 2, v2);
  14226. if (bindLen > 3)
  14227. checkBindingNoChanges(view, nodeDef, 3, v3);
  14228. if (bindLen > 4)
  14229. checkBindingNoChanges(view, nodeDef, 4, v4);
  14230. if (bindLen > 5)
  14231. checkBindingNoChanges(view, nodeDef, 5, v5);
  14232. if (bindLen > 6)
  14233. checkBindingNoChanges(view, nodeDef, 6, v6);
  14234. if (bindLen > 7)
  14235. checkBindingNoChanges(view, nodeDef, 7, v7);
  14236. if (bindLen > 8)
  14237. checkBindingNoChanges(view, nodeDef, 8, v8);
  14238. if (bindLen > 9)
  14239. checkBindingNoChanges(view, nodeDef, 9, v9);
  14240. }
  14241. /**
  14242. * @param {?} view
  14243. * @param {?} nodeDef
  14244. * @param {?} values
  14245. * @return {?}
  14246. */
  14247. function checkNoChangesNodeDynamic(view, nodeDef, values) {
  14248. for (var /** @type {?} */ i = 0; i < values.length; i++) {
  14249. checkBindingNoChanges(view, nodeDef, i, values[i]);
  14250. }
  14251. }
  14252. /**
  14253. * Workaround https://github.com/angular/tsickle/issues/497
  14254. * @suppress {misplacedTypeAnnotation}
  14255. * @param {?} view
  14256. * @param {?} nodeDef
  14257. * @return {?}
  14258. */
  14259. function checkNoChangesQuery(view, nodeDef) {
  14260. var /** @type {?} */ queryList = asQueryList(view, nodeDef.nodeIndex);
  14261. if (queryList.dirty) {
  14262. throw expressionChangedAfterItHasBeenCheckedError(Services.createDebugContext(view, nodeDef.nodeIndex), "Query " + (/** @type {?} */ ((nodeDef.query))).id + " not dirty", "Query " + (/** @type {?} */ ((nodeDef.query))).id + " dirty", (view.state & 1 /* BeforeFirstCheck */) !== 0);
  14263. }
  14264. }
  14265. /**
  14266. * @param {?} view
  14267. * @return {?}
  14268. */
  14269. function destroyView(view) {
  14270. if (view.state & 128 /* Destroyed */) {
  14271. return;
  14272. }
  14273. execEmbeddedViewsAction(view, ViewAction.Destroy);
  14274. execComponentViewsAction(view, ViewAction.Destroy);
  14275. callLifecycleHooksChildrenFirst(view, 131072 /* OnDestroy */);
  14276. if (view.disposables) {
  14277. for (var /** @type {?} */ i = 0; i < view.disposables.length; i++) {
  14278. view.disposables[i]();
  14279. }
  14280. }
  14281. detachProjectedView(view);
  14282. if (view.renderer.destroyNode) {
  14283. destroyViewNodes(view);
  14284. }
  14285. if (isComponentView(view)) {
  14286. view.renderer.destroy();
  14287. }
  14288. view.state |= 128 /* Destroyed */;
  14289. }
  14290. /**
  14291. * @param {?} view
  14292. * @return {?}
  14293. */
  14294. function destroyViewNodes(view) {
  14295. var /** @type {?} */ len = view.def.nodes.length;
  14296. for (var /** @type {?} */ i = 0; i < len; i++) {
  14297. var /** @type {?} */ def = view.def.nodes[i];
  14298. if (def.flags & 1 /* TypeElement */) {
  14299. /** @type {?} */ ((view.renderer.destroyNode))(asElementData(view, i).renderElement);
  14300. }
  14301. else if (def.flags & 2 /* TypeText */) {
  14302. /** @type {?} */ ((view.renderer.destroyNode))(asTextData(view, i).renderText);
  14303. }
  14304. else if (def.flags & 67108864 /* TypeContentQuery */ || def.flags & 134217728 /* TypeViewQuery */) {
  14305. asQueryList(view, i).destroy();
  14306. }
  14307. }
  14308. }
  14309. /** @enum {number} */
  14310. var ViewAction = {
  14311. CreateViewNodes: 0,
  14312. CheckNoChanges: 1,
  14313. CheckNoChangesProjectedViews: 2,
  14314. CheckAndUpdate: 3,
  14315. CheckAndUpdateProjectedViews: 4,
  14316. Destroy: 5,
  14317. };
  14318. ViewAction[ViewAction.CreateViewNodes] = "CreateViewNodes";
  14319. ViewAction[ViewAction.CheckNoChanges] = "CheckNoChanges";
  14320. ViewAction[ViewAction.CheckNoChangesProjectedViews] = "CheckNoChangesProjectedViews";
  14321. ViewAction[ViewAction.CheckAndUpdate] = "CheckAndUpdate";
  14322. ViewAction[ViewAction.CheckAndUpdateProjectedViews] = "CheckAndUpdateProjectedViews";
  14323. ViewAction[ViewAction.Destroy] = "Destroy";
  14324. /**
  14325. * @param {?} view
  14326. * @param {?} action
  14327. * @return {?}
  14328. */
  14329. function execComponentViewsAction(view, action) {
  14330. var /** @type {?} */ def = view.def;
  14331. if (!(def.nodeFlags & 33554432 /* ComponentView */)) {
  14332. return;
  14333. }
  14334. for (var /** @type {?} */ i = 0; i < def.nodes.length; i++) {
  14335. var /** @type {?} */ nodeDef = def.nodes[i];
  14336. if (nodeDef.flags & 33554432 /* ComponentView */) {
  14337. // a leaf
  14338. callViewAction(asElementData(view, i).componentView, action);
  14339. }
  14340. else if ((nodeDef.childFlags & 33554432 /* ComponentView */) === 0) {
  14341. // a parent with leafs
  14342. // no child is a component,
  14343. // then skip the children
  14344. i += nodeDef.childCount;
  14345. }
  14346. }
  14347. }
  14348. /**
  14349. * @param {?} view
  14350. * @param {?} action
  14351. * @return {?}
  14352. */
  14353. function execEmbeddedViewsAction(view, action) {
  14354. var /** @type {?} */ def = view.def;
  14355. if (!(def.nodeFlags & 16777216 /* EmbeddedViews */)) {
  14356. return;
  14357. }
  14358. for (var /** @type {?} */ i = 0; i < def.nodes.length; i++) {
  14359. var /** @type {?} */ nodeDef = def.nodes[i];
  14360. if (nodeDef.flags & 16777216 /* EmbeddedViews */) {
  14361. // a leaf
  14362. var /** @type {?} */ embeddedViews = /** @type {?} */ ((asElementData(view, i).viewContainer))._embeddedViews;
  14363. for (var /** @type {?} */ k = 0; k < embeddedViews.length; k++) {
  14364. callViewAction(embeddedViews[k], action);
  14365. }
  14366. }
  14367. else if ((nodeDef.childFlags & 16777216 /* EmbeddedViews */) === 0) {
  14368. // a parent with leafs
  14369. // no child is a component,
  14370. // then skip the children
  14371. i += nodeDef.childCount;
  14372. }
  14373. }
  14374. }
  14375. /**
  14376. * @param {?} view
  14377. * @param {?} action
  14378. * @return {?}
  14379. */
  14380. function callViewAction(view, action) {
  14381. var /** @type {?} */ viewState = view.state;
  14382. switch (action) {
  14383. case ViewAction.CheckNoChanges:
  14384. if ((viewState & 128 /* Destroyed */) === 0) {
  14385. if ((viewState & 12 /* CatDetectChanges */) === 12 /* CatDetectChanges */) {
  14386. checkNoChangesView(view);
  14387. }
  14388. else if (viewState & 64 /* CheckProjectedViews */) {
  14389. execProjectedViewsAction(view, ViewAction.CheckNoChangesProjectedViews);
  14390. }
  14391. }
  14392. break;
  14393. case ViewAction.CheckNoChangesProjectedViews:
  14394. if ((viewState & 128 /* Destroyed */) === 0) {
  14395. if (viewState & 32 /* CheckProjectedView */) {
  14396. checkNoChangesView(view);
  14397. }
  14398. else if (viewState & 64 /* CheckProjectedViews */) {
  14399. execProjectedViewsAction(view, action);
  14400. }
  14401. }
  14402. break;
  14403. case ViewAction.CheckAndUpdate:
  14404. if ((viewState & 128 /* Destroyed */) === 0) {
  14405. if ((viewState & 12 /* CatDetectChanges */) === 12 /* CatDetectChanges */) {
  14406. checkAndUpdateView(view);
  14407. }
  14408. else if (viewState & 64 /* CheckProjectedViews */) {
  14409. execProjectedViewsAction(view, ViewAction.CheckAndUpdateProjectedViews);
  14410. }
  14411. }
  14412. break;
  14413. case ViewAction.CheckAndUpdateProjectedViews:
  14414. if ((viewState & 128 /* Destroyed */) === 0) {
  14415. if (viewState & 32 /* CheckProjectedView */) {
  14416. checkAndUpdateView(view);
  14417. }
  14418. else if (viewState & 64 /* CheckProjectedViews */) {
  14419. execProjectedViewsAction(view, action);
  14420. }
  14421. }
  14422. break;
  14423. case ViewAction.Destroy:
  14424. // Note: destroyView recurses over all views,
  14425. // so we don't need to special case projected views here.
  14426. destroyView(view);
  14427. break;
  14428. case ViewAction.CreateViewNodes:
  14429. createViewNodes(view);
  14430. break;
  14431. }
  14432. }
  14433. /**
  14434. * @param {?} view
  14435. * @param {?} action
  14436. * @return {?}
  14437. */
  14438. function execProjectedViewsAction(view, action) {
  14439. execEmbeddedViewsAction(view, action);
  14440. execComponentViewsAction(view, action);
  14441. }
  14442. /**
  14443. * @param {?} view
  14444. * @param {?} queryFlags
  14445. * @param {?} staticDynamicQueryFlag
  14446. * @param {?} checkType
  14447. * @return {?}
  14448. */
  14449. function execQueriesAction(view, queryFlags, staticDynamicQueryFlag, checkType) {
  14450. if (!(view.def.nodeFlags & queryFlags) || !(view.def.nodeFlags & staticDynamicQueryFlag)) {
  14451. return;
  14452. }
  14453. var /** @type {?} */ nodeCount = view.def.nodes.length;
  14454. for (var /** @type {?} */ i = 0; i < nodeCount; i++) {
  14455. var /** @type {?} */ nodeDef = view.def.nodes[i];
  14456. if ((nodeDef.flags & queryFlags) && (nodeDef.flags & staticDynamicQueryFlag)) {
  14457. Services.setCurrentNode(view, nodeDef.nodeIndex);
  14458. switch (checkType) {
  14459. case 0 /* CheckAndUpdate */:
  14460. checkAndUpdateQuery(view, nodeDef);
  14461. break;
  14462. case 1 /* CheckNoChanges */:
  14463. checkNoChangesQuery(view, nodeDef);
  14464. break;
  14465. }
  14466. }
  14467. if (!(nodeDef.childFlags & queryFlags) || !(nodeDef.childFlags & staticDynamicQueryFlag)) {
  14468. // no child has a matching query
  14469. // then skip the children
  14470. i += nodeDef.childCount;
  14471. }
  14472. }
  14473. }
  14474. /**
  14475. * @fileoverview added by tsickle
  14476. * @suppress {checkTypes} checked by tsc
  14477. */
  14478. /**
  14479. * @license
  14480. * Copyright Google Inc. All Rights Reserved.
  14481. *
  14482. * Use of this source code is governed by an MIT-style license that can be
  14483. * found in the LICENSE file at https://angular.io/license
  14484. */
  14485. var initialized = false;
  14486. /**
  14487. * @return {?}
  14488. */
  14489. function initServicesIfNeeded() {
  14490. if (initialized) {
  14491. return;
  14492. }
  14493. initialized = true;
  14494. var /** @type {?} */ services = isDevMode() ? createDebugServices() : createProdServices();
  14495. Services.setCurrentNode = services.setCurrentNode;
  14496. Services.createRootView = services.createRootView;
  14497. Services.createEmbeddedView = services.createEmbeddedView;
  14498. Services.createComponentView = services.createComponentView;
  14499. Services.createNgModuleRef = services.createNgModuleRef;
  14500. Services.overrideProvider = services.overrideProvider;
  14501. Services.overrideComponentView = services.overrideComponentView;
  14502. Services.clearOverrides = services.clearOverrides;
  14503. Services.checkAndUpdateView = services.checkAndUpdateView;
  14504. Services.checkNoChangesView = services.checkNoChangesView;
  14505. Services.destroyView = services.destroyView;
  14506. Services.resolveDep = resolveDep;
  14507. Services.createDebugContext = services.createDebugContext;
  14508. Services.handleEvent = services.handleEvent;
  14509. Services.updateDirectives = services.updateDirectives;
  14510. Services.updateRenderer = services.updateRenderer;
  14511. Services.dirtyParentQueries = dirtyParentQueries;
  14512. }
  14513. /**
  14514. * @return {?}
  14515. */
  14516. function createProdServices() {
  14517. return {
  14518. setCurrentNode: function () { },
  14519. createRootView: createProdRootView,
  14520. createEmbeddedView: createEmbeddedView,
  14521. createComponentView: createComponentView,
  14522. createNgModuleRef: createNgModuleRef,
  14523. overrideProvider: NOOP,
  14524. overrideComponentView: NOOP,
  14525. clearOverrides: NOOP,
  14526. checkAndUpdateView: checkAndUpdateView,
  14527. checkNoChangesView: checkNoChangesView,
  14528. destroyView: destroyView,
  14529. createDebugContext: function (view, nodeIndex) { return new DebugContext_(view, nodeIndex); },
  14530. handleEvent: function (view, nodeIndex, eventName, event) {
  14531. return view.def.handleEvent(view, nodeIndex, eventName, event);
  14532. },
  14533. updateDirectives: function (view, checkType) {
  14534. return view.def.updateDirectives(checkType === 0 /* CheckAndUpdate */ ? prodCheckAndUpdateNode :
  14535. prodCheckNoChangesNode, view);
  14536. },
  14537. updateRenderer: function (view, checkType) {
  14538. return view.def.updateRenderer(checkType === 0 /* CheckAndUpdate */ ? prodCheckAndUpdateNode :
  14539. prodCheckNoChangesNode, view);
  14540. },
  14541. };
  14542. }
  14543. /**
  14544. * @return {?}
  14545. */
  14546. function createDebugServices() {
  14547. return {
  14548. setCurrentNode: debugSetCurrentNode,
  14549. createRootView: debugCreateRootView,
  14550. createEmbeddedView: debugCreateEmbeddedView,
  14551. createComponentView: debugCreateComponentView,
  14552. createNgModuleRef: debugCreateNgModuleRef,
  14553. overrideProvider: debugOverrideProvider,
  14554. overrideComponentView: debugOverrideComponentView,
  14555. clearOverrides: debugClearOverrides,
  14556. checkAndUpdateView: debugCheckAndUpdateView,
  14557. checkNoChangesView: debugCheckNoChangesView,
  14558. destroyView: debugDestroyView,
  14559. createDebugContext: function (view, nodeIndex) { return new DebugContext_(view, nodeIndex); },
  14560. handleEvent: debugHandleEvent,
  14561. updateDirectives: debugUpdateDirectives,
  14562. updateRenderer: debugUpdateRenderer,
  14563. };
  14564. }
  14565. /**
  14566. * @param {?} elInjector
  14567. * @param {?} projectableNodes
  14568. * @param {?} rootSelectorOrNode
  14569. * @param {?} def
  14570. * @param {?} ngModule
  14571. * @param {?=} context
  14572. * @return {?}
  14573. */
  14574. function createProdRootView(elInjector, projectableNodes, rootSelectorOrNode, def, ngModule, context) {
  14575. var /** @type {?} */ rendererFactory = ngModule.injector.get(RendererFactory2);
  14576. return createRootView(createRootData(elInjector, ngModule, rendererFactory, projectableNodes, rootSelectorOrNode), def, context);
  14577. }
  14578. /**
  14579. * @param {?} elInjector
  14580. * @param {?} projectableNodes
  14581. * @param {?} rootSelectorOrNode
  14582. * @param {?} def
  14583. * @param {?} ngModule
  14584. * @param {?=} context
  14585. * @return {?}
  14586. */
  14587. function debugCreateRootView(elInjector, projectableNodes, rootSelectorOrNode, def, ngModule, context) {
  14588. var /** @type {?} */ rendererFactory = ngModule.injector.get(RendererFactory2);
  14589. var /** @type {?} */ root = createRootData(elInjector, ngModule, new DebugRendererFactory2(rendererFactory), projectableNodes, rootSelectorOrNode);
  14590. var /** @type {?} */ defWithOverride = applyProviderOverridesToView(def);
  14591. return callWithDebugContext(DebugAction.create, createRootView, null, [root, defWithOverride, context]);
  14592. }
  14593. /**
  14594. * @param {?} elInjector
  14595. * @param {?} ngModule
  14596. * @param {?} rendererFactory
  14597. * @param {?} projectableNodes
  14598. * @param {?} rootSelectorOrNode
  14599. * @return {?}
  14600. */
  14601. function createRootData(elInjector, ngModule, rendererFactory, projectableNodes, rootSelectorOrNode) {
  14602. var /** @type {?} */ sanitizer = ngModule.injector.get(Sanitizer);
  14603. var /** @type {?} */ errorHandler = ngModule.injector.get(ErrorHandler);
  14604. var /** @type {?} */ renderer = rendererFactory.createRenderer(null, null);
  14605. return {
  14606. ngModule: ngModule,
  14607. injector: elInjector, projectableNodes: projectableNodes,
  14608. selectorOrNode: rootSelectorOrNode, sanitizer: sanitizer, rendererFactory: rendererFactory, renderer: renderer, errorHandler: errorHandler
  14609. };
  14610. }
  14611. /**
  14612. * @param {?} parentView
  14613. * @param {?} anchorDef
  14614. * @param {?} viewDef
  14615. * @param {?=} context
  14616. * @return {?}
  14617. */
  14618. function debugCreateEmbeddedView(parentView, anchorDef, viewDef$$1, context) {
  14619. var /** @type {?} */ defWithOverride = applyProviderOverridesToView(viewDef$$1);
  14620. return callWithDebugContext(DebugAction.create, createEmbeddedView, null, [parentView, anchorDef, defWithOverride, context]);
  14621. }
  14622. /**
  14623. * @param {?} parentView
  14624. * @param {?} nodeDef
  14625. * @param {?} viewDef
  14626. * @param {?} hostElement
  14627. * @return {?}
  14628. */
  14629. function debugCreateComponentView(parentView, nodeDef, viewDef$$1, hostElement) {
  14630. var /** @type {?} */ overrideComponentView = viewDefOverrides.get(/** @type {?} */ ((/** @type {?} */ ((/** @type {?} */ ((nodeDef.element)).componentProvider)).provider)).token);
  14631. if (overrideComponentView) {
  14632. viewDef$$1 = overrideComponentView;
  14633. }
  14634. else {
  14635. viewDef$$1 = applyProviderOverridesToView(viewDef$$1);
  14636. }
  14637. return callWithDebugContext(DebugAction.create, createComponentView, null, [parentView, nodeDef, viewDef$$1, hostElement]);
  14638. }
  14639. /**
  14640. * @param {?} moduleType
  14641. * @param {?} parentInjector
  14642. * @param {?} bootstrapComponents
  14643. * @param {?} def
  14644. * @return {?}
  14645. */
  14646. function debugCreateNgModuleRef(moduleType, parentInjector, bootstrapComponents, def) {
  14647. var /** @type {?} */ defWithOverride = applyProviderOverridesToNgModule(def);
  14648. return createNgModuleRef(moduleType, parentInjector, bootstrapComponents, defWithOverride);
  14649. }
  14650. var providerOverrides = new Map();
  14651. var viewDefOverrides = new Map();
  14652. /**
  14653. * @param {?} override
  14654. * @return {?}
  14655. */
  14656. function debugOverrideProvider(override) {
  14657. providerOverrides.set(override.token, override);
  14658. }
  14659. /**
  14660. * @param {?} comp
  14661. * @param {?} compFactory
  14662. * @return {?}
  14663. */
  14664. function debugOverrideComponentView(comp, compFactory) {
  14665. var /** @type {?} */ hostViewDef = resolveDefinition(getComponentViewDefinitionFactory(compFactory));
  14666. var /** @type {?} */ compViewDef = resolveDefinition(/** @type {?} */ ((/** @type {?} */ ((hostViewDef.nodes[0].element)).componentView)));
  14667. viewDefOverrides.set(comp, compViewDef);
  14668. }
  14669. /**
  14670. * @return {?}
  14671. */
  14672. function debugClearOverrides() {
  14673. providerOverrides.clear();
  14674. viewDefOverrides.clear();
  14675. }
  14676. /**
  14677. * @param {?} def
  14678. * @return {?}
  14679. */
  14680. function applyProviderOverridesToView(def) {
  14681. if (providerOverrides.size === 0) {
  14682. return def;
  14683. }
  14684. var /** @type {?} */ elementIndicesWithOverwrittenProviders = findElementIndicesWithOverwrittenProviders(def);
  14685. if (elementIndicesWithOverwrittenProviders.length === 0) {
  14686. return def;
  14687. }
  14688. // clone the whole view definition,
  14689. // as it maintains references between the nodes that are hard to update.
  14690. def = /** @type {?} */ ((def.factory))(function () { return NOOP; });
  14691. for (var /** @type {?} */ i = 0; i < elementIndicesWithOverwrittenProviders.length; i++) {
  14692. applyProviderOverridesToElement(def, elementIndicesWithOverwrittenProviders[i]);
  14693. }
  14694. return def;
  14695. /**
  14696. * @param {?} def
  14697. * @return {?}
  14698. */
  14699. function findElementIndicesWithOverwrittenProviders(def) {
  14700. var /** @type {?} */ elIndicesWithOverwrittenProviders = [];
  14701. var /** @type {?} */ lastElementDef = null;
  14702. for (var /** @type {?} */ i = 0; i < def.nodes.length; i++) {
  14703. var /** @type {?} */ nodeDef = def.nodes[i];
  14704. if (nodeDef.flags & 1 /* TypeElement */) {
  14705. lastElementDef = nodeDef;
  14706. }
  14707. if (lastElementDef && nodeDef.flags & 3840 /* CatProviderNoDirective */ &&
  14708. providerOverrides.has(/** @type {?} */ ((nodeDef.provider)).token)) {
  14709. elIndicesWithOverwrittenProviders.push(/** @type {?} */ ((lastElementDef)).nodeIndex);
  14710. lastElementDef = null;
  14711. }
  14712. }
  14713. return elIndicesWithOverwrittenProviders;
  14714. }
  14715. /**
  14716. * @param {?} viewDef
  14717. * @param {?} elIndex
  14718. * @return {?}
  14719. */
  14720. function applyProviderOverridesToElement(viewDef$$1, elIndex) {
  14721. for (var /** @type {?} */ i = elIndex + 1; i < viewDef$$1.nodes.length; i++) {
  14722. var /** @type {?} */ nodeDef = viewDef$$1.nodes[i];
  14723. if (nodeDef.flags & 1 /* TypeElement */) {
  14724. // stop at the next element
  14725. return;
  14726. }
  14727. if (nodeDef.flags & 3840 /* CatProviderNoDirective */) {
  14728. var /** @type {?} */ provider = /** @type {?} */ ((nodeDef.provider));
  14729. var /** @type {?} */ override = providerOverrides.get(provider.token);
  14730. if (override) {
  14731. nodeDef.flags = (nodeDef.flags & ~3840 /* CatProviderNoDirective */) | override.flags;
  14732. provider.deps = splitDepsDsl(override.deps);
  14733. provider.value = override.value;
  14734. }
  14735. }
  14736. }
  14737. }
  14738. }
  14739. /**
  14740. * @param {?} def
  14741. * @return {?}
  14742. */
  14743. function applyProviderOverridesToNgModule(def) {
  14744. var _a = calcHasOverrides(def), hasOverrides = _a.hasOverrides, hasDeprecatedOverrides = _a.hasDeprecatedOverrides;
  14745. if (!hasOverrides) {
  14746. return def;
  14747. }
  14748. // clone the whole view definition,
  14749. // as it maintains references between the nodes that are hard to update.
  14750. def = /** @type {?} */ ((def.factory))(function () { return NOOP; });
  14751. applyProviderOverrides(def);
  14752. return def;
  14753. /**
  14754. * @param {?} def
  14755. * @return {?}
  14756. */
  14757. function calcHasOverrides(def) {
  14758. var /** @type {?} */ hasOverrides = false;
  14759. var /** @type {?} */ hasDeprecatedOverrides = false;
  14760. if (providerOverrides.size === 0) {
  14761. return { hasOverrides: hasOverrides, hasDeprecatedOverrides: hasDeprecatedOverrides };
  14762. }
  14763. def.providers.forEach(function (node) {
  14764. var /** @type {?} */ override = providerOverrides.get(node.token);
  14765. if ((node.flags & 3840 /* CatProviderNoDirective */) && override) {
  14766. hasOverrides = true;
  14767. hasDeprecatedOverrides = hasDeprecatedOverrides || override.deprecatedBehavior;
  14768. }
  14769. });
  14770. return { hasOverrides: hasOverrides, hasDeprecatedOverrides: hasDeprecatedOverrides };
  14771. }
  14772. /**
  14773. * @param {?} def
  14774. * @return {?}
  14775. */
  14776. function applyProviderOverrides(def) {
  14777. for (var /** @type {?} */ i = 0; i < def.providers.length; i++) {
  14778. var /** @type {?} */ provider = def.providers[i];
  14779. if (hasDeprecatedOverrides) {
  14780. // We had a bug where me made
  14781. // all providers lazy. Keep this logic behind a flag
  14782. // for migrating existing users.
  14783. provider.flags |= 4096 /* LazyProvider */;
  14784. }
  14785. var /** @type {?} */ override = providerOverrides.get(provider.token);
  14786. if (override) {
  14787. provider.flags = (provider.flags & ~3840 /* CatProviderNoDirective */) | override.flags;
  14788. provider.deps = splitDepsDsl(override.deps);
  14789. provider.value = override.value;
  14790. }
  14791. }
  14792. }
  14793. }
  14794. /**
  14795. * @param {?} view
  14796. * @param {?} checkIndex
  14797. * @param {?} argStyle
  14798. * @param {?=} v0
  14799. * @param {?=} v1
  14800. * @param {?=} v2
  14801. * @param {?=} v3
  14802. * @param {?=} v4
  14803. * @param {?=} v5
  14804. * @param {?=} v6
  14805. * @param {?=} v7
  14806. * @param {?=} v8
  14807. * @param {?=} v9
  14808. * @return {?}
  14809. */
  14810. function prodCheckAndUpdateNode(view, checkIndex, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {
  14811. var /** @type {?} */ nodeDef = view.def.nodes[checkIndex];
  14812. checkAndUpdateNode(view, nodeDef, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
  14813. return (nodeDef.flags & 224 /* CatPureExpression */) ?
  14814. asPureExpressionData(view, checkIndex).value :
  14815. undefined;
  14816. }
  14817. /**
  14818. * @param {?} view
  14819. * @param {?} checkIndex
  14820. * @param {?} argStyle
  14821. * @param {?=} v0
  14822. * @param {?=} v1
  14823. * @param {?=} v2
  14824. * @param {?=} v3
  14825. * @param {?=} v4
  14826. * @param {?=} v5
  14827. * @param {?=} v6
  14828. * @param {?=} v7
  14829. * @param {?=} v8
  14830. * @param {?=} v9
  14831. * @return {?}
  14832. */
  14833. function prodCheckNoChangesNode(view, checkIndex, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {
  14834. var /** @type {?} */ nodeDef = view.def.nodes[checkIndex];
  14835. checkNoChangesNode(view, nodeDef, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
  14836. return (nodeDef.flags & 224 /* CatPureExpression */) ?
  14837. asPureExpressionData(view, checkIndex).value :
  14838. undefined;
  14839. }
  14840. /**
  14841. * @param {?} view
  14842. * @return {?}
  14843. */
  14844. function debugCheckAndUpdateView(view) {
  14845. return callWithDebugContext(DebugAction.detectChanges, checkAndUpdateView, null, [view]);
  14846. }
  14847. /**
  14848. * @param {?} view
  14849. * @return {?}
  14850. */
  14851. function debugCheckNoChangesView(view) {
  14852. return callWithDebugContext(DebugAction.checkNoChanges, checkNoChangesView, null, [view]);
  14853. }
  14854. /**
  14855. * @param {?} view
  14856. * @return {?}
  14857. */
  14858. function debugDestroyView(view) {
  14859. return callWithDebugContext(DebugAction.destroy, destroyView, null, [view]);
  14860. }
  14861. /** @enum {number} */
  14862. var DebugAction = {
  14863. create: 0,
  14864. detectChanges: 1,
  14865. checkNoChanges: 2,
  14866. destroy: 3,
  14867. handleEvent: 4,
  14868. };
  14869. DebugAction[DebugAction.create] = "create";
  14870. DebugAction[DebugAction.detectChanges] = "detectChanges";
  14871. DebugAction[DebugAction.checkNoChanges] = "checkNoChanges";
  14872. DebugAction[DebugAction.destroy] = "destroy";
  14873. DebugAction[DebugAction.handleEvent] = "handleEvent";
  14874. var _currentAction;
  14875. var _currentView;
  14876. var _currentNodeIndex;
  14877. /**
  14878. * @param {?} view
  14879. * @param {?} nodeIndex
  14880. * @return {?}
  14881. */
  14882. function debugSetCurrentNode(view, nodeIndex) {
  14883. _currentView = view;
  14884. _currentNodeIndex = nodeIndex;
  14885. }
  14886. /**
  14887. * @param {?} view
  14888. * @param {?} nodeIndex
  14889. * @param {?} eventName
  14890. * @param {?} event
  14891. * @return {?}
  14892. */
  14893. function debugHandleEvent(view, nodeIndex, eventName, event) {
  14894. debugSetCurrentNode(view, nodeIndex);
  14895. return callWithDebugContext(DebugAction.handleEvent, view.def.handleEvent, null, [view, nodeIndex, eventName, event]);
  14896. }
  14897. /**
  14898. * @param {?} view
  14899. * @param {?} checkType
  14900. * @return {?}
  14901. */
  14902. function debugUpdateDirectives(view, checkType) {
  14903. if (view.state & 128 /* Destroyed */) {
  14904. throw viewDestroyedError(DebugAction[_currentAction]);
  14905. }
  14906. debugSetCurrentNode(view, nextDirectiveWithBinding(view, 0));
  14907. return view.def.updateDirectives(debugCheckDirectivesFn, view);
  14908. /**
  14909. * @param {?} view
  14910. * @param {?} nodeIndex
  14911. * @param {?} argStyle
  14912. * @param {...?} values
  14913. * @return {?}
  14914. */
  14915. function debugCheckDirectivesFn(view, nodeIndex, argStyle) {
  14916. var values = [];
  14917. for (var _i = 3; _i < arguments.length; _i++) {
  14918. values[_i - 3] = arguments[_i];
  14919. }
  14920. var /** @type {?} */ nodeDef = view.def.nodes[nodeIndex];
  14921. if (checkType === 0 /* CheckAndUpdate */) {
  14922. debugCheckAndUpdateNode(view, nodeDef, argStyle, values);
  14923. }
  14924. else {
  14925. debugCheckNoChangesNode(view, nodeDef, argStyle, values);
  14926. }
  14927. if (nodeDef.flags & 16384 /* TypeDirective */) {
  14928. debugSetCurrentNode(view, nextDirectiveWithBinding(view, nodeIndex));
  14929. }
  14930. return (nodeDef.flags & 224 /* CatPureExpression */) ?
  14931. asPureExpressionData(view, nodeDef.nodeIndex).value :
  14932. undefined;
  14933. }
  14934. }
  14935. /**
  14936. * @param {?} view
  14937. * @param {?} checkType
  14938. * @return {?}
  14939. */
  14940. function debugUpdateRenderer(view, checkType) {
  14941. if (view.state & 128 /* Destroyed */) {
  14942. throw viewDestroyedError(DebugAction[_currentAction]);
  14943. }
  14944. debugSetCurrentNode(view, nextRenderNodeWithBinding(view, 0));
  14945. return view.def.updateRenderer(debugCheckRenderNodeFn, view);
  14946. /**
  14947. * @param {?} view
  14948. * @param {?} nodeIndex
  14949. * @param {?} argStyle
  14950. * @param {...?} values
  14951. * @return {?}
  14952. */
  14953. function debugCheckRenderNodeFn(view, nodeIndex, argStyle) {
  14954. var values = [];
  14955. for (var _i = 3; _i < arguments.length; _i++) {
  14956. values[_i - 3] = arguments[_i];
  14957. }
  14958. var /** @type {?} */ nodeDef = view.def.nodes[nodeIndex];
  14959. if (checkType === 0 /* CheckAndUpdate */) {
  14960. debugCheckAndUpdateNode(view, nodeDef, argStyle, values);
  14961. }
  14962. else {
  14963. debugCheckNoChangesNode(view, nodeDef, argStyle, values);
  14964. }
  14965. if (nodeDef.flags & 3 /* CatRenderNode */) {
  14966. debugSetCurrentNode(view, nextRenderNodeWithBinding(view, nodeIndex));
  14967. }
  14968. return (nodeDef.flags & 224 /* CatPureExpression */) ?
  14969. asPureExpressionData(view, nodeDef.nodeIndex).value :
  14970. undefined;
  14971. }
  14972. }
  14973. /**
  14974. * @param {?} view
  14975. * @param {?} nodeDef
  14976. * @param {?} argStyle
  14977. * @param {?} givenValues
  14978. * @return {?}
  14979. */
  14980. function debugCheckAndUpdateNode(view, nodeDef, argStyle, givenValues) {
  14981. var /** @type {?} */ changed = (/** @type {?} */ (checkAndUpdateNode)).apply(void 0, [view, nodeDef, argStyle].concat(givenValues));
  14982. if (changed) {
  14983. var /** @type {?} */ values = argStyle === 1 /* Dynamic */ ? givenValues[0] : givenValues;
  14984. if (nodeDef.flags & 16384 /* TypeDirective */) {
  14985. var /** @type {?} */ bindingValues = {};
  14986. for (var /** @type {?} */ i = 0; i < nodeDef.bindings.length; i++) {
  14987. var /** @type {?} */ binding = nodeDef.bindings[i];
  14988. var /** @type {?} */ value = values[i];
  14989. if (binding.flags & 8 /* TypeProperty */) {
  14990. bindingValues[normalizeDebugBindingName(/** @type {?} */ ((binding.nonMinifiedName)))] =
  14991. normalizeDebugBindingValue(value);
  14992. }
  14993. }
  14994. var /** @type {?} */ elDef = /** @type {?} */ ((nodeDef.parent));
  14995. var /** @type {?} */ el = asElementData(view, elDef.nodeIndex).renderElement;
  14996. if (!/** @type {?} */ ((elDef.element)).name) {
  14997. // a comment.
  14998. view.renderer.setValue(el, "bindings=" + JSON.stringify(bindingValues, null, 2));
  14999. }
  15000. else {
  15001. // a regular element.
  15002. for (var /** @type {?} */ attr in bindingValues) {
  15003. var /** @type {?} */ value = bindingValues[attr];
  15004. if (value != null) {
  15005. view.renderer.setAttribute(el, attr, value);
  15006. }
  15007. else {
  15008. view.renderer.removeAttribute(el, attr);
  15009. }
  15010. }
  15011. }
  15012. }
  15013. }
  15014. }
  15015. /**
  15016. * @param {?} view
  15017. * @param {?} nodeDef
  15018. * @param {?} argStyle
  15019. * @param {?} values
  15020. * @return {?}
  15021. */
  15022. function debugCheckNoChangesNode(view, nodeDef, argStyle, values) {
  15023. (/** @type {?} */ (checkNoChangesNode)).apply(void 0, [view, nodeDef, argStyle].concat(values));
  15024. }
  15025. /**
  15026. * @param {?} name
  15027. * @return {?}
  15028. */
  15029. function normalizeDebugBindingName(name) {
  15030. // Attribute names with `$` (eg `x-y$`) are valid per spec, but unsupported by some browsers
  15031. name = camelCaseToDashCase(name.replace(/[$@]/g, '_'));
  15032. return "ng-reflect-" + name;
  15033. }
  15034. var CAMEL_CASE_REGEXP = /([A-Z])/g;
  15035. /**
  15036. * @param {?} input
  15037. * @return {?}
  15038. */
  15039. function camelCaseToDashCase(input) {
  15040. return input.replace(CAMEL_CASE_REGEXP, function () {
  15041. var m = [];
  15042. for (var _i = 0; _i < arguments.length; _i++) {
  15043. m[_i] = arguments[_i];
  15044. }
  15045. return '-' + m[1].toLowerCase();
  15046. });
  15047. }
  15048. /**
  15049. * @param {?} value
  15050. * @return {?}
  15051. */
  15052. function normalizeDebugBindingValue(value) {
  15053. try {
  15054. // Limit the size of the value as otherwise the DOM just gets polluted.
  15055. return value != null ? value.toString().slice(0, 30) : value;
  15056. }
  15057. catch (/** @type {?} */ e) {
  15058. return '[ERROR] Exception while trying to serialize the value';
  15059. }
  15060. }
  15061. /**
  15062. * @param {?} view
  15063. * @param {?} nodeIndex
  15064. * @return {?}
  15065. */
  15066. function nextDirectiveWithBinding(view, nodeIndex) {
  15067. for (var /** @type {?} */ i = nodeIndex; i < view.def.nodes.length; i++) {
  15068. var /** @type {?} */ nodeDef = view.def.nodes[i];
  15069. if (nodeDef.flags & 16384 /* TypeDirective */ && nodeDef.bindings && nodeDef.bindings.length) {
  15070. return i;
  15071. }
  15072. }
  15073. return null;
  15074. }
  15075. /**
  15076. * @param {?} view
  15077. * @param {?} nodeIndex
  15078. * @return {?}
  15079. */
  15080. function nextRenderNodeWithBinding(view, nodeIndex) {
  15081. for (var /** @type {?} */ i = nodeIndex; i < view.def.nodes.length; i++) {
  15082. var /** @type {?} */ nodeDef = view.def.nodes[i];
  15083. if ((nodeDef.flags & 3 /* CatRenderNode */) && nodeDef.bindings && nodeDef.bindings.length) {
  15084. return i;
  15085. }
  15086. }
  15087. return null;
  15088. }
  15089. var DebugContext_ = /** @class */ (function () {
  15090. function DebugContext_(view, nodeIndex) {
  15091. this.view = view;
  15092. this.nodeIndex = nodeIndex;
  15093. if (nodeIndex == null) {
  15094. this.nodeIndex = nodeIndex = 0;
  15095. }
  15096. this.nodeDef = view.def.nodes[nodeIndex];
  15097. var /** @type {?} */ elDef = this.nodeDef;
  15098. var /** @type {?} */ elView = view;
  15099. while (elDef && (elDef.flags & 1 /* TypeElement */) === 0) {
  15100. elDef = /** @type {?} */ ((elDef.parent));
  15101. }
  15102. if (!elDef) {
  15103. while (!elDef && elView) {
  15104. elDef = /** @type {?} */ ((viewParentEl(elView)));
  15105. elView = /** @type {?} */ ((elView.parent));
  15106. }
  15107. }
  15108. this.elDef = elDef;
  15109. this.elView = elView;
  15110. }
  15111. Object.defineProperty(DebugContext_.prototype, "elOrCompView", {
  15112. get: /**
  15113. * @return {?}
  15114. */
  15115. function () {
  15116. // Has to be done lazily as we use the DebugContext also during creation of elements...
  15117. return asElementData(this.elView, this.elDef.nodeIndex).componentView || this.view;
  15118. },
  15119. enumerable: true,
  15120. configurable: true
  15121. });
  15122. Object.defineProperty(DebugContext_.prototype, "injector", {
  15123. get: /**
  15124. * @return {?}
  15125. */
  15126. function () { return createInjector(this.elView, this.elDef); },
  15127. enumerable: true,
  15128. configurable: true
  15129. });
  15130. Object.defineProperty(DebugContext_.prototype, "component", {
  15131. get: /**
  15132. * @return {?}
  15133. */
  15134. function () { return this.elOrCompView.component; },
  15135. enumerable: true,
  15136. configurable: true
  15137. });
  15138. Object.defineProperty(DebugContext_.prototype, "context", {
  15139. get: /**
  15140. * @return {?}
  15141. */
  15142. function () { return this.elOrCompView.context; },
  15143. enumerable: true,
  15144. configurable: true
  15145. });
  15146. Object.defineProperty(DebugContext_.prototype, "providerTokens", {
  15147. get: /**
  15148. * @return {?}
  15149. */
  15150. function () {
  15151. var /** @type {?} */ tokens = [];
  15152. if (this.elDef) {
  15153. for (var /** @type {?} */ i = this.elDef.nodeIndex + 1; i <= this.elDef.nodeIndex + this.elDef.childCount; i++) {
  15154. var /** @type {?} */ childDef = this.elView.def.nodes[i];
  15155. if (childDef.flags & 20224 /* CatProvider */) {
  15156. tokens.push(/** @type {?} */ ((childDef.provider)).token);
  15157. }
  15158. i += childDef.childCount;
  15159. }
  15160. }
  15161. return tokens;
  15162. },
  15163. enumerable: true,
  15164. configurable: true
  15165. });
  15166. Object.defineProperty(DebugContext_.prototype, "references", {
  15167. get: /**
  15168. * @return {?}
  15169. */
  15170. function () {
  15171. var /** @type {?} */ references = {};
  15172. if (this.elDef) {
  15173. collectReferences(this.elView, this.elDef, references);
  15174. for (var /** @type {?} */ i = this.elDef.nodeIndex + 1; i <= this.elDef.nodeIndex + this.elDef.childCount; i++) {
  15175. var /** @type {?} */ childDef = this.elView.def.nodes[i];
  15176. if (childDef.flags & 20224 /* CatProvider */) {
  15177. collectReferences(this.elView, childDef, references);
  15178. }
  15179. i += childDef.childCount;
  15180. }
  15181. }
  15182. return references;
  15183. },
  15184. enumerable: true,
  15185. configurable: true
  15186. });
  15187. Object.defineProperty(DebugContext_.prototype, "componentRenderElement", {
  15188. get: /**
  15189. * @return {?}
  15190. */
  15191. function () {
  15192. var /** @type {?} */ elData = findHostElement(this.elOrCompView);
  15193. return elData ? elData.renderElement : undefined;
  15194. },
  15195. enumerable: true,
  15196. configurable: true
  15197. });
  15198. Object.defineProperty(DebugContext_.prototype, "renderNode", {
  15199. get: /**
  15200. * @return {?}
  15201. */
  15202. function () {
  15203. return this.nodeDef.flags & 2 /* TypeText */ ? renderNode(this.view, this.nodeDef) :
  15204. renderNode(this.elView, this.elDef);
  15205. },
  15206. enumerable: true,
  15207. configurable: true
  15208. });
  15209. /**
  15210. * @param {?} console
  15211. * @param {...?} values
  15212. * @return {?}
  15213. */
  15214. DebugContext_.prototype.logError = /**
  15215. * @param {?} console
  15216. * @param {...?} values
  15217. * @return {?}
  15218. */
  15219. function (console) {
  15220. var values = [];
  15221. for (var _i = 1; _i < arguments.length; _i++) {
  15222. values[_i - 1] = arguments[_i];
  15223. }
  15224. var /** @type {?} */ logViewDef;
  15225. var /** @type {?} */ logNodeIndex;
  15226. if (this.nodeDef.flags & 2 /* TypeText */) {
  15227. logViewDef = this.view.def;
  15228. logNodeIndex = this.nodeDef.nodeIndex;
  15229. }
  15230. else {
  15231. logViewDef = this.elView.def;
  15232. logNodeIndex = this.elDef.nodeIndex;
  15233. }
  15234. // Note: we only generate a log function for text and element nodes
  15235. // to make the generated code as small as possible.
  15236. var /** @type {?} */ renderNodeIndex = getRenderNodeIndex(logViewDef, logNodeIndex);
  15237. var /** @type {?} */ currRenderNodeIndex = -1;
  15238. var /** @type {?} */ nodeLogger = function () {
  15239. currRenderNodeIndex++;
  15240. if (currRenderNodeIndex === renderNodeIndex) {
  15241. return (_a = console.error).bind.apply(_a, [console].concat(values));
  15242. }
  15243. else {
  15244. return NOOP;
  15245. }
  15246. var _a;
  15247. }; /** @type {?} */
  15248. ((logViewDef.factory))(nodeLogger);
  15249. if (currRenderNodeIndex < renderNodeIndex) {
  15250. console.error('Illegal state: the ViewDefinitionFactory did not call the logger!');
  15251. console.error.apply(console, values);
  15252. }
  15253. };
  15254. return DebugContext_;
  15255. }());
  15256. /**
  15257. * @param {?} viewDef
  15258. * @param {?} nodeIndex
  15259. * @return {?}
  15260. */
  15261. function getRenderNodeIndex(viewDef$$1, nodeIndex) {
  15262. var /** @type {?} */ renderNodeIndex = -1;
  15263. for (var /** @type {?} */ i = 0; i <= nodeIndex; i++) {
  15264. var /** @type {?} */ nodeDef = viewDef$$1.nodes[i];
  15265. if (nodeDef.flags & 3 /* CatRenderNode */) {
  15266. renderNodeIndex++;
  15267. }
  15268. }
  15269. return renderNodeIndex;
  15270. }
  15271. /**
  15272. * @param {?} view
  15273. * @return {?}
  15274. */
  15275. function findHostElement(view) {
  15276. while (view && !isComponentView(view)) {
  15277. view = /** @type {?} */ ((view.parent));
  15278. }
  15279. if (view.parent) {
  15280. return asElementData(view.parent, /** @type {?} */ ((viewParentEl(view))).nodeIndex);
  15281. }
  15282. return null;
  15283. }
  15284. /**
  15285. * @param {?} view
  15286. * @param {?} nodeDef
  15287. * @param {?} references
  15288. * @return {?}
  15289. */
  15290. function collectReferences(view, nodeDef, references) {
  15291. for (var /** @type {?} */ refName in nodeDef.references) {
  15292. references[refName] = getQueryValue(view, nodeDef, nodeDef.references[refName]);
  15293. }
  15294. }
  15295. /**
  15296. * @param {?} action
  15297. * @param {?} fn
  15298. * @param {?} self
  15299. * @param {?} args
  15300. * @return {?}
  15301. */
  15302. function callWithDebugContext(action, fn, self, args) {
  15303. var /** @type {?} */ oldAction = _currentAction;
  15304. var /** @type {?} */ oldView = _currentView;
  15305. var /** @type {?} */ oldNodeIndex = _currentNodeIndex;
  15306. try {
  15307. _currentAction = action;
  15308. var /** @type {?} */ result = fn.apply(self, args);
  15309. _currentView = oldView;
  15310. _currentNodeIndex = oldNodeIndex;
  15311. _currentAction = oldAction;
  15312. return result;
  15313. }
  15314. catch (/** @type {?} */ e) {
  15315. if (isViewDebugError(e) || !_currentView) {
  15316. throw e;
  15317. }
  15318. throw viewWrappedDebugError(e, /** @type {?} */ ((getCurrentDebugContext())));
  15319. }
  15320. }
  15321. /**
  15322. * @return {?}
  15323. */
  15324. function getCurrentDebugContext() {
  15325. return _currentView ? new DebugContext_(_currentView, _currentNodeIndex) : null;
  15326. }
  15327. var DebugRendererFactory2 = /** @class */ (function () {
  15328. function DebugRendererFactory2(delegate) {
  15329. this.delegate = delegate;
  15330. }
  15331. /**
  15332. * @param {?} element
  15333. * @param {?} renderData
  15334. * @return {?}
  15335. */
  15336. DebugRendererFactory2.prototype.createRenderer = /**
  15337. * @param {?} element
  15338. * @param {?} renderData
  15339. * @return {?}
  15340. */
  15341. function (element, renderData) {
  15342. return new DebugRenderer2(this.delegate.createRenderer(element, renderData));
  15343. };
  15344. /**
  15345. * @return {?}
  15346. */
  15347. DebugRendererFactory2.prototype.begin = /**
  15348. * @return {?}
  15349. */
  15350. function () {
  15351. if (this.delegate.begin) {
  15352. this.delegate.begin();
  15353. }
  15354. };
  15355. /**
  15356. * @return {?}
  15357. */
  15358. DebugRendererFactory2.prototype.end = /**
  15359. * @return {?}
  15360. */
  15361. function () {
  15362. if (this.delegate.end) {
  15363. this.delegate.end();
  15364. }
  15365. };
  15366. /**
  15367. * @return {?}
  15368. */
  15369. DebugRendererFactory2.prototype.whenRenderingDone = /**
  15370. * @return {?}
  15371. */
  15372. function () {
  15373. if (this.delegate.whenRenderingDone) {
  15374. return this.delegate.whenRenderingDone();
  15375. }
  15376. return Promise.resolve(null);
  15377. };
  15378. return DebugRendererFactory2;
  15379. }());
  15380. var DebugRenderer2 = /** @class */ (function () {
  15381. function DebugRenderer2(delegate) {
  15382. this.delegate = delegate;
  15383. this.data = this.delegate.data;
  15384. }
  15385. /**
  15386. * @param {?} node
  15387. * @return {?}
  15388. */
  15389. DebugRenderer2.prototype.destroyNode = /**
  15390. * @param {?} node
  15391. * @return {?}
  15392. */
  15393. function (node) {
  15394. removeDebugNodeFromIndex(/** @type {?} */ ((getDebugNode(node))));
  15395. if (this.delegate.destroyNode) {
  15396. this.delegate.destroyNode(node);
  15397. }
  15398. };
  15399. /**
  15400. * @return {?}
  15401. */
  15402. DebugRenderer2.prototype.destroy = /**
  15403. * @return {?}
  15404. */
  15405. function () { this.delegate.destroy(); };
  15406. /**
  15407. * @param {?} name
  15408. * @param {?=} namespace
  15409. * @return {?}
  15410. */
  15411. DebugRenderer2.prototype.createElement = /**
  15412. * @param {?} name
  15413. * @param {?=} namespace
  15414. * @return {?}
  15415. */
  15416. function (name, namespace) {
  15417. var /** @type {?} */ el = this.delegate.createElement(name, namespace);
  15418. var /** @type {?} */ debugCtx = getCurrentDebugContext();
  15419. if (debugCtx) {
  15420. var /** @type {?} */ debugEl = new DebugElement(el, null, debugCtx);
  15421. debugEl.name = name;
  15422. indexDebugNode(debugEl);
  15423. }
  15424. return el;
  15425. };
  15426. /**
  15427. * @param {?} value
  15428. * @return {?}
  15429. */
  15430. DebugRenderer2.prototype.createComment = /**
  15431. * @param {?} value
  15432. * @return {?}
  15433. */
  15434. function (value) {
  15435. var /** @type {?} */ comment = this.delegate.createComment(value);
  15436. var /** @type {?} */ debugCtx = getCurrentDebugContext();
  15437. if (debugCtx) {
  15438. indexDebugNode(new DebugNode(comment, null, debugCtx));
  15439. }
  15440. return comment;
  15441. };
  15442. /**
  15443. * @param {?} value
  15444. * @return {?}
  15445. */
  15446. DebugRenderer2.prototype.createText = /**
  15447. * @param {?} value
  15448. * @return {?}
  15449. */
  15450. function (value) {
  15451. var /** @type {?} */ text = this.delegate.createText(value);
  15452. var /** @type {?} */ debugCtx = getCurrentDebugContext();
  15453. if (debugCtx) {
  15454. indexDebugNode(new DebugNode(text, null, debugCtx));
  15455. }
  15456. return text;
  15457. };
  15458. /**
  15459. * @param {?} parent
  15460. * @param {?} newChild
  15461. * @return {?}
  15462. */
  15463. DebugRenderer2.prototype.appendChild = /**
  15464. * @param {?} parent
  15465. * @param {?} newChild
  15466. * @return {?}
  15467. */
  15468. function (parent, newChild) {
  15469. var /** @type {?} */ debugEl = getDebugNode(parent);
  15470. var /** @type {?} */ debugChildEl = getDebugNode(newChild);
  15471. if (debugEl && debugChildEl && debugEl instanceof DebugElement) {
  15472. debugEl.addChild(debugChildEl);
  15473. }
  15474. this.delegate.appendChild(parent, newChild);
  15475. };
  15476. /**
  15477. * @param {?} parent
  15478. * @param {?} newChild
  15479. * @param {?} refChild
  15480. * @return {?}
  15481. */
  15482. DebugRenderer2.prototype.insertBefore = /**
  15483. * @param {?} parent
  15484. * @param {?} newChild
  15485. * @param {?} refChild
  15486. * @return {?}
  15487. */
  15488. function (parent, newChild, refChild) {
  15489. var /** @type {?} */ debugEl = getDebugNode(parent);
  15490. var /** @type {?} */ debugChildEl = getDebugNode(newChild);
  15491. var /** @type {?} */ debugRefEl = /** @type {?} */ ((getDebugNode(refChild)));
  15492. if (debugEl && debugChildEl && debugEl instanceof DebugElement) {
  15493. debugEl.insertBefore(debugRefEl, debugChildEl);
  15494. }
  15495. this.delegate.insertBefore(parent, newChild, refChild);
  15496. };
  15497. /**
  15498. * @param {?} parent
  15499. * @param {?} oldChild
  15500. * @return {?}
  15501. */
  15502. DebugRenderer2.prototype.removeChild = /**
  15503. * @param {?} parent
  15504. * @param {?} oldChild
  15505. * @return {?}
  15506. */
  15507. function (parent, oldChild) {
  15508. var /** @type {?} */ debugEl = getDebugNode(parent);
  15509. var /** @type {?} */ debugChildEl = getDebugNode(oldChild);
  15510. if (debugEl && debugChildEl && debugEl instanceof DebugElement) {
  15511. debugEl.removeChild(debugChildEl);
  15512. }
  15513. this.delegate.removeChild(parent, oldChild);
  15514. };
  15515. /**
  15516. * @param {?} selectorOrNode
  15517. * @return {?}
  15518. */
  15519. DebugRenderer2.prototype.selectRootElement = /**
  15520. * @param {?} selectorOrNode
  15521. * @return {?}
  15522. */
  15523. function (selectorOrNode) {
  15524. var /** @type {?} */ el = this.delegate.selectRootElement(selectorOrNode);
  15525. var /** @type {?} */ debugCtx = getCurrentDebugContext();
  15526. if (debugCtx) {
  15527. indexDebugNode(new DebugElement(el, null, debugCtx));
  15528. }
  15529. return el;
  15530. };
  15531. /**
  15532. * @param {?} el
  15533. * @param {?} name
  15534. * @param {?} value
  15535. * @param {?=} namespace
  15536. * @return {?}
  15537. */
  15538. DebugRenderer2.prototype.setAttribute = /**
  15539. * @param {?} el
  15540. * @param {?} name
  15541. * @param {?} value
  15542. * @param {?=} namespace
  15543. * @return {?}
  15544. */
  15545. function (el, name, value, namespace) {
  15546. var /** @type {?} */ debugEl = getDebugNode(el);
  15547. if (debugEl && debugEl instanceof DebugElement) {
  15548. var /** @type {?} */ fullName = namespace ? namespace + ':' + name : name;
  15549. debugEl.attributes[fullName] = value;
  15550. }
  15551. this.delegate.setAttribute(el, name, value, namespace);
  15552. };
  15553. /**
  15554. * @param {?} el
  15555. * @param {?} name
  15556. * @param {?=} namespace
  15557. * @return {?}
  15558. */
  15559. DebugRenderer2.prototype.removeAttribute = /**
  15560. * @param {?} el
  15561. * @param {?} name
  15562. * @param {?=} namespace
  15563. * @return {?}
  15564. */
  15565. function (el, name, namespace) {
  15566. var /** @type {?} */ debugEl = getDebugNode(el);
  15567. if (debugEl && debugEl instanceof DebugElement) {
  15568. var /** @type {?} */ fullName = namespace ? namespace + ':' + name : name;
  15569. debugEl.attributes[fullName] = null;
  15570. }
  15571. this.delegate.removeAttribute(el, name, namespace);
  15572. };
  15573. /**
  15574. * @param {?} el
  15575. * @param {?} name
  15576. * @return {?}
  15577. */
  15578. DebugRenderer2.prototype.addClass = /**
  15579. * @param {?} el
  15580. * @param {?} name
  15581. * @return {?}
  15582. */
  15583. function (el, name) {
  15584. var /** @type {?} */ debugEl = getDebugNode(el);
  15585. if (debugEl && debugEl instanceof DebugElement) {
  15586. debugEl.classes[name] = true;
  15587. }
  15588. this.delegate.addClass(el, name);
  15589. };
  15590. /**
  15591. * @param {?} el
  15592. * @param {?} name
  15593. * @return {?}
  15594. */
  15595. DebugRenderer2.prototype.removeClass = /**
  15596. * @param {?} el
  15597. * @param {?} name
  15598. * @return {?}
  15599. */
  15600. function (el, name) {
  15601. var /** @type {?} */ debugEl = getDebugNode(el);
  15602. if (debugEl && debugEl instanceof DebugElement) {
  15603. debugEl.classes[name] = false;
  15604. }
  15605. this.delegate.removeClass(el, name);
  15606. };
  15607. /**
  15608. * @param {?} el
  15609. * @param {?} style
  15610. * @param {?} value
  15611. * @param {?} flags
  15612. * @return {?}
  15613. */
  15614. DebugRenderer2.prototype.setStyle = /**
  15615. * @param {?} el
  15616. * @param {?} style
  15617. * @param {?} value
  15618. * @param {?} flags
  15619. * @return {?}
  15620. */
  15621. function (el, style, value, flags) {
  15622. var /** @type {?} */ debugEl = getDebugNode(el);
  15623. if (debugEl && debugEl instanceof DebugElement) {
  15624. debugEl.styles[style] = value;
  15625. }
  15626. this.delegate.setStyle(el, style, value, flags);
  15627. };
  15628. /**
  15629. * @param {?} el
  15630. * @param {?} style
  15631. * @param {?} flags
  15632. * @return {?}
  15633. */
  15634. DebugRenderer2.prototype.removeStyle = /**
  15635. * @param {?} el
  15636. * @param {?} style
  15637. * @param {?} flags
  15638. * @return {?}
  15639. */
  15640. function (el, style, flags) {
  15641. var /** @type {?} */ debugEl = getDebugNode(el);
  15642. if (debugEl && debugEl instanceof DebugElement) {
  15643. debugEl.styles[style] = null;
  15644. }
  15645. this.delegate.removeStyle(el, style, flags);
  15646. };
  15647. /**
  15648. * @param {?} el
  15649. * @param {?} name
  15650. * @param {?} value
  15651. * @return {?}
  15652. */
  15653. DebugRenderer2.prototype.setProperty = /**
  15654. * @param {?} el
  15655. * @param {?} name
  15656. * @param {?} value
  15657. * @return {?}
  15658. */
  15659. function (el, name, value) {
  15660. var /** @type {?} */ debugEl = getDebugNode(el);
  15661. if (debugEl && debugEl instanceof DebugElement) {
  15662. debugEl.properties[name] = value;
  15663. }
  15664. this.delegate.setProperty(el, name, value);
  15665. };
  15666. /**
  15667. * @param {?} target
  15668. * @param {?} eventName
  15669. * @param {?} callback
  15670. * @return {?}
  15671. */
  15672. DebugRenderer2.prototype.listen = /**
  15673. * @param {?} target
  15674. * @param {?} eventName
  15675. * @param {?} callback
  15676. * @return {?}
  15677. */
  15678. function (target, eventName, callback) {
  15679. if (typeof target !== 'string') {
  15680. var /** @type {?} */ debugEl = getDebugNode(target);
  15681. if (debugEl) {
  15682. debugEl.listeners.push(new EventListener(eventName, callback));
  15683. }
  15684. }
  15685. return this.delegate.listen(target, eventName, callback);
  15686. };
  15687. /**
  15688. * @param {?} node
  15689. * @return {?}
  15690. */
  15691. DebugRenderer2.prototype.parentNode = /**
  15692. * @param {?} node
  15693. * @return {?}
  15694. */
  15695. function (node) { return this.delegate.parentNode(node); };
  15696. /**
  15697. * @param {?} node
  15698. * @return {?}
  15699. */
  15700. DebugRenderer2.prototype.nextSibling = /**
  15701. * @param {?} node
  15702. * @return {?}
  15703. */
  15704. function (node) { return this.delegate.nextSibling(node); };
  15705. /**
  15706. * @param {?} node
  15707. * @param {?} value
  15708. * @return {?}
  15709. */
  15710. DebugRenderer2.prototype.setValue = /**
  15711. * @param {?} node
  15712. * @param {?} value
  15713. * @return {?}
  15714. */
  15715. function (node, value) { return this.delegate.setValue(node, value); };
  15716. return DebugRenderer2;
  15717. }());
  15718. /**
  15719. * @fileoverview added by tsickle
  15720. * @suppress {checkTypes} checked by tsc
  15721. */
  15722. /**
  15723. * @license
  15724. * Copyright Google Inc. All Rights Reserved.
  15725. *
  15726. * Use of this source code is governed by an MIT-style license that can be
  15727. * found in the LICENSE file at https://angular.io/license
  15728. */
  15729. /**
  15730. * @param {?} override
  15731. * @return {?}
  15732. */
  15733. function overrideProvider(override) {
  15734. initServicesIfNeeded();
  15735. return Services.overrideProvider(override);
  15736. }
  15737. /**
  15738. * @param {?} comp
  15739. * @param {?} componentFactory
  15740. * @return {?}
  15741. */
  15742. function overrideComponentView(comp, componentFactory) {
  15743. initServicesIfNeeded();
  15744. return Services.overrideComponentView(comp, componentFactory);
  15745. }
  15746. /**
  15747. * @return {?}
  15748. */
  15749. function clearOverrides() {
  15750. initServicesIfNeeded();
  15751. return Services.clearOverrides();
  15752. }
  15753. /**
  15754. * @param {?} ngModuleType
  15755. * @param {?} bootstrapComponents
  15756. * @param {?} defFactory
  15757. * @return {?}
  15758. */
  15759. function createNgModuleFactory(ngModuleType, bootstrapComponents, defFactory) {
  15760. return new NgModuleFactory_(ngModuleType, bootstrapComponents, defFactory);
  15761. }
  15762. var NgModuleFactory_ = /** @class */ (function (_super) {
  15763. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(NgModuleFactory_, _super);
  15764. function NgModuleFactory_(moduleType, _bootstrapComponents, _ngModuleDefFactory) {
  15765. var _this =
  15766. // Attention: this ctor is called as top level function.
  15767. // Putting any logic in here will destroy closure tree shaking!
  15768. _super.call(this) || this;
  15769. _this.moduleType = moduleType;
  15770. _this._bootstrapComponents = _bootstrapComponents;
  15771. _this._ngModuleDefFactory = _ngModuleDefFactory;
  15772. return _this;
  15773. }
  15774. /**
  15775. * @param {?} parentInjector
  15776. * @return {?}
  15777. */
  15778. NgModuleFactory_.prototype.create = /**
  15779. * @param {?} parentInjector
  15780. * @return {?}
  15781. */
  15782. function (parentInjector) {
  15783. initServicesIfNeeded();
  15784. var /** @type {?} */ def = resolveDefinition(this._ngModuleDefFactory);
  15785. return Services.createNgModuleRef(this.moduleType, parentInjector || Injector.NULL, this._bootstrapComponents, def);
  15786. };
  15787. return NgModuleFactory_;
  15788. }(NgModuleFactory));
  15789. /**
  15790. * @fileoverview added by tsickle
  15791. * @suppress {checkTypes} checked by tsc
  15792. */
  15793. /**
  15794. * @license
  15795. * Copyright Google Inc. All Rights Reserved.
  15796. *
  15797. * Use of this source code is governed by an MIT-style license that can be
  15798. * found in the LICENSE file at https://angular.io/license
  15799. */
  15800. /**
  15801. * @fileoverview added by tsickle
  15802. * @suppress {checkTypes} checked by tsc
  15803. */
  15804. /**
  15805. * @license
  15806. * Copyright Google Inc. All Rights Reserved.
  15807. *
  15808. * Use of this source code is governed by an MIT-style license that can be
  15809. * found in the LICENSE file at https://angular.io/license
  15810. */
  15811. /**
  15812. * @fileoverview added by tsickle
  15813. * @suppress {checkTypes} checked by tsc
  15814. */
  15815. /**
  15816. * @license
  15817. * Copyright Google Inc. All Rights Reserved.
  15818. *
  15819. * Use of this source code is governed by an MIT-style license that can be
  15820. * found in the LICENSE file at https://angular.io/license
  15821. */
  15822. // The functions in this file verify that the assumptions we are making
  15823. // about state in an instruction are correct before implementing any logic.
  15824. // They are meant only to be called in dev mode as sanity checks.
  15825. /**
  15826. * Stringifies values such that strings are wrapped in explicit quotation marks and
  15827. * other types are stringified normally. Used in error messages (e.g. assertThrow)
  15828. * to make it clear that certain values are of the string type when comparing.
  15829. *
  15830. * e.g. `expected "3" to be 3` is easier to understand than `expected 3 to be 3`.
  15831. *
  15832. * @param {?} value The value to be stringified
  15833. * @return {?} The stringified value
  15834. */
  15835. function stringifyValueForError(value) {
  15836. return typeof value === 'string' ? "\"" + value + "\"" : '' + value;
  15837. }
  15838. /**
  15839. * @param {?} actual
  15840. * @param {?} name
  15841. * @return {?}
  15842. */
  15843. /**
  15844. * @template T
  15845. * @param {?} actual
  15846. * @param {?} expected
  15847. * @param {?} name
  15848. * @param {?=} serializer
  15849. * @return {?}
  15850. */
  15851. function assertEqual(actual, expected, name, serializer) {
  15852. (actual != expected) && assertThrow(actual, expected, name, '==', serializer);
  15853. }
  15854. /**
  15855. * @template T
  15856. * @param {?} actual
  15857. * @param {?} expected
  15858. * @param {?} name
  15859. * @return {?}
  15860. */
  15861. function assertLessThan(actual, expected, name) {
  15862. (actual < expected) && assertThrow(actual, expected, name, '>');
  15863. }
  15864. /**
  15865. * @template T
  15866. * @param {?} actual
  15867. * @param {?} name
  15868. * @return {?}
  15869. */
  15870. function assertNotNull(actual, name) {
  15871. assertNotEqual(actual, null, name);
  15872. }
  15873. /**
  15874. * @template T
  15875. * @param {?} actual
  15876. * @param {?} expected
  15877. * @param {?} name
  15878. * @return {?}
  15879. */
  15880. function assertNotEqual(actual, expected, name) {
  15881. (actual == expected) && assertThrow(actual, expected, name, '!=');
  15882. }
  15883. /**
  15884. * Throws an error with a message constructed from the arguments.
  15885. *
  15886. * @template T
  15887. * @param {?} actual The actual value (e.g. 3)
  15888. * @param {?} expected The expected value (e.g. 5)
  15889. * @param {?} name The name of the value being checked (e.g. attrs.length)
  15890. * @param {?} operator The comparison operator (e.g. <, >, ==)
  15891. * @param {?=} serializer Function that maps a value to its display value
  15892. * @return {?}
  15893. */
  15894. function assertThrow(actual, expected, name, operator, serializer) {
  15895. if (serializer === void 0) { serializer = stringifyValueForError; }
  15896. throw new Error("ASSERT: expected " + name + " " + operator + " " + serializer(expected) + " but was " + serializer(actual) + "!");
  15897. }
  15898. /**
  15899. * @fileoverview added by tsickle
  15900. * @suppress {checkTypes} checked by tsc
  15901. */
  15902. /**
  15903. * @license
  15904. * Copyright Google Inc. All Rights Reserved.
  15905. *
  15906. * Use of this source code is governed by an MIT-style license that can be
  15907. * found in the LICENSE file at https://angular.io/license
  15908. */
  15909. if (typeof ngDevMode == 'undefined') {
  15910. if (typeof window != 'undefined')
  15911. (/** @type {?} */ (window)).ngDevMode = true;
  15912. if (typeof self != 'undefined')
  15913. (/** @type {?} */ (self)).ngDevMode = true;
  15914. if (typeof global != 'undefined')
  15915. (/** @type {?} */ (global)).ngDevMode = true;
  15916. }
  15917. /**
  15918. * @fileoverview added by tsickle
  15919. * @suppress {checkTypes} checked by tsc
  15920. */
  15921. /**
  15922. * @license
  15923. * Copyright Google Inc. All Rights Reserved.
  15924. *
  15925. * Use of this source code is governed by an MIT-style license that can be
  15926. * found in the LICENSE file at https://angular.io/license
  15927. */
  15928. /**
  15929. * @param {?} node
  15930. * @param {?} type
  15931. * @return {?}
  15932. */
  15933. function assertNodeType(node, type) {
  15934. assertNotEqual(node, null, 'node');
  15935. assertEqual(node.flags & 3 /* TYPE_MASK */, type, 'Node.type', typeSerializer);
  15936. }
  15937. /**
  15938. * @param {?} node
  15939. * @param {...?} types
  15940. * @return {?}
  15941. */
  15942. /**
  15943. * @param {?} type
  15944. * @return {?}
  15945. */
  15946. function typeSerializer(type) {
  15947. if (type == 1 /* Projection */)
  15948. return 'Projection';
  15949. if (type == 0 /* Container */)
  15950. return 'Container';
  15951. if (type == 2 /* View */)
  15952. return 'View';
  15953. if (type == 3 /* Element */)
  15954. return 'Element';
  15955. return '??? ' + type + ' ???';
  15956. }
  15957. /**
  15958. * @fileoverview added by tsickle
  15959. * @suppress {checkTypes} checked by tsc
  15960. */
  15961. /**
  15962. * @license
  15963. * Copyright Google Inc. All Rights Reserved.
  15964. *
  15965. * Use of this source code is governed by an MIT-style license that can be
  15966. * found in the LICENSE file at https://angular.io/license
  15967. */
  15968. /**
  15969. * Finds the closest DOM node above a given container in the hierarchy.
  15970. *
  15971. * This is necessary to add or remove elements from the DOM when a view
  15972. * is added or removed from the container. e.g. parent.removeChild(...)
  15973. *
  15974. * @param {?} containerNode The container node whose parent must be found
  15975. * @return {?} Closest DOM node above the container
  15976. */
  15977. function findNativeParent(containerNode) {
  15978. var /** @type {?} */ container = containerNode;
  15979. while (container) {
  15980. ngDevMode && assertNodeType(container, 0 /* Container */);
  15981. var /** @type {?} */ renderParent = container.data.renderParent;
  15982. if (renderParent !== null) {
  15983. return renderParent.native;
  15984. }
  15985. var /** @type {?} */ viewOrElement = /** @type {?} */ ((container.parent));
  15986. ngDevMode && assertNotNull(viewOrElement, 'container.parent');
  15987. if ((viewOrElement.flags & 3 /* TYPE_MASK */) === 3 /* Element */) {
  15988. // we are an LElement, which means we are past the last LContainer.
  15989. // This means than we have not been projected so just ignore.
  15990. return null;
  15991. }
  15992. ngDevMode && assertNodeType(viewOrElement, 2 /* View */);
  15993. container = (/** @type {?} */ (viewOrElement)).parent;
  15994. }
  15995. return null;
  15996. }
  15997. /**
  15998. * Finds the DOM element before which a certain view should be inserting its
  15999. * child elements.
  16000. *
  16001. * If the view has a next (e.g. for loop), elements should be inserted before
  16002. * the next view's first child element. Otherwise, the container's comment
  16003. * anchor is the marker.
  16004. *
  16005. * @param {?} index The index of the view to check
  16006. * @param {?} state ContainerState of the parent container
  16007. * @param {?} native Comment anchor for container
  16008. * @return {?} The DOM element for which the view should insert elements
  16009. */
  16010. function findBeforeNode(index, state, native) {
  16011. var /** @type {?} */ views = state.views;
  16012. // Find the node to insert in front of
  16013. return index + 1 < views.length ?
  16014. (/** @type {?} */ (views[index + 1].child)).native :
  16015. native;
  16016. }
  16017. /**
  16018. * @param {?} container
  16019. * @param {?} rootNode
  16020. * @param {?} insertMode
  16021. * @param {?=} beforeNode
  16022. * @return {?}
  16023. */
  16024. function addRemoveViewFromContainer(container, rootNode, insertMode, beforeNode) {
  16025. ngDevMode && assertNodeType(container, 0 /* Container */);
  16026. ngDevMode && assertNodeType(rootNode, 2 /* View */);
  16027. var /** @type {?} */ parent = findNativeParent(container);
  16028. var /** @type {?} */ node = rootNode.child;
  16029. if (parent) {
  16030. while (node) {
  16031. var /** @type {?} */ type = node.flags & 3;
  16032. var /** @type {?} */ nextNode = null;
  16033. var /** @type {?} */ renderer = container.view.renderer;
  16034. var /** @type {?} */ isFnRenderer = (/** @type {?} */ (renderer)).listen;
  16035. if (type === 3 /* Element */) {
  16036. insertMode ? (isFnRenderer ? /** @type {?} */ (((/** @type {?} */ (renderer))
  16037. .insertBefore))(parent, /** @type {?} */ ((node.native)), /** @type {?} */ (beforeNode)) :
  16038. parent.insertBefore(/** @type {?} */ ((node.native)), /** @type {?} */ (beforeNode), true)) :
  16039. (isFnRenderer ? /** @type {?} */ (((/** @type {?} */ (renderer))
  16040. .removeChild))(/** @type {?} */ (parent), /** @type {?} */ ((node.native))) :
  16041. parent.removeChild(/** @type {?} */ ((node.native))));
  16042. nextNode = node.next;
  16043. }
  16044. else if (type === 0 /* Container */) {
  16045. // if we get to a container, it must be a root node of a view because we are only
  16046. // propagating down into child views / containers and not child elements
  16047. var /** @type {?} */ childContainerData = (/** @type {?} */ (node)).data;
  16048. insertMode ? (isFnRenderer ? /** @type {?} */ (((/** @type {?} */ (renderer))
  16049. .appendChild))(/** @type {?} */ (parent), /** @type {?} */ ((node.native))) :
  16050. parent.appendChild(/** @type {?} */ ((node.native)))) :
  16051. (isFnRenderer ? /** @type {?} */ (((/** @type {?} */ (renderer))
  16052. .removeChild))(/** @type {?} */ (parent), /** @type {?} */ ((node.native))) :
  16053. parent.removeChild(/** @type {?} */ ((node.native))));
  16054. nextNode = childContainerData.views.length ? childContainerData.views[0].child : null;
  16055. }
  16056. else if (type === 1 /* Projection */) {
  16057. nextNode = (/** @type {?} */ (node)).data[0];
  16058. }
  16059. else {
  16060. nextNode = (/** @type {?} */ (node)).child;
  16061. }
  16062. if (nextNode === null) {
  16063. while (node && !node.next) {
  16064. node = node.parent;
  16065. if (node === rootNode)
  16066. node = null;
  16067. }
  16068. node = node && node.next;
  16069. }
  16070. else {
  16071. node = nextNode;
  16072. }
  16073. }
  16074. }
  16075. }
  16076. /**
  16077. * Traverses the tree of component views and containers to remove listeners and
  16078. * call onDestroy callbacks.
  16079. *
  16080. * Notes:
  16081. * - Because it's used for onDestroy calls, it needs to be bottom-up.
  16082. * - Must process containers instead of their views to avoid splicing
  16083. * when views are destroyed and re-added.
  16084. * - Using a while loop because it's faster than recursion
  16085. * - Destroy only called on movement to sibling or movement to parent (laterally or up)
  16086. *
  16087. * \@param rootView The view to destroy
  16088. * @param {?} rootView
  16089. * @return {?}
  16090. */
  16091. function destroyViewTree(rootView) {
  16092. var /** @type {?} */ viewOrContainerState = rootView;
  16093. while (viewOrContainerState) {
  16094. var /** @type {?} */ next = null;
  16095. if (viewOrContainerState.views && viewOrContainerState.views.length) {
  16096. next = viewOrContainerState.views[0].data;
  16097. }
  16098. else if (viewOrContainerState.child) {
  16099. next = viewOrContainerState.child;
  16100. }
  16101. else if (viewOrContainerState.next) {
  16102. cleanUpView(/** @type {?} */ (viewOrContainerState));
  16103. next = viewOrContainerState.next;
  16104. }
  16105. if (next == null) {
  16106. while (viewOrContainerState && !/** @type {?} */ ((viewOrContainerState)).next) {
  16107. cleanUpView(/** @type {?} */ (viewOrContainerState));
  16108. viewOrContainerState = getParentState(viewOrContainerState, rootView);
  16109. }
  16110. cleanUpView(/** @type {?} */ (viewOrContainerState) || rootView);
  16111. next = viewOrContainerState && viewOrContainerState.next;
  16112. }
  16113. viewOrContainerState = next;
  16114. }
  16115. }
  16116. /**
  16117. * Inserts a view into a container.
  16118. *
  16119. * This adds the view to the container's array of active views in the correct
  16120. * position. It also adds the view's elements to the DOM if the container isn't a
  16121. * root node of another view (in that case, the view's elements will be added when
  16122. * the container's parent view is added later).
  16123. *
  16124. * @param {?} container The container into which the view should be inserted
  16125. * @param {?} newView The view to insert
  16126. * @param {?} index The index at which to insert the view
  16127. * @return {?} The inserted view
  16128. */
  16129. function insertView(container, newView, index) {
  16130. var /** @type {?} */ state = container.data;
  16131. var /** @type {?} */ views = state.views;
  16132. if (index > 0) {
  16133. // This is a new view, we need to add it to the children.
  16134. setViewNext(views[index - 1], newView);
  16135. }
  16136. if (index < views.length && views[index].data.id !== newView.data.id) {
  16137. // View ID change replace the view.
  16138. setViewNext(newView, views[index]);
  16139. views.splice(index, 0, newView);
  16140. }
  16141. else if (index >= views.length) {
  16142. views.push(newView);
  16143. }
  16144. if (state.nextIndex <= index) {
  16145. state.nextIndex++;
  16146. }
  16147. // If the container's renderParent is null, we know that it is a root node of its own parent view
  16148. // and we should wait until that parent processes its nodes (otherwise, we will insert this view's
  16149. // nodes twice - once now and once when its parent inserts its views).
  16150. if (container.data.renderParent !== null) {
  16151. addRemoveViewFromContainer(container, newView, true, findBeforeNode(index, state, container.native));
  16152. }
  16153. // Notify query that view has been inserted
  16154. container.query && container.query.insertView(container, newView, index);
  16155. return newView;
  16156. }
  16157. /**
  16158. * Removes a view from a container.
  16159. *
  16160. * This method splices the view from the container's array of active views. It also
  16161. * removes the view's elements from the DOM and conducts cleanup (e.g. removing
  16162. * listeners, calling onDestroys).
  16163. *
  16164. * @param {?} container The container from which to remove a view
  16165. * @param {?} removeIndex The index of the view to remove
  16166. * @return {?} The removed view
  16167. */
  16168. function removeView(container, removeIndex) {
  16169. var /** @type {?} */ views = container.data.views;
  16170. var /** @type {?} */ viewNode = views[removeIndex];
  16171. if (removeIndex > 0) {
  16172. setViewNext(views[removeIndex - 1], viewNode.next);
  16173. }
  16174. views.splice(removeIndex, 1);
  16175. destroyViewTree(viewNode.data);
  16176. addRemoveViewFromContainer(container, viewNode, false);
  16177. // Notify query that view has been removed
  16178. container.query && container.query.removeView(container, viewNode, removeIndex);
  16179. return viewNode;
  16180. }
  16181. /**
  16182. * Sets a next on the view node, so views in for loops can easily jump from
  16183. * one view to the next to add/remove elements. Also adds the ViewState (view.data)
  16184. * to the view tree for easy traversal when cleaning up the view.
  16185. *
  16186. * @param {?} view The view to set up
  16187. * @param {?} next The view's new next
  16188. * @return {?}
  16189. */
  16190. function setViewNext(view, next) {
  16191. view.next = next;
  16192. view.data.next = next ? next.data : null;
  16193. }
  16194. /**
  16195. * Determines which ViewOrContainerState to jump to when traversing back up the
  16196. * tree in destroyViewTree.
  16197. *
  16198. * Normally, the view's parent ViewState should be checked, but in the case of
  16199. * embedded views, the container (which is the view node's parent, but not the
  16200. * ViewState's parent) needs to be checked for a possible next property.
  16201. *
  16202. * @param {?} state The ViewOrContainerState for which we need a parent state
  16203. * @param {?} rootView The rootView, so we don't propagate too far up the view tree
  16204. * @return {?} The correct parent ViewOrContainerState
  16205. */
  16206. function getParentState(state, rootView) {
  16207. var /** @type {?} */ node;
  16208. if ((node = /** @type {?} */ (((/** @type {?} */ (state)))).node) &&
  16209. (node.flags & 3 /* TYPE_MASK */) === 2 /* View */) {
  16210. // if it's an embedded view, the state needs to go up to the container, in case the
  16211. // container has a next
  16212. return /** @type {?} */ (((node.parent)).data);
  16213. }
  16214. else {
  16215. // otherwise, use parent view for containers or component views
  16216. return state.parent === rootView ? null : state.parent;
  16217. }
  16218. }
  16219. /**
  16220. * Removes all listeners and call all onDestroys in a given view.
  16221. *
  16222. * @param {?} viewState The ViewState of the view to clean up
  16223. * @return {?}
  16224. */
  16225. function cleanUpView(viewState) {
  16226. if (!viewState.cleanup)
  16227. return;
  16228. var /** @type {?} */ cleanup = /** @type {?} */ ((viewState.cleanup));
  16229. for (var /** @type {?} */ i = 0; i < cleanup.length - 1; i += 2) {
  16230. if (typeof cleanup[i] === 'string') {
  16231. /** @type {?} */ ((cleanup))[i + 1].removeEventListener(cleanup[i], cleanup[i + 2], cleanup[i + 3]);
  16232. i += 2;
  16233. }
  16234. else {
  16235. cleanup[i].call(cleanup[i + 1]);
  16236. }
  16237. }
  16238. viewState.cleanup = null;
  16239. }
  16240. /**
  16241. * Appends the provided child element to the provided parent, if appropriate.
  16242. *
  16243. * If the parent is a view, the element will be appended as part of viewEnd(), so
  16244. * the element should not be appended now. Similarly, if the child is a content child
  16245. * of a parent component, the child will be appended to the right position later by
  16246. * the content projection system. Otherwise, append normally.
  16247. *
  16248. * @param {?} parent The parent to which to append the child
  16249. * @param {?} child The child that should be appended
  16250. * @param {?} currentView The current view's ViewState
  16251. * @return {?} Whether or not the child was appended
  16252. */
  16253. function appendChild(parent, child, currentView) {
  16254. // Only add native child element to parent element if the parent element is regular Element.
  16255. // If parent is:
  16256. // - Regular element => add child
  16257. // - Component host element =>
  16258. // - Current View, and parent view same => content => don't add -> parent component will
  16259. // re-project if needed.
  16260. // - Current View, and parent view different => view => add Child
  16261. // - View element => View's get added separately.
  16262. if (child !== null && (parent.flags & 3 /* TYPE_MASK */) === 3 /* Element */ &&
  16263. (parent.view !==
  16264. currentView /* Crossing View Boundaries, it is Component, but add Element of View */
  16265. || parent.data === null /* Regular Element. */)) {
  16266. // We only add element if not in View or not projected.
  16267. var /** @type {?} */ renderer = currentView.renderer;
  16268. (/** @type {?} */ (renderer)).listen ? /** @type {?} */ (((/** @type {?} */ (renderer)).appendChild))(/** @type {?} */ (((parent.native))), child) : /** @type {?} */ ((parent.native)).appendChild(child);
  16269. return true;
  16270. }
  16271. return false;
  16272. }
  16273. /**
  16274. * Inserts the provided node before the correct element in the DOM, if appropriate.
  16275. *
  16276. * If the parent is a view, the element will be inserted as part of viewEnd(), so
  16277. * the element should not be inserted now. Similarly, if the child is a content child
  16278. * of a parent component, the child will be inserted to the right position later by
  16279. * the content projection system. Otherwise, insertBefore normally.
  16280. *
  16281. * @param {?} node Node to insert
  16282. * @param {?} currentView The current view's ViewState
  16283. * @return {?}
  16284. */
  16285. function insertChild(node, currentView) {
  16286. var /** @type {?} */ parent = /** @type {?} */ ((node.parent));
  16287. // Only add child element to parent element if the parent element is regular Element.
  16288. // If parent is:
  16289. // - Normal element => add child
  16290. // - Component element =>
  16291. // - Current View, and parent view same => content don't add -> parent component will
  16292. // re-project if needed.
  16293. // - Current View, and parent view different => view => add Child
  16294. // - View element => View's get added separately.
  16295. if ((parent.flags & 3 /* TYPE_MASK */) === 3 /* Element */ &&
  16296. (parent.view !==
  16297. currentView /* Crossing View Boundaries, its Component, but add Element of View */
  16298. || parent.data === null /* Regular Element. */)) {
  16299. // We only add element if not in View or not projected.
  16300. var /** @type {?} */ sibling = node.next;
  16301. var /** @type {?} */ nativeSibling = null;
  16302. while (sibling && (nativeSibling = sibling.native) === null) {
  16303. sibling = sibling.next;
  16304. }
  16305. var /** @type {?} */ renderer = currentView.renderer;
  16306. (/** @type {?} */ (renderer)).listen ? /** @type {?} */ (((/** @type {?} */ (renderer))
  16307. .insertBefore))(/** @type {?} */ ((parent.native)), /** @type {?} */ ((node.native)), nativeSibling) : /** @type {?} */ ((parent.native)).insertBefore(/** @type {?} */ ((node.native)), nativeSibling, false);
  16308. }
  16309. }
  16310. /**
  16311. * Appends a projected node to the DOM, or in the case of a projected container,
  16312. * appends the nodes from all of the container's active views to the DOM. Also stores the
  16313. * node in the given projectedNodes array.
  16314. *
  16315. * @param {?} projectedNodes Array to store the projected node
  16316. * @param {?} node The node to process
  16317. * @param {?} currentParent The last parent element to be processed
  16318. * @param {?} currentView The current view's ViewState
  16319. * @return {?}
  16320. */
  16321. /**
  16322. * @fileoverview added by tsickle
  16323. * @suppress {checkTypes} checked by tsc
  16324. */
  16325. /**
  16326. * @license
  16327. * Copyright Google Inc. All Rights Reserved.
  16328. *
  16329. * Use of this source code is governed by an MIT-style license that can be
  16330. * found in the LICENSE file at https://angular.io/license
  16331. */
  16332. /**
  16333. * A utility function to match an Ivy node static data against a simple CSS selector
  16334. *
  16335. * @param {?} lNodeStaticData
  16336. * @param {?} selector
  16337. * @return {?} true if node matches the selector.
  16338. */
  16339. /**
  16340. * @param {?} lNodeStaticData
  16341. * @param {?} selector
  16342. * @return {?}
  16343. */
  16344. /**
  16345. * @param {?} lNodeStaticData
  16346. * @param {?} selector
  16347. * @return {?}
  16348. */
  16349. /**
  16350. * @fileoverview added by tsickle
  16351. * @suppress {checkTypes} checked by tsc
  16352. */
  16353. /**
  16354. * @license
  16355. * Copyright Google Inc. All Rights Reserved.
  16356. *
  16357. * Use of this source code is governed by an MIT-style license that can be
  16358. * found in the LICENSE file at https://angular.io/license
  16359. */
  16360. /**
  16361. * Must use this method for CD (instead of === ) since NaN !== NaN
  16362. * @param {?} a
  16363. * @param {?} b
  16364. * @return {?}
  16365. */
  16366. function isDifferent(a, b) {
  16367. // NaN is the only value that is not equal to itself so the first
  16368. // test checks if both a and b are not NaN
  16369. return !(a !== a && b !== b) && a !== b;
  16370. }
  16371. /**
  16372. * @param {?} value
  16373. * @return {?}
  16374. */
  16375. function stringify$1(value) {
  16376. if (typeof value == 'function')
  16377. return value.name || value;
  16378. if (typeof value == 'string')
  16379. return value;
  16380. if (value == null)
  16381. return '';
  16382. return '' + value;
  16383. }
  16384. /**
  16385. * Function that throws a "not implemented" error so it's clear certain
  16386. * behaviors/methods aren't yet ready.
  16387. *
  16388. * @return {?} Not implemented error
  16389. */
  16390. /**
  16391. * @fileoverview added by tsickle
  16392. * @suppress {checkTypes} checked by tsc
  16393. */
  16394. /**
  16395. * @license
  16396. * Copyright Google Inc. All Rights Reserved.
  16397. *
  16398. * Use of this source code is governed by an MIT-style license that can be
  16399. * found in the LICENSE file at https://angular.io/license
  16400. */
  16401. /**
  16402. * If a directive is diPublic, bloomAdd sets a property on the instance with this constant as
  16403. * the key and the directive's unique ID as the value. This allows us to map directives to their
  16404. * bloom filter bit for DI.
  16405. */
  16406. var NG_ELEMENT_ID = '__NG_ELEMENT_ID__';
  16407. /**
  16408. * The number of slots in each bloom filter (used by DI). The larger this number, the fewer
  16409. * directives that will share slots, and thus, the fewer false positives when checking for
  16410. * the existence of a directive.
  16411. */
  16412. var BLOOM_SIZE = 128;
  16413. /**
  16414. * Registers this directive as present in its node's injector by flipping the directive's
  16415. * corresponding bit in the injector's bloom filter.
  16416. *
  16417. * @param {?} injector The node injector in which the directive should be registered
  16418. * @param {?} type The directive to register
  16419. * @return {?}
  16420. */
  16421. /**
  16422. * Creates (or gets an existing) injector for a given element or container.
  16423. *
  16424. * @param {?} node for which an injector should be retrieved / created.
  16425. * @return {?} Node injector
  16426. */
  16427. /**
  16428. * Constructs an injection error with the given text and token.
  16429. *
  16430. * @param {?} text The text of the error
  16431. * @param {?} token The token associated with the error
  16432. * @return {?} The error that was created
  16433. */
  16434. function createInjectionError(text, token) {
  16435. return new Error("ElementInjector: " + text + " [" + stringify$1(token) + "]");
  16436. }
  16437. /**
  16438. * Makes a directive public to the DI system by adding it to an injector's bloom filter.
  16439. *
  16440. * @param {?} di The node injector in which a directive will be added
  16441. * @param {?} def The definition of the directive to be made public
  16442. * @return {?}
  16443. */
  16444. /**
  16445. * Searches for an instance of the given directive type up the injector tree and returns
  16446. * that instance if found.
  16447. *
  16448. * Specifically, it gets the bloom filter bit associated with the directive (see bloomHashBit),
  16449. * checks that bit against the bloom filter structure to identify an injector that might have
  16450. * the directive (see bloomFindPossibleInjector), then searches the directives on that injector
  16451. * for a match.
  16452. *
  16453. * If not found, it will propagate up to the next parent injector until the token
  16454. * is found or the top is reached.
  16455. *
  16456. * @template T
  16457. * @param {?} di Node injector where the search should start
  16458. * @param {?} token The directive type to search for
  16459. * @param {?=} flags Injection flags (e.g. CheckParent)
  16460. * @return {?} The instance found
  16461. */
  16462. /**
  16463. * Given a directive type, this function returns the bit in an injector's bloom filter
  16464. * that should be used to determine whether or not the directive is present.
  16465. *
  16466. * When the directive was added to the bloom filter, it was given a unique ID that can be
  16467. * retrieved on the class. Since there are only BLOOM_SIZE slots per bloom filter, the directive's
  16468. * ID must be modulo-ed by BLOOM_SIZE to get the correct bloom bit (directives share slots after
  16469. * BLOOM_SIZE is reached).
  16470. *
  16471. * @param {?} type The directive type
  16472. * @return {?} The bloom bit to check for the directive
  16473. */
  16474. function bloomHashBit(type) {
  16475. var /** @type {?} */ id = (/** @type {?} */ (type))[NG_ELEMENT_ID];
  16476. return typeof id === 'number' ? id % BLOOM_SIZE : null;
  16477. }
  16478. /**
  16479. * Finds the closest injector that might have a certain directive.
  16480. *
  16481. * Each directive corresponds to a bit in an injector's bloom filter. Given the bloom bit to
  16482. * check and a starting injector, this function traverses up injectors until it finds an
  16483. * injector that contains a 1 for that bit in its bloom filter. A 1 indicates that the
  16484. * injector may have that directive. It only *may* have the directive because directives begin
  16485. * to share bloom filter bits after the BLOOM_SIZE is reached, and it could correspond to a
  16486. * different directive sharing the bit.
  16487. *
  16488. * Note: We can skip checking further injectors up the tree if an injector's cbf structure
  16489. * has a 0 for that bloom bit. Since cbf contains the merged value of all the parent
  16490. * injectors, a 0 in the bloom bit indicates that the parents definitely do not contain
  16491. * the directive and do not need to be checked.
  16492. *
  16493. * @param {?} startInjector
  16494. * @param {?} bloomBit The bit to check in each injector's bloom filter
  16495. * @return {?} An injector that might have the directive
  16496. */
  16497. function bloomFindPossibleInjector(startInjector, bloomBit) {
  16498. // Create a mask that targets the specific bit associated with the directive we're looking for.
  16499. // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding
  16500. // to bit positions 0 - 31 in a 32 bit integer.
  16501. var /** @type {?} */ mask = 1 << bloomBit;
  16502. // Traverse up the injector tree until we find a potential match or until we know there *isn't* a
  16503. // match.
  16504. var /** @type {?} */ injector = startInjector;
  16505. while (injector) {
  16506. // Our bloom filter size is 128 bits, which is four 32-bit bloom filter buckets:
  16507. // bf0 = [0 - 31], bf1 = [32 - 63], bf2 = [64 - 95], bf3 = [96 - 127]
  16508. // Get the bloom filter value from the appropriate bucket based on the directive's bloomBit.
  16509. var /** @type {?} */ value = bloomBit < 64 ? (bloomBit < 32 ? injector.bf0 : injector.bf1) :
  16510. (bloomBit < 96 ? injector.bf2 : injector.bf3);
  16511. // If the bloom filter value has the bit corresponding to the directive's bloomBit flipped on,
  16512. // this injector is a potential match.
  16513. if ((value & mask) === mask) {
  16514. return injector;
  16515. }
  16516. // If the current injector does not have the directive, check the bloom filters for the ancestor
  16517. // injectors (cbf0 - cbf3). These filters capture *all* ancestor injectors.
  16518. value = bloomBit < 64 ? (bloomBit < 32 ? injector.cbf0 : injector.cbf1) :
  16519. (bloomBit < 96 ? injector.cbf2 : injector.cbf3);
  16520. // If the ancestor bloom filter value has the bit corresponding to the directive, traverse up to
  16521. // find the specific injector. If the ancestor bloom filter does not have the bit, we can abort.
  16522. injector = (value & mask) ? injector.parent : null;
  16523. }
  16524. return null;
  16525. }
  16526. /**
  16527. * Creates an ElementRef for a given node injector and stores it on the injector.
  16528. * Or, if the ElementRef already exists, retrieves the existing ElementRef.
  16529. *
  16530. * @param {?} di The node injector where we should store a created ElementRef
  16531. * @return {?} The ElementRef instance to use
  16532. */
  16533. /**
  16534. * Creates a TemplateRef and stores it on the injector. Or, if the TemplateRef already
  16535. * exists, retrieves the existing TemplateRef.
  16536. *
  16537. * @template T
  16538. * @param {?} di The node injector where we should store a created TemplateRef
  16539. * @return {?} The TemplateRef instance to use
  16540. */
  16541. /**
  16542. * Creates a ViewContainerRef and stores it on the injector. Or, if the ViewContainerRef
  16543. * already exists, retrieves the existing ViewContainerRef.
  16544. *
  16545. * @param {?} di
  16546. * @return {?} The ViewContainerRef instance to use
  16547. */
  16548. /**
  16549. * @fileoverview added by tsickle
  16550. * @suppress {checkTypes} checked by tsc
  16551. */
  16552. /**
  16553. * @license
  16554. * Copyright Google Inc. All Rights Reserved.
  16555. *
  16556. * Use of this source code is governed by an MIT-style license that can be
  16557. * found in the LICENSE file at https://angular.io/license
  16558. */
  16559. /**
  16560. * A predicate which determines if a given element/directive should be included in the query
  16561. * @record
  16562. * @template T
  16563. */
  16564. /**
  16565. * @template T
  16566. */
  16567. var QueryList_ = /** @class */ (function () {
  16568. function QueryList_() {
  16569. this.dirty = false;
  16570. /**
  16571. * \@internal
  16572. */
  16573. this._valuesTree = null;
  16574. /**
  16575. * \@internal
  16576. */
  16577. this._values = null;
  16578. }
  16579. Object.defineProperty(QueryList_.prototype, "length", {
  16580. get: /**
  16581. * @return {?}
  16582. */
  16583. function () {
  16584. ngDevMode && assertNotNull(this._values, 'refreshed');
  16585. return /** @type {?} */ ((this._values)).length;
  16586. },
  16587. enumerable: true,
  16588. configurable: true
  16589. });
  16590. Object.defineProperty(QueryList_.prototype, "first", {
  16591. get: /**
  16592. * @return {?}
  16593. */
  16594. function () {
  16595. ngDevMode && assertNotNull(this._values, 'refreshed');
  16596. var /** @type {?} */ values = /** @type {?} */ ((this._values));
  16597. return values.length ? values[0] : null;
  16598. },
  16599. enumerable: true,
  16600. configurable: true
  16601. });
  16602. Object.defineProperty(QueryList_.prototype, "last", {
  16603. get: /**
  16604. * @return {?}
  16605. */
  16606. function () {
  16607. ngDevMode && assertNotNull(this._values, 'refreshed');
  16608. var /** @type {?} */ values = /** @type {?} */ ((this._values));
  16609. return values.length ? values[values.length - 1] : null;
  16610. },
  16611. enumerable: true,
  16612. configurable: true
  16613. });
  16614. /** @internal */
  16615. /**
  16616. * \@internal
  16617. * @return {?}
  16618. */
  16619. QueryList_.prototype._refresh = /**
  16620. * \@internal
  16621. * @return {?}
  16622. */
  16623. function () {
  16624. // TODO(misko): needs more logic to flatten tree.
  16625. if (this._values === null) {
  16626. this._values = this._valuesTree;
  16627. return true;
  16628. }
  16629. return false;
  16630. };
  16631. /**
  16632. * @template U
  16633. * @param {?} fn
  16634. * @return {?}
  16635. */
  16636. QueryList_.prototype.map = /**
  16637. * @template U
  16638. * @param {?} fn
  16639. * @return {?}
  16640. */
  16641. function (fn) {
  16642. throw new Error('Method not implemented.');
  16643. };
  16644. /**
  16645. * @param {?} fn
  16646. * @return {?}
  16647. */
  16648. QueryList_.prototype.filter = /**
  16649. * @param {?} fn
  16650. * @return {?}
  16651. */
  16652. function (fn) {
  16653. throw new Error('Method not implemented.');
  16654. };
  16655. /**
  16656. * @param {?} fn
  16657. * @return {?}
  16658. */
  16659. QueryList_.prototype.find = /**
  16660. * @param {?} fn
  16661. * @return {?}
  16662. */
  16663. function (fn) {
  16664. throw new Error('Method not implemented.');
  16665. };
  16666. /**
  16667. * @template U
  16668. * @param {?} fn
  16669. * @param {?} init
  16670. * @return {?}
  16671. */
  16672. QueryList_.prototype.reduce = /**
  16673. * @template U
  16674. * @param {?} fn
  16675. * @param {?} init
  16676. * @return {?}
  16677. */
  16678. function (fn, init) {
  16679. throw new Error('Method not implemented.');
  16680. };
  16681. /**
  16682. * @param {?} fn
  16683. * @return {?}
  16684. */
  16685. QueryList_.prototype.forEach = /**
  16686. * @param {?} fn
  16687. * @return {?}
  16688. */
  16689. function (fn) {
  16690. throw new Error('Method not implemented.');
  16691. };
  16692. /**
  16693. * @param {?} fn
  16694. * @return {?}
  16695. */
  16696. QueryList_.prototype.some = /**
  16697. * @param {?} fn
  16698. * @return {?}
  16699. */
  16700. function (fn) {
  16701. throw new Error('Method not implemented.');
  16702. };
  16703. /**
  16704. * @return {?}
  16705. */
  16706. QueryList_.prototype.toArray = /**
  16707. * @return {?}
  16708. */
  16709. function () {
  16710. ngDevMode && assertNotNull(this._values, 'refreshed');
  16711. return /** @type {?} */ ((this._values));
  16712. };
  16713. /**
  16714. * @return {?}
  16715. */
  16716. QueryList_.prototype.toString = /**
  16717. * @return {?}
  16718. */
  16719. function () { throw new Error('Method not implemented.'); };
  16720. /**
  16721. * @param {?} res
  16722. * @return {?}
  16723. */
  16724. QueryList_.prototype.reset = /**
  16725. * @param {?} res
  16726. * @return {?}
  16727. */
  16728. function (res) { throw new Error('Method not implemented.'); };
  16729. /**
  16730. * @return {?}
  16731. */
  16732. QueryList_.prototype.notifyOnChanges = /**
  16733. * @return {?}
  16734. */
  16735. function () { throw new Error('Method not implemented.'); };
  16736. /**
  16737. * @return {?}
  16738. */
  16739. QueryList_.prototype.setDirty = /**
  16740. * @return {?}
  16741. */
  16742. function () { throw new Error('Method not implemented.'); };
  16743. /**
  16744. * @return {?}
  16745. */
  16746. QueryList_.prototype.destroy = /**
  16747. * @return {?}
  16748. */
  16749. function () { throw new Error('Method not implemented.'); };
  16750. return QueryList_;
  16751. }());
  16752. /**
  16753. * @param {?} query
  16754. * @return {?}
  16755. */
  16756. /**
  16757. * @fileoverview added by tsickle
  16758. * @suppress {checkTypes} checked by tsc
  16759. */
  16760. /**
  16761. * @license
  16762. * Copyright Google Inc. All Rights Reserved.
  16763. *
  16764. * Use of this source code is governed by an MIT-style license that can be
  16765. * found in the LICENSE file at https://angular.io/license
  16766. */
  16767. /** @enum {number} */
  16768. var RendererStyleFlags3 = {
  16769. Important: 1,
  16770. DashCase: 2,
  16771. };
  16772. RendererStyleFlags3[RendererStyleFlags3.Important] = "Important";
  16773. RendererStyleFlags3[RendererStyleFlags3.DashCase] = "DashCase";
  16774. /**
  16775. * Object Oriented style of API needed to create elements and text nodes.
  16776. *
  16777. * This is the native browser API style, e.g. operations are methods on individual objects
  16778. * like HTMLElement. With this style, no additional code is needed as a facade
  16779. * (reducing payload size).
  16780. *
  16781. * @record
  16782. */
  16783. /**
  16784. * Procedural style of API needed to create elements and text nodes.
  16785. *
  16786. * In non-native browser environments (e.g. platforms such as web-workers), this is the
  16787. * facade that enables element manipulation. This also facilitates backwards compatibility
  16788. * with Renderer2.
  16789. * @record
  16790. */
  16791. /**
  16792. * @record
  16793. */
  16794. var domRendererFactory3 = {
  16795. createRenderer: function (hostElement, rendererType) { return document; }
  16796. };
  16797. /**
  16798. * Subset of API needed for appending elements and text nodes.
  16799. * @record
  16800. */
  16801. /**
  16802. * Subset of API needed for writing attributes, properties, and setting up
  16803. * listeners on Element.
  16804. * @record
  16805. */
  16806. /**
  16807. * @record
  16808. */
  16809. /**
  16810. * @record
  16811. */
  16812. /**
  16813. * @record
  16814. */
  16815. /**
  16816. * @record
  16817. */
  16818. /**
  16819. * @fileoverview added by tsickle
  16820. * @suppress {checkTypes} checked by tsc
  16821. */
  16822. /**
  16823. * @license
  16824. * Copyright Google Inc. All Rights Reserved.
  16825. *
  16826. * Use of this source code is governed by an MIT-style license that can be
  16827. * found in the LICENSE file at https://angular.io/license
  16828. */
  16829. /**
  16830. * Directive (D) sets a property on all component instances using this constant as a key and the
  16831. * component's host node (LElement) as the value. This is used in methods like detectChanges to
  16832. * facilitate jumping from an instance to the host node.
  16833. */
  16834. var NG_HOST_SYMBOL = '__ngHostLNode__';
  16835. /**
  16836. * This property gets set before entering a template.
  16837. *
  16838. * This renderer can be one of two varieties of Renderer3:
  16839. *
  16840. * - ObjectedOrientedRenderer3
  16841. *
  16842. * This is the native browser API style, e.g. operations are methods on individual objects
  16843. * like HTMLElement. With this style, no additional code is needed as a facade (reducing payload
  16844. * size).
  16845. *
  16846. * - ProceduralRenderer3
  16847. *
  16848. * In non-native browser environments (e.g. platforms such as web-workers), this is the facade
  16849. * that enables element manipulation. This also facilitates backwards compatibility with
  16850. * Renderer2.
  16851. */
  16852. var renderer;
  16853. var rendererFactory;
  16854. /**
  16855. * Used to set the parent property when nodes are created.
  16856. */
  16857. var previousOrParentNode;
  16858. /**
  16859. * If `isParent` is:
  16860. * - `true`: then `previousOrParentNode` points to a parent node.
  16861. * - `false`: then `previousOrParentNode` points to previous node (sibling).
  16862. */
  16863. var isParent;
  16864. /**
  16865. * The current template's static data (shared between all templates of a
  16866. * given type).
  16867. *
  16868. * Each node's static data is stored at the same index that it's stored
  16869. * in the data array. Any nodes that do not have static data store a null
  16870. * value to avoid a sparse array.
  16871. */
  16872. var ngStaticData;
  16873. /**
  16874. * State of the current view being processed.
  16875. */
  16876. var currentView;
  16877. // The initialization has to be after the `let`, otherwise `createViewState` can't see `let`.
  16878. currentView = createViewState(/** @type {?} */ ((null)), /** @type {?} */ ((null)), []);
  16879. var currentQuery;
  16880. /**
  16881. * This property gets set before entering a template.
  16882. */
  16883. var creationMode;
  16884. /**
  16885. * An array of nodes (text, element, container, etc), their bindings, and
  16886. * any local variables that need to be stored between invocations.
  16887. */
  16888. var data;
  16889. /**
  16890. * Points to the next binding index to read or write to.
  16891. */
  16892. var bindingIndex;
  16893. /**
  16894. * When a view is destroyed, listeners need to be released
  16895. * and onDestroy callbacks need to be called. This cleanup array
  16896. * stores both listener data (in chunks of 4) and onDestroy data
  16897. * (in chunks of 2), as they'll be processed at the same time.
  16898. *
  16899. * If it's a listener being stored:
  16900. * 1st index is: event name to remove
  16901. * 2nd index is: native element
  16902. * 3rd index is: listener function
  16903. * 4th index is: useCapture boolean
  16904. *
  16905. * If it's an onDestroy function:
  16906. * 1st index is: onDestroy function
  16907. * 2nd index is: context for function
  16908. */
  16909. var cleanup;
  16910. /**
  16911. * Index in the data array at which view hooks begin to be stored.
  16912. */
  16913. var viewHookStartIndex;
  16914. /**
  16915. * Swap the current state with a new state.
  16916. *
  16917. * For performance reasons we store the state in the top level of the module.
  16918. * This way we minimize the number of properties to read. Whenever a new view
  16919. * is entered we have to store the state for later, and when the view is
  16920. * exited the state has to be restored
  16921. *
  16922. * @param {?} newViewState New state to become active
  16923. * @param {?} host Element to which the View is a child of
  16924. * @return {?} the previous state;
  16925. */
  16926. function enterView(newViewState, host) {
  16927. var /** @type {?} */ oldViewState = currentView;
  16928. data = newViewState.data;
  16929. bindingIndex = newViewState.bindingStartIndex || 0;
  16930. ngStaticData = newViewState.ngStaticData;
  16931. creationMode = newViewState.creationMode;
  16932. viewHookStartIndex = newViewState.viewHookStartIndex;
  16933. cleanup = newViewState.cleanup;
  16934. renderer = newViewState.renderer;
  16935. if (host != null) {
  16936. previousOrParentNode = host;
  16937. isParent = true;
  16938. }
  16939. currentView = newViewState;
  16940. return /** @type {?} */ ((oldViewState));
  16941. }
  16942. /**
  16943. * Used in lieu of enterView to make it clear when we are exiting a child view. This makes
  16944. * the direction of traversal (up or down the view tree) a bit clearer.
  16945. * @param {?} newViewState
  16946. * @return {?}
  16947. */
  16948. function leaveView(newViewState) {
  16949. executeViewHooks();
  16950. enterView(newViewState, null);
  16951. }
  16952. /**
  16953. * @param {?} viewId
  16954. * @param {?} renderer
  16955. * @param {?} ngStaticData
  16956. * @return {?}
  16957. */
  16958. function createViewState(viewId, renderer, ngStaticData) {
  16959. var /** @type {?} */ newView = {
  16960. parent: currentView,
  16961. id: viewId,
  16962. // -1 for component views
  16963. node: /** @type {?} */ ((null)),
  16964. // until we initialize it in createNode.
  16965. data: [],
  16966. ngStaticData: ngStaticData,
  16967. cleanup: null,
  16968. renderer: renderer,
  16969. child: null,
  16970. tail: null,
  16971. next: null,
  16972. bindingStartIndex: null,
  16973. creationMode: true,
  16974. viewHookStartIndex: null
  16975. };
  16976. return newView;
  16977. }
  16978. /**
  16979. * @param {?} index
  16980. * @param {?} type
  16981. * @param {?} native
  16982. * @param {?=} state
  16983. * @return {?}
  16984. */
  16985. function createLNode(index, type, native, state) {
  16986. var /** @type {?} */ parent = isParent ? previousOrParentNode :
  16987. previousOrParentNode && /** @type {?} */ (previousOrParentNode.parent);
  16988. var /** @type {?} */ query = (isParent ? currentQuery : previousOrParentNode && previousOrParentNode.query) ||
  16989. parent && parent.query && parent.query.child();
  16990. var /** @type {?} */ isState = state != null;
  16991. var /** @type {?} */ node = {
  16992. flags: type,
  16993. native: /** @type {?} */ (native),
  16994. view: currentView,
  16995. parent: /** @type {?} */ (parent),
  16996. child: null,
  16997. next: null,
  16998. nodeInjector: parent ? parent.nodeInjector : null,
  16999. data: isState ? /** @type {?} */ (state) : null,
  17000. query: query,
  17001. staticData: null
  17002. };
  17003. if ((type & 2 /* ViewOrElement */) === 2 /* ViewOrElement */ && isState) {
  17004. // Bit of a hack to bust through the readonly because there is a circular dep between
  17005. // ViewState and LNode.
  17006. ngDevMode && assertEqual((/** @type {?} */ (state)).node, null, 'viewState.node');
  17007. (/** @type {?} */ ((state))).node = node;
  17008. }
  17009. if (index != null) {
  17010. // We are Element or Container
  17011. ngDevMode && assertEqual(data.length, index, 'data.length not in sequence');
  17012. data[index] = node;
  17013. // Every node adds a value to the static data array to avoid a sparse array
  17014. if (index >= ngStaticData.length) {
  17015. ngStaticData[index] = null;
  17016. }
  17017. else {
  17018. node.staticData = /** @type {?} */ (ngStaticData[index]);
  17019. }
  17020. // Now link ourselves into the tree.
  17021. if (isParent) {
  17022. currentQuery = null;
  17023. if (previousOrParentNode.view === currentView ||
  17024. (previousOrParentNode.flags & 3 /* TYPE_MASK */) === 2 /* View */) {
  17025. // We are in the same view, which means we are adding content node to the parent View.
  17026. ngDevMode && assertEqual(previousOrParentNode.child, null, 'previousNode.child');
  17027. previousOrParentNode.child = node;
  17028. }
  17029. else {
  17030. // We are adding component view, so we don't link parent node child to this node.
  17031. }
  17032. }
  17033. else if (previousOrParentNode) {
  17034. ngDevMode && assertEqual(previousOrParentNode.next, null, 'previousNode.next');
  17035. previousOrParentNode.next = node;
  17036. }
  17037. }
  17038. previousOrParentNode = node;
  17039. isParent = true;
  17040. return node;
  17041. }
  17042. /**
  17043. * Resets the application state.
  17044. * @return {?}
  17045. */
  17046. function resetApplicationState() {
  17047. isParent = false;
  17048. previousOrParentNode = /** @type {?} */ ((null));
  17049. }
  17050. /**
  17051. *
  17052. * @template T
  17053. * @param {?} hostNode
  17054. * @param {?} template Template function with the instructions.
  17055. * @param {?} context to pass into the template.
  17056. * @param {?} providedRendererFactory
  17057. * @param {?} host Existing node to render into.
  17058. * @return {?}
  17059. */
  17060. /**
  17061. * @template T
  17062. * @param {?} node
  17063. * @param {?} viewState
  17064. * @param {?} componentOrContext
  17065. * @param {?=} template
  17066. * @return {?}
  17067. */
  17068. function renderComponentOrTemplate(node, viewState, componentOrContext, template) {
  17069. var /** @type {?} */ oldView = enterView(viewState, node);
  17070. try {
  17071. if (rendererFactory.begin) {
  17072. rendererFactory.begin();
  17073. }
  17074. if (template) {
  17075. ngStaticData = template.ngStaticData || (template.ngStaticData = /** @type {?} */ ([]));
  17076. template(/** @type {?} */ ((componentOrContext)), creationMode);
  17077. }
  17078. else {
  17079. // Element was stored at 0 and directive was stored at 1 in renderComponent
  17080. // so to refresh the component, r() needs to be called with (1, 0)
  17081. (/** @type {?} */ (componentOrContext.constructor)).ngComponentDef.r(1, 0);
  17082. }
  17083. }
  17084. finally {
  17085. if (rendererFactory.end) {
  17086. rendererFactory.end();
  17087. }
  17088. viewState.creationMode = false;
  17089. leaveView(oldView);
  17090. }
  17091. }
  17092. /**
  17093. * @return {?}
  17094. */
  17095. /**
  17096. * Makes a directive public to the DI system by adding it to an injector's bloom filter.
  17097. *
  17098. * @param {?} def The definition of the directive to be made public
  17099. * @return {?}
  17100. */
  17101. /**
  17102. * Searches for an instance of the given directive type up the injector tree and returns
  17103. * that instance if found.
  17104. *
  17105. * If not found, it will propagate up to the next parent injector until the token
  17106. * is found or the top is reached.
  17107. *
  17108. * Usage example (in factory function):
  17109. *
  17110. * class SomeDirective {
  17111. * constructor(directive: DirectiveA) {}
  17112. *
  17113. * static ngDirectiveDef = defineDirective({
  17114. * type: SomeDirective,
  17115. * factory: () => new SomeDirective(inject(DirectiveA))
  17116. * });
  17117. * }
  17118. *
  17119. * @template T
  17120. * @param {?} token The directive type to search for
  17121. * @param {?=} flags Injection flags (e.g. CheckParent)
  17122. * @return {?} The instance found
  17123. */
  17124. /**
  17125. * Creates an ElementRef and stores it on the injector.
  17126. * Or, if the ElementRef already exists, retrieves the existing ElementRef.
  17127. *
  17128. * @return {?} The ElementRef instance to use
  17129. */
  17130. /**
  17131. * Creates a TemplateRef and stores it on the injector. Or, if the TemplateRef already
  17132. * exists, retrieves the existing TemplateRef.
  17133. *
  17134. * @template T
  17135. * @return {?} The TemplateRef instance to use
  17136. */
  17137. /**
  17138. * Creates a ViewContainerRef and stores it on the injector. Or, if the ViewContainerRef
  17139. * already exists, retrieves the existing ViewContainerRef.
  17140. *
  17141. * @return {?} The ViewContainerRef instance to use
  17142. */
  17143. /**
  17144. * Create DOM element. The instruction must later be followed by `elementEnd()` call.
  17145. *
  17146. * @param {?} index Index of the element in the data array
  17147. * @param {?=} nameOrComponentDef Name of the DOM Node or `ComponentDef`.
  17148. * @param {?=} attrs Statically bound set of attributes to be written into the DOM element on creation.
  17149. * @param {?=} localName A name under which a given element is exported.
  17150. *
  17151. * Attributes are passed as an array of strings where elements with an even index hold an attribute
  17152. * name and elements with an odd index hold an attribute value, ex.:
  17153. * ['id', 'warning5', 'class', 'alert']
  17154. * @return {?}
  17155. */
  17156. function elementStart(index, nameOrComponentDef, attrs, localName) {
  17157. var /** @type {?} */ node;
  17158. var /** @type {?} */ native;
  17159. if (nameOrComponentDef == null) {
  17160. // native node retrieval - used for exporting elements as tpl local variables (<div #foo>)
  17161. var /** @type {?} */ node_1 = /** @type {?} */ ((data[index]));
  17162. native = node_1 && (/** @type {?} */ (node_1)).native;
  17163. }
  17164. else {
  17165. ngDevMode && assertEqual(currentView.bindingStartIndex, null, 'bindingStartIndex');
  17166. var /** @type {?} */ isHostElement = typeof nameOrComponentDef !== 'string';
  17167. var /** @type {?} */ name_1 = isHostElement ? (/** @type {?} */ (nameOrComponentDef)).tag : /** @type {?} */ (nameOrComponentDef);
  17168. if (name_1 === null) {
  17169. // TODO: future support for nameless components.
  17170. throw 'for now name is required';
  17171. }
  17172. else {
  17173. native = renderer.createElement(name_1);
  17174. var /** @type {?} */ componentView = null;
  17175. if (isHostElement) {
  17176. var /** @type {?} */ ngStaticData_1 = getTemplateStatic((/** @type {?} */ (nameOrComponentDef)).template);
  17177. componentView = addToViewTree(createViewState(-1, rendererFactory.createRenderer(native, (/** @type {?} */ (nameOrComponentDef)).rendererType), ngStaticData_1));
  17178. }
  17179. // Only component views should be added to the view tree directly. Embedded views are
  17180. // accessed through their containers because they may be removed / re-added later.
  17181. node = createLNode(index, 3 /* Element */, native, componentView);
  17182. if (node.staticData == null) {
  17183. ngDevMode && assertDataInRange(index - 1);
  17184. node.staticData = ngStaticData[index] =
  17185. createNodeStatic(name_1, attrs || null, null, localName || null);
  17186. }
  17187. if (attrs)
  17188. setUpAttributes(native, attrs);
  17189. appendChild(/** @type {?} */ ((node.parent)), native, currentView);
  17190. }
  17191. }
  17192. return native;
  17193. }
  17194. /**
  17195. * Gets static data from a template function or creates a new static
  17196. * data array if it doesn't already exist.
  17197. *
  17198. * @param {?} template The template from which to get static data
  17199. * @return {?} NgStaticData
  17200. */
  17201. function getTemplateStatic(template) {
  17202. return template.ngStaticData || (template.ngStaticData = /** @type {?} */ ([]));
  17203. }
  17204. /**
  17205. * @param {?} native
  17206. * @param {?} attrs
  17207. * @return {?}
  17208. */
  17209. function setUpAttributes(native, attrs) {
  17210. ngDevMode && assertEqual(attrs.length % 2, 0, 'attrs.length % 2');
  17211. var /** @type {?} */ isProceduralRenderer = (/** @type {?} */ (renderer)).setAttribute;
  17212. for (var /** @type {?} */ i = 0; i < attrs.length; i += 2) {
  17213. isProceduralRenderer ? /** @type {?} */ (((/** @type {?} */ (renderer)).setAttribute))(native, attrs[i], attrs[i | 1]) :
  17214. native.setAttribute(attrs[i], attrs[i | 1]);
  17215. }
  17216. }
  17217. /**
  17218. * @param {?} text
  17219. * @param {?} token
  17220. * @return {?}
  17221. */
  17222. function createError(text, token) {
  17223. return new Error("Renderer: " + text + " [" + stringify$1(token) + "]");
  17224. }
  17225. /**
  17226. * Locates the host native element, used for bootstrapping existing nodes into rendering pipeline.
  17227. *
  17228. * @param {?} factory
  17229. * @param {?} elementOrSelector Render element or CSS selector to locate the element.
  17230. * @return {?}
  17231. */
  17232. function locateHostElement(factory, elementOrSelector) {
  17233. ngDevMode && assertDataInRange(-1);
  17234. rendererFactory = factory;
  17235. var /** @type {?} */ defaultRenderer = factory.createRenderer(null, null);
  17236. var /** @type {?} */ rNode = typeof elementOrSelector === 'string' ?
  17237. ((/** @type {?} */ (defaultRenderer)).selectRootElement ?
  17238. (/** @type {?} */ (defaultRenderer)).selectRootElement(elementOrSelector) : /** @type {?} */ (((/** @type {?} */ (defaultRenderer)).querySelector))(elementOrSelector)) :
  17239. elementOrSelector;
  17240. if (ngDevMode && !rNode) {
  17241. if (typeof elementOrSelector === 'string') {
  17242. throw createError('Host node with selector not found:', elementOrSelector);
  17243. }
  17244. else {
  17245. throw createError('Host node is required:', elementOrSelector);
  17246. }
  17247. }
  17248. return rNode;
  17249. }
  17250. /**
  17251. * Creates the host LNode..
  17252. *
  17253. * @param {?} rNode Render host element.
  17254. * @param {?} def
  17255. * @return {?}
  17256. */
  17257. function hostElement(rNode, def) {
  17258. resetApplicationState();
  17259. createLNode(0, 3 /* Element */, rNode, createViewState(-1, renderer, getTemplateStatic(def.template)));
  17260. }
  17261. /**
  17262. * Adds an event listener to the current node.
  17263. *
  17264. * If an output exists on one of the node's directives, it also subscribes to the output
  17265. * and saves the subscription for later cleanup.
  17266. *
  17267. * @param {?} eventName Name of the event
  17268. * @param {?} listener The function to be called when event emits
  17269. * @param {?=} useCapture Whether or not to use capture in event listener.
  17270. * @return {?}
  17271. */
  17272. /**
  17273. * Mark the end of the element.
  17274. * @return {?}
  17275. */
  17276. function elementEnd() {
  17277. if (isParent) {
  17278. isParent = false;
  17279. }
  17280. else {
  17281. ngDevMode && assertHasParent();
  17282. previousOrParentNode = /** @type {?} */ ((previousOrParentNode.parent));
  17283. }
  17284. ngDevMode && assertNodeType(previousOrParentNode, 3 /* Element */);
  17285. var /** @type {?} */ query = previousOrParentNode.query;
  17286. query && query.addNode(previousOrParentNode);
  17287. }
  17288. /**
  17289. * Update an attribute on an Element. This is used with a `bind` instruction.
  17290. *
  17291. * @param {?} index The index of the element to update in the data array
  17292. * @param {?} attrName Name of attribute. Because it is going to DOM, this is not subject to
  17293. * renaming as port of minification.
  17294. * @param {?} value Value to write. This value will go through stringification.
  17295. * @return {?}
  17296. */
  17297. /**
  17298. * Update a property on an Element.
  17299. *
  17300. * If the property name also exists as an input property on one of the element's directives,
  17301. * the component property will be set instead of the element property. This check must
  17302. * be conducted at runtime so child components that add new \@Inputs don't have to be re-compiled.
  17303. *
  17304. * @template T
  17305. * @param {?} index The index of the element to update in the data array
  17306. * @param {?} propName Name of property. Because it is going to DOM, this is not subject to
  17307. * renaming as part of minification.
  17308. * @param {?} value New value to write.
  17309. * @return {?}
  17310. */
  17311. function elementProperty(index, propName, value) {
  17312. if (value === NO_CHANGE)
  17313. return;
  17314. var /** @type {?} */ node = /** @type {?} */ (data[index]);
  17315. var /** @type {?} */ staticData = /** @type {?} */ ((node.staticData));
  17316. // if staticData.inputs is undefined, a listener has created output staticData, but inputs haven't
  17317. // yet been checked
  17318. if (staticData.inputs === undefined) {
  17319. // mark inputs as checked
  17320. staticData.inputs = null;
  17321. staticData = generatePropertyAliases(node.flags, staticData, true);
  17322. }
  17323. var /** @type {?} */ inputData = staticData.inputs;
  17324. var /** @type {?} */ dataValue;
  17325. if (inputData && (dataValue = inputData[propName])) {
  17326. setInputsForProperty(dataValue, value);
  17327. }
  17328. else {
  17329. var /** @type {?} */ native = node.native;
  17330. (/** @type {?} */ (renderer)).setProperty ?
  17331. (/** @type {?} */ (renderer)).setProperty(native, propName, value) :
  17332. native.setProperty ? native.setProperty(propName, value) :
  17333. (/** @type {?} */ (native))[propName] = value;
  17334. }
  17335. }
  17336. /**
  17337. * Constructs a LNodeStatic object from the arguments.
  17338. *
  17339. * @param {?} tagName
  17340. * @param {?} attrs
  17341. * @param {?} containerStatic
  17342. * @param {?} localName
  17343. * @return {?} the LNodeStatic object
  17344. */
  17345. function createNodeStatic(tagName, attrs, containerStatic, localName) {
  17346. return {
  17347. tagName: tagName,
  17348. attrs: attrs,
  17349. localNames: localName ? [localName, -1] : null,
  17350. initialInputs: undefined,
  17351. inputs: undefined,
  17352. outputs: undefined,
  17353. containerStatic: containerStatic
  17354. };
  17355. }
  17356. /**
  17357. * Given a list of directive indices and minified input names, sets the
  17358. * input properties on the corresponding directives.
  17359. * @param {?} inputs
  17360. * @param {?} value
  17361. * @return {?}
  17362. */
  17363. function setInputsForProperty(inputs, value) {
  17364. for (var /** @type {?} */ i = 0; i < inputs.length; i += 2) {
  17365. ngDevMode && assertDataInRange(/** @type {?} */ (inputs[i]));
  17366. data[/** @type {?} */ (inputs[i])][inputs[i | 1]] = value;
  17367. }
  17368. }
  17369. /**
  17370. * This function consolidates all the inputs or outputs defined by directives
  17371. * on this node into one object and stores it in ngStaticData so it can
  17372. * be shared between all templates of this type.
  17373. *
  17374. * @param {?} flags
  17375. * @param {?} data
  17376. * @param {?=} isInputData
  17377. * @return {?}
  17378. */
  17379. function generatePropertyAliases(flags, data, isInputData) {
  17380. if (isInputData === void 0) { isInputData = false; }
  17381. var /** @type {?} */ start = flags >> 12;
  17382. var /** @type {?} */ size = (flags & 4092 /* SIZE_MASK */) >> 2;
  17383. for (var /** @type {?} */ i = start, /** @type {?} */ ii = start + size; i < ii; i++) {
  17384. var /** @type {?} */ directiveDef = /** @type {?} */ (((ngStaticData))[i]);
  17385. var /** @type {?} */ propertyAliasMap = isInputData ? directiveDef.inputs : directiveDef.outputs;
  17386. for (var /** @type {?} */ publicName in propertyAliasMap) {
  17387. if (propertyAliasMap.hasOwnProperty(publicName)) {
  17388. var /** @type {?} */ internalName = propertyAliasMap[publicName];
  17389. var /** @type {?} */ staticDirData = isInputData ? (data.inputs || (data.inputs = {})) :
  17390. (data.outputs || (data.outputs = {}));
  17391. var /** @type {?} */ hasProperty = staticDirData.hasOwnProperty(publicName);
  17392. hasProperty ? staticDirData[publicName].push(i, internalName) :
  17393. (staticDirData[publicName] = [i, internalName]);
  17394. }
  17395. }
  17396. }
  17397. return data;
  17398. }
  17399. /**
  17400. * Add or remove a class in a classList.
  17401. *
  17402. * This instruction is meant to handle the [class.foo]="exp" case
  17403. *
  17404. * @template T
  17405. * @param {?} index The index of the element to update in the data array
  17406. * @param {?} className Name of class to toggle. Because it is going to DOM, this is not subject to
  17407. * renaming as part of minification.
  17408. * @param {?} value A value indicating if a given class should be added or removed.
  17409. * @return {?}
  17410. */
  17411. /**
  17412. * Update a given style on an Element.
  17413. *
  17414. * @template T
  17415. * @param {?} index Index of the element to change in the data array
  17416. * @param {?} styleName Name of property. Because it is going to DOM this is not subject to
  17417. * renaming as part of minification.
  17418. * @param {?} value New value to write (null to remove).
  17419. * @param {?=} suffix Suffix to add to style's value (optional).
  17420. * @return {?}
  17421. */
  17422. function elementStyle(index, styleName, value, suffix) {
  17423. if (value !== NO_CHANGE) {
  17424. var /** @type {?} */ lElement = /** @type {?} */ (data[index]);
  17425. if (value == null) {
  17426. (/** @type {?} */ (renderer)).removeStyle ?
  17427. (/** @type {?} */ (renderer))
  17428. .removeStyle(lElement.native, styleName, RendererStyleFlags3.DashCase) :
  17429. lElement.native.style.removeProperty(styleName);
  17430. }
  17431. else {
  17432. (/** @type {?} */ (renderer)).setStyle ?
  17433. (/** @type {?} */ (renderer))
  17434. .setStyle(lElement.native, styleName, suffix ? stringify$1(value) + suffix : stringify$1(value), RendererStyleFlags3.DashCase) :
  17435. lElement.native.style.setProperty(styleName, suffix ? stringify$1(value) + suffix : stringify$1(value));
  17436. }
  17437. }
  17438. }
  17439. /**
  17440. * Create static text node
  17441. *
  17442. * @param {?} index Index of the node in the data array.
  17443. * @param {?=} value Value to write. This value will be stringified.
  17444. * If value is not provided than the actual creation of the text node is delayed.
  17445. * @return {?}
  17446. */
  17447. function text(index, value) {
  17448. ngDevMode && assertEqual(currentView.bindingStartIndex, null, 'bindingStartIndex');
  17449. var /** @type {?} */ textNode = value != null ?
  17450. ((/** @type {?} */ (renderer)).createText ?
  17451. (/** @type {?} */ (renderer)).createText(stringify$1(value)) : /** @type {?} */ (((/** @type {?} */ (renderer)).createTextNode))(stringify$1(value))) :
  17452. null;
  17453. var /** @type {?} */ node = createLNode(index, 3 /* Element */, textNode);
  17454. // Text nodes are self closing.
  17455. isParent = false;
  17456. appendChild(/** @type {?} */ ((node.parent)), textNode, currentView);
  17457. }
  17458. /**
  17459. * Create text node with binding
  17460. * Bindings should be handled externally with the proper bind(1-8) method
  17461. *
  17462. * @template T
  17463. * @param {?} index Index of the node in the data array.
  17464. * @param {?} value Stringified value to write.
  17465. * @return {?}
  17466. */
  17467. function textBinding(index, value) {
  17468. // TODO(misko): I don't think index < nodes.length check is needed here.
  17469. var /** @type {?} */ existingNode = index < data.length && /** @type {?} */ (data[index]);
  17470. if (existingNode && existingNode.native) {
  17471. // If DOM node exists and value changed, update textContent
  17472. value !== NO_CHANGE &&
  17473. ((/** @type {?} */ (renderer)).setValue ?
  17474. (/** @type {?} */ (renderer)).setValue(existingNode.native, stringify$1(value)) :
  17475. existingNode.native.textContent = stringify$1(value));
  17476. }
  17477. else if (existingNode) {
  17478. // Node was created but DOM node creation was delayed. Create and append now.
  17479. existingNode.native =
  17480. ((/** @type {?} */ (renderer)).createText ?
  17481. (/** @type {?} */ (renderer)).createText(stringify$1(value)) : /** @type {?} */ (((/** @type {?} */ (renderer)).createTextNode))(stringify$1(value)));
  17482. insertChild(existingNode, currentView);
  17483. }
  17484. else {
  17485. text(index, value);
  17486. }
  17487. }
  17488. /**
  17489. * @template T
  17490. * @param {?} index
  17491. * @param {?=} directive
  17492. * @param {?=} directiveDef
  17493. * @param {?=} localName
  17494. * @return {?}
  17495. */
  17496. function directive(index, directive, directiveDef, localName) {
  17497. var /** @type {?} */ instance;
  17498. if (directive == null) {
  17499. // return existing
  17500. ngDevMode && assertDataInRange(index);
  17501. instance = data[index];
  17502. }
  17503. else {
  17504. ngDevMode && assertEqual(currentView.bindingStartIndex, null, 'bindingStartIndex');
  17505. ngDevMode && assertPreviousIsParent();
  17506. var /** @type {?} */ flags = /** @type {?} */ ((previousOrParentNode)).flags;
  17507. var /** @type {?} */ size = flags & 4092;
  17508. if (size === 0) {
  17509. flags =
  17510. (index << 12 /* INDX_SHIFT */) | 4 /* SIZE_SKIP */ | flags & 3 /* TYPE_MASK */;
  17511. }
  17512. else {
  17513. flags += 4 /* SIZE_SKIP */;
  17514. } /** @type {?} */
  17515. ((previousOrParentNode)).flags = flags;
  17516. ngDevMode && assertDataInRange(index - 1);
  17517. Object.defineProperty(directive, NG_HOST_SYMBOL, { enumerable: false, value: previousOrParentNode });
  17518. data[index] = instance = directive;
  17519. if (index >= ngStaticData.length) {
  17520. ngStaticData[index] = /** @type {?} */ ((directiveDef));
  17521. if (localName) {
  17522. ngDevMode &&
  17523. assertNotNull(previousOrParentNode.staticData, 'previousOrParentNode.staticData');
  17524. var /** @type {?} */ nodeStaticData = /** @type {?} */ ((/** @type {?} */ ((previousOrParentNode)).staticData));
  17525. (nodeStaticData.localNames || (nodeStaticData.localNames = [])).push(localName, index);
  17526. }
  17527. }
  17528. var /** @type {?} */ diPublic_1 = /** @type {?} */ ((directiveDef)).diPublic;
  17529. if (diPublic_1) {
  17530. diPublic_1(/** @type {?} */ ((directiveDef)));
  17531. }
  17532. var /** @type {?} */ staticData = /** @type {?} */ ((previousOrParentNode.staticData));
  17533. if (staticData && staticData.attrs) {
  17534. setInputsFromAttrs(instance, /** @type {?} */ ((directiveDef)).inputs, staticData);
  17535. }
  17536. }
  17537. return instance;
  17538. }
  17539. /**
  17540. * Sets initial input properties on directive instances from attribute data
  17541. *
  17542. * @template T
  17543. * @param {?} instance Instance of the directive on which to set the initial inputs
  17544. * @param {?} inputs The list of inputs from the directive def
  17545. * @param {?} staticData The static data for this node
  17546. * @return {?}
  17547. */
  17548. function setInputsFromAttrs(instance, inputs, staticData) {
  17549. var /** @type {?} */ directiveIndex = ((previousOrParentNode.flags & 4092 /* SIZE_MASK */) >> 2 /* SIZE_SHIFT */) - 1;
  17550. var /** @type {?} */ initialInputData = /** @type {?} */ (staticData.initialInputs);
  17551. if (initialInputData === undefined || directiveIndex >= initialInputData.length) {
  17552. initialInputData = generateInitialInputs(directiveIndex, inputs, staticData);
  17553. }
  17554. var /** @type {?} */ initialInputs = initialInputData[directiveIndex];
  17555. if (initialInputs) {
  17556. for (var /** @type {?} */ i = 0; i < initialInputs.length; i += 2) {
  17557. (/** @type {?} */ (instance))[initialInputs[i]] = initialInputs[i | 1];
  17558. }
  17559. }
  17560. }
  17561. /**
  17562. * Generates initialInputData for a node and stores it in the template's static storage
  17563. * so subsequent template invocations don't have to recalculate it.
  17564. *
  17565. * initialInputData is an array containing values that need to be set as input properties
  17566. * for directives on this node, but only once on creation. We need this array to support
  17567. * the case where you set an \@Input property of a directive using attribute-like syntax.
  17568. * e.g. if you have a `name` \@Input, you can set it once like this:
  17569. *
  17570. * <my-component name="Bess"></my-component>
  17571. *
  17572. * @param {?} directiveIndex Index to store the initial input data
  17573. * @param {?} inputs The list of inputs from the directive def
  17574. * @param {?} staticData The static data on this node
  17575. * @return {?}
  17576. */
  17577. function generateInitialInputs(directiveIndex, inputs, staticData) {
  17578. var /** @type {?} */ initialInputData = staticData.initialInputs || (staticData.initialInputs = []);
  17579. initialInputData[directiveIndex] = null;
  17580. var /** @type {?} */ attrs = /** @type {?} */ ((staticData.attrs));
  17581. for (var /** @type {?} */ i = 0; i < attrs.length; i += 2) {
  17582. var /** @type {?} */ attrName = attrs[i];
  17583. var /** @type {?} */ minifiedInputName = inputs[attrName];
  17584. if (minifiedInputName !== undefined) {
  17585. var /** @type {?} */ inputsToStore = initialInputData[directiveIndex] || (initialInputData[directiveIndex] = []);
  17586. inputsToStore.push(minifiedInputName, attrs[i | 1]);
  17587. }
  17588. }
  17589. return initialInputData;
  17590. }
  17591. /**
  17592. * @param {?} lifecycle
  17593. * @param {?=} self
  17594. * @param {?=} method
  17595. * @return {?}
  17596. */
  17597. /**
  17598. * Iterates over view hook functions and calls them.
  17599. * @return {?}
  17600. */
  17601. function executeViewHooks() {
  17602. if (viewHookStartIndex == null)
  17603. return;
  17604. // Instead of using splice to remove init hooks after their first run (expensive), we
  17605. // shift over the AFTER_CHECKED hooks as we call them and truncate once at the end.
  17606. var /** @type {?} */ checkIndex = /** @type {?} */ (viewHookStartIndex);
  17607. var /** @type {?} */ writeIndex = checkIndex;
  17608. while (checkIndex < data.length) {
  17609. // Call lifecycle hook with its context
  17610. data[checkIndex + 1].call(data[checkIndex + 2]);
  17611. if (data[checkIndex] === 16 /* AFTER_VIEW_CHECKED */) {
  17612. // We know if the writeIndex falls behind that there is an init that needs to
  17613. // be overwritten.
  17614. if (writeIndex < checkIndex) {
  17615. data[writeIndex] = data[checkIndex];
  17616. data[writeIndex + 1] = data[checkIndex + 1];
  17617. data[writeIndex + 2] = data[checkIndex + 2];
  17618. }
  17619. writeIndex += 3;
  17620. }
  17621. checkIndex += 3;
  17622. }
  17623. // Truncate once at the writeIndex
  17624. data.length = writeIndex;
  17625. }
  17626. /**
  17627. * Creates an LContainer.
  17628. *
  17629. * Only `LView`s can go into `LContainer`.
  17630. *
  17631. * @param {?} index The index of the container in the data array
  17632. * @param {?=} template Optional inline template
  17633. * @param {?=} tagName The name of the container element, if applicable
  17634. * @param {?=} attrs The attrs attached to the container, if applicable
  17635. * @param {?=} localName
  17636. * @return {?}
  17637. */
  17638. function containerStart(index, template, tagName, attrs, localName) {
  17639. ngDevMode && assertEqual(currentView.bindingStartIndex, null, 'bindingStartIndex');
  17640. // If the direct parent of the container is a view, its views (including its comment)
  17641. // will need to be added through insertView() when its parent view is being inserted.
  17642. // For now, it is marked "headless" so we know to append its views later.
  17643. var /** @type {?} */ comment = renderer.createComment(ngDevMode ? 'container' : '');
  17644. var /** @type {?} */ renderParent = null;
  17645. var /** @type {?} */ currentParent = isParent ? previousOrParentNode : /** @type {?} */ ((previousOrParentNode.parent));
  17646. ngDevMode && assertNotEqual(currentParent, null, 'currentParent');
  17647. if (appendChild(currentParent, comment, currentView)) {
  17648. // we are adding to an Element which is either:
  17649. // - Not a component (will not be re-projected, just added)
  17650. // - View of the Component
  17651. renderParent = /** @type {?} */ (currentParent);
  17652. }
  17653. var /** @type {?} */ node = createLNode(index, 0 /* Container */, comment, /** @type {?} */ ({
  17654. views: [],
  17655. nextIndex: 0, renderParent: renderParent,
  17656. template: template == null ? null : template,
  17657. next: null,
  17658. parent: currentView
  17659. }));
  17660. if (node.staticData == null) {
  17661. node.staticData = ngStaticData[index] =
  17662. createNodeStatic(tagName || null, attrs || null, [], localName || null);
  17663. }
  17664. // Containers are added to the current view tree instead of their embedded views
  17665. // because views can be removed and re-inserted.
  17666. addToViewTree(node.data);
  17667. }
  17668. /**
  17669. * @return {?}
  17670. */
  17671. function containerEnd() {
  17672. if (isParent) {
  17673. isParent = false;
  17674. }
  17675. else {
  17676. ngDevMode && assertHasParent();
  17677. previousOrParentNode = /** @type {?} */ ((previousOrParentNode.parent));
  17678. }
  17679. ngDevMode && assertNodeType(previousOrParentNode, 0 /* Container */);
  17680. var /** @type {?} */ query = previousOrParentNode.query;
  17681. query && query.addNode(previousOrParentNode);
  17682. }
  17683. /**
  17684. * Sets a container up to receive views.
  17685. *
  17686. * @param {?} index The index of the container in the data array
  17687. * @return {?}
  17688. */
  17689. function containerRefreshStart(index) {
  17690. ngDevMode && assertDataInRange(index);
  17691. previousOrParentNode = /** @type {?} */ (data[index]);
  17692. ngDevMode && assertNodeType(previousOrParentNode, 0 /* Container */);
  17693. isParent = true;
  17694. (/** @type {?} */ (previousOrParentNode)).data.nextIndex = 0;
  17695. }
  17696. /**
  17697. * Marks the end of the LContainer.
  17698. *
  17699. * Marking the end of ViewContainer is the time when to child Views get inserted or removed.
  17700. * @return {?}
  17701. */
  17702. function containerRefreshEnd() {
  17703. if (isParent) {
  17704. isParent = false;
  17705. }
  17706. else {
  17707. ngDevMode && assertNodeType(previousOrParentNode, 2 /* View */);
  17708. ngDevMode && assertHasParent();
  17709. previousOrParentNode = /** @type {?} */ ((previousOrParentNode.parent));
  17710. }
  17711. ngDevMode && assertNodeType(previousOrParentNode, 0 /* Container */);
  17712. var /** @type {?} */ container = /** @type {?} */ (previousOrParentNode);
  17713. ngDevMode && assertNodeType(container, 0 /* Container */);
  17714. var /** @type {?} */ nextIndex = container.data.nextIndex;
  17715. while (nextIndex < container.data.views.length) {
  17716. // remove extra view.
  17717. removeView(container, nextIndex);
  17718. }
  17719. }
  17720. /**
  17721. * Creates an LView.
  17722. *
  17723. * @param {?} viewBlockId The ID of this view
  17724. * @return {?} Whether or not this view is in creation mode
  17725. */
  17726. function viewStart(viewBlockId) {
  17727. var /** @type {?} */ container = /** @type {?} */ ((isParent ? previousOrParentNode : /** @type {?} */ ((previousOrParentNode.parent))));
  17728. ngDevMode && assertNodeType(container, 0 /* Container */);
  17729. var /** @type {?} */ containerState = container.data;
  17730. var /** @type {?} */ views = containerState.views;
  17731. var /** @type {?} */ existingView = !creationMode && containerState.nextIndex < views.length && views[containerState.nextIndex];
  17732. var /** @type {?} */ viewUpdateMode = existingView && viewBlockId === (/** @type {?} */ (existingView)).data.id;
  17733. if (viewUpdateMode) {
  17734. previousOrParentNode = views[containerState.nextIndex++];
  17735. ngDevMode && assertNodeType(previousOrParentNode, 2 /* View */);
  17736. isParent = true;
  17737. enterView((/** @type {?} */ (existingView)).data, /** @type {?} */ (previousOrParentNode));
  17738. }
  17739. else {
  17740. // When we create a new View, we always reset the state of the instructions.
  17741. var /** @type {?} */ newViewState = createViewState(viewBlockId, renderer, initViewStaticData(viewBlockId, container));
  17742. enterView(newViewState, createLNode(null, 2 /* View */, null, newViewState));
  17743. containerState.nextIndex++;
  17744. }
  17745. return !viewUpdateMode;
  17746. }
  17747. /**
  17748. * Initialize the static data for the active view.
  17749. *
  17750. * Each embedded view needs to set the global ngStaticData variable to the static data for
  17751. * that view. Otherwise, the view's static data for a particular node would overwrite
  17752. * the staticdata for a node in the view above it with the same index (since it's in the
  17753. * same template).
  17754. *
  17755. * @param {?} viewIndex The index of the view's static data in containerStatic
  17756. * @param {?} parent The parent container in which to look for the view's static data
  17757. * @return {?} NgStaticData
  17758. */
  17759. function initViewStaticData(viewIndex, parent) {
  17760. ngDevMode && assertNodeType(parent, 0 /* Container */);
  17761. var /** @type {?} */ containerStatic = (/** @type {?} */ (((parent)).staticData)).containerStatic;
  17762. if (viewIndex >= containerStatic.length || containerStatic[viewIndex] == null) {
  17763. containerStatic[viewIndex] = [];
  17764. }
  17765. return containerStatic[viewIndex];
  17766. }
  17767. /**
  17768. * Marks the end of the LView.
  17769. * @return {?}
  17770. */
  17771. function viewEnd() {
  17772. isParent = false;
  17773. var /** @type {?} */ viewNode = previousOrParentNode = /** @type {?} */ (currentView.node);
  17774. var /** @type {?} */ container = /** @type {?} */ (previousOrParentNode.parent);
  17775. ngDevMode && assertNodeType(viewNode, 2 /* View */);
  17776. ngDevMode && assertNodeType(container, 0 /* Container */);
  17777. var /** @type {?} */ containerState = container.data;
  17778. var /** @type {?} */ previousView = containerState.nextIndex <= containerState.views.length ? /** @type {?} */ (containerState.views[containerState.nextIndex - 1]) :
  17779. null;
  17780. var /** @type {?} */ viewIdChanged = previousView == null ? true : previousView.data.id !== viewNode.data.id;
  17781. if (viewIdChanged) {
  17782. insertView(container, viewNode, containerState.nextIndex - 1);
  17783. currentView.creationMode = false;
  17784. }
  17785. leaveView(/** @type {?} */ ((/** @type {?} */ ((currentView)).parent)));
  17786. ngDevMode && assertEqual(isParent, false, 'isParent');
  17787. ngDevMode && assertNodeType(previousOrParentNode, 2 /* View */);
  17788. }
  17789. /**
  17790. * Refreshes the component view.
  17791. *
  17792. * In other words, enters the component's view and processes it to update bindings, queries, etc.
  17793. *
  17794. * @param directiveIndex
  17795. * @param elementIndex
  17796. * @param template
  17797. */
  17798. var componentRefresh = function (directiveIndex, elementIndex, template) {
  17799. ngDevMode && assertDataInRange(elementIndex);
  17800. var /** @type {?} */ element = /** @type {?} */ (((data))[elementIndex]);
  17801. ngDevMode && assertNodeType(element, 3 /* Element */);
  17802. ngDevMode && assertNotEqual(element.data, null, 'isComponent');
  17803. ngDevMode && assertDataInRange(directiveIndex);
  17804. var /** @type {?} */ hostView = /** @type {?} */ ((element.data));
  17805. ngDevMode && assertNotEqual(hostView, null, 'hostView');
  17806. var /** @type {?} */ directive = data[directiveIndex];
  17807. var /** @type {?} */ oldView = enterView(hostView, element);
  17808. try {
  17809. template(directive, creationMode);
  17810. }
  17811. finally {
  17812. hostView.creationMode = false;
  17813. leaveView(oldView);
  17814. }
  17815. };
  17816. /**
  17817. * Instruction to distribute projectable nodes among <ng-content> occurrences in a given template.
  17818. * It takes all the selectors from the entire component's template and decides where
  17819. * each projected node belongs (it re-distributes nodes among "buckets" where each "bucket" is
  17820. * backed by a selector).
  17821. *
  17822. * @param {?=} selectors
  17823. * @return {?}
  17824. */
  17825. /**
  17826. * Inserts previously re-distributed projected nodes. This instruction must be preceded by a call
  17827. * to the projectionDef instruction.
  17828. *
  17829. * @param {?} nodeIndex
  17830. * @param {?} localIndex - index under which distribution of projected nodes was memorized
  17831. * @param {?=} selectorIndex - 0 means <ng-content> without any selector
  17832. * @return {?}
  17833. */
  17834. /**
  17835. * Adds a ViewState or a ContainerState to the end of the current view tree.
  17836. *
  17837. * This structure will be used to traverse through nested views to remove listeners
  17838. * and call onDestroy callbacks.
  17839. *
  17840. * @template T
  17841. * @param {?} state The ViewState or ContainerState to add to the view tree
  17842. * @return {?} The state passed in
  17843. */
  17844. function addToViewTree(state) {
  17845. currentView.tail ? (currentView.tail.next = state) : (currentView.child = state);
  17846. currentView.tail = state;
  17847. return state;
  17848. }
  17849. /**
  17850. * A special value which designates that a value has not changed.
  17851. */
  17852. var NO_CHANGE = /** @type {?} */ ({});
  17853. /**
  17854. * Create interpolation bindings with variable number of arguments.
  17855. *
  17856. * If any of the arguments change, then the interpolation is concatenated
  17857. * and causes an update.
  17858. *
  17859. * @param {?} values an array of values to diff.
  17860. * @return {?}
  17861. */
  17862. /**
  17863. * Create a single value binding without interpolation.
  17864. *
  17865. * @template T
  17866. * @param {?} value Value to diff
  17867. * @return {?}
  17868. */
  17869. function bind(value) {
  17870. var /** @type {?} */ different;
  17871. if (different = creationMode) {
  17872. if (typeof currentView.bindingStartIndex !== 'number') {
  17873. bindingIndex = currentView.bindingStartIndex = data.length;
  17874. }
  17875. data[bindingIndex++] = value;
  17876. }
  17877. else {
  17878. if (different = value !== NO_CHANGE && isDifferent(data[bindingIndex], value)) {
  17879. data[bindingIndex] = value;
  17880. }
  17881. bindingIndex++;
  17882. }
  17883. return different ? value : NO_CHANGE;
  17884. }
  17885. /**
  17886. * Create an interpolation bindings with 1 arguments.
  17887. *
  17888. * @param {?} prefix static value used for concatenation only.
  17889. * @param {?} value value checked for change.
  17890. * @param {?} suffix static value used for concatenation only.
  17891. * @return {?}
  17892. */
  17893. function bind1(prefix, value, suffix) {
  17894. return bind(value) === NO_CHANGE ? NO_CHANGE : prefix + stringify$1(value) + suffix;
  17895. }
  17896. /**
  17897. * Create an interpolation bindings with 2 arguments.
  17898. *
  17899. * @param {?} prefix
  17900. * @param {?} v0 value checked for change
  17901. * @param {?} i0
  17902. * @param {?} v1 value checked for change
  17903. * @param {?} suffix
  17904. * @return {?}
  17905. */
  17906. /**
  17907. * Create an interpolation bindings with 3 arguments.
  17908. *
  17909. * @param {?} prefix
  17910. * @param {?} v0
  17911. * @param {?} i0
  17912. * @param {?} v1
  17913. * @param {?} i1
  17914. * @param {?} v2
  17915. * @param {?} suffix
  17916. * @return {?}
  17917. */
  17918. /**
  17919. * Create an interpolation binding with 4 arguments.
  17920. *
  17921. * @param {?} prefix
  17922. * @param {?} v0
  17923. * @param {?} i0
  17924. * @param {?} v1
  17925. * @param {?} i1
  17926. * @param {?} v2
  17927. * @param {?} i2
  17928. * @param {?} v3
  17929. * @param {?} suffix
  17930. * @return {?}
  17931. */
  17932. /**
  17933. * Create an interpolation binding with 5 arguments.
  17934. *
  17935. * @param {?} prefix
  17936. * @param {?} v0
  17937. * @param {?} i0
  17938. * @param {?} v1
  17939. * @param {?} i1
  17940. * @param {?} v2
  17941. * @param {?} i2
  17942. * @param {?} v3
  17943. * @param {?} i3
  17944. * @param {?} v4
  17945. * @param {?} suffix
  17946. * @return {?}
  17947. */
  17948. /**
  17949. * Create an interpolation binding with 6 arguments.
  17950. *
  17951. * @param {?} prefix
  17952. * @param {?} v0
  17953. * @param {?} i0
  17954. * @param {?} v1
  17955. * @param {?} i1
  17956. * @param {?} v2
  17957. * @param {?} i2
  17958. * @param {?} v3
  17959. * @param {?} i3
  17960. * @param {?} v4
  17961. * @param {?} i4
  17962. * @param {?} v5
  17963. * @param {?} suffix
  17964. * @return {?}
  17965. */
  17966. /**
  17967. * Create an interpolation binding with 7 arguments.
  17968. *
  17969. * @param {?} prefix
  17970. * @param {?} v0
  17971. * @param {?} i0
  17972. * @param {?} v1
  17973. * @param {?} i1
  17974. * @param {?} v2
  17975. * @param {?} i2
  17976. * @param {?} v3
  17977. * @param {?} i3
  17978. * @param {?} v4
  17979. * @param {?} i4
  17980. * @param {?} v5
  17981. * @param {?} i5
  17982. * @param {?} v6
  17983. * @param {?} suffix
  17984. * @return {?}
  17985. */
  17986. /**
  17987. * Create an interpolation binding with 8 arguments.
  17988. *
  17989. * @param {?} prefix
  17990. * @param {?} v0
  17991. * @param {?} i0
  17992. * @param {?} v1
  17993. * @param {?} i1
  17994. * @param {?} v2
  17995. * @param {?} i2
  17996. * @param {?} v3
  17997. * @param {?} i3
  17998. * @param {?} v4
  17999. * @param {?} i4
  18000. * @param {?} v5
  18001. * @param {?} i5
  18002. * @param {?} v6
  18003. * @param {?} i6
  18004. * @param {?} v7
  18005. * @param {?} suffix
  18006. * @return {?}
  18007. */
  18008. /**
  18009. * @template T
  18010. * @param {?} index
  18011. * @param {?=} value
  18012. * @return {?}
  18013. */
  18014. /**
  18015. * @template T
  18016. * @param {?} predicate
  18017. * @param {?=} descend
  18018. * @param {?=} read
  18019. * @return {?}
  18020. */
  18021. /**
  18022. * @return {?}
  18023. */
  18024. function assertPreviousIsParent() {
  18025. assertEqual(isParent, true, 'isParent');
  18026. }
  18027. /**
  18028. * @return {?}
  18029. */
  18030. function assertHasParent() {
  18031. assertNotEqual(previousOrParentNode.parent, null, 'isParent');
  18032. }
  18033. /**
  18034. * @param {?} index
  18035. * @param {?=} arr
  18036. * @return {?}
  18037. */
  18038. function assertDataInRange(index, arr) {
  18039. if (arr == null)
  18040. arr = data;
  18041. assertLessThan(arr ? arr.length : 0, index, 'data.length');
  18042. }
  18043. /**
  18044. * @fileoverview added by tsickle
  18045. * @suppress {checkTypes} checked by tsc
  18046. */
  18047. /**
  18048. * @license
  18049. * Copyright Google Inc. All Rights Reserved.
  18050. *
  18051. * Use of this source code is governed by an MIT-style license that can be
  18052. * found in the LICENSE file at https://angular.io/license
  18053. */
  18054. /**
  18055. * Options that control how the component should be bootstrapped.
  18056. * @record
  18057. */
  18058. /**
  18059. * Bootstraps a component, then creates and returns a `ComponentRef` for that component.
  18060. *
  18061. * @template T
  18062. * @param {?} componentType Component to bootstrap
  18063. * @param {?} opts
  18064. * @return {?}
  18065. */
  18066. // TODO: A hack to not pull in the NullInjector from @angular/core.
  18067. /**
  18068. * Bootstraps a Component into an existing host element and returns an instance
  18069. * of the component.
  18070. *
  18071. * @template T
  18072. * @param {?} componentType Component to bootstrap
  18073. * @param {?=} opts
  18074. * @return {?}
  18075. */
  18076. function renderComponent(componentType, opts) {
  18077. if (opts === void 0) { opts = {}; }
  18078. var /** @type {?} */ rendererFactory = opts.rendererFactory || domRendererFactory3;
  18079. var /** @type {?} */ componentDef = componentType.ngComponentDef;
  18080. var /** @type {?} */ component;
  18081. var /** @type {?} */ hostNode = locateHostElement(rendererFactory, opts.host || componentDef.tag);
  18082. var /** @type {?} */ oldView = enterView(createViewState(-1, rendererFactory.createRenderer(hostNode, componentDef.rendererType), []), /** @type {?} */ ((null)));
  18083. try {
  18084. // Create element node at index 0 in data array
  18085. hostElement(hostNode, componentDef);
  18086. // Create directive instance with n() and store at index 1 in data array (el is 0)
  18087. component = directive(1, componentDef.n(), componentDef);
  18088. }
  18089. finally {
  18090. leaveView(oldView);
  18091. }
  18092. opts.features && opts.features.forEach(function (feature) { return feature(component, componentDef); });
  18093. detectChanges(component);
  18094. return component;
  18095. }
  18096. /**
  18097. * @template T
  18098. * @param {?} component
  18099. * @return {?}
  18100. */
  18101. function detectChanges(component) {
  18102. ngDevMode && assertNotNull(component, 'component');
  18103. var /** @type {?} */ hostNode = /** @type {?} */ ((/** @type {?} */ (component))[NG_HOST_SYMBOL]);
  18104. if (ngDevMode && !hostNode) {
  18105. createError('Not a directive instance', component);
  18106. }
  18107. ngDevMode && assertNotNull(hostNode.data, 'hostNode.data');
  18108. renderComponentOrTemplate(hostNode, hostNode.view, component);
  18109. isDirty = false;
  18110. }
  18111. var isDirty = false;
  18112. /**
  18113. * @template T
  18114. * @param {?} component
  18115. * @param {?=} scheduler
  18116. * @return {?}
  18117. */
  18118. /**
  18119. * @template T
  18120. * @param {?} component
  18121. * @return {?}
  18122. */
  18123. /**
  18124. * @fileoverview added by tsickle
  18125. * @suppress {checkTypes} checked by tsc
  18126. */
  18127. /**
  18128. * @license
  18129. * Copyright Google Inc. All Rights Reserved.
  18130. *
  18131. * Use of this source code is governed by an MIT-style license that can be
  18132. * found in the LICENSE file at https://angular.io/license
  18133. */
  18134. /**
  18135. * Create a component definition object.
  18136. *
  18137. *
  18138. * # Example
  18139. * ```
  18140. * class MyDirective {
  18141. * // Generated by Angular Template Compiler
  18142. * // [Symbol] syntax will not be supported by TypeScript until v2.7
  18143. * static [COMPONENT_DEF_SYMBOL] = defineComponent({
  18144. * ...
  18145. * });
  18146. * }
  18147. * ```
  18148. * @template T
  18149. * @param {?} componentDefinition
  18150. * @return {?}
  18151. */
  18152. function defineComponent(componentDefinition) {
  18153. var /** @type {?} */ def = /** @type {?} */ ({
  18154. type: componentDefinition.type,
  18155. diPublic: null,
  18156. n: componentDefinition.factory,
  18157. tag: (/** @type {?} */ (componentDefinition)).tag || /** @type {?} */ ((null)),
  18158. template: (/** @type {?} */ (componentDefinition)).template || /** @type {?} */ ((null)),
  18159. r: componentDefinition.refresh ||
  18160. function (d, e) { componentRefresh(d, e, componentDefinition.template); },
  18161. h: componentDefinition.hostBindings || noop$1,
  18162. inputs: invertObject(componentDefinition.inputs),
  18163. outputs: invertObject(componentDefinition.outputs),
  18164. methods: invertObject(componentDefinition.methods),
  18165. rendererType: resolveRendererType2(componentDefinition.rendererType) || null,
  18166. });
  18167. var /** @type {?} */ feature = componentDefinition.features;
  18168. feature && feature.forEach(function (fn) { return fn(def); });
  18169. return def;
  18170. }
  18171. /**
  18172. * @template T
  18173. * @param {?} definition
  18174. * @return {?}
  18175. */
  18176. /**
  18177. * @template T
  18178. * @param {?} definition
  18179. * @return {?}
  18180. */
  18181. var EMPTY$1 = {};
  18182. /**
  18183. * @return {?}
  18184. */
  18185. function noop$1() { }
  18186. /**
  18187. * Swaps the keys and values of an object.
  18188. * @param {?} obj
  18189. * @return {?}
  18190. */
  18191. function invertObject(obj) {
  18192. if (obj == null)
  18193. return EMPTY$1;
  18194. var /** @type {?} */ newObj = {};
  18195. for (var /** @type {?} */ minifiedKey in obj) {
  18196. newObj[obj[minifiedKey]] = minifiedKey;
  18197. }
  18198. return newObj;
  18199. }
  18200. /**
  18201. * Create a directive definition object.
  18202. *
  18203. * # Example
  18204. * ```
  18205. * class MyDirective {
  18206. * // Generated by Angular Template Compiler
  18207. * // [Symbol] syntax will not be supported by TypeScript until v2.7
  18208. * static [DIRECTIVE_DEF_SYMBOL] = defineDirective({
  18209. * ...
  18210. * });
  18211. * }
  18212. * ```
  18213. */
  18214. /**
  18215. * @fileoverview added by tsickle
  18216. * @suppress {checkTypes} checked by tsc
  18217. */
  18218. /**
  18219. * @license
  18220. * Copyright Google Inc. All Rights Reserved.
  18221. *
  18222. * Use of this source code is governed by an MIT-style license that can be
  18223. * found in the LICENSE file at https://angular.io/license
  18224. */
  18225. /**
  18226. * @fileoverview added by tsickle
  18227. * @suppress {checkTypes} checked by tsc
  18228. */
  18229. /**
  18230. * @license
  18231. * Copyright Google Inc. All Rights Reserved.
  18232. *
  18233. * Use of this source code is governed by an MIT-style license that can be
  18234. * found in the LICENSE file at https://angular.io/license
  18235. */
  18236. // clang-format on
  18237. /**
  18238. * @fileoverview added by tsickle
  18239. * @suppress {checkTypes} checked by tsc
  18240. */
  18241. /**
  18242. * @license
  18243. * Copyright Google Inc. All Rights Reserved.
  18244. *
  18245. * Use of this source code is governed by an MIT-style license that can be
  18246. * found in the LICENSE file at https://angular.io/license
  18247. */
  18248. /**
  18249. * @fileoverview added by tsickle
  18250. * @suppress {checkTypes} checked by tsc
  18251. */
  18252. /**
  18253. * @license
  18254. * Copyright Google Inc. All Rights Reserved.
  18255. *
  18256. * Use of this source code is governed by an MIT-style license that can be
  18257. * found in the LICENSE file at https://angular.io/license
  18258. * @record
  18259. */
  18260. /**
  18261. * \@experimental Animation support is experimental.
  18262. */
  18263. /**
  18264. * \@experimental Animation support is experimental.
  18265. * @record
  18266. */
  18267. /**
  18268. * Metadata representing the entry of animations. Instances of this interface are provided via the
  18269. * animation DSL when the {\@link trigger trigger animation function} is called.
  18270. *
  18271. * \@experimental Animation support is experimental.
  18272. * @record
  18273. */
  18274. /**
  18275. * Metadata representing the entry of animations. Instances of this interface are provided via the
  18276. * animation DSL when the {\@link state state animation function} is called.
  18277. *
  18278. * \@experimental Animation support is experimental.
  18279. * @record
  18280. */
  18281. /**
  18282. * Metadata representing the entry of animations. Instances of this interface are provided via the
  18283. * animation DSL when the {\@link transition transition animation function} is called.
  18284. *
  18285. * \@experimental Animation support is experimental.
  18286. * @record
  18287. */
  18288. /**
  18289. * \@experimental Animation support is experimental.
  18290. * @record
  18291. */
  18292. /**
  18293. * \@experimental Animation support is experimental.
  18294. * @record
  18295. */
  18296. /**
  18297. * Metadata representing the entry of animations. Instances of this interface are provided via the
  18298. * animation DSL when the {\@link keyframes keyframes animation function} is called.
  18299. *
  18300. * \@experimental Animation support is experimental.
  18301. * @record
  18302. */
  18303. /**
  18304. * Metadata representing the entry of animations. Instances of this interface are provided via the
  18305. * animation DSL when the {\@link style style animation function} is called.
  18306. *
  18307. * \@experimental Animation support is experimental.
  18308. * @record
  18309. */
  18310. /**
  18311. * Metadata representing the entry of animations. Instances of this interface are provided via the
  18312. * animation DSL when the {\@link animate animate animation function} is called.
  18313. *
  18314. * \@experimental Animation support is experimental.
  18315. * @record
  18316. */
  18317. /**
  18318. * Metadata representing the entry of animations. Instances of this interface are provided via the
  18319. * animation DSL when the {\@link animateChild animateChild animation function} is called.
  18320. *
  18321. * \@experimental Animation support is experimental.
  18322. * @record
  18323. */
  18324. /**
  18325. * Metadata representing the entry of animations. Instances of this interface are provided via the
  18326. * animation DSL when the {\@link useAnimation useAnimation animation function} is called.
  18327. *
  18328. * \@experimental Animation support is experimental.
  18329. * @record
  18330. */
  18331. /**
  18332. * Metadata representing the entry of animations. Instances of this interface are provided via the
  18333. * animation DSL when the {\@link sequence sequence animation function} is called.
  18334. *
  18335. * \@experimental Animation support is experimental.
  18336. * @record
  18337. */
  18338. /**
  18339. * Metadata representing the entry of animations. Instances of this interface are provided via the
  18340. * animation DSL when the {\@link group group animation function} is called.
  18341. *
  18342. * \@experimental Animation support is experimental.
  18343. * @record
  18344. */
  18345. /**
  18346. * Metadata representing the entry of animations. Instances of this interface are provided via the
  18347. * animation DSL when the {\@link stagger stagger animation function} is called.
  18348. *
  18349. * \@experimental Animation support is experimental.
  18350. * @record
  18351. */
  18352. /**
  18353. * `trigger` is an animation-specific function that is designed to be used inside of Angular's
  18354. * animation DSL language. If this information is new, please navigate to the
  18355. * {\@link Component#animations component animations metadata page} to gain a better
  18356. * understanding of how animations in Angular are used.
  18357. *
  18358. * `trigger` Creates an animation trigger which will a list of {\@link state state} and
  18359. * {\@link transition transition} entries that will be evaluated when the expression
  18360. * bound to the trigger changes.
  18361. *
  18362. * Triggers are registered within the component annotation data under the
  18363. * {\@link Component#animations animations section}. An animation trigger can be placed on an element
  18364. * within a template by referencing the name of the trigger followed by the expression value that
  18365. * the
  18366. * trigger is bound to (in the form of `[\@triggerName]="expression"`.
  18367. *
  18368. * Animation trigger bindings strigify values and then match the previous and current values against
  18369. * any linked transitions. If a boolean value is provided into the trigger binding then it will both
  18370. * be represented as `1` or `true` and `0` or `false` for a true and false boolean values
  18371. * respectively.
  18372. *
  18373. * ### Usage
  18374. *
  18375. * `trigger` will create an animation trigger reference based on the provided `name` value. The
  18376. * provided `animation` value is expected to be an array consisting of {\@link state state} and
  18377. * {\@link transition transition} declarations.
  18378. *
  18379. * ```typescript
  18380. * \@Component({
  18381. * selector: 'my-component',
  18382. * templateUrl: 'my-component-tpl.html',
  18383. * animations: [
  18384. * trigger("myAnimationTrigger", [
  18385. * state(...),
  18386. * state(...),
  18387. * transition(...),
  18388. * transition(...)
  18389. * ])
  18390. * ]
  18391. * })
  18392. * class MyComponent {
  18393. * myStatusExp = "something";
  18394. * }
  18395. * ```
  18396. *
  18397. * The template associated with this component will make use of the `myAnimationTrigger` animation
  18398. * trigger by binding to an element within its template code.
  18399. *
  18400. * ```html
  18401. * <!-- somewhere inside of my-component-tpl.html -->
  18402. * <div [\@myAnimationTrigger]="myStatusExp">...</div>
  18403. * ```
  18404. *
  18405. * ## Disable Animations
  18406. * A special animation control binding called `\@.disabled` can be placed on an element which will
  18407. * then disable animations for any inner animation triggers situated within the element as well as
  18408. * any animations on the element itself.
  18409. *
  18410. * When true, the `\@.disabled` binding will prevent all animations from rendering. The example
  18411. * below shows how to use this feature:
  18412. *
  18413. * ```ts
  18414. * \@Component({
  18415. * selector: 'my-component',
  18416. * template: `
  18417. * <div [\@.disabled]="isDisabled">
  18418. * <div [\@childAnimation]="exp"></div>
  18419. * </div>
  18420. * `,
  18421. * animations: [
  18422. * trigger("childAnimation", [
  18423. * // ...
  18424. * ])
  18425. * ]
  18426. * })
  18427. * class MyComponent {
  18428. * isDisabled = true;
  18429. * exp = '...';
  18430. * }
  18431. * ```
  18432. *
  18433. * The `\@childAnimation` trigger will not animate because `\@.disabled` prevents it from happening
  18434. * (when true).
  18435. *
  18436. * Note that `\@.disabled` will only disable all animations (this means any animations running on
  18437. * the same element will also be disabled).
  18438. *
  18439. * ### Disabling Animations Application-wide
  18440. * When an area of the template is set to have animations disabled, **all** inner components will
  18441. * also have their animations disabled as well. This means that all animations for an angular
  18442. * application can be disabled by placing a host binding set on `\@.disabled` on the topmost Angular
  18443. * component.
  18444. *
  18445. * ```ts
  18446. * import {Component, HostBinding} from '\@angular/core';
  18447. *
  18448. * \@Component({
  18449. * selector: 'app-component',
  18450. * templateUrl: 'app.component.html',
  18451. * })
  18452. * class AppComponent {
  18453. * \@HostBinding('\@.disabled')
  18454. * public animationsDisabled = true;
  18455. * }
  18456. * ```
  18457. *
  18458. * ### What about animations that us `query()` and `animateChild()`?
  18459. * Despite inner animations being disabled, a parent animation can {\@link query query} for inner
  18460. * elements located in disabled areas of the template and still animate them as it sees fit. This is
  18461. * also the case for when a sub animation is queried by a parent and then later animated using {\@link
  18462. * animateChild animateChild}.
  18463. *
  18464. * \@experimental Animation support is experimental.
  18465. * @param {?} name
  18466. * @param {?} definitions
  18467. * @return {?}
  18468. */
  18469. function trigger$1(name, definitions) {
  18470. return { type: 7 /* Trigger */, name: name, definitions: definitions, options: {} };
  18471. }
  18472. /**
  18473. * `animate` is an animation-specific function that is designed to be used inside of Angular's
  18474. * animation DSL language. If this information is new, please navigate to the {\@link
  18475. * Component#animations component animations metadata page} to gain a better understanding of
  18476. * how animations in Angular are used.
  18477. *
  18478. * `animate` specifies an animation step that will apply the provided `styles` data for a given
  18479. * amount of time based on the provided `timing` expression value. Calls to `animate` are expected
  18480. * to be used within {\@link sequence an animation sequence}, {\@link group group}, or {\@link
  18481. * transition transition}.
  18482. *
  18483. * ### Usage
  18484. *
  18485. * The `animate` function accepts two input parameters: `timing` and `styles`:
  18486. *
  18487. * - `timing` is a string based value that can be a combination of a duration with optional delay
  18488. * and easing values. The format for the expression breaks down to `duration delay easing`
  18489. * (therefore a value such as `1s 100ms ease-out` will be parse itself into `duration=1000,
  18490. * delay=100, easing=ease-out`. If a numeric value is provided then that will be used as the
  18491. * `duration` value in millisecond form.
  18492. * - `styles` is the style input data which can either be a call to {\@link style style} or {\@link
  18493. * keyframes keyframes}. If left empty then the styles from the destination state will be collected
  18494. * and used (this is useful when describing an animation step that will complete an animation by
  18495. * {\@link transition#the-final-animate-call animating to the final state}).
  18496. *
  18497. * ```typescript
  18498. * // various functions for specifying timing data
  18499. * animate(500, style(...))
  18500. * animate("1s", style(...))
  18501. * animate("100ms 0.5s", style(...))
  18502. * animate("5s ease", style(...))
  18503. * animate("5s 10ms cubic-bezier(.17,.67,.88,.1)", style(...))
  18504. *
  18505. * // either style() of keyframes() can be used
  18506. * animate(500, style({ background: "red" }))
  18507. * animate(500, keyframes([
  18508. * style({ background: "blue" })),
  18509. * style({ background: "red" }))
  18510. * ])
  18511. * ```
  18512. *
  18513. * {\@example core/animation/ts/dsl/animation_example.ts region='Component'}
  18514. *
  18515. * \@experimental Animation support is experimental.
  18516. * @param {?} timings
  18517. * @param {?=} styles
  18518. * @return {?}
  18519. */
  18520. function animate$1(timings, styles) {
  18521. if (styles === void 0) { styles = null; }
  18522. return { type: 4 /* Animate */, styles: styles, timings: timings };
  18523. }
  18524. /**
  18525. * `group` is an animation-specific function that is designed to be used inside of Angular's
  18526. * animation DSL language. If this information is new, please navigate to the {\@link
  18527. * Component#animations component animations metadata page} to gain a better understanding of
  18528. * how animations in Angular are used.
  18529. *
  18530. * `group` specifies a list of animation steps that are all run in parallel. Grouped animations are
  18531. * useful when a series of styles must be animated/closed off at different starting/ending times.
  18532. *
  18533. * The `group` function can either be used within a {\@link sequence sequence} or a {\@link transition
  18534. * transition} and it will only continue to the next instruction once all of the inner animation
  18535. * steps have completed.
  18536. *
  18537. * ### Usage
  18538. *
  18539. * The `steps` data that is passed into the `group` animation function can either consist of {\@link
  18540. * style style} or {\@link animate animate} function calls. Each call to `style()` or `animate()`
  18541. * within a group will be executed instantly (use {\@link keyframes keyframes} or a {\@link
  18542. * animate#usage animate() with a delay value} to offset styles to be applied at a later time).
  18543. *
  18544. * ```typescript
  18545. * group([
  18546. * animate("1s", { background: "black" }))
  18547. * animate("2s", { color: "white" }))
  18548. * ])
  18549. * ```
  18550. *
  18551. * {\@example core/animation/ts/dsl/animation_example.ts region='Component'}
  18552. *
  18553. * \@experimental Animation support is experimental.
  18554. * @param {?} steps
  18555. * @param {?=} options
  18556. * @return {?}
  18557. */
  18558. function group$1(steps, options) {
  18559. if (options === void 0) { options = null; }
  18560. return { type: 3 /* Group */, steps: steps, options: options };
  18561. }
  18562. /**
  18563. * `sequence` is an animation-specific function that is designed to be used inside of Angular's
  18564. * animation DSL language. If this information is new, please navigate to the {\@link
  18565. * Component#animations component animations metadata page} to gain a better understanding of
  18566. * how animations in Angular are used.
  18567. *
  18568. * `sequence` Specifies a list of animation steps that are run one by one. (`sequence` is used by
  18569. * default when an array is passed as animation data into {\@link transition transition}.)
  18570. *
  18571. * The `sequence` function can either be used within a {\@link group group} or a {\@link transition
  18572. * transition} and it will only continue to the next instruction once each of the inner animation
  18573. * steps have completed.
  18574. *
  18575. * To perform animation styling in parallel with other animation steps then have a look at the
  18576. * {\@link group group} animation function.
  18577. *
  18578. * ### Usage
  18579. *
  18580. * The `steps` data that is passed into the `sequence` animation function can either consist of
  18581. * {\@link style style} or {\@link animate animate} function calls. A call to `style()` will apply the
  18582. * provided styling data immediately while a call to `animate()` will apply its styling data over a
  18583. * given time depending on its timing data.
  18584. *
  18585. * ```typescript
  18586. * sequence([
  18587. * style({ opacity: 0 })),
  18588. * animate("1s", { opacity: 1 }))
  18589. * ])
  18590. * ```
  18591. *
  18592. * {\@example core/animation/ts/dsl/animation_example.ts region='Component'}
  18593. *
  18594. * \@experimental Animation support is experimental.
  18595. * @param {?} steps
  18596. * @param {?=} options
  18597. * @return {?}
  18598. */
  18599. function sequence$1(steps, options) {
  18600. if (options === void 0) { options = null; }
  18601. return { type: 2 /* Sequence */, steps: steps, options: options };
  18602. }
  18603. /**
  18604. * `style` is an animation-specific function that is designed to be used inside of Angular's
  18605. * animation DSL language. If this information is new, please navigate to the {\@link
  18606. * Component#animations component animations metadata page} to gain a better understanding of
  18607. * how animations in Angular are used.
  18608. *
  18609. * `style` declares a key/value object containing CSS properties/styles that can then be used for
  18610. * {\@link state animation states}, within an {\@link sequence animation sequence}, or as styling data
  18611. * for both {\@link animate animate} and {\@link keyframes keyframes}.
  18612. *
  18613. * ### Usage
  18614. *
  18615. * `style` takes in a key/value string map as data and expects one or more CSS property/value pairs
  18616. * to be defined.
  18617. *
  18618. * ```typescript
  18619. * // string values are used for css properties
  18620. * style({ background: "red", color: "blue" })
  18621. *
  18622. * // numerical (pixel) values are also supported
  18623. * style({ width: 100, height: 0 })
  18624. * ```
  18625. *
  18626. * #### Auto-styles (using `*`)
  18627. *
  18628. * When an asterix (`*`) character is used as a value then it will be detected from the element
  18629. * being animated and applied as animation data when the animation starts.
  18630. *
  18631. * This feature proves useful for a state depending on layout and/or environment factors; in such
  18632. * cases the styles are calculated just before the animation starts.
  18633. *
  18634. * ```typescript
  18635. * // the steps below will animate from 0 to the
  18636. * // actual height of the element
  18637. * style({ height: 0 }),
  18638. * animate("1s", style({ height: "*" }))
  18639. * ```
  18640. *
  18641. * {\@example core/animation/ts/dsl/animation_example.ts region='Component'}
  18642. *
  18643. * \@experimental Animation support is experimental.
  18644. * @param {?} tokens
  18645. * @return {?}
  18646. */
  18647. function style$1(tokens) {
  18648. return { type: 6 /* Style */, styles: tokens, offset: null };
  18649. }
  18650. /**
  18651. * `state` is an animation-specific function that is designed to be used inside of Angular's
  18652. * animation DSL language. If this information is new, please navigate to the {\@link
  18653. * Component#animations component animations metadata page} to gain a better understanding of
  18654. * how animations in Angular are used.
  18655. *
  18656. * `state` declares an animation state within the given trigger. When a state is active within a
  18657. * component then its associated styles will persist on the element that the trigger is attached to
  18658. * (even when the animation ends).
  18659. *
  18660. * To animate between states, have a look at the animation {\@link transition transition} DSL
  18661. * function. To register states to an animation trigger please have a look at the {\@link trigger
  18662. * trigger} function.
  18663. *
  18664. * #### The `void` state
  18665. *
  18666. * The `void` state value is a reserved word that angular uses to determine when the element is not
  18667. * apart of the application anymore (e.g. when an `ngIf` evaluates to false then the state of the
  18668. * associated element is void).
  18669. *
  18670. * #### The `*` (default) state
  18671. *
  18672. * The `*` state (when styled) is a fallback state that will be used if the state that is being
  18673. * animated is not declared within the trigger.
  18674. *
  18675. * ### Usage
  18676. *
  18677. * `state` will declare an animation state with its associated styles
  18678. * within the given trigger.
  18679. *
  18680. * - `stateNameExpr` can be one or more state names separated by commas.
  18681. * - `styles` refers to the {\@link style styling data} that will be persisted on the element once
  18682. * the state has been reached.
  18683. *
  18684. * ```typescript
  18685. * // "void" is a reserved name for a state and is used to represent
  18686. * // the state in which an element is detached from from the application.
  18687. * state("void", style({ height: 0 }))
  18688. *
  18689. * // user-defined states
  18690. * state("closed", style({ height: 0 }))
  18691. * state("open, visible", style({ height: "*" }))
  18692. * ```
  18693. *
  18694. * {\@example core/animation/ts/dsl/animation_example.ts region='Component'}
  18695. *
  18696. * \@experimental Animation support is experimental.
  18697. * @param {?} name
  18698. * @param {?} styles
  18699. * @param {?=} options
  18700. * @return {?}
  18701. */
  18702. function state$1(name, styles, options) {
  18703. return { type: 0 /* State */, name: name, styles: styles, options: options };
  18704. }
  18705. /**
  18706. * `keyframes` is an animation-specific function that is designed to be used inside of Angular's
  18707. * animation DSL language. If this information is new, please navigate to the {\@link
  18708. * Component#animations component animations metadata page} to gain a better understanding of
  18709. * how animations in Angular are used.
  18710. *
  18711. * `keyframes` specifies a collection of {\@link style style} entries each optionally characterized
  18712. * by an `offset` value.
  18713. *
  18714. * ### Usage
  18715. *
  18716. * The `keyframes` animation function is designed to be used alongside the {\@link animate animate}
  18717. * animation function. Instead of applying animations from where they are currently to their
  18718. * destination, keyframes can describe how each style entry is applied and at what point within the
  18719. * animation arc (much like CSS Keyframe Animations do).
  18720. *
  18721. * For each `style()` entry an `offset` value can be set. Doing so allows to specifiy at what
  18722. * percentage of the animate time the styles will be applied.
  18723. *
  18724. * ```typescript
  18725. * // the provided offset values describe when each backgroundColor value is applied.
  18726. * animate("5s", keyframes([
  18727. * style({ backgroundColor: "red", offset: 0 }),
  18728. * style({ backgroundColor: "blue", offset: 0.2 }),
  18729. * style({ backgroundColor: "orange", offset: 0.3 }),
  18730. * style({ backgroundColor: "black", offset: 1 })
  18731. * ]))
  18732. * ```
  18733. *
  18734. * Alternatively, if there are no `offset` values used within the style entries then the offsets
  18735. * will be calculated automatically.
  18736. *
  18737. * ```typescript
  18738. * animate("5s", keyframes([
  18739. * style({ backgroundColor: "red" }) // offset = 0
  18740. * style({ backgroundColor: "blue" }) // offset = 0.33
  18741. * style({ backgroundColor: "orange" }) // offset = 0.66
  18742. * style({ backgroundColor: "black" }) // offset = 1
  18743. * ]))
  18744. * ```
  18745. *
  18746. * {\@example core/animation/ts/dsl/animation_example.ts region='Component'}
  18747. *
  18748. * \@experimental Animation support is experimental.
  18749. * @param {?} steps
  18750. * @return {?}
  18751. */
  18752. function keyframes$1(steps) {
  18753. return { type: 5 /* Keyframes */, steps: steps };
  18754. }
  18755. /**
  18756. * `transition` is an animation-specific function that is designed to be used inside of Angular's
  18757. * animation DSL language. If this information is new, please navigate to the {\@link
  18758. * Component#animations component animations metadata page} to gain a better understanding of
  18759. * how animations in Angular are used.
  18760. *
  18761. * `transition` declares the {\@link sequence sequence of animation steps} that will be run when the
  18762. * provided `stateChangeExpr` value is satisfied. The `stateChangeExpr` consists of a `state1 =>
  18763. * state2` which consists of two known states (use an asterix (`*`) to refer to a dynamic starting
  18764. * and/or ending state).
  18765. *
  18766. * A function can also be provided as the `stateChangeExpr` argument for a transition and this
  18767. * function will be executed each time a state change occurs. If the value returned within the
  18768. * function is true then the associated animation will be run.
  18769. *
  18770. * Animation transitions are placed within an {\@link trigger animation trigger}. For an transition
  18771. * to animate to a state value and persist its styles then one or more {\@link state animation
  18772. * states} is expected to be defined.
  18773. *
  18774. * ### Usage
  18775. *
  18776. * An animation transition is kicked off the `stateChangeExpr` predicate evaluates to true based on
  18777. * what the previous state is and what the current state has become. In other words, if a transition
  18778. * is defined that matches the old/current state criteria then the associated animation will be
  18779. * triggered.
  18780. *
  18781. * ```typescript
  18782. * // all transition/state changes are defined within an animation trigger
  18783. * trigger("myAnimationTrigger", [
  18784. * // if a state is defined then its styles will be persisted when the
  18785. * // animation has fully completed itself
  18786. * state("on", style({ background: "green" })),
  18787. * state("off", style({ background: "grey" })),
  18788. *
  18789. * // a transition animation that will be kicked off when the state value
  18790. * // bound to "myAnimationTrigger" changes from "on" to "off"
  18791. * transition("on => off", animate(500)),
  18792. *
  18793. * // it is also possible to do run the same animation for both directions
  18794. * transition("on <=> off", animate(500)),
  18795. *
  18796. * // or to define multiple states pairs separated by commas
  18797. * transition("on => off, off => void", animate(500)),
  18798. *
  18799. * // this is a catch-all state change for when an element is inserted into
  18800. * // the page and the destination state is unknown
  18801. * transition("void => *", [
  18802. * style({ opacity: 0 }),
  18803. * animate(500)
  18804. * ]),
  18805. *
  18806. * // this will capture a state change between any states
  18807. * transition("* => *", animate("1s 0s")),
  18808. *
  18809. * // you can also go full out and include a function
  18810. * transition((fromState, toState) => {
  18811. * // when `true` then it will allow the animation below to be invoked
  18812. * return fromState == "off" && toState == "on";
  18813. * }, animate("1s 0s"))
  18814. * ])
  18815. * ```
  18816. *
  18817. * The template associated with this component will make use of the `myAnimationTrigger` animation
  18818. * trigger by binding to an element within its template code.
  18819. *
  18820. * ```html
  18821. * <!-- somewhere inside of my-component-tpl.html -->
  18822. * <div [\@myAnimationTrigger]="myStatusExp">...</div>
  18823. * ```
  18824. *
  18825. * #### The final `animate` call
  18826. *
  18827. * If the final step within the transition steps is a call to `animate()` that **only** uses a
  18828. * timing value with **no style data** then it will be automatically used as the final animation arc
  18829. * for the element to animate itself to the final state. This involves an automatic mix of
  18830. * adding/removing CSS styles so that the element will be in the exact state it should be for the
  18831. * applied state to be presented correctly.
  18832. *
  18833. * ```
  18834. * // start off by hiding the element, but make sure that it animates properly to whatever state
  18835. * // is currently active for "myAnimationTrigger"
  18836. * transition("void => *", [
  18837. * style({ opacity: 0 }),
  18838. * animate(500)
  18839. * ])
  18840. * ```
  18841. *
  18842. * ### Using :enter and :leave
  18843. *
  18844. * Given that enter (insertion) and leave (removal) animations are so common, the `transition`
  18845. * function accepts both `:enter` and `:leave` values which are aliases for the `void => *` and `*
  18846. * => void` state changes.
  18847. *
  18848. * ```
  18849. * transition(":enter", [
  18850. * style({ opacity: 0 }),
  18851. * animate(500, style({ opacity: 1 }))
  18852. * ]),
  18853. * transition(":leave", [
  18854. * animate(500, style({ opacity: 0 }))
  18855. * ])
  18856. * ```
  18857. *
  18858. * ### Boolean values
  18859. * if a trigger binding value is a boolean value then it can be matched using a transition
  18860. * expression that compares `true` and `false` or `1` and `0`.
  18861. *
  18862. * ```
  18863. * // in the template
  18864. * <div [\@openClose]="open ? true : false">...</div>
  18865. *
  18866. * // in the component metadata
  18867. * trigger('openClose', [
  18868. * state('true', style({ height: '*' })),
  18869. * state('false', style({ height: '0px' })),
  18870. * transition('false <=> true', animate(500))
  18871. * ])
  18872. * ```
  18873. *
  18874. * ### Using :increment and :decrement
  18875. * In addition to the :enter and :leave transition aliases, the :increment and :decrement aliases
  18876. * can be used to kick off a transition when a numeric value has increased or decreased in value.
  18877. *
  18878. * ```
  18879. * import {group, animate, query, transition, style, trigger} from '\@angular/animations';
  18880. * import {Component} from '\@angular/core';
  18881. *
  18882. * \@Component({
  18883. * selector: 'banner-carousel-component',
  18884. * styles: [`
  18885. * .banner-container {
  18886. * position:relative;
  18887. * height:500px;
  18888. * overflow:hidden;
  18889. * }
  18890. * .banner-container > .banner {
  18891. * position:absolute;
  18892. * left:0;
  18893. * top:0;
  18894. * font-size:200px;
  18895. * line-height:500px;
  18896. * font-weight:bold;
  18897. * text-align:center;
  18898. * width:100%;
  18899. * }
  18900. * `],
  18901. * template: `
  18902. * <button (click)="previous()">Previous</button>
  18903. * <button (click)="next()">Next</button>
  18904. * <hr>
  18905. * <div [\@bannerAnimation]="selectedIndex" class="banner-container">
  18906. * <div class="banner" *ngFor="let banner of banners"> {{ banner }} </div>
  18907. * </div>
  18908. * `,
  18909. * animations: [
  18910. * trigger('bannerAnimation', [
  18911. * transition(":increment", group([
  18912. * query(':enter', [
  18913. * style({ left: '100%' }),
  18914. * animate('0.5s ease-out', style('*'))
  18915. * ]),
  18916. * query(':leave', [
  18917. * animate('0.5s ease-out', style({ left: '-100%' }))
  18918. * ])
  18919. * ])),
  18920. * transition(":decrement", group([
  18921. * query(':enter', [
  18922. * style({ left: '-100%' }),
  18923. * animate('0.5s ease-out', style('*'))
  18924. * ]),
  18925. * query(':leave', [
  18926. * animate('0.5s ease-out', style({ left: '100%' }))
  18927. * ])
  18928. * ]))
  18929. * ])
  18930. * ]
  18931. * })
  18932. * class BannerCarouselComponent {
  18933. * allBanners: string[] = ['1', '2', '3', '4'];
  18934. * selectedIndex: number = 0;
  18935. *
  18936. * get banners() {
  18937. * return [this.allBanners[this.selectedIndex]];
  18938. * }
  18939. *
  18940. * previous() {
  18941. * this.selectedIndex = Math.max(this.selectedIndex - 1, 0);
  18942. * }
  18943. *
  18944. * next() {
  18945. * this.selectedIndex = Math.min(this.selectedIndex + 1, this.allBanners.length - 1);
  18946. * }
  18947. * }
  18948. * ```
  18949. *
  18950. * {\@example core/animation/ts/dsl/animation_example.ts region='Component'}
  18951. *
  18952. * \@experimental Animation support is experimental.
  18953. * @param {?} stateChangeExpr
  18954. * @param {?} steps
  18955. * @param {?=} options
  18956. * @return {?}
  18957. */
  18958. function transition$1(stateChangeExpr, steps, options) {
  18959. if (options === void 0) { options = null; }
  18960. return { type: 1 /* Transition */, expr: stateChangeExpr, animation: steps, options: options };
  18961. }
  18962. /**
  18963. * `animation` is an animation-specific function that is designed to be used inside of Angular's
  18964. * animation DSL language.
  18965. *
  18966. * `var myAnimation = animation(...)` is designed to produce a reusable animation that can be later
  18967. * invoked in another animation or sequence. Reusable animations are designed to make use of
  18968. * animation parameters and the produced animation can be used via the `useAnimation` method.
  18969. *
  18970. * ```
  18971. * var fadeAnimation = animation([
  18972. * style({ opacity: '{{ start }}' }),
  18973. * animate('{{ time }}',
  18974. * style({ opacity: '{{ end }}'}))
  18975. * ], { params: { time: '1000ms', start: 0, end: 1 }});
  18976. * ```
  18977. *
  18978. * If parameters are attached to an animation then they act as **default parameter values**. When an
  18979. * animation is invoked via `useAnimation` then parameter values are allowed to be passed in
  18980. * directly. If any of the passed in parameter values are missing then the default values will be
  18981. * used.
  18982. *
  18983. * ```
  18984. * useAnimation(fadeAnimation, {
  18985. * params: {
  18986. * time: '2s',
  18987. * start: 1,
  18988. * end: 0
  18989. * }
  18990. * })
  18991. * ```
  18992. *
  18993. * If one or more parameter values are missing before animated then an error will be thrown.
  18994. *
  18995. * \@experimental Animation support is experimental.
  18996. * @param {?} steps
  18997. * @param {?=} options
  18998. * @return {?}
  18999. */
  19000. /**
  19001. * `animateChild` is an animation-specific function that is designed to be used inside of Angular's
  19002. * animation DSL language. It works by allowing a queried element to execute its own
  19003. * animation within the animation sequence.
  19004. *
  19005. * Each time an animation is triggered in angular, the parent animation
  19006. * will always get priority and any child animations will be blocked. In order
  19007. * for a child animation to run, the parent animation must query each of the elements
  19008. * containing child animations and then allow the animations to run using `animateChild`.
  19009. *
  19010. * The example HTML code below shows both parent and child elements that have animation
  19011. * triggers that will execute at the same time.
  19012. *
  19013. * ```html
  19014. * <!-- parent-child.component.html -->
  19015. * <button (click)="exp =! exp">Toggle</button>
  19016. * <hr>
  19017. *
  19018. * <div [\@parentAnimation]="exp">
  19019. * <header>Hello</header>
  19020. * <div [\@childAnimation]="exp">
  19021. * one
  19022. * </div>
  19023. * <div [\@childAnimation]="exp">
  19024. * two
  19025. * </div>
  19026. * <div [\@childAnimation]="exp">
  19027. * three
  19028. * </div>
  19029. * </div>
  19030. * ```
  19031. *
  19032. * Now when the `exp` value changes to true, only the `parentAnimation` animation will animate
  19033. * because it has priority. However, using `query` and `animateChild` each of the inner animations
  19034. * can also fire:
  19035. *
  19036. * ```ts
  19037. * // parent-child.component.ts
  19038. * import {trigger, transition, animate, style, query, animateChild} from '\@angular/animations';
  19039. * \@Component({
  19040. * selector: 'parent-child-component',
  19041. * animations: [
  19042. * trigger('parentAnimation', [
  19043. * transition('false => true', [
  19044. * query('header', [
  19045. * style({ opacity: 0 }),
  19046. * animate(500, style({ opacity: 1 }))
  19047. * ]),
  19048. * query('\@childAnimation', [
  19049. * animateChild()
  19050. * ])
  19051. * ])
  19052. * ]),
  19053. * trigger('childAnimation', [
  19054. * transition('false => true', [
  19055. * style({ opacity: 0 }),
  19056. * animate(500, style({ opacity: 1 }))
  19057. * ])
  19058. * ])
  19059. * ]
  19060. * })
  19061. * class ParentChildCmp {
  19062. * exp: boolean = false;
  19063. * }
  19064. * ```
  19065. *
  19066. * In the animation code above, when the `parentAnimation` transition kicks off it first queries to
  19067. * find the header element and fades it in. It then finds each of the sub elements that contain the
  19068. * `\@childAnimation` trigger and then allows for their animations to fire.
  19069. *
  19070. * This example can be further extended by using stagger:
  19071. *
  19072. * ```ts
  19073. * query('\@childAnimation', stagger(100, [
  19074. * animateChild()
  19075. * ]))
  19076. * ```
  19077. *
  19078. * Now each of the sub animations start off with respect to the `100ms` staggering step.
  19079. *
  19080. * ## The first frame of child animations
  19081. * When sub animations are executed using `animateChild` the animation engine will always apply the
  19082. * first frame of every sub animation immediately at the start of the animation sequence. This way
  19083. * the parent animation does not need to set any initial styling data on the sub elements before the
  19084. * sub animations kick off.
  19085. *
  19086. * In the example above the first frame of the `childAnimation`'s `false => true` transition
  19087. * consists of a style of `opacity: 0`. This is applied immediately when the `parentAnimation`
  19088. * animation transition sequence starts. Only then when the `\@childAnimation` is queried and called
  19089. * with `animateChild` will it then animate to its destination of `opacity: 1`.
  19090. *
  19091. * Note that this feature designed to be used alongside {\@link query query()} and it will only work
  19092. * with animations that are assigned using the Angular animation DSL (this means that CSS keyframes
  19093. * and transitions are not handled by this API).
  19094. *
  19095. * \@experimental Animation support is experimental.
  19096. * @param {?=} options
  19097. * @return {?}
  19098. */
  19099. /**
  19100. * `useAnimation` is an animation-specific function that is designed to be used inside of Angular's
  19101. * animation DSL language. It is used to kick off a reusable animation that is created using {\@link
  19102. * animation animation()}.
  19103. *
  19104. * \@experimental Animation support is experimental.
  19105. * @param {?} animation
  19106. * @param {?=} options
  19107. * @return {?}
  19108. */
  19109. /**
  19110. * `query` is an animation-specific function that is designed to be used inside of Angular's
  19111. * animation DSL language.
  19112. *
  19113. * query() is used to find one or more inner elements within the current element that is
  19114. * being animated within the sequence. The provided animation steps are applied
  19115. * to the queried element (by default, an array is provided, then this will be
  19116. * treated as an animation sequence).
  19117. *
  19118. * ### Usage
  19119. *
  19120. * query() is designed to collect mutiple elements and works internally by using
  19121. * `element.querySelectorAll`. An additional options object can be provided which
  19122. * can be used to limit the total amount of items to be collected.
  19123. *
  19124. * ```js
  19125. * query('div', [
  19126. * animate(...),
  19127. * animate(...)
  19128. * ], { limit: 1 })
  19129. * ```
  19130. *
  19131. * query(), by default, will throw an error when zero items are found. If a query
  19132. * has the `optional` flag set to true then this error will be ignored.
  19133. *
  19134. * ```js
  19135. * query('.some-element-that-may-not-be-there', [
  19136. * animate(...),
  19137. * animate(...)
  19138. * ], { optional: true })
  19139. * ```
  19140. *
  19141. * ### Special Selector Values
  19142. *
  19143. * The selector value within a query can collect elements that contain angular-specific
  19144. * characteristics
  19145. * using special pseudo-selectors tokens.
  19146. *
  19147. * These include:
  19148. *
  19149. * - Querying for newly inserted/removed elements using `query(":enter")`/`query(":leave")`
  19150. * - Querying all currently animating elements using `query(":animating")`
  19151. * - Querying elements that contain an animation trigger using `query("\@triggerName")`
  19152. * - Querying all elements that contain an animation triggers using `query("\@*")`
  19153. * - Including the current element into the animation sequence using `query(":self")`
  19154. *
  19155. *
  19156. * Each of these pseudo-selector tokens can be merged together into a combined query selector
  19157. * string:
  19158. *
  19159. * ```
  19160. * query(':self, .record:enter, .record:leave, \@subTrigger', [...])
  19161. * ```
  19162. *
  19163. * ### Demo
  19164. *
  19165. * ```
  19166. * \@Component({
  19167. * selector: 'inner',
  19168. * template: `
  19169. * <div [\@queryAnimation]="exp">
  19170. * <h1>Title</h1>
  19171. * <div class="content">
  19172. * Blah blah blah
  19173. * </div>
  19174. * </div>
  19175. * `,
  19176. * animations: [
  19177. * trigger('queryAnimation', [
  19178. * transition('* => goAnimate', [
  19179. * // hide the inner elements
  19180. * query('h1', style({ opacity: 0 })),
  19181. * query('.content', style({ opacity: 0 })),
  19182. *
  19183. * // animate the inner elements in, one by one
  19184. * query('h1', animate(1000, style({ opacity: 1 })),
  19185. * query('.content', animate(1000, style({ opacity: 1 })),
  19186. * ])
  19187. * ])
  19188. * ]
  19189. * })
  19190. * class Cmp {
  19191. * exp = '';
  19192. *
  19193. * goAnimate() {
  19194. * this.exp = 'goAnimate';
  19195. * }
  19196. * }
  19197. * ```
  19198. *
  19199. * \@experimental Animation support is experimental.
  19200. * @param {?} selector
  19201. * @param {?} animation
  19202. * @param {?=} options
  19203. * @return {?}
  19204. */
  19205. /**
  19206. * `stagger` is an animation-specific function that is designed to be used inside of Angular's
  19207. * animation DSL language. It is designed to be used inside of an animation {\@link query query()}
  19208. * and works by issuing a timing gap between after each queried item is animated.
  19209. *
  19210. * ### Usage
  19211. *
  19212. * In the example below there is a container element that wraps a list of items stamped out
  19213. * by an ngFor. The container element contains an animation trigger that will later be set
  19214. * to query for each of the inner items.
  19215. *
  19216. * ```html
  19217. * <!-- list.component.html -->
  19218. * <button (click)="toggle()">Show / Hide Items</button>
  19219. * <hr />
  19220. * <div [\@listAnimation]="items.length">
  19221. * <div *ngFor="let item of items">
  19222. * {{ item }}
  19223. * </div>
  19224. * </div>
  19225. * ```
  19226. *
  19227. * The component code for this looks as such:
  19228. *
  19229. * ```ts
  19230. * import {trigger, transition, style, animate, query, stagger} from '\@angular/animations';
  19231. * \@Component({
  19232. * templateUrl: 'list.component.html',
  19233. * animations: [
  19234. * trigger('listAnimation', [
  19235. * //...
  19236. * ])
  19237. * ]
  19238. * })
  19239. * class ListComponent {
  19240. * items = [];
  19241. *
  19242. * showItems() {
  19243. * this.items = [0,1,2,3,4];
  19244. * }
  19245. *
  19246. * hideItems() {
  19247. * this.items = [];
  19248. * }
  19249. *
  19250. * toggle() {
  19251. * this.items.length ? this.hideItems() : this.showItems();
  19252. * }
  19253. * }
  19254. * ```
  19255. *
  19256. * And now for the animation trigger code:
  19257. *
  19258. * ```ts
  19259. * trigger('listAnimation', [
  19260. * transition('* => *', [ // each time the binding value changes
  19261. * query(':leave', [
  19262. * stagger(100, [
  19263. * animate('0.5s', style({ opacity: 0 }))
  19264. * ])
  19265. * ]),
  19266. * query(':enter', [
  19267. * style({ opacity: 0 }),
  19268. * stagger(100, [
  19269. * animate('0.5s', style({ opacity: 1 }))
  19270. * ])
  19271. * ])
  19272. * ])
  19273. * ])
  19274. * ```
  19275. *
  19276. * Now each time the items are added/removed then either the opacity
  19277. * fade-in animation will run or each removed item will be faded out.
  19278. * When either of these animations occur then a stagger effect will be
  19279. * applied after each item's animation is started.
  19280. *
  19281. * \@experimental Animation support is experimental.
  19282. * @param {?} timings
  19283. * @param {?} animation
  19284. * @return {?}
  19285. */
  19286. /**
  19287. * @fileoverview added by tsickle
  19288. * @suppress {checkTypes} checked by tsc
  19289. */
  19290. /**
  19291. * @deprecated This symbol has moved. Please Import from \@angular/animations instead!
  19292. */
  19293. var AUTO_STYLE = '*';
  19294. /**
  19295. * @deprecated This symbol has moved. Please Import from \@angular/animations instead!
  19296. * @record
  19297. */
  19298. /**
  19299. * @deprecated This symbol has moved. Please Import from \@angular/animations instead!
  19300. * @record
  19301. */
  19302. /**
  19303. * @deprecated This symbol has moved. Please Import from \@angular/animations instead!
  19304. * @record
  19305. */
  19306. /**
  19307. * @deprecated This symbol has moved. Please Import from \@angular/animations instead!
  19308. * @record
  19309. */
  19310. /**
  19311. * @deprecated This symbol has moved. Please Import from \@angular/animations instead!
  19312. * @record
  19313. */
  19314. /**
  19315. * @deprecated This symbol has moved. Please Import from \@angular/animations instead!
  19316. * @record
  19317. */
  19318. /**
  19319. * @deprecated This symbol has moved. Please Import from \@angular/animations instead!
  19320. * @record
  19321. */
  19322. /**
  19323. * @deprecated This symbol has moved. Please Import from \@angular/animations instead!
  19324. * @record
  19325. */
  19326. /**
  19327. * @deprecated This symbol has moved. Please Import from \@angular/animations instead!
  19328. * @record
  19329. */
  19330. /**
  19331. * @deprecated This symbol has moved. Please Import from \@angular/animations instead!
  19332. * @param {?} name
  19333. * @param {?} definitions
  19334. * @return {?}
  19335. */
  19336. function trigger$$1(name, definitions) {
  19337. return trigger$1(name, definitions);
  19338. }
  19339. /**
  19340. * @deprecated This symbol has moved. Please Import from \@angular/animations instead!
  19341. * @param {?} timings
  19342. * @param {?=} styles
  19343. * @return {?}
  19344. */
  19345. function animate$$1(timings, styles) {
  19346. return animate$1(timings, styles);
  19347. }
  19348. /**
  19349. * @deprecated This symbol has moved. Please Import from \@angular/animations instead!
  19350. * @param {?} steps
  19351. * @return {?}
  19352. */
  19353. function group$$1(steps) {
  19354. return group$1(steps);
  19355. }
  19356. /**
  19357. * @deprecated This symbol has moved. Please Import from \@angular/animations instead!
  19358. * @param {?} steps
  19359. * @return {?}
  19360. */
  19361. function sequence$$1(steps) {
  19362. return sequence$1(steps);
  19363. }
  19364. /**
  19365. * @deprecated This symbol has moved. Please Import from \@angular/animations instead!
  19366. * @param {?} tokens
  19367. * @return {?}
  19368. */
  19369. function style$$1(tokens) {
  19370. return style$1(tokens);
  19371. }
  19372. /**
  19373. * @deprecated This symbol has moved. Please Import from \@angular/animations instead!
  19374. * @param {?} name
  19375. * @param {?} styles
  19376. * @return {?}
  19377. */
  19378. function state$$1(name, styles) {
  19379. return state$1(name, styles);
  19380. }
  19381. /**
  19382. * @deprecated This symbol has moved. Please Import from \@angular/animations instead!
  19383. * @param {?} steps
  19384. * @return {?}
  19385. */
  19386. function keyframes$$1(steps) {
  19387. return keyframes$1(steps);
  19388. }
  19389. /**
  19390. * @deprecated This symbol has moved. Please Import from \@angular/animations instead!
  19391. * @param {?} stateChangeExpr
  19392. * @param {?} steps
  19393. * @return {?}
  19394. */
  19395. function transition$$1(stateChangeExpr, steps) {
  19396. return transition$1(stateChangeExpr, steps);
  19397. }
  19398. /**
  19399. * @deprecated This has been renamed to `AnimationEvent`. Please import it from \@angular/animations.
  19400. * @record
  19401. */
  19402. /**
  19403. * @fileoverview added by tsickle
  19404. * @suppress {checkTypes} checked by tsc
  19405. */
  19406. /**
  19407. * @license
  19408. * Copyright Google Inc. All Rights Reserved.
  19409. *
  19410. * Use of this source code is governed by an MIT-style license that can be
  19411. * found in the LICENSE file at https://angular.io/license
  19412. */
  19413. /**
  19414. * @module
  19415. * @description
  19416. * Entry point from which you should import all public core APIs.
  19417. */
  19418. /**
  19419. * @fileoverview added by tsickle
  19420. * @suppress {checkTypes} checked by tsc
  19421. */
  19422. /**
  19423. * @license
  19424. * Copyright Google Inc. All Rights Reserved.
  19425. *
  19426. * Use of this source code is governed by an MIT-style license that can be
  19427. * found in the LICENSE file at https://angular.io/license
  19428. */
  19429. /**
  19430. * @module
  19431. * @description
  19432. * Entry point for all public APIs of this package.
  19433. */
  19434. // This file only reexports content of the `src` folder. Keep it that way.
  19435. /**
  19436. * @fileoverview added by tsickle
  19437. * @suppress {checkTypes} checked by tsc
  19438. */
  19439. /**
  19440. * Generated bundle index. Do not edit.
  19441. */
  19442. //# sourceMappingURL=core.js.map
  19443. /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(103)))
  19444. /***/ }),
  19445. /* 1 */
  19446. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19447. "use strict";
  19448. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Config; });
  19449. /* harmony export (immutable) */ __webpack_exports__["c"] = setupConfig;
  19450. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return ConfigToken; });
  19451. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  19452. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_util__ = __webpack_require__(2);
  19453. /**
  19454. * @name Config
  19455. * @demo /docs/demos/src/config/
  19456. * @description
  19457. * The Config lets you configure your entire app or specific platforms.
  19458. * You can set the tab placement, icon mode, animations, and more here.
  19459. *
  19460. * ```ts
  19461. * import { IonicApp, IonicModule } from 'ionic-angular';
  19462. *
  19463. * @NgModule({
  19464. * declarations: [ MyApp ],
  19465. * imports: [
  19466. * BrowserModule,
  19467. * IonicModule.forRoot(MyApp, {
  19468. * backButtonText: 'Go Back',
  19469. * iconMode: 'ios',
  19470. * modalEnter: 'modal-slide-in',
  19471. * modalLeave: 'modal-slide-out',
  19472. * tabsPlacement: 'bottom',
  19473. * pageTransition: 'ios-transition'
  19474. * }, {}
  19475. * )],
  19476. * bootstrap: [IonicApp],
  19477. * entryComponents: [ MyApp ],
  19478. * providers: []
  19479. * })
  19480. * ```
  19481. *
  19482. *
  19483. * Config can be overwritten at multiple levels allowing for more granular configuration.
  19484. * Below is an example where an app can override any setting we want based on a platform.
  19485. *
  19486. * ```ts
  19487. * import { IonicModule } from 'ionic-angular';
  19488. *
  19489. * @NgModule({
  19490. * ...
  19491. * imports: [
  19492. * BrowserModule,
  19493. * IonicModule.forRoot(MyApp, {
  19494. * tabsPlacement: 'bottom',
  19495. * platforms: {
  19496. * ios: {
  19497. * tabsPlacement: 'top',
  19498. * }
  19499. * }
  19500. * }, {}
  19501. * )],
  19502. * ...
  19503. * })
  19504. * ```
  19505. *
  19506. * We could also configure these values at a component level. Take `tabsPlacement`,
  19507. * we can configure this as a property on our `ion-tabs`.
  19508. *
  19509. * ```html
  19510. * <ion-tabs tabsPlacement="top">
  19511. * <ion-tab tabTitle="Dash" tabIcon="pulse" [root]="tabRoot"></ion-tab>
  19512. * </ion-tabs>
  19513. * ```
  19514. *
  19515. * The last way we could configure is through URL query strings. This is useful for testing
  19516. * while in the browser. Simply add `?ionic<PROPERTYNAME>=<value>` to the url.
  19517. *
  19518. * ```bash
  19519. * http://localhost:8100/?ionicTabsPlacement=bottom
  19520. * ```
  19521. *
  19522. * Any value can be added to config, and looked up at a later in any component.
  19523. *
  19524. * ```js
  19525. * config.set('ios', 'favoriteColor', 'green');
  19526. *
  19527. * // from any page in your app:
  19528. * config.get('favoriteColor'); // 'green' when iOS
  19529. * ```
  19530. *
  19531. *
  19532. * A config value can come from anywhere and be anything, but there are default
  19533. * values for each mode. The [theming](../../../theming/platform-specific-styles/)
  19534. * documentation has a chart of the default mode configuration. The following
  19535. * chart displays each property with a description of what it controls.
  19536. *
  19537. *
  19538. * | Config Property | Type | Details |
  19539. * |--------------------------|---------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|
  19540. * | `activator` | `string` | Used for buttons, changes the effect of pressing on a button. Available options: `"ripple"`, `"highlight"`. |
  19541. * | `actionSheetEnter` | `string` | The name of the transition to use while an action sheet is presented. |
  19542. * | `actionSheetLeave` | `string` | The name of the transition to use while an action sheet is dismissed. |
  19543. * | `alertEnter` | `string` | The name of the transition to use while an alert is presented. |
  19544. * | `alertLeave` | `string` | The name of the transition to use while an alert is dismissed. |
  19545. * | `backButtonText` | `string` | The text to display by the back button icon in the navbar. |
  19546. * | `backButtonIcon` | `string` | The icon to use as the back button icon. |
  19547. * | `iconMode` | `string` | The mode to use for all icons throughout the application. Available options: `"ios"`, `"md"` |
  19548. * | `locationStrategy` | `string` | Set to 'path' to remove hashbangs when using Deeplinking. |
  19549. * | `loadingEnter` | `string` | The name of the transition to use while a loading indicator is presented. |
  19550. * | `loadingLeave` | `string` | The name of the transition to use while a loading indicator is dismissed. |
  19551. * | `menuType` | `string` | Type of menu to display. Available options: `"overlay"`, `"reveal"`, `"push"`. |
  19552. * | `modalEnter` | `string` | The name of the transition to use while a modal is presented. |
  19553. * | `modalLeave` | `string` | The name of the transition to use while a modal is dismiss. |
  19554. * | `mode` | `string` | The mode to use throughout the application. |
  19555. * | `pageTransition` | `string` | The name of the transition to use while changing pages. Available options: `"ios-transition"`, `"md-transition"`, `"wp-transition"`. |
  19556. * | `pickerEnter` | `string` | The name of the transition to use while a picker is presented. |
  19557. * | `pickerLeave` | `string` | The name of the transition to use while a picker is dismissed. |
  19558. * | `popoverEnter` | `string` | The name of the transition to use while a popover is presented. |
  19559. * | `popoverLeave` | `string` | The name of the transition to use while a popover is dismissed.
  19560. * | `scrollAssist` | `boolean` | Used to avoid the input to be hidden by the keyboard if it's near the bottom of the page.
  19561. * | `scrollPadding` | `boolean` | Used to remove the extra padding on ion-content when keyboard is displayed.
  19562. * | `spinner` | `string` | The default spinner to use when a name is not defined. |
  19563. * | `statusbarPadding` | `boolean` | Whether to hide extra padding for statusbar. |
  19564. * | `swipeBackEnabled` | `boolean` | Whether native iOS swipe to go back functionality is enabled. |
  19565. * | `tabsHighlight` | `boolean` | Whether to show a highlight line under the tab when it is selected. |
  19566. * | `tabsLayout` | `string` | The layout to use for all tabs. Available options: `"icon-top"`, `"icon-start"`, `"icon-end"`, `"icon-bottom"`, `"icon-hide"`, `"title-hide"`. |
  19567. * | `tabsPlacement` | `string` | The position of the tabs relative to the content. Available options: `"top"`, `"bottom"` |
  19568. * | `tabsHideOnSubPages` | `boolean` | Whether to hide the tabs on child pages or not. If `true` it will not show the tabs on child pages. |
  19569. * | `toastEnter` | `string` | The name of the transition to use while a toast is presented. |
  19570. * | `toastLeave` | `string` | The name of the transition to use while a toast is dismissed. |
  19571. *
  19572. **/
  19573. var Config = (function () {
  19574. function Config() {
  19575. this._c = {};
  19576. this._s = {};
  19577. this._modes = {};
  19578. this._trns = {};
  19579. }
  19580. /**
  19581. * @hidden
  19582. */
  19583. Config.prototype.init = function (config, plt) {
  19584. this._s = config && Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["k" /* isObject */])(config) && !Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["e" /* isArray */])(config) ? config : {};
  19585. this.plt = plt;
  19586. };
  19587. /**
  19588. * @name get
  19589. * @description
  19590. * Returns a single config value, given a key.
  19591. *
  19592. * @param {string} [key] - the key for the config value
  19593. * @param {any} [fallbackValue] - a fallback value to use when the config
  19594. * value was not found, or is config value is `null`. Fallback value
  19595. * defaults to `null`.
  19596. */
  19597. Config.prototype.get = function (key, fallbackValue) {
  19598. if (fallbackValue === void 0) { fallbackValue = null; }
  19599. var platform = this.plt;
  19600. if (!Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["h" /* isDefined */])(this._c[key])) {
  19601. if (!Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["h" /* isDefined */])(key)) {
  19602. throw 'config key is not defined';
  19603. }
  19604. // if the value was already set this will all be skipped
  19605. // if there was no user config then it'll check each of
  19606. // the user config's platforms, which already contains
  19607. // settings from default platform configs
  19608. var userPlatformValue = undefined;
  19609. var userDefaultValue = this._s[key];
  19610. var userPlatformModeValue = undefined;
  19611. var userDefaultModeValue = undefined;
  19612. var platformValue = undefined;
  19613. var platformModeValue = undefined;
  19614. var configObj = null;
  19615. if (platform) {
  19616. var queryStringValue = platform.getQueryParam('ionic' + key);
  19617. if (Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["h" /* isDefined */])(queryStringValue)) {
  19618. return this._c[key] = (queryStringValue === 'true' ? true : queryStringValue === 'false' ? false : queryStringValue);
  19619. }
  19620. // check the platform settings object for this value
  19621. // loop though each of the active platforms
  19622. // array of active platforms, which also knows the hierarchy,
  19623. // with the last one the most important
  19624. var activePlatformKeys = platform.platforms();
  19625. // loop through all of the active platforms we're on
  19626. for (var i = 0, ilen = activePlatformKeys.length; i < ilen; i++) {
  19627. // get user defined platform values
  19628. if (this._s.platforms) {
  19629. configObj = this._s.platforms[activePlatformKeys[i]];
  19630. if (configObj) {
  19631. if (Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["h" /* isDefined */])(configObj[key])) {
  19632. userPlatformValue = configObj[key];
  19633. }
  19634. configObj = this.getModeConfig(configObj.mode);
  19635. if (configObj && Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["h" /* isDefined */])(configObj[key])) {
  19636. userPlatformModeValue = configObj[key];
  19637. }
  19638. }
  19639. }
  19640. // get default platform's setting
  19641. configObj = platform.getPlatformConfig(activePlatformKeys[i]);
  19642. if (configObj && configObj.settings) {
  19643. if (Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["h" /* isDefined */])(configObj.settings[key])) {
  19644. // found a setting for this platform
  19645. platformValue = configObj.settings[key];
  19646. }
  19647. configObj = this.getModeConfig(configObj.settings.mode);
  19648. if (configObj && Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["h" /* isDefined */])(configObj[key])) {
  19649. // found setting for this platform's mode
  19650. platformModeValue = configObj[key];
  19651. }
  19652. }
  19653. }
  19654. }
  19655. configObj = this.getModeConfig(this._s.mode);
  19656. if (configObj && Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["h" /* isDefined */])(configObj[key])) {
  19657. userDefaultModeValue = configObj[key];
  19658. }
  19659. // cache the value
  19660. this._c[key] = Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["h" /* isDefined */])(userPlatformValue) ? userPlatformValue :
  19661. Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["h" /* isDefined */])(userDefaultValue) ? userDefaultValue :
  19662. Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["h" /* isDefined */])(userPlatformModeValue) ? userPlatformModeValue :
  19663. Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["h" /* isDefined */])(userDefaultModeValue) ? userDefaultModeValue :
  19664. Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["h" /* isDefined */])(platformValue) ? platformValue :
  19665. Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["h" /* isDefined */])(platformModeValue) ? platformModeValue :
  19666. null;
  19667. }
  19668. // return key's value
  19669. // either it came directly from the user config
  19670. // or it was from the users platform configs
  19671. // or it was from the default platform configs
  19672. // in that order
  19673. var rtnVal = this._c[key];
  19674. if (Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["i" /* isFunction */])(rtnVal)) {
  19675. rtnVal = rtnVal(platform);
  19676. }
  19677. return (rtnVal !== null ? rtnVal : fallbackValue);
  19678. };
  19679. /**
  19680. * @name getBoolean
  19681. * @description
  19682. * Same as `get()`, however always returns a boolean value. If the
  19683. * value from `get()` is `null`, then it'll return the `fallbackValue`
  19684. * which defaults to `false`. Otherwise, `getBoolean()` will return
  19685. * if the config value is truthy or not. It also returns `true` if
  19686. * the config value was the string value `"true"`.
  19687. * @param {string} [key] - the key for the config value
  19688. * @param {boolean} [fallbackValue] - a fallback value to use when the config
  19689. * value was `null`. Fallback value defaults to `false`.
  19690. */
  19691. Config.prototype.getBoolean = function (key, fallbackValue) {
  19692. if (fallbackValue === void 0) { fallbackValue = false; }
  19693. var val = this.get(key);
  19694. if (val === null) {
  19695. return fallbackValue;
  19696. }
  19697. if (typeof val === 'string') {
  19698. return val === 'true';
  19699. }
  19700. return !!val;
  19701. };
  19702. /**
  19703. * @name getNumber
  19704. * @description
  19705. * Same as `get()`, however always returns a number value. Uses `parseFloat()`
  19706. * on the value received from `get()`. If the result from the parse is `NaN`,
  19707. * then it will return the value passed to `fallbackValue`. If no fallback
  19708. * value was provided then it'll default to returning `NaN` when the result
  19709. * is not a valid number.
  19710. * @param {string} [key] - the key for the config value
  19711. * @param {number} [fallbackValue] - a fallback value to use when the config
  19712. * value turned out to be `NaN`. Fallback value defaults to `NaN`.
  19713. */
  19714. Config.prototype.getNumber = function (key, fallbackValue) {
  19715. if (fallbackValue === void 0) { fallbackValue = NaN; }
  19716. var val = parseFloat(this.get(key));
  19717. return isNaN(val) ? fallbackValue : val;
  19718. };
  19719. /**
  19720. * @name set
  19721. * @description
  19722. * Sets a single config value.
  19723. *
  19724. * @param {string} [platform] - The platform (either 'ios' or 'android') that the config value should apply to. Leaving this blank will apply the config value to all platforms.
  19725. * @param {string} [key] - The key used to look up the value at a later point in time.
  19726. * @param {string} [value] - The config value being stored.
  19727. */
  19728. Config.prototype.set = function () {
  19729. var args = [];
  19730. for (var _i = 0; _i < arguments.length; _i++) {
  19731. args[_i] = arguments[_i];
  19732. }
  19733. var arg0 = args[0];
  19734. var arg1 = args[1];
  19735. switch (args.length) {
  19736. case 2:
  19737. // set('key', 'value') = set key/value pair
  19738. // arg1 = value
  19739. this._s[arg0] = arg1;
  19740. delete this._c[arg0]; // clear cache
  19741. break;
  19742. case 3:
  19743. // setting('ios', 'key', 'value') = set key/value pair for platform
  19744. // arg0 = platform
  19745. // arg1 = key
  19746. // arg2 = value
  19747. this._s.platforms = this._s.platforms || {};
  19748. this._s.platforms[arg0] = this._s.platforms[arg0] || {};
  19749. this._s.platforms[arg0][arg1] = args[2];
  19750. delete this._c[arg1]; // clear cache
  19751. break;
  19752. }
  19753. return this;
  19754. };
  19755. /**
  19756. * @hidden
  19757. * @name settings()
  19758. * @description
  19759. */
  19760. Config.prototype.settings = function (arg0, arg1) {
  19761. switch (arguments.length) {
  19762. case 0:
  19763. return this._s;
  19764. case 1:
  19765. // settings({...})
  19766. this._s = arg0;
  19767. this._c = {}; // clear cache
  19768. break;
  19769. case 2:
  19770. // settings('ios', {...})
  19771. this._s.platforms = this._s.platforms || {};
  19772. this._s.platforms[arg0] = arg1;
  19773. this._c = {}; // clear cache
  19774. break;
  19775. }
  19776. return this;
  19777. };
  19778. /**
  19779. * @hidden
  19780. */
  19781. Config.prototype.setModeConfig = function (modeName, modeConfig) {
  19782. this._modes[modeName] = modeConfig;
  19783. };
  19784. /**
  19785. * @hidden
  19786. */
  19787. Config.prototype.getModeConfig = function (modeName) {
  19788. return this._modes[modeName] || null;
  19789. };
  19790. /**
  19791. * @hidden
  19792. */
  19793. Config.prototype.setTransition = function (trnsName, trnsClass) {
  19794. this._trns[trnsName] = trnsClass;
  19795. };
  19796. /**
  19797. * @hidden
  19798. */
  19799. Config.prototype.getTransition = function (trnsName) {
  19800. return this._trns[trnsName] || null;
  19801. };
  19802. return Config;
  19803. }());
  19804. /**
  19805. * @hidden
  19806. */
  19807. function setupConfig(userConfig, plt) {
  19808. var config = new Config();
  19809. config.init(userConfig, plt);
  19810. // add the config obj to the window
  19811. var win = plt.win();
  19812. win['Ionic'] = win['Ionic'] || {};
  19813. win['Ionic']['config'] = config;
  19814. return config;
  19815. }
  19816. /**
  19817. * @hidden
  19818. */
  19819. var ConfigToken = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["B" /* InjectionToken */]('USERCONFIG');
  19820. //# sourceMappingURL=config.js.map
  19821. /***/ }),
  19822. /* 2 */
  19823. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19824. "use strict";
  19825. /* harmony export (immutable) */ __webpack_exports__["a"] = clamp;
  19826. /* harmony export (immutable) */ __webpack_exports__["b"] = deepCopy;
  19827. /* harmony export (immutable) */ __webpack_exports__["c"] = deepEqual;
  19828. /* unused harmony export debounce */
  19829. /* unused harmony export normalizeURL */
  19830. /* harmony export (immutable) */ __webpack_exports__["d"] = defaults;
  19831. /* unused harmony export isBoolean */
  19832. /* harmony export (immutable) */ __webpack_exports__["n"] = isString;
  19833. /* harmony export (immutable) */ __webpack_exports__["j"] = isNumber;
  19834. /* harmony export (immutable) */ __webpack_exports__["i"] = isFunction;
  19835. /* harmony export (immutable) */ __webpack_exports__["h"] = isDefined;
  19836. /* harmony export (immutable) */ __webpack_exports__["p"] = isUndefined;
  19837. /* harmony export (immutable) */ __webpack_exports__["l"] = isPresent;
  19838. /* harmony export (immutable) */ __webpack_exports__["f"] = isBlank;
  19839. /* harmony export (immutable) */ __webpack_exports__["k"] = isObject;
  19840. /* harmony export (immutable) */ __webpack_exports__["e"] = isArray;
  19841. /* unused harmony export isPrimitive */
  19842. /* harmony export (immutable) */ __webpack_exports__["o"] = isTrueProperty;
  19843. /* harmony export (immutable) */ __webpack_exports__["g"] = isCheckedProperty;
  19844. /* harmony export (immutable) */ __webpack_exports__["m"] = isRightSide;
  19845. /* harmony export (immutable) */ __webpack_exports__["r"] = reorderArray;
  19846. /* harmony export (immutable) */ __webpack_exports__["q"] = removeArrayItem;
  19847. /* harmony export (immutable) */ __webpack_exports__["t"] = swipeShouldReset;
  19848. /* harmony export (immutable) */ __webpack_exports__["s"] = requestIonicCallback;
  19849. /* unused harmony export assert */
  19850. /* unused harmony export runInDev */
  19851. /**
  19852. * @hidden
  19853. * Given a min and max, restrict the given number
  19854. * to the range.
  19855. * @param min the minimum
  19856. * @param n the value
  19857. * @param max the maximum
  19858. */
  19859. function clamp(min, n, max) {
  19860. return Math.max(min, Math.min(n, max));
  19861. }
  19862. /** @hidden */
  19863. function deepCopy(obj) {
  19864. return JSON.parse(JSON.stringify(obj));
  19865. }
  19866. /** @hidden */
  19867. function deepEqual(a, b) {
  19868. if (a === b) {
  19869. return true;
  19870. }
  19871. return JSON.stringify(a) === JSON.stringify(b);
  19872. }
  19873. /** @hidden */
  19874. function debounce(fn, wait, immediate) {
  19875. if (immediate === void 0) { immediate = false; }
  19876. var timeout, args, context, timestamp, result;
  19877. return function () {
  19878. context = this;
  19879. args = arguments;
  19880. timestamp = Date.now();
  19881. var later = function () {
  19882. var last = Date.now() - timestamp;
  19883. if (last < wait) {
  19884. timeout = setTimeout(later, wait - last);
  19885. }
  19886. else {
  19887. timeout = null;
  19888. if (!immediate)
  19889. result = fn.apply(context, args);
  19890. }
  19891. };
  19892. var callNow = immediate && !timeout;
  19893. if (!timeout) {
  19894. timeout = setTimeout(later, wait);
  19895. }
  19896. if (callNow)
  19897. result = fn.apply(context, args);
  19898. return result;
  19899. };
  19900. }
  19901. /**
  19902. * @hidden
  19903. * Rewrites an absolute URL so it works across file and http based engines
  19904. */
  19905. function normalizeURL(url) {
  19906. var ionic = window['Ionic'];
  19907. if (ionic && ionic.normalizeURL) {
  19908. return ionic.normalizeURL(url);
  19909. }
  19910. return url;
  19911. }
  19912. /**
  19913. * @hidden
  19914. * Apply default arguments if they don't exist in
  19915. * the first object.
  19916. * @param {any} dest the destination to apply defaults to.
  19917. */
  19918. function defaults(dest) {
  19919. var _args = [];
  19920. for (var _i = 1; _i < arguments.length; _i++) {
  19921. _args[_i - 1] = arguments[_i];
  19922. }
  19923. for (var i = arguments.length - 1; i >= 1; i--) {
  19924. var source = arguments[i];
  19925. if (source) {
  19926. for (var key in source) {
  19927. if (source.hasOwnProperty(key) && !dest.hasOwnProperty(key)) {
  19928. dest[key] = source[key];
  19929. }
  19930. }
  19931. }
  19932. }
  19933. return dest;
  19934. }
  19935. /** @hidden */
  19936. function isBoolean(val) { return typeof val === 'boolean'; }
  19937. /** @hidden */
  19938. function isString(val) { return typeof val === 'string'; }
  19939. /** @hidden */
  19940. function isNumber(val) { return typeof val === 'number'; }
  19941. /** @hidden */
  19942. function isFunction(val) { return typeof val === 'function'; }
  19943. /** @hidden */
  19944. function isDefined(val) { return typeof val !== 'undefined'; }
  19945. /** @hidden */
  19946. function isUndefined(val) { return typeof val === 'undefined'; }
  19947. /** @hidden */
  19948. function isPresent(val) { return val !== undefined && val !== null; }
  19949. /** @hidden */
  19950. function isBlank(val) { return val === undefined || val === null; }
  19951. /** @hidden */
  19952. function isObject(val) { return typeof val === 'object'; }
  19953. /** @hidden */
  19954. function isArray(val) { return Array.isArray(val); }
  19955. /** @hidden */
  19956. function isPrimitive(val) {
  19957. return isString(val) || isBoolean(val) || (isNumber(val) && !isNaN(val));
  19958. }
  19959. /** @hidden */
  19960. function isTrueProperty(val) {
  19961. if (typeof val === 'string') {
  19962. val = val.toLowerCase().trim();
  19963. return (val === 'true' || val === 'on' || val === '');
  19964. }
  19965. return !!val;
  19966. }
  19967. /** @hidden */
  19968. function isCheckedProperty(a, b) {
  19969. if (a === undefined || a === null || a === '') {
  19970. return (b === undefined || b === null || b === '');
  19971. }
  19972. else if (a === true || a === 'true') {
  19973. return (b === true || b === 'true');
  19974. }
  19975. else if (a === false || a === 'false') {
  19976. return (b === false || b === 'false');
  19977. }
  19978. else if (a === 0 || a === '0') {
  19979. return (b === 0 || b === '0');
  19980. }
  19981. // not using strict comparison on purpose
  19982. return (a == b); // tslint:disable-line
  19983. }
  19984. /**
  19985. * @hidden
  19986. * Given a side, return if it should be on the right
  19987. * based on the value of dir
  19988. * @param side the side
  19989. * @param isRTL whether the application dir is rtl
  19990. * @param defaultRight whether the default side is right
  19991. */
  19992. function isRightSide(side, isRTL, defaultRight) {
  19993. if (defaultRight === void 0) { defaultRight = false; }
  19994. switch (side) {
  19995. case 'right': return true;
  19996. case 'left': return false;
  19997. case 'end': return !isRTL;
  19998. case 'start': return isRTL;
  19999. default: return defaultRight ? !isRTL : isRTL;
  20000. }
  20001. }
  20002. /** @hidden */
  20003. function reorderArray(array, indexes) {
  20004. var element = array[indexes.from];
  20005. array.splice(indexes.from, 1);
  20006. array.splice(indexes.to, 0, element);
  20007. return array;
  20008. }
  20009. /** @hidden */
  20010. function removeArrayItem(array, item) {
  20011. var index = array.indexOf(item);
  20012. return !!~index && !!array.splice(index, 1);
  20013. }
  20014. /** @hidden */
  20015. function swipeShouldReset(isResetDirection, isMovingFast, isOnResetZone) {
  20016. // The logic required to know when the sliding item should close (openAmount=0)
  20017. // depends on three booleans (isCloseDirection, isMovingFast, isOnCloseZone)
  20018. // and it ended up being too complicated to be written manually without errors
  20019. // so the truth table is attached below: (0=false, 1=true)
  20020. // isCloseDirection | isMovingFast | isOnCloseZone || shouldClose
  20021. // 0 | 0 | 0 || 0
  20022. // 0 | 0 | 1 || 1
  20023. // 0 | 1 | 0 || 0
  20024. // 0 | 1 | 1 || 0
  20025. // 1 | 0 | 0 || 0
  20026. // 1 | 0 | 1 || 1
  20027. // 1 | 1 | 0 || 1
  20028. // 1 | 1 | 1 || 1
  20029. // The resulting expression was generated by resolving the K-map (Karnaugh map):
  20030. var shouldClose = (!isMovingFast && isOnResetZone) || (isResetDirection && isMovingFast);
  20031. return shouldClose;
  20032. }
  20033. /** @hidden */
  20034. var ASSERT_ENABLED = true;
  20035. /** @hidden */
  20036. function _runInDev(fn) {
  20037. if (ASSERT_ENABLED === true) {
  20038. return fn();
  20039. }
  20040. }
  20041. /** @hidden */
  20042. function _assert(actual, reason) {
  20043. if (!actual && ASSERT_ENABLED === true) {
  20044. var message = 'IONIC ASSERT: ' + reason;
  20045. console.error(message);
  20046. debugger; // tslint:disable-line
  20047. throw new Error(message);
  20048. }
  20049. }
  20050. /** @hidden */
  20051. function requestIonicCallback(functionToLazy) {
  20052. if ('requestIdleCallback' in window) {
  20053. return window.requestIdleCallback(functionToLazy);
  20054. }
  20055. else {
  20056. return setTimeout(functionToLazy, 500);
  20057. }
  20058. }
  20059. /** @hidden */
  20060. /** @hidden */
  20061. //# sourceMappingURL=util.js.map
  20062. /***/ }),
  20063. /* 3 */
  20064. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20065. "use strict";
  20066. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Platform; });
  20067. /* harmony export (immutable) */ __webpack_exports__["b"] = setupPlatform;
  20068. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  20069. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_dom__ = __webpack_require__(10);
  20070. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__query_params__ = __webpack_require__(225);
  20071. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_util__ = __webpack_require__(2);
  20072. /**
  20073. * @name Platform
  20074. * @description
  20075. * The Platform service can be used to get information about your current device.
  20076. * You can get all of the platforms associated with the device using the [platforms](#platforms)
  20077. * method, including whether the app is being viewed from a tablet, if it's
  20078. * on a mobile device or browser, and the exact platform (iOS, Android, etc).
  20079. * You can also get the orientation of the device, if it uses right-to-left
  20080. * language direction, and much much more. With this information you can completely
  20081. * customize your app to fit any device.
  20082. *
  20083. * @usage
  20084. * ```ts
  20085. * import { Platform } from 'ionic-angular';
  20086. *
  20087. * @Component({...})
  20088. * export MyPage {
  20089. * constructor(public platform: Platform) {
  20090. *
  20091. * }
  20092. * }
  20093. * ```
  20094. * @demo /docs/demos/src/platform/
  20095. */
  20096. var Platform = (function () {
  20097. function Platform() {
  20098. var _this = this;
  20099. this._versions = {};
  20100. this._qp = new __WEBPACK_IMPORTED_MODULE_2__query_params__["a" /* QueryParams */]();
  20101. this._bbActions = [];
  20102. this._pW = 0;
  20103. this._pH = 0;
  20104. this._lW = 0;
  20105. this._lH = 0;
  20106. this._isPortrait = null;
  20107. this._uiEvtOpts = false;
  20108. /** @internal */
  20109. this._platforms = [];
  20110. // Events meant to be triggered by the engine
  20111. // **********************************************
  20112. /**
  20113. * @hidden
  20114. */
  20115. this.backButton = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  20116. /**
  20117. * The pause event emits when the native platform puts the application
  20118. * into the background, typically when the user switches to a different
  20119. * application. This event would emit when a Cordova app is put into
  20120. * the background, however, it would not fire on a standard web browser.
  20121. */
  20122. this.pause = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  20123. /**
  20124. * The resume event emits when the native platform pulls the application
  20125. * out from the background. This event would emit when a Cordova app comes
  20126. * out from the background, however, it would not fire on a standard web browser.
  20127. */
  20128. this.resume = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  20129. /**
  20130. * The resize event emits when the browser window has changed dimensions. This
  20131. * could be from a browser window being physically resized, or from a device
  20132. * changing orientation.
  20133. */
  20134. this.resize = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  20135. this._readyPromise = new Promise(function (res) { _this._readyResolve = res; });
  20136. this.backButton.subscribe(function () {
  20137. // the hardware back button event has been fired
  20138. (void 0) /* console.debug */;
  20139. // decide which backbutton action should run
  20140. _this.runBackButtonAction();
  20141. });
  20142. }
  20143. /**
  20144. * @hidden
  20145. */
  20146. Platform.prototype.setWindow = function (win) {
  20147. this._win = win;
  20148. };
  20149. /**
  20150. * @hidden
  20151. */
  20152. Platform.prototype.win = function () {
  20153. return this._win;
  20154. };
  20155. /**
  20156. * @hidden
  20157. */
  20158. Platform.prototype.setDocument = function (doc) {
  20159. this._doc = doc;
  20160. };
  20161. /**
  20162. * @hidden
  20163. */
  20164. Platform.prototype.doc = function () {
  20165. return this._doc;
  20166. };
  20167. /**
  20168. * @hidden
  20169. */
  20170. Platform.prototype.setZone = function (zone) {
  20171. this.zone = zone;
  20172. };
  20173. /**
  20174. * @hidden
  20175. */
  20176. Platform.prototype.setCssProps = function (docElement) {
  20177. this.Css = Object(__WEBPACK_IMPORTED_MODULE_1__util_dom__["c" /* getCss */])(docElement);
  20178. };
  20179. // Methods
  20180. // **********************************************
  20181. /**
  20182. * @returns {boolean} returns true/false based on platform.
  20183. * @description
  20184. * Depending on the platform the user is on, `is(platformName)` will
  20185. * return `true` or `false`. Note that the same app can return `true`
  20186. * for more than one platform name. For example, an app running from
  20187. * an iPad would return `true` for the platform names: `mobile`,
  20188. * `ios`, `ipad`, and `tablet`. Additionally, if the app was running
  20189. * from Cordova then `cordova` would be true, and if it was running
  20190. * from a web browser on the iPad then `mobileweb` would be `true`.
  20191. *
  20192. * ```
  20193. * import { Platform } from 'ionic-angular';
  20194. *
  20195. * @Component({...})
  20196. * export MyPage {
  20197. * constructor(public platform: Platform) {
  20198. * if (this.platform.is('ios')) {
  20199. * // This will only print when on iOS
  20200. * console.log('I am an iOS device!');
  20201. * }
  20202. * }
  20203. * }
  20204. * ```
  20205. *
  20206. * | Platform Name | Description |
  20207. * |-----------------|------------------------------------|
  20208. * | android | on a device running Android. |
  20209. * | cordova | on a device running Cordova. |
  20210. * | core | on a desktop device. |
  20211. * | ios | on a device running iOS. |
  20212. * | ipad | on an iPad device. |
  20213. * | iphone | on an iPhone device. |
  20214. * | mobile | on a mobile device. |
  20215. * | mobileweb | in a browser on a mobile device. |
  20216. * | phablet | on a phablet device. |
  20217. * | tablet | on a tablet device. |
  20218. * | windows | on a device running Windows. |
  20219. *
  20220. * @param {string} platformName
  20221. */
  20222. Platform.prototype.is = function (platformName) {
  20223. return (this._platforms.indexOf(platformName) > -1);
  20224. };
  20225. /**
  20226. * @returns {array} the array of platforms
  20227. * @description
  20228. * Depending on what device you are on, `platforms` can return multiple values.
  20229. * Each possible value is a hierarchy of platforms. For example, on an iPhone,
  20230. * it would return `mobile`, `ios`, and `iphone`.
  20231. *
  20232. * ```
  20233. * import { Platform } from 'ionic-angular';
  20234. *
  20235. * @Component({...})
  20236. * export MyPage {
  20237. * constructor(public platform: Platform) {
  20238. * // This will print an array of the current platforms
  20239. * console.log(this.platform.platforms());
  20240. * }
  20241. * }
  20242. * ```
  20243. */
  20244. Platform.prototype.platforms = function () {
  20245. // get the array of active platforms, which also knows the hierarchy,
  20246. // with the last one the most important
  20247. return this._platforms;
  20248. };
  20249. /**
  20250. * Returns an object containing version information about all of the platforms.
  20251. *
  20252. * ```
  20253. * import { Platform } from 'ionic-angular';
  20254. *
  20255. * @Component({...})
  20256. * export MyPage {
  20257. * constructor(public platform: Platform) {
  20258. * // This will print an object containing
  20259. * // all of the platforms and their versions
  20260. * console.log(platform.versions());
  20261. * }
  20262. * }
  20263. * ```
  20264. *
  20265. * @returns {object} An object containing all of the platforms and their versions.
  20266. */
  20267. Platform.prototype.versions = function () {
  20268. // get all the platforms that have a valid parsed version
  20269. return this._versions;
  20270. };
  20271. /**
  20272. * @hidden
  20273. */
  20274. Platform.prototype.version = function () {
  20275. for (var platformName in this._versions) {
  20276. if (this._versions[platformName]) {
  20277. return this._versions[platformName];
  20278. }
  20279. }
  20280. return {};
  20281. };
  20282. /**
  20283. * Returns a promise when the platform is ready and native functionality
  20284. * can be called. If the app is running from within a web browser, then
  20285. * the promise will resolve when the DOM is ready. When the app is running
  20286. * from an application engine such as Cordova, then the promise will
  20287. * resolve when Cordova triggers the `deviceready` event.
  20288. *
  20289. * The resolved value is the `readySource`, which states which platform
  20290. * ready was used. For example, when Cordova is ready, the resolved ready
  20291. * source is `cordova`. The default ready source value will be `dom`. The
  20292. * `readySource` is useful if different logic should run depending on the
  20293. * platform the app is running from. For example, only Cordova can execute
  20294. * the status bar plugin, so the web should not run status bar plugin logic.
  20295. *
  20296. * ```
  20297. * import { Component } from '@angular/core';
  20298. * import { Platform } from 'ionic-angular';
  20299. *
  20300. * @Component({...})
  20301. * export MyApp {
  20302. * constructor(public platform: Platform) {
  20303. * this.platform.ready().then((readySource) => {
  20304. * console.log('Platform ready from', readySource);
  20305. * // Platform now ready, execute any required native code
  20306. * });
  20307. * }
  20308. * }
  20309. * ```
  20310. * @returns {promise}
  20311. */
  20312. Platform.prototype.ready = function () {
  20313. return this._readyPromise;
  20314. };
  20315. /**
  20316. * @hidden
  20317. * This should be triggered by the engine when the platform is
  20318. * ready. If there was no custom prepareReady method from the engine,
  20319. * such as Cordova or Electron, then it uses the default DOM ready.
  20320. */
  20321. Platform.prototype.triggerReady = function (readySource) {
  20322. var _this = this;
  20323. this.zone.run(function () {
  20324. _this._readyResolve(readySource);
  20325. });
  20326. };
  20327. /**
  20328. * @hidden
  20329. * This is the default prepareReady if it's not replaced by an engine,
  20330. * such as Cordova or Electron. If there was no custom prepareReady
  20331. * method from an engine then it uses the method below, which triggers
  20332. * the platform ready on the DOM ready event, and the default resolved
  20333. * value is `dom`.
  20334. */
  20335. Platform.prototype.prepareReady = function () {
  20336. var self = this;
  20337. if (self._doc.readyState === 'complete' || self._doc.readyState === 'interactive') {
  20338. self.triggerReady('dom');
  20339. }
  20340. else {
  20341. self._doc.addEventListener('DOMContentLoaded', completed, false);
  20342. self._win.addEventListener('load', completed, false);
  20343. }
  20344. function completed() {
  20345. self._doc.removeEventListener('DOMContentLoaded', completed, false);
  20346. self._win.removeEventListener('load', completed, false);
  20347. self.triggerReady('dom');
  20348. }
  20349. };
  20350. /**
  20351. * Set the app's language direction, which will update the `dir` attribute
  20352. * on the app's root `<html>` element. We recommend the app's `index.html`
  20353. * file already has the correct `dir` attribute value set, such as
  20354. * `<html dir="ltr">` or `<html dir="rtl">`. This method is useful if the
  20355. * direction needs to be dynamically changed per user/session.
  20356. * [W3C: Structural markup and right-to-left text in HTML](http://www.w3.org/International/questions/qa-html-dir)
  20357. * @param {DocumentDirection} dir Examples: `rtl`, `ltr`
  20358. * @param {boolean} updateDocument
  20359. */
  20360. Platform.prototype.setDir = function (dir, updateDocument) {
  20361. this._dir = dir;
  20362. this.isRTL = (dir === 'rtl');
  20363. if (updateDocument !== false) {
  20364. this._doc['documentElement'].setAttribute('dir', dir);
  20365. }
  20366. };
  20367. /**
  20368. * Returns app's language direction.
  20369. * We recommend the app's `index.html` file already has the correct `dir`
  20370. * attribute value set, such as `<html dir="ltr">` or `<html dir="rtl">`.
  20371. * [W3C: Structural markup and right-to-left text in HTML](http://www.w3.org/International/questions/qa-html-dir)
  20372. * @returns {DocumentDirection}
  20373. */
  20374. Platform.prototype.dir = function () {
  20375. return this._dir;
  20376. };
  20377. /**
  20378. * Set the app's language and optionally the country code, which will update
  20379. * the `lang` attribute on the app's root `<html>` element.
  20380. * We recommend the app's `index.html` file already has the correct `lang`
  20381. * attribute value set, such as `<html lang="en">`. This method is useful if
  20382. * the language needs to be dynamically changed per user/session.
  20383. * [W3C: Declaring language in HTML](http://www.w3.org/International/questions/qa-html-language-declarations)
  20384. * @param {string} language Examples: `en-US`, `en-GB`, `ar`, `de`, `zh`, `es-MX`
  20385. * @param {boolean} updateDocument Specifies whether the `lang` attribute of `<html>` should be updated
  20386. */
  20387. Platform.prototype.setLang = function (language, updateDocument) {
  20388. this._lang = language;
  20389. if (updateDocument !== false) {
  20390. this._doc['documentElement'].setAttribute('lang', language);
  20391. }
  20392. };
  20393. /**
  20394. * Returns app's language and optional country code.
  20395. * We recommend the app's `index.html` file already has the correct `lang`
  20396. * attribute value set, such as `<html lang="en">`.
  20397. * [W3C: Declaring language in HTML](http://www.w3.org/International/questions/qa-html-language-declarations)
  20398. * @returns {string}
  20399. */
  20400. Platform.prototype.lang = function () {
  20401. return this._lang;
  20402. };
  20403. // Methods meant to be overridden by the engine
  20404. // **********************************************
  20405. // Provided NOOP methods so they do not error when
  20406. // called by engines (the browser)that do not provide them
  20407. /**
  20408. * @hidden
  20409. */
  20410. Platform.prototype.exitApp = function () { };
  20411. /**
  20412. * The back button event is triggered when the user presses the native
  20413. * platform's back button, also referred to as the "hardware" back button.
  20414. * This event is only used within Cordova apps running on Android and
  20415. * Windows platforms. This event is not fired on iOS since iOS doesn't come
  20416. * with a hardware back button in the same sense an Android or Windows device
  20417. * does.
  20418. *
  20419. * Registering a hardware back button action and setting a priority allows
  20420. * apps to control which action should be called when the hardware back
  20421. * button is pressed. This method decides which of the registered back button
  20422. * actions has the highest priority and should be called.
  20423. *
  20424. * @param {Function} fn Called when the back button is pressed,
  20425. * if this registered action has the highest priority.
  20426. * @param {number} priority Set the priority for this action. Only the highest priority will execute. Defaults to `0`.
  20427. * @returns {Function} A function that, when called, will unregister
  20428. * the back button action.
  20429. */
  20430. Platform.prototype.registerBackButtonAction = function (fn, priority) {
  20431. var _this = this;
  20432. if (priority === void 0) { priority = 0; }
  20433. var action = { fn: fn, priority: priority };
  20434. this._bbActions.push(action);
  20435. // return a function to unregister this back button action
  20436. return function () {
  20437. Object(__WEBPACK_IMPORTED_MODULE_3__util_util__["q" /* removeArrayItem */])(_this._bbActions, action);
  20438. };
  20439. };
  20440. /**
  20441. * @hidden
  20442. */
  20443. Platform.prototype.runBackButtonAction = function () {
  20444. // decide which one back button action should run
  20445. var winner = null;
  20446. this._bbActions.forEach(function (action) {
  20447. if (!winner || action.priority >= winner.priority) {
  20448. winner = action;
  20449. }
  20450. });
  20451. // run the winning action if there is one
  20452. winner && winner.fn && winner.fn();
  20453. };
  20454. // Getter/Setter Methods
  20455. // **********************************************
  20456. /**
  20457. * @hidden
  20458. */
  20459. Platform.prototype.setUserAgent = function (userAgent) {
  20460. this._ua = userAgent;
  20461. };
  20462. /**
  20463. * @hidden
  20464. */
  20465. Platform.prototype.setQueryParams = function (url) {
  20466. this._qp.parseUrl(url);
  20467. };
  20468. /**
  20469. * Get the query string parameter
  20470. */
  20471. Platform.prototype.getQueryParam = function (key) {
  20472. return this._qp.get(key);
  20473. };
  20474. /**
  20475. * Get the current url.
  20476. */
  20477. Platform.prototype.url = function () {
  20478. return this._win['location']['href'];
  20479. };
  20480. /**
  20481. * @hidden
  20482. */
  20483. Platform.prototype.userAgent = function () {
  20484. return this._ua || '';
  20485. };
  20486. /**
  20487. * @hidden
  20488. */
  20489. Platform.prototype.setNavigatorPlatform = function (navigatorPlt) {
  20490. this._nPlt = navigatorPlt;
  20491. };
  20492. /**
  20493. * @hidden
  20494. */
  20495. Platform.prototype.navigatorPlatform = function () {
  20496. return this._nPlt || '';
  20497. };
  20498. /**
  20499. * Gets the width of the platform's viewport using `window.innerWidth`.
  20500. * Using this method is preferred since the dimension is a cached value,
  20501. * which reduces the chance of multiple and expensive DOM reads.
  20502. */
  20503. Platform.prototype.width = function () {
  20504. this._calcDim();
  20505. return this._isPortrait ? this._pW : this._lW;
  20506. };
  20507. /**
  20508. * Gets the height of the platform's viewport using `window.innerHeight`.
  20509. * Using this method is preferred since the dimension is a cached value,
  20510. * which reduces the chance of multiple and expensive DOM reads.
  20511. */
  20512. Platform.prototype.height = function () {
  20513. this._calcDim();
  20514. return this._isPortrait ? this._pH : this._lH;
  20515. };
  20516. /**
  20517. * @hidden
  20518. */
  20519. Platform.prototype.getElementComputedStyle = function (ele, pseudoEle) {
  20520. return this._win['getComputedStyle'](ele, pseudoEle);
  20521. };
  20522. /**
  20523. * @hidden
  20524. */
  20525. Platform.prototype.getElementFromPoint = function (x, y) {
  20526. return this._doc['elementFromPoint'](x, y);
  20527. };
  20528. /**
  20529. * @hidden
  20530. */
  20531. Platform.prototype.getElementBoundingClientRect = function (ele) {
  20532. return ele['getBoundingClientRect']();
  20533. };
  20534. /**
  20535. * Returns `true` if the app is in portait mode.
  20536. */
  20537. Platform.prototype.isPortrait = function () {
  20538. this._calcDim();
  20539. return this._isPortrait;
  20540. };
  20541. /**
  20542. * Returns `true` if the app is in landscape mode.
  20543. */
  20544. Platform.prototype.isLandscape = function () {
  20545. return !this.isPortrait();
  20546. };
  20547. Platform.prototype._calcDim = function () {
  20548. // we're caching window dimensions so that
  20549. // we're not forcing many layouts
  20550. // if _isPortrait is null then that means
  20551. // the dimensions needs to be looked up again
  20552. // this also has to cover an edge case that only
  20553. // happens on iOS 10 (not other versions of iOS)
  20554. // where window.innerWidth is always bigger than
  20555. // window.innerHeight when it is first measured,
  20556. // even when the device is in portrait but
  20557. // the second time it is measured it is correct.
  20558. // Hopefully this check will not be needed in the future
  20559. if (this._isPortrait === null || this._isPortrait === false && this._win['innerWidth'] < this._win['innerHeight']) {
  20560. var win = this._win;
  20561. var innerWidth = win['innerWidth'];
  20562. var innerHeight = win['innerHeight'];
  20563. // we're keeping track of portrait and landscape dimensions
  20564. // separately because the virtual keyboard can really mess
  20565. // up accurate values when the keyboard is up
  20566. if (win.screen.width > 0 && win.screen.height > 0) {
  20567. if (innerWidth < innerHeight) {
  20568. // the device is in portrait
  20569. // we have to do fancier checking here
  20570. // because of the virtual keyboard resizing
  20571. // the window
  20572. if (this._pW <= innerWidth) {
  20573. (void 0) /* console.debug */;
  20574. this._isPortrait = true;
  20575. this._pW = innerWidth;
  20576. }
  20577. if (this._pH <= innerHeight) {
  20578. (void 0) /* console.debug */;
  20579. this._isPortrait = true;
  20580. this._pH = innerHeight;
  20581. }
  20582. }
  20583. else {
  20584. // the device is in landscape
  20585. if (this._lW !== innerWidth) {
  20586. (void 0) /* console.debug */;
  20587. this._isPortrait = false;
  20588. this._lW = innerWidth;
  20589. }
  20590. if (this._lH !== innerHeight) {
  20591. (void 0) /* console.debug */;
  20592. this._isPortrait = false;
  20593. this._lH = innerHeight;
  20594. }
  20595. }
  20596. }
  20597. }
  20598. };
  20599. /**
  20600. * @hidden
  20601. * This requestAnimationFrame will NOT be wrapped by zone.
  20602. */
  20603. Platform.prototype.raf = function (callback) {
  20604. var win = this._win;
  20605. return win['__zone_symbol__requestAnimationFrame'](callback);
  20606. };
  20607. /**
  20608. * @hidden
  20609. */
  20610. Platform.prototype.cancelRaf = function (rafId) {
  20611. var win = this._win;
  20612. return win['__zone_symbol__cancelAnimationFrame'](rafId);
  20613. };
  20614. /**
  20615. * @hidden
  20616. * This setTimeout will NOT be wrapped by zone.
  20617. */
  20618. Platform.prototype.timeout = function (callback, timeout) {
  20619. var win = this._win;
  20620. return win['__zone_symbol__setTimeout'](callback, timeout);
  20621. };
  20622. /**
  20623. * @hidden
  20624. * This setTimeout will NOT be wrapped by zone.
  20625. */
  20626. Platform.prototype.cancelTimeout = function (timeoutId) {
  20627. var win = this._win;
  20628. win['__zone_symbol__clearTimeout'](timeoutId);
  20629. };
  20630. /**
  20631. * @hidden
  20632. * Built to use modern event listener options, like "passive".
  20633. * If options are not supported, then just return a boolean which
  20634. * represents "capture". Returns a method to remove the listener.
  20635. */
  20636. Platform.prototype.registerListener = function (ele, eventName, callback, opts, unregisterListenersCollection) {
  20637. // use event listener options when supported
  20638. // otherwise it's just a boolean for the "capture" arg
  20639. var listenerOpts = this._uiEvtOpts ? {
  20640. 'capture': !!opts.capture,
  20641. 'passive': !!opts.passive,
  20642. } : !!opts.capture;
  20643. var unReg;
  20644. if (!opts.zone && ele['__zone_symbol__addEventListener']) {
  20645. // do not wrap this event in zone and we've verified we can use the raw addEventListener
  20646. ele['__zone_symbol__addEventListener'](eventName, callback, listenerOpts);
  20647. unReg = function unregisterListener() {
  20648. ele['__zone_symbol__removeEventListener'](eventName, callback, listenerOpts);
  20649. };
  20650. }
  20651. else {
  20652. // use the native addEventListener, which is wrapped with zone
  20653. ele['addEventListener'](eventName, callback, listenerOpts);
  20654. unReg = function unregisterListener() {
  20655. ele['removeEventListener'](eventName, callback, listenerOpts);
  20656. };
  20657. }
  20658. if (unregisterListenersCollection) {
  20659. unregisterListenersCollection.push(unReg);
  20660. }
  20661. return unReg;
  20662. };
  20663. /**
  20664. * @hidden
  20665. */
  20666. Platform.prototype.transitionEnd = function (el, callback, zone) {
  20667. if (zone === void 0) { zone = true; }
  20668. var unRegs = [];
  20669. function unregister() {
  20670. unRegs.forEach(function (unReg) {
  20671. unReg();
  20672. });
  20673. }
  20674. function onTransitionEnd(ev) {
  20675. if (el === ev.target) {
  20676. unregister();
  20677. callback(ev);
  20678. }
  20679. }
  20680. if (el) {
  20681. this.registerListener(el, 'webkitTransitionEnd', onTransitionEnd, { zone: zone }, unRegs);
  20682. this.registerListener(el, 'transitionend', onTransitionEnd, { zone: zone }, unRegs);
  20683. }
  20684. return unregister;
  20685. };
  20686. /**
  20687. * @hidden
  20688. */
  20689. Platform.prototype.windowLoad = function (callback) {
  20690. var win = this._win;
  20691. var doc = this._doc;
  20692. var unreg;
  20693. if (doc.readyState === 'complete') {
  20694. callback(win, doc);
  20695. }
  20696. else {
  20697. unreg = this.registerListener(win, 'load', function () {
  20698. unreg && unreg();
  20699. callback(win, doc);
  20700. }, { zone: false });
  20701. }
  20702. };
  20703. /**
  20704. * @hidden
  20705. */
  20706. Platform.prototype.isActiveElement = function (ele) {
  20707. return !!(ele && (this.getActiveElement() === ele));
  20708. };
  20709. /**
  20710. * @hidden
  20711. */
  20712. Platform.prototype.getActiveElement = function () {
  20713. return this._doc['activeElement'];
  20714. };
  20715. /**
  20716. * @hidden
  20717. */
  20718. Platform.prototype.hasFocus = function (ele) {
  20719. return !!((ele && (this.getActiveElement() === ele)) && (ele.parentElement.querySelector(':focus') === ele));
  20720. };
  20721. /**
  20722. * @hidden
  20723. */
  20724. Platform.prototype.hasFocusedTextInput = function () {
  20725. var ele = this.getActiveElement();
  20726. if (Object(__WEBPACK_IMPORTED_MODULE_1__util_dom__["e" /* isTextInput */])(ele)) {
  20727. return (ele.parentElement.querySelector(':focus') === ele);
  20728. }
  20729. return false;
  20730. };
  20731. /**
  20732. * @hidden
  20733. */
  20734. Platform.prototype.focusOutActiveElement = function () {
  20735. var activeElement = this.getActiveElement();
  20736. activeElement && activeElement.blur && activeElement.blur();
  20737. };
  20738. Platform.prototype._initEvents = function () {
  20739. var _this = this;
  20740. // Test via a getter in the options object to see if the passive property is accessed
  20741. try {
  20742. var opts = Object.defineProperty({}, 'passive', {
  20743. get: function () {
  20744. _this._uiEvtOpts = true;
  20745. }
  20746. });
  20747. this._win.addEventListener('optsTest', null, opts);
  20748. }
  20749. catch (e) { }
  20750. // add the window resize event listener XXms after
  20751. this.timeout(function () {
  20752. var timerId;
  20753. _this.registerListener(_this._win, 'resize', function () {
  20754. clearTimeout(timerId);
  20755. timerId = setTimeout(function () {
  20756. // setting _isPortrait to null means the
  20757. // dimensions will need to be looked up again
  20758. if (_this.hasFocusedTextInput() === false) {
  20759. _this._isPortrait = null;
  20760. }
  20761. _this.zone.run(function () { return _this.resize.emit(); });
  20762. }, 200);
  20763. }, { passive: true, zone: false });
  20764. }, 2000);
  20765. };
  20766. // Platform Registry
  20767. // **********************************************
  20768. /**
  20769. * @hidden
  20770. */
  20771. Platform.prototype.setPlatformConfigs = function (platformConfigs) {
  20772. this._registry = platformConfigs || {};
  20773. };
  20774. /**
  20775. * @hidden
  20776. */
  20777. Platform.prototype.getPlatformConfig = function (platformName) {
  20778. return this._registry[platformName] || {};
  20779. };
  20780. /**
  20781. * @hidden
  20782. */
  20783. Platform.prototype.registry = function () {
  20784. return this._registry;
  20785. };
  20786. /**
  20787. * @hidden
  20788. */
  20789. Platform.prototype.setDefault = function (platformName) {
  20790. this._default = platformName;
  20791. };
  20792. /**
  20793. * @hidden
  20794. */
  20795. Platform.prototype.testQuery = function (queryValue, queryTestValue) {
  20796. var valueSplit = queryValue.toLowerCase().split(';');
  20797. return valueSplit.indexOf(queryTestValue) > -1;
  20798. };
  20799. /**
  20800. * @hidden
  20801. */
  20802. Platform.prototype.testNavigatorPlatform = function (navigatorPlatformExpression) {
  20803. var rgx = new RegExp(navigatorPlatformExpression, 'i');
  20804. return rgx.test(this._nPlt);
  20805. };
  20806. /**
  20807. * @hidden
  20808. */
  20809. Platform.prototype.matchUserAgentVersion = function (userAgentExpression) {
  20810. if (this._ua && userAgentExpression) {
  20811. var val = this._ua.match(userAgentExpression);
  20812. if (val) {
  20813. return {
  20814. major: val[1],
  20815. minor: val[2]
  20816. };
  20817. }
  20818. }
  20819. };
  20820. Platform.prototype.testUserAgent = function (expression) {
  20821. if (this._ua) {
  20822. return this._ua.indexOf(expression) >= 0;
  20823. }
  20824. return false;
  20825. };
  20826. /**
  20827. * @hidden
  20828. */
  20829. Platform.prototype.isPlatformMatch = function (queryStringName, userAgentAtLeastHas, userAgentMustNotHave) {
  20830. if (userAgentMustNotHave === void 0) { userAgentMustNotHave = []; }
  20831. var queryValue = this._qp.get('ionicplatform');
  20832. if (queryValue) {
  20833. return this.testQuery(queryValue, queryStringName);
  20834. }
  20835. userAgentAtLeastHas = userAgentAtLeastHas || [queryStringName];
  20836. var userAgent = this._ua.toLowerCase();
  20837. for (var i = 0; i < userAgentAtLeastHas.length; i++) {
  20838. if (userAgent.indexOf(userAgentAtLeastHas[i]) > -1) {
  20839. for (var j = 0; j < userAgentMustNotHave.length; j++) {
  20840. if (userAgent.indexOf(userAgentMustNotHave[j]) > -1) {
  20841. return false;
  20842. }
  20843. }
  20844. return true;
  20845. }
  20846. }
  20847. return false;
  20848. };
  20849. /** @hidden */
  20850. Platform.prototype.init = function () {
  20851. this._initEvents();
  20852. var rootPlatformNode;
  20853. var enginePlatformNode;
  20854. // figure out the most specific platform and active engine
  20855. var tmpPlt;
  20856. for (var platformName in this._registry) {
  20857. tmpPlt = this.matchPlatform(platformName);
  20858. if (tmpPlt) {
  20859. // we found a platform match!
  20860. // check if its more specific than the one we already have
  20861. if (tmpPlt.isEngine) {
  20862. // because it matched then this should be the active engine
  20863. // you cannot have more than one active engine
  20864. enginePlatformNode = tmpPlt;
  20865. }
  20866. else if (!rootPlatformNode || tmpPlt.depth > rootPlatformNode.depth) {
  20867. // only find the root node for platforms that are not engines
  20868. // set this node as the root since we either don't already
  20869. // have one, or this one is more specific that the current one
  20870. rootPlatformNode = tmpPlt;
  20871. }
  20872. }
  20873. }
  20874. if (!rootPlatformNode) {
  20875. rootPlatformNode = new PlatformNode(this._registry, this._default);
  20876. }
  20877. // build a Platform instance filled with the
  20878. // hierarchy of active platforms and settings
  20879. if (rootPlatformNode) {
  20880. // check if we found an engine node (cordova/node-webkit/etc)
  20881. if (enginePlatformNode) {
  20882. // add the engine to the first in the platform hierarchy
  20883. // the original rootPlatformNode now becomes a child
  20884. // of the engineNode, which is not the new root
  20885. enginePlatformNode.child = rootPlatformNode;
  20886. rootPlatformNode.parent = enginePlatformNode;
  20887. rootPlatformNode = enginePlatformNode;
  20888. }
  20889. var platformNode = rootPlatformNode;
  20890. while (platformNode) {
  20891. insertSuperset(this._registry, platformNode);
  20892. platformNode = platformNode.child;
  20893. }
  20894. // make sure the root noot is actually the root
  20895. // incase a node was inserted before the root
  20896. platformNode = rootPlatformNode.parent;
  20897. while (platformNode) {
  20898. rootPlatformNode = platformNode;
  20899. platformNode = platformNode.parent;
  20900. }
  20901. platformNode = rootPlatformNode;
  20902. while (platformNode) {
  20903. platformNode.initialize(this);
  20904. // extra check for ipad pro issue
  20905. // https://forums.developer.apple.com/thread/25948
  20906. if (platformNode.name === 'iphone' && this.navigatorPlatform() === 'iPad') {
  20907. // this is an ipad pro so push ipad and tablet to platforms
  20908. // and then return as we are done
  20909. this._platforms.push('tablet');
  20910. this._platforms.push('ipad');
  20911. return;
  20912. }
  20913. // set the array of active platforms with
  20914. // the last one in the array the most important
  20915. this._platforms.push(platformNode.name);
  20916. // get the platforms version if a version parser was provided
  20917. this._versions[platformNode.name] = platformNode.version(this);
  20918. // go to the next platform child
  20919. platformNode = platformNode.child;
  20920. }
  20921. }
  20922. if (this._platforms.indexOf('mobile') > -1 && this._platforms.indexOf('cordova') === -1) {
  20923. this._platforms.push('mobileweb');
  20924. }
  20925. };
  20926. /**
  20927. * @hidden
  20928. */
  20929. Platform.prototype.matchPlatform = function (platformName) {
  20930. // build a PlatformNode and assign config data to it
  20931. // use it's getRoot method to build up its hierarchy
  20932. // depending on which platforms match
  20933. var platformNode = new PlatformNode(this._registry, platformName);
  20934. var rootNode = platformNode.getRoot(this);
  20935. if (rootNode) {
  20936. rootNode.depth = 0;
  20937. var childPlatform = rootNode.child;
  20938. while (childPlatform) {
  20939. rootNode.depth++;
  20940. childPlatform = childPlatform.child;
  20941. }
  20942. }
  20943. return rootNode;
  20944. };
  20945. return Platform;
  20946. }());
  20947. function insertSuperset(registry, platformNode) {
  20948. var supersetPlaformName = platformNode.superset();
  20949. if (supersetPlaformName) {
  20950. // add a platform in between two exist platforms
  20951. // so we can build the correct hierarchy of active platforms
  20952. var supersetPlatform = new PlatformNode(registry, supersetPlaformName);
  20953. supersetPlatform.parent = platformNode.parent;
  20954. supersetPlatform.child = platformNode;
  20955. if (supersetPlatform.parent) {
  20956. supersetPlatform.parent.child = supersetPlatform;
  20957. }
  20958. platformNode.parent = supersetPlatform;
  20959. }
  20960. }
  20961. /**
  20962. * @hidden
  20963. */
  20964. var PlatformNode = (function () {
  20965. function PlatformNode(registry, platformName) {
  20966. this.registry = registry;
  20967. this.c = registry[platformName];
  20968. this.name = platformName;
  20969. this.isEngine = this.c.isEngine;
  20970. }
  20971. PlatformNode.prototype.settings = function () {
  20972. return this.c.settings || {};
  20973. };
  20974. PlatformNode.prototype.superset = function () {
  20975. return this.c.superset;
  20976. };
  20977. PlatformNode.prototype.isMatch = function (p) {
  20978. return this.c.isMatch && this.c.isMatch(p) || false;
  20979. };
  20980. PlatformNode.prototype.initialize = function (plt) {
  20981. this.c.initialize && this.c.initialize(plt);
  20982. };
  20983. PlatformNode.prototype.version = function (plt) {
  20984. if (this.c.versionParser) {
  20985. var v = this.c.versionParser(plt);
  20986. if (v) {
  20987. var str = v.major + '.' + v.minor;
  20988. return {
  20989. str: str,
  20990. num: parseFloat(str),
  20991. major: parseInt(v.major, 10),
  20992. minor: parseInt(v.minor, 10)
  20993. };
  20994. }
  20995. }
  20996. };
  20997. PlatformNode.prototype.getRoot = function (plt) {
  20998. if (this.isMatch(plt)) {
  20999. var parents = this.getSubsetParents(this.name);
  21000. if (!parents.length) {
  21001. return this;
  21002. }
  21003. var platformNode = null;
  21004. var rootPlatformNode = null;
  21005. for (var i = 0; i < parents.length; i++) {
  21006. platformNode = new PlatformNode(this.registry, parents[i]);
  21007. platformNode.child = this;
  21008. rootPlatformNode = platformNode.getRoot(plt);
  21009. if (rootPlatformNode) {
  21010. this.parent = platformNode;
  21011. return rootPlatformNode;
  21012. }
  21013. }
  21014. }
  21015. return null;
  21016. };
  21017. PlatformNode.prototype.getSubsetParents = function (subsetPlatformName) {
  21018. var parentPlatformNames = [];
  21019. var pltConfig = null;
  21020. for (var platformName in this.registry) {
  21021. pltConfig = this.registry[platformName];
  21022. if (pltConfig.subsets && pltConfig.subsets.indexOf(subsetPlatformName) > -1) {
  21023. parentPlatformNames.push(platformName);
  21024. }
  21025. }
  21026. return parentPlatformNames;
  21027. };
  21028. return PlatformNode;
  21029. }());
  21030. /**
  21031. * @hidden
  21032. */
  21033. function setupPlatform(doc, platformConfigs, zone) {
  21034. var plt = new Platform();
  21035. plt.setDefault('core');
  21036. plt.setPlatformConfigs(platformConfigs);
  21037. plt.setZone(zone);
  21038. // set values from "document"
  21039. var docElement = doc.documentElement;
  21040. plt.setDocument(doc);
  21041. var dir = docElement.dir;
  21042. plt.setDir(dir === 'rtl' ? 'rtl' : 'ltr', !dir);
  21043. plt.setLang(docElement.lang, false);
  21044. // set css properties
  21045. plt.setCssProps(docElement);
  21046. // set values from "window"
  21047. var win = doc.defaultView;
  21048. plt.setWindow(win);
  21049. plt.setNavigatorPlatform(win.navigator.platform);
  21050. plt.setUserAgent(win.navigator.userAgent);
  21051. // set location values
  21052. plt.setQueryParams(win.location.href);
  21053. plt.init();
  21054. // add the platform obj to the window
  21055. win['Ionic'] = win['Ionic'] || {};
  21056. win['Ionic']['platform'] = plt;
  21057. return plt;
  21058. }
  21059. //# sourceMappingURL=platform.js.map
  21060. /***/ }),
  21061. /* 4 */
  21062. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21063. "use strict";
  21064. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Ion; });
  21065. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  21066. /**
  21067. * Base class for all Ionic components. Exposes some common functionality
  21068. * that all Ionic components need, such as accessing underlying native elements and
  21069. * sending/receiving app-level events.
  21070. */
  21071. /** @hidden */
  21072. var Ion = (function () {
  21073. function Ion(config, elementRef, renderer, componentName) {
  21074. this._config = config;
  21075. this._elementRef = elementRef;
  21076. this._renderer = renderer;
  21077. this._componentName = componentName;
  21078. if (componentName) {
  21079. this._setComponentName();
  21080. this._setMode(config.get('mode'));
  21081. }
  21082. }
  21083. Object.defineProperty(Ion.prototype, "color", {
  21084. get: function () {
  21085. return this._color;
  21086. },
  21087. /**
  21088. * @input {string} The color to use from your Sass `$colors` map.
  21089. * Default options are: `"primary"`, `"secondary"`, `"danger"`, `"light"`, and `"dark"`.
  21090. * For more information, see [Theming your App](/docs/theming/theming-your-app).
  21091. */
  21092. set: function (val) {
  21093. this._setColor(val);
  21094. },
  21095. enumerable: true,
  21096. configurable: true
  21097. });
  21098. Object.defineProperty(Ion.prototype, "mode", {
  21099. get: function () {
  21100. return this._mode;
  21101. },
  21102. /**
  21103. * @input {string} The mode determines which platform styles to use.
  21104. * Possible values are: `"ios"`, `"md"`, or `"wp"`.
  21105. * For more information, see [Platform Styles](/docs/theming/platform-specific-styles).
  21106. */
  21107. set: function (val) {
  21108. this._setMode(val);
  21109. },
  21110. enumerable: true,
  21111. configurable: true
  21112. });
  21113. /** @hidden */
  21114. Ion.prototype.setElementClass = function (className, isAdd) {
  21115. this._renderer.setElementClass(this._elementRef.nativeElement, className, isAdd);
  21116. };
  21117. /** @hidden */
  21118. Ion.prototype.setElementAttribute = function (attributeName, attributeValue) {
  21119. this._renderer.setElementAttribute(this._elementRef.nativeElement, attributeName, attributeValue);
  21120. };
  21121. /** @hidden */
  21122. Ion.prototype.setElementStyle = function (property, value) {
  21123. this._renderer.setElementStyle(this._elementRef.nativeElement, property, value);
  21124. };
  21125. /** @hidden */
  21126. Ion.prototype._setColor = function (newColor, componentName) {
  21127. if (componentName) {
  21128. // This is needed for the item-radio
  21129. this._componentName = componentName;
  21130. }
  21131. if (this._color) {
  21132. this.setElementClass(this._componentName + "-" + this._mode + "-" + this._color, false);
  21133. }
  21134. if (newColor) {
  21135. this.setElementClass(this._componentName + "-" + this._mode + "-" + newColor, true);
  21136. this._color = newColor;
  21137. }
  21138. };
  21139. /** @hidden */
  21140. Ion.prototype._setMode = function (newMode) {
  21141. if (this._mode) {
  21142. this.setElementClass(this._componentName + "-" + this._mode, false);
  21143. }
  21144. if (newMode) {
  21145. this.setElementClass(this._componentName + "-" + newMode, true);
  21146. // Remove the color class associated with the previous mode,
  21147. // change the mode, then add the new color class
  21148. this._setColor(null);
  21149. this._mode = newMode;
  21150. this._setColor(this._color);
  21151. }
  21152. };
  21153. /** @hidden */
  21154. Ion.prototype._setComponentName = function () {
  21155. this.setElementClass(this._componentName, true);
  21156. };
  21157. /** @hidden */
  21158. Ion.prototype.getElementRef = function () {
  21159. return this._elementRef;
  21160. };
  21161. /** @hidden */
  21162. Ion.prototype.getNativeElement = function () {
  21163. return this._elementRef.nativeElement;
  21164. };
  21165. Ion.propDecorators = {
  21166. 'color': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  21167. 'mode': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  21168. };
  21169. return Ion;
  21170. }());
  21171. //# sourceMappingURL=ion.js.map
  21172. /***/ }),
  21173. /* 5 */
  21174. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21175. "use strict";
  21176. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ViewController; });
  21177. /* harmony export (immutable) */ __webpack_exports__["b"] = isViewController;
  21178. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  21179. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_util__ = __webpack_require__(2);
  21180. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__nav_util__ = __webpack_require__(21);
  21181. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__nav_params__ = __webpack_require__(13);
  21182. /**
  21183. * @name ViewController
  21184. * @description
  21185. * Access various features and information about the current view.
  21186. * @usage
  21187. * ```ts
  21188. * import { Component } from '@angular/core';
  21189. * import { ViewController } from 'ionic-angular';
  21190. *
  21191. * @Component({...})
  21192. * export class MyPage{
  21193. *
  21194. * constructor(public viewCtrl: ViewController) {}
  21195. *
  21196. * }
  21197. * ```
  21198. */
  21199. var ViewController = (function () {
  21200. function ViewController(component, data, rootCssClass) {
  21201. if (rootCssClass === void 0) { rootCssClass = DEFAULT_CSS_CLASS; }
  21202. this.component = component;
  21203. this._isHidden = false;
  21204. this._state = __WEBPACK_IMPORTED_MODULE_2__nav_util__["h" /* STATE_NEW */];
  21205. /**
  21206. * Observable to be subscribed to when the current component will become active
  21207. * @returns {Observable} Returns an observable
  21208. */
  21209. this.willEnter = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  21210. /**
  21211. * Observable to be subscribed to when the current component has become active
  21212. * @returns {Observable} Returns an observable
  21213. */
  21214. this.didEnter = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  21215. /**
  21216. * Observable to be subscribed to when the current component will no longer be active
  21217. * @returns {Observable} Returns an observable
  21218. */
  21219. this.willLeave = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  21220. /**
  21221. * Observable to be subscribed to when the current component is no long active
  21222. * @returns {Observable} Returns an observable
  21223. */
  21224. this.didLeave = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  21225. /**
  21226. * Observable to be subscribed to when the current component has been destroyed
  21227. * @returns {Observable} Returns an observable
  21228. */
  21229. this.willUnload = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  21230. /**
  21231. * @hidden
  21232. */
  21233. this.readReady = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  21234. /**
  21235. * @hidden
  21236. */
  21237. this.writeReady = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  21238. /** @hidden */
  21239. this.isOverlay = false;
  21240. /** @hidden */
  21241. this._emitter = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  21242. // passed in data could be NavParams, but all we care about is its data object
  21243. this.data = (data instanceof __WEBPACK_IMPORTED_MODULE_3__nav_params__["a" /* NavParams */] ? data.data : (Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["l" /* isPresent */])(data) ? data : {}));
  21244. this._cssClass = rootCssClass;
  21245. this._ts = Date.now();
  21246. window.addEventListener('orientationchange', this.handleOrientationChange.bind(this));
  21247. }
  21248. ViewController.prototype.handleOrientationChange = function () {
  21249. if (this.getContent()) {
  21250. this.getContent().resize();
  21251. }
  21252. };
  21253. /**
  21254. * @hidden
  21255. */
  21256. ViewController.prototype.init = function (componentRef) {
  21257. (void 0) /* assert */;
  21258. this._ts = Date.now();
  21259. this._cmp = componentRef;
  21260. this.instance = this.instance || componentRef.instance;
  21261. this._detached = false;
  21262. };
  21263. ViewController.prototype._setNav = function (navCtrl) {
  21264. this._nav = navCtrl;
  21265. };
  21266. ViewController.prototype._setInstance = function (instance) {
  21267. this.instance = instance;
  21268. };
  21269. /**
  21270. * @hidden
  21271. */
  21272. ViewController.prototype.subscribe = function (generatorOrNext) {
  21273. return this._emitter.subscribe(generatorOrNext);
  21274. };
  21275. /**
  21276. * @hidden
  21277. */
  21278. ViewController.prototype.emit = function (data) {
  21279. this._emitter.emit(data);
  21280. };
  21281. /**
  21282. * Called when the current viewController has be successfully dismissed
  21283. */
  21284. ViewController.prototype.onDidDismiss = function (callback) {
  21285. this._onDidDismiss = callback;
  21286. };
  21287. /**
  21288. * Called when the current viewController will be dismissed
  21289. */
  21290. ViewController.prototype.onWillDismiss = function (callback) {
  21291. this._onWillDismiss = callback;
  21292. };
  21293. /**
  21294. * Dismiss the current viewController
  21295. * @param {any} [data] Data that you want to return when the viewController is dismissed.
  21296. * @param {any} [role ]
  21297. * @param {NavOptions} navOptions Options for the dismiss navigation.
  21298. * @returns {any} data Returns the data passed in, if any.
  21299. */
  21300. ViewController.prototype.dismiss = function (data, role, navOptions) {
  21301. if (navOptions === void 0) { navOptions = {}; }
  21302. if (!this._nav) {
  21303. (void 0) /* assert */;
  21304. return Promise.resolve(false);
  21305. }
  21306. if (this.isOverlay && !navOptions.minClickBlockDuration) {
  21307. // This is a Modal being dismissed so we need
  21308. // to add the minClickBlockDuration option
  21309. // for UIWebView
  21310. navOptions.minClickBlockDuration = 400;
  21311. }
  21312. this._dismissData = data;
  21313. this._dismissRole = role;
  21314. var options = Object.assign({}, this._leavingOpts, navOptions);
  21315. return this._nav.removeView(this, options).then(function () { return data; });
  21316. };
  21317. /**
  21318. * @hidden
  21319. */
  21320. ViewController.prototype.getNav = function () {
  21321. return this._nav;
  21322. };
  21323. /**
  21324. * @hidden
  21325. */
  21326. ViewController.prototype.getTransitionName = function (_direction) {
  21327. return this._nav && this._nav.config.get('pageTransition');
  21328. };
  21329. /**
  21330. * @hidden
  21331. */
  21332. ViewController.prototype.getNavParams = function () {
  21333. return new __WEBPACK_IMPORTED_MODULE_3__nav_params__["a" /* NavParams */](this.data);
  21334. };
  21335. /**
  21336. * @hidden
  21337. */
  21338. ViewController.prototype.setLeavingOpts = function (opts) {
  21339. this._leavingOpts = opts;
  21340. };
  21341. /**
  21342. * Check to see if you can go back in the navigation stack.
  21343. * @returns {boolean} Returns if it's possible to go back from this Page.
  21344. */
  21345. ViewController.prototype.enableBack = function () {
  21346. // update if it's possible to go back from this nav item
  21347. if (!this._nav) {
  21348. return false;
  21349. }
  21350. // the previous view may exist, but if it's about to be destroyed
  21351. // it shouldn't be able to go back to
  21352. var previousItem = this._nav.getPrevious(this);
  21353. return !!(previousItem);
  21354. };
  21355. Object.defineProperty(ViewController.prototype, "name", {
  21356. /**
  21357. * @hidden
  21358. */
  21359. get: function () {
  21360. return (this.component ? this.component.name : '');
  21361. },
  21362. enumerable: true,
  21363. configurable: true
  21364. });
  21365. Object.defineProperty(ViewController.prototype, "index", {
  21366. /**
  21367. * Get the index of the current component in the current navigation stack.
  21368. * @returns {number} Returns the index of this page within its `NavController`.
  21369. */
  21370. get: function () {
  21371. return (this._nav ? this._nav.indexOf(this) : -1);
  21372. },
  21373. enumerable: true,
  21374. configurable: true
  21375. });
  21376. /**
  21377. * @returns {boolean} Returns if this Page is the first in the stack of pages within its NavController.
  21378. */
  21379. ViewController.prototype.isFirst = function () {
  21380. return (this._nav ? this._nav.first() === this : false);
  21381. };
  21382. /**
  21383. * @returns {boolean} Returns if this Page is the last in the stack of pages within its NavController.
  21384. */
  21385. ViewController.prototype.isLast = function () {
  21386. return (this._nav ? this._nav.last() === this : false);
  21387. };
  21388. /**
  21389. * @hidden
  21390. * DOM WRITE
  21391. */
  21392. ViewController.prototype._domShow = function (shouldShow, renderer) {
  21393. // using hidden element attribute to display:none and not render views
  21394. // _hidden value of '' means the hidden attribute will be added
  21395. // _hidden value of null means the hidden attribute will be removed
  21396. // doing checks to make sure we only update the DOM when actually needed
  21397. // if it should render, then the hidden attribute should not be on the element
  21398. if (this._cmp && shouldShow === this._isHidden) {
  21399. this._isHidden = !shouldShow;
  21400. var value = (shouldShow ? null : '');
  21401. // ******** DOM WRITE ****************
  21402. renderer.setElementAttribute(this.pageRef().nativeElement, 'hidden', value);
  21403. }
  21404. };
  21405. /**
  21406. * @hidden
  21407. */
  21408. ViewController.prototype.getZIndex = function () {
  21409. return this._zIndex;
  21410. };
  21411. /**
  21412. * @hidden
  21413. * DOM WRITE
  21414. */
  21415. ViewController.prototype._setZIndex = function (zIndex, renderer) {
  21416. if (zIndex !== this._zIndex) {
  21417. this._zIndex = zIndex;
  21418. var pageRef = this.pageRef();
  21419. if (pageRef) {
  21420. // ******** DOM WRITE ****************
  21421. renderer.setElementStyle(pageRef.nativeElement, 'z-index', zIndex);
  21422. }
  21423. }
  21424. };
  21425. /**
  21426. * @returns {ElementRef} Returns the Page's ElementRef.
  21427. */
  21428. ViewController.prototype.pageRef = function () {
  21429. return this._cmp && this._cmp.location;
  21430. };
  21431. ViewController.prototype._setContent = function (directive) {
  21432. this._cntDir = directive;
  21433. };
  21434. /**
  21435. * @returns {component} Returns the Page's Content component reference.
  21436. */
  21437. ViewController.prototype.getContent = function () {
  21438. return this._cntDir;
  21439. };
  21440. ViewController.prototype._setContentRef = function (elementRef) {
  21441. this._cntRef = elementRef;
  21442. };
  21443. /**
  21444. * @returns {ElementRef} Returns the Content's ElementRef.
  21445. */
  21446. ViewController.prototype.contentRef = function () {
  21447. return this._cntRef;
  21448. };
  21449. ViewController.prototype._setIONContent = function (content) {
  21450. this._setContent(content);
  21451. this._ionCntDir = content;
  21452. };
  21453. /**
  21454. * @hidden
  21455. */
  21456. ViewController.prototype.getIONContent = function () {
  21457. return this._ionCntDir;
  21458. };
  21459. ViewController.prototype._setIONContentRef = function (elementRef) {
  21460. this._setContentRef(elementRef);
  21461. this._ionCntRef = elementRef;
  21462. };
  21463. /**
  21464. * @hidden
  21465. */
  21466. ViewController.prototype.getIONContentRef = function () {
  21467. return this._ionCntRef;
  21468. };
  21469. ViewController.prototype._setHeader = function (directive) {
  21470. this._hdrDir = directive;
  21471. };
  21472. /**
  21473. * @hidden
  21474. */
  21475. ViewController.prototype.getHeader = function () {
  21476. return this._hdrDir;
  21477. };
  21478. ViewController.prototype._setFooter = function (directive) {
  21479. this._ftrDir = directive;
  21480. };
  21481. /**
  21482. * @hidden
  21483. */
  21484. ViewController.prototype.getFooter = function () {
  21485. return this._ftrDir;
  21486. };
  21487. ViewController.prototype._setNavbar = function (directive) {
  21488. this._nb = directive;
  21489. };
  21490. /**
  21491. * @hidden
  21492. */
  21493. ViewController.prototype.getNavbar = function () {
  21494. return this._nb;
  21495. };
  21496. /**
  21497. * Find out if the current component has a NavBar or not. Be sure
  21498. * to wrap this in an `ionViewWillEnter` method in order to make sure
  21499. * the view has rendered fully.
  21500. * @returns {boolean} Returns a boolean if this Page has a navbar or not.
  21501. */
  21502. ViewController.prototype.hasNavbar = function () {
  21503. return !!this._nb;
  21504. };
  21505. /**
  21506. * Change the title of the back-button. Be sure to call this
  21507. * after `ionViewWillEnter` to make sure the DOM has been rendered.
  21508. * @param {string} val Set the back button text.
  21509. */
  21510. ViewController.prototype.setBackButtonText = function (val) {
  21511. this._nb && this._nb.setBackButtonText(val);
  21512. };
  21513. /**
  21514. * Set if the back button for the current view is visible or not. Be sure to call this
  21515. * after `ionViewWillEnter` to make sure the DOM has been rendered.
  21516. * @param {boolean} Set if this Page's back button should show or not.
  21517. */
  21518. ViewController.prototype.showBackButton = function (shouldShow) {
  21519. if (this._nb) {
  21520. this._nb.hideBackButton = !shouldShow;
  21521. }
  21522. };
  21523. ViewController.prototype._preLoad = function () {
  21524. (void 0) /* assert */;
  21525. this._lifecycle('PreLoad');
  21526. };
  21527. /**
  21528. * @hidden
  21529. * The view has loaded. This event only happens once per view will be created.
  21530. * This event is fired before the component and his children have been initialized.
  21531. */
  21532. ViewController.prototype._willLoad = function () {
  21533. (void 0) /* assert */;
  21534. this._lifecycle('WillLoad');
  21535. };
  21536. /**
  21537. * @hidden
  21538. * The view has loaded. This event only happens once per view being
  21539. * created. If a view leaves but is cached, then this will not
  21540. * fire again on a subsequent viewing. This method is a good place
  21541. * to put your setup code for the view; however, it is not the
  21542. * recommended method to use when a view becomes active.
  21543. */
  21544. ViewController.prototype._didLoad = function () {
  21545. (void 0) /* assert */;
  21546. this._lifecycle('DidLoad');
  21547. };
  21548. /**
  21549. * @hidden
  21550. * The view is about to enter and become the active view.
  21551. */
  21552. ViewController.prototype._willEnter = function () {
  21553. this.handleOrientationChange();
  21554. (void 0) /* assert */;
  21555. if (this._detached && this._cmp) {
  21556. // ensure this has been re-attached to the change detector
  21557. this._cmp.changeDetectorRef.reattach();
  21558. this._detached = false;
  21559. }
  21560. this.willEnter.emit(null);
  21561. this._lifecycle('WillEnter');
  21562. };
  21563. /**
  21564. * @hidden
  21565. * The view has fully entered and is now the active view. This
  21566. * will fire, whether it was the first load or loaded from the cache.
  21567. */
  21568. ViewController.prototype._didEnter = function () {
  21569. (void 0) /* assert */;
  21570. this._nb && this._nb.didEnter();
  21571. this.didEnter.emit(null);
  21572. this._lifecycle('DidEnter');
  21573. };
  21574. /**
  21575. * @hidden
  21576. * The view is about to leave and no longer be the active view.
  21577. */
  21578. ViewController.prototype._willLeave = function (willUnload) {
  21579. this.willLeave.emit(null);
  21580. this._lifecycle('WillLeave');
  21581. if (willUnload && this._onWillDismiss) {
  21582. this._onWillDismiss(this._dismissData, this._dismissRole);
  21583. this._onWillDismiss = null;
  21584. }
  21585. };
  21586. /**
  21587. * @hidden
  21588. * The view has finished leaving and is no longer the active view. This
  21589. * will fire, whether it is cached or unloaded.
  21590. */
  21591. ViewController.prototype._didLeave = function () {
  21592. this.didLeave.emit(null);
  21593. this._lifecycle('DidLeave');
  21594. // when this is not the active page
  21595. // we no longer need to detect changes
  21596. if (!this._detached && this._cmp) {
  21597. this._cmp.changeDetectorRef.detach();
  21598. this._detached = true;
  21599. }
  21600. };
  21601. /**
  21602. * @hidden
  21603. */
  21604. ViewController.prototype._willUnload = function () {
  21605. this.willUnload.emit(null);
  21606. this._lifecycle('WillUnload');
  21607. this._onDidDismiss && this._onDidDismiss(this._dismissData, this._dismissRole);
  21608. this._onDidDismiss = null;
  21609. this._dismissData = null;
  21610. this._dismissRole = null;
  21611. };
  21612. /**
  21613. * @hidden
  21614. * DOM WRITE
  21615. */
  21616. ViewController.prototype._destroy = function (renderer) {
  21617. (void 0) /* assert */;
  21618. if (this._cmp) {
  21619. if (renderer) {
  21620. // ensure the element is cleaned up for when the view pool reuses this element
  21621. // ******** DOM WRITE ****************
  21622. var cmpEle = this._cmp.location.nativeElement;
  21623. renderer.setElementAttribute(cmpEle, 'class', null);
  21624. renderer.setElementAttribute(cmpEle, 'style', null);
  21625. }
  21626. window.removeEventListener('orientationchange', this.handleOrientationChange.bind(this));
  21627. // completely destroy this component. boom.
  21628. this._cmp.destroy();
  21629. }
  21630. this._nav = this._cmp = this.instance = this._cntDir = this._cntRef = this._leavingOpts = this._hdrDir = this._ftrDir = this._nb = this._onDidDismiss = this._onWillDismiss = null;
  21631. this._state = __WEBPACK_IMPORTED_MODULE_2__nav_util__["f" /* STATE_DESTROYED */];
  21632. };
  21633. /**
  21634. * @hidden
  21635. */
  21636. ViewController.prototype._lifecycleTest = function (lifecycle) {
  21637. var instance = this.instance;
  21638. var methodName = 'ionViewCan' + lifecycle;
  21639. if (instance && instance[methodName]) {
  21640. try {
  21641. var result = instance[methodName]();
  21642. if (result instanceof Promise) {
  21643. return result;
  21644. }
  21645. else {
  21646. // Any value but explitic false, should be true
  21647. return Promise.resolve(result !== false);
  21648. }
  21649. }
  21650. catch (e) {
  21651. return Promise.reject(this.name + " " + methodName + " error: " + e.message);
  21652. }
  21653. }
  21654. return Promise.resolve(true);
  21655. };
  21656. /**
  21657. * @hidden
  21658. */
  21659. ViewController.prototype._lifecycle = function (lifecycle) {
  21660. var instance = this.instance;
  21661. var methodName = 'ionView' + lifecycle;
  21662. if (instance && instance[methodName]) {
  21663. instance[methodName]();
  21664. }
  21665. };
  21666. ViewController.propDecorators = {
  21667. '_emitter': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  21668. };
  21669. return ViewController;
  21670. }());
  21671. function isViewController(viewCtrl) {
  21672. return !!(viewCtrl && viewCtrl._didLoad && viewCtrl._willUnload);
  21673. }
  21674. var DEFAULT_CSS_CLASS = 'ion-page';
  21675. //# sourceMappingURL=view-controller.js.map
  21676. /***/ }),
  21677. /* 6 */
  21678. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21679. "use strict";
  21680. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return App; });
  21681. /* unused harmony export getNavByIdOrName */
  21682. /* unused harmony export findTopNavs */
  21683. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  21684. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_platform_browser__ = __webpack_require__(31);
  21685. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__app_constants__ = __webpack_require__(35);
  21686. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__config_config__ = __webpack_require__(1);
  21687. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__navigation_nav_util__ = __webpack_require__(21);
  21688. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__menu_controller__ = __webpack_require__(26);
  21689. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__platform_platform__ = __webpack_require__(3);
  21690. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__transitions_transition_ios__ = __webpack_require__(226);
  21691. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__transitions_transition_md__ = __webpack_require__(227);
  21692. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__transitions_transition_wp__ = __webpack_require__(228);
  21693. /**
  21694. * @name App
  21695. * @description
  21696. * App is a utility class used in Ionic to get information about various aspects of an app
  21697. */
  21698. var App = (function () {
  21699. function App(_config, _plt, _menuCtrl) {
  21700. this._config = _config;
  21701. this._plt = _plt;
  21702. this._menuCtrl = _menuCtrl;
  21703. this._disTime = 0;
  21704. this._scrollTime = 0;
  21705. this._title = '';
  21706. this._titleSrv = new __WEBPACK_IMPORTED_MODULE_1__angular_platform_browser__["e" /* Title */](__WEBPACK_IMPORTED_MODULE_1__angular_platform_browser__["b" /* DOCUMENT */]);
  21707. this._rootNavs = new Map();
  21708. this._didScroll = false;
  21709. /**
  21710. * Observable that emits whenever a view loads in the app.
  21711. * @returns {Observable} Returns an observable
  21712. */
  21713. this.viewDidLoad = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  21714. /**
  21715. * Observable that emits before any view is entered in the app.
  21716. * @returns {Observable} Returns an observable
  21717. */
  21718. this.viewWillEnter = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  21719. /**
  21720. * Observable that emits after any view is entered in the app.
  21721. * @returns {Observable} Returns an observable
  21722. */
  21723. this.viewDidEnter = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  21724. /**
  21725. * Observable that emits before any view is exited in the app.
  21726. * @returns {Observable} Returns an observable
  21727. */
  21728. this.viewWillLeave = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  21729. /**
  21730. * Observable that emits after any view is exited in the app.
  21731. * @returns {Observable} Returns an observable
  21732. */
  21733. this.viewDidLeave = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  21734. /**
  21735. * Observable that emits before any view unloads in the app.
  21736. * @returns {Observable} Returns an observable
  21737. */
  21738. this.viewWillUnload = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  21739. // listen for hardware back button events
  21740. // register this back button action with a default priority
  21741. _plt.registerBackButtonAction(this.goBack.bind(this));
  21742. this._disableScrollAssist = _config.getBoolean('disableScrollAssist', false);
  21743. var blurring = _config.getBoolean('inputBlurring', false);
  21744. if (blurring) {
  21745. this._enableInputBlurring();
  21746. }
  21747. (void 0) /* runInDev */;
  21748. _config.setTransition('ios-transition', __WEBPACK_IMPORTED_MODULE_7__transitions_transition_ios__["a" /* IOSTransition */]);
  21749. _config.setTransition('md-transition', __WEBPACK_IMPORTED_MODULE_8__transitions_transition_md__["a" /* MDTransition */]);
  21750. _config.setTransition('wp-transition', __WEBPACK_IMPORTED_MODULE_9__transitions_transition_wp__["a" /* WPTransition */]);
  21751. }
  21752. /**
  21753. * Sets the document title.
  21754. * @param {string} val Value to set the document title to.
  21755. */
  21756. App.prototype.setTitle = function (val) {
  21757. if (val !== this._title) {
  21758. this._title = val;
  21759. this._titleSrv.setTitle(val);
  21760. }
  21761. };
  21762. /**
  21763. * @hidden
  21764. */
  21765. App.prototype.setElementClass = function (className, isAdd) {
  21766. this._appRoot.setElementClass(className, isAdd);
  21767. };
  21768. /**
  21769. * @hidden
  21770. * Sets if the app is currently enabled or not, meaning if it's
  21771. * available to accept new user commands. For example, this is set to `false`
  21772. * while views transition, a modal slides up, an action-sheet
  21773. * slides up, etc. After the transition completes it is set back to `true`.
  21774. * @param {boolean} isEnabled `true` for enabled, `false` for disabled
  21775. * @param {number} duration When `isEnabled` is set to `false`, this argument
  21776. * is used to set the maximum number of milliseconds that app will wait until
  21777. * it will automatically enable the app again. It's basically a fallback incase
  21778. * something goes wrong during a transition and the app wasn't re-enabled correctly.
  21779. */
  21780. App.prototype.setEnabled = function (isEnabled, duration, minDuration) {
  21781. if (duration === void 0) { duration = 700; }
  21782. if (minDuration === void 0) { minDuration = 0; }
  21783. this._disTime = (isEnabled ? 0 : Date.now() + duration);
  21784. if (this._clickBlock) {
  21785. if (isEnabled) {
  21786. // disable the click block if it's enabled, or the duration is tiny
  21787. this._clickBlock.activate(false, CLICK_BLOCK_BUFFER_IN_MILLIS, minDuration);
  21788. }
  21789. else {
  21790. // show the click block for duration + some number
  21791. this._clickBlock.activate(true, duration + CLICK_BLOCK_BUFFER_IN_MILLIS, minDuration);
  21792. }
  21793. }
  21794. };
  21795. /**
  21796. * @hidden
  21797. * Toggles whether an application can be scrolled
  21798. * @param {boolean} disableScroll when set to `false`, the application's
  21799. * scrolling is enabled. When set to `true`, scrolling is disabled.
  21800. */
  21801. App.prototype._setDisableScroll = function (disableScroll) {
  21802. if (this._disableScrollAssist) {
  21803. this._appRoot._disableScroll(disableScroll);
  21804. }
  21805. };
  21806. /**
  21807. * @hidden
  21808. * Boolean if the app is actively enabled or not.
  21809. * @return {boolean}
  21810. */
  21811. App.prototype.isEnabled = function () {
  21812. var disTime = this._disTime;
  21813. if (disTime === 0) {
  21814. return true;
  21815. }
  21816. return (disTime < Date.now());
  21817. };
  21818. /**
  21819. * @hidden
  21820. */
  21821. App.prototype.setScrolling = function () {
  21822. this._scrollTime = Date.now() + ACTIVE_SCROLLING_TIME;
  21823. this._didScroll = true;
  21824. };
  21825. /**
  21826. * Boolean if the app is actively scrolling or not.
  21827. * @return {boolean} returns true or false
  21828. */
  21829. App.prototype.isScrolling = function () {
  21830. var scrollTime = this._scrollTime;
  21831. if (scrollTime === 0) {
  21832. return false;
  21833. }
  21834. if (scrollTime < Date.now()) {
  21835. this._scrollTime = 0;
  21836. return false;
  21837. }
  21838. return true;
  21839. };
  21840. /**
  21841. * @return {NavController} Returns the first Active Nav Controller from the list. This method is deprecated
  21842. */
  21843. App.prototype.getActiveNav = function () {
  21844. console.warn('(getActiveNav) is deprecated and will be removed in the next major release. Use getActiveNavs instead.');
  21845. var navs = this.getActiveNavs();
  21846. if (navs && navs.length) {
  21847. return navs[0];
  21848. }
  21849. return null;
  21850. };
  21851. /**
  21852. * @return {NavController[]} Returns the active NavControllers. Using this method is preferred when we need access to the top-level navigation controller while on the outside views and handlers like `registerBackButtonAction()`
  21853. */
  21854. App.prototype.getActiveNavs = function (rootNavId) {
  21855. var portal = this._appRoot._getPortal(__WEBPACK_IMPORTED_MODULE_2__app_constants__["c" /* PORTAL_MODAL */]);
  21856. if (portal.length() > 0) {
  21857. return findTopNavs(portal);
  21858. }
  21859. if (!this._rootNavs || !this._rootNavs.size) {
  21860. return [];
  21861. }
  21862. if (this._rootNavs.size === 1) {
  21863. return findTopNavs(this._rootNavs.values().next().value);
  21864. }
  21865. if (rootNavId) {
  21866. return findTopNavs(this._rootNavs.get(rootNavId));
  21867. }
  21868. // fallback to just using all root names
  21869. var activeNavs = [];
  21870. this._rootNavs.forEach(function (nav) {
  21871. var topNavs = findTopNavs(nav);
  21872. activeNavs = activeNavs.concat(topNavs);
  21873. });
  21874. return activeNavs;
  21875. };
  21876. App.prototype.getRootNav = function () {
  21877. console.warn('(getRootNav) is deprecated and will be removed in the next major release. Use getRootNavById instead.');
  21878. var rootNavs = this.getRootNavs();
  21879. if (rootNavs.length === 0) {
  21880. return null;
  21881. }
  21882. else if (rootNavs.length > 1) {
  21883. console.warn('(getRootNav) there are multiple root navs, use getRootNavs instead');
  21884. }
  21885. return rootNavs[0];
  21886. };
  21887. App.prototype.getRootNavs = function () {
  21888. var navs = [];
  21889. this._rootNavs.forEach(function (nav) { return navs.push(nav); });
  21890. return navs;
  21891. };
  21892. /**
  21893. * @return {NavController} Returns the root NavController
  21894. */
  21895. App.prototype.getRootNavById = function (navId) {
  21896. return this._rootNavs.get(navId);
  21897. };
  21898. /**
  21899. * @hidden
  21900. */
  21901. App.prototype.registerRootNav = function (nav) {
  21902. this._rootNavs.set(nav.id, nav);
  21903. };
  21904. /**
  21905. * @hidden
  21906. */
  21907. App.prototype.unregisterRootNav = function (nav) {
  21908. this._rootNavs.delete(nav.id);
  21909. };
  21910. App.prototype.getActiveNavContainers = function () {
  21911. // for each root nav container, get it's active nav
  21912. var list = [];
  21913. this._rootNavs.forEach(function (container) {
  21914. list = list.concat(findTopNavs(container));
  21915. });
  21916. return list;
  21917. };
  21918. /**
  21919. * @hidden
  21920. */
  21921. App.prototype.present = function (enteringView, opts, appPortal) {
  21922. (void 0) /* assert */;
  21923. var portal = this._appRoot._getPortal(appPortal);
  21924. // Set Nav must be set here in order to dimiss() work synchnously.
  21925. // TODO: move _setNav() to the earlier stages of NavController. _queueTrns()
  21926. enteringView._setNav(portal);
  21927. opts.direction = __WEBPACK_IMPORTED_MODULE_4__navigation_nav_util__["b" /* DIRECTION_FORWARD */];
  21928. if (!opts.animation) {
  21929. opts.animation = enteringView.getTransitionName(__WEBPACK_IMPORTED_MODULE_4__navigation_nav_util__["b" /* DIRECTION_FORWARD */]);
  21930. }
  21931. enteringView.setLeavingOpts({
  21932. keyboardClose: opts.keyboardClose,
  21933. direction: __WEBPACK_IMPORTED_MODULE_4__navigation_nav_util__["a" /* DIRECTION_BACK */],
  21934. animation: enteringView.getTransitionName(__WEBPACK_IMPORTED_MODULE_4__navigation_nav_util__["a" /* DIRECTION_BACK */]),
  21935. ev: opts.ev
  21936. });
  21937. return portal.insertPages(-1, [enteringView], opts);
  21938. };
  21939. /**
  21940. * @hidden
  21941. */
  21942. App.prototype.goBack = function () {
  21943. if (this._menuCtrl && this._menuCtrl.isOpen()) {
  21944. return this._menuCtrl.close();
  21945. }
  21946. var navPromise = this.navPop();
  21947. if (!navPromise) {
  21948. // no views to go back to
  21949. // let's exit the app
  21950. if (this._config.getBoolean('navExitApp', true)) {
  21951. (void 0) /* console.debug */;
  21952. this._plt.exitApp();
  21953. }
  21954. }
  21955. return navPromise;
  21956. };
  21957. /**
  21958. * @hidden
  21959. */
  21960. App.prototype.navPop = function () {
  21961. var _this = this;
  21962. if (!this._rootNavs || this._rootNavs.size === 0 || !this.isEnabled()) {
  21963. return Promise.resolve();
  21964. }
  21965. // If there are any alert/actionsheet open, let's do nothing
  21966. var portal = this._appRoot._getPortal(__WEBPACK_IMPORTED_MODULE_2__app_constants__["a" /* PORTAL_DEFAULT */]);
  21967. if (portal.length() > 0) {
  21968. return Promise.resolve();
  21969. }
  21970. var navToPop = null;
  21971. var mostRecentVC = null;
  21972. this._rootNavs.forEach(function (navContainer) {
  21973. var activeNavs = _this.getActiveNavs(navContainer.id);
  21974. var poppableNavs = activeNavs.map(function (activeNav) { return getPoppableNav(activeNav); }).filter(function (nav) { return !!nav; });
  21975. poppableNavs.forEach(function (poppable) {
  21976. var topViewController = poppable.last();
  21977. if (poppable._isPortal || (topViewController && poppable.length() > 1 && (!mostRecentVC || topViewController._ts >= mostRecentVC._ts))) {
  21978. mostRecentVC = topViewController;
  21979. navToPop = poppable;
  21980. }
  21981. });
  21982. });
  21983. if (navToPop) {
  21984. return navToPop.pop();
  21985. }
  21986. };
  21987. /**
  21988. * @hidden
  21989. */
  21990. App.prototype._enableInputBlurring = function () {
  21991. (void 0) /* console.debug */;
  21992. var focused = true;
  21993. var self = this;
  21994. var platform = this._plt;
  21995. platform.registerListener(platform.doc(), 'focusin', onFocusin, { capture: true, zone: false, passive: true });
  21996. platform.registerListener(platform.doc(), 'touchend', onTouchend, { capture: false, zone: false, passive: true });
  21997. function onFocusin() {
  21998. focused = true;
  21999. }
  22000. function onTouchend(ev) {
  22001. // if app did scroll return early
  22002. if (self._didScroll) {
  22003. self._didScroll = false;
  22004. return;
  22005. }
  22006. var active = self._plt.getActiveElement();
  22007. if (!active) {
  22008. return;
  22009. }
  22010. // only blur if the active element is a text-input or a textarea
  22011. if (SKIP_BLURRING.indexOf(active.tagName) === -1) {
  22012. return;
  22013. }
  22014. // if the selected target is the active element, do not blur
  22015. var tapped = ev.target;
  22016. if (tapped === active) {
  22017. return;
  22018. }
  22019. if (SKIP_BLURRING.indexOf(tapped.tagName) >= 0) {
  22020. return;
  22021. }
  22022. // skip if div is a cover
  22023. if (tapped.classList.contains('input-cover')) {
  22024. return;
  22025. }
  22026. focused = false;
  22027. // TODO: find a better way, why 50ms?
  22028. platform.timeout(function () {
  22029. if (!focused) {
  22030. active.blur();
  22031. }
  22032. }, 50);
  22033. }
  22034. };
  22035. App.prototype.getNavByIdOrName = function (id) {
  22036. var navs = Array.from(this._rootNavs.values());
  22037. for (var _i = 0, navs_1 = navs; _i < navs_1.length; _i++) {
  22038. var navContainer = navs_1[_i];
  22039. var match = getNavByIdOrName(navContainer, id);
  22040. if (match) {
  22041. return match;
  22042. }
  22043. }
  22044. return null;
  22045. };
  22046. App.decorators = [
  22047. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */] },
  22048. ];
  22049. /** @nocollapse */
  22050. App.ctorParameters = function () { return [
  22051. { type: __WEBPACK_IMPORTED_MODULE_3__config_config__["a" /* Config */], },
  22052. { type: __WEBPACK_IMPORTED_MODULE_6__platform_platform__["a" /* Platform */], },
  22053. { type: __WEBPACK_IMPORTED_MODULE_5__menu_controller__["a" /* MenuController */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  22054. ]; };
  22055. return App;
  22056. }());
  22057. function getNavByIdOrName(nav, id) {
  22058. if (nav.id === id || nav.name === id) {
  22059. return nav;
  22060. }
  22061. for (var _i = 0, _a = nav.getAllChildNavs(); _i < _a.length; _i++) {
  22062. var child = _a[_i];
  22063. var tmp = getNavByIdOrName(child, id);
  22064. if (tmp) {
  22065. return tmp;
  22066. }
  22067. }
  22068. return null;
  22069. }
  22070. function getPoppableNav(nav) {
  22071. if (!nav) {
  22072. return null;
  22073. }
  22074. if (Object(__WEBPACK_IMPORTED_MODULE_4__navigation_nav_util__["m" /* isTabs */])(nav)) {
  22075. // tabs aren't a nav, so just call this function again immediately on the parent on tabs
  22076. return getPoppableNav(nav.parent);
  22077. }
  22078. var len = nav.length();
  22079. if (len > 1 || (nav._isPortal && len > 0)) {
  22080. // this nav controller has more than one view
  22081. // use this nav!
  22082. return nav;
  22083. }
  22084. // try again using the parent nav (if there is one)
  22085. return getPoppableNav(nav.parent);
  22086. }
  22087. function findTopNavs(nav) {
  22088. var containers = [];
  22089. var childNavs = nav.getActiveChildNavs();
  22090. if (!childNavs || !childNavs.length) {
  22091. containers.push(nav);
  22092. }
  22093. else {
  22094. childNavs.forEach(function (childNav) {
  22095. var topNavs = findTopNavs(childNav);
  22096. containers = containers.concat(topNavs);
  22097. });
  22098. }
  22099. return containers;
  22100. }
  22101. var SKIP_BLURRING = ['INPUT', 'TEXTAREA', 'ION-INPUT', 'ION-TEXTAREA'];
  22102. var ACTIVE_SCROLLING_TIME = 100;
  22103. var CLICK_BLOCK_BUFFER_IN_MILLIS = 64;
  22104. //# sourceMappingURL=app.js.map
  22105. /***/ }),
  22106. /* 7 */
  22107. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22108. "use strict";
  22109. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return GESTURE_GO_BACK_SWIPE; });
  22110. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return GESTURE_MENU_SWIPE; });
  22111. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return GESTURE_ITEM_SWIPE; });
  22112. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return GESTURE_REFRESHER; });
  22113. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return GESTURE_TOGGLE; });
  22114. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return GESTURE_PRIORITY_SLIDING_ITEM; });
  22115. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return GESTURE_PRIORITY_REFRESHER; });
  22116. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return GESTURE_PRIORITY_MENU_SWIPE; });
  22117. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return GESTURE_PRIORITY_GO_BACK_SWIPE; });
  22118. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return GESTURE_PRIORITY_TOGGLE; });
  22119. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return BLOCK_ALL; });
  22120. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return GestureController; });
  22121. /* unused harmony export GestureDelegate */
  22122. /* unused harmony export BlockerDelegate */
  22123. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  22124. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__components_app_app__ = __webpack_require__(6);
  22125. /** @hidden */
  22126. var GESTURE_GO_BACK_SWIPE = 'goback-swipe';
  22127. /** @hidden */
  22128. var GESTURE_MENU_SWIPE = 'menu-swipe';
  22129. /** @hidden */
  22130. var GESTURE_ITEM_SWIPE = 'item-swipe';
  22131. /** @hidden */
  22132. var GESTURE_REFRESHER = 'refresher';
  22133. /** @hidden */
  22134. var GESTURE_TOGGLE = 'toggle';
  22135. /** @hidden */
  22136. var GESTURE_PRIORITY_SLIDING_ITEM = -10;
  22137. /** @hidden */
  22138. var GESTURE_PRIORITY_REFRESHER = 0;
  22139. /** @hidden */
  22140. var GESTURE_PRIORITY_MENU_SWIPE = 10;
  22141. /** @hidden */
  22142. var GESTURE_PRIORITY_GO_BACK_SWIPE = 20;
  22143. /** @hidden */
  22144. var GESTURE_PRIORITY_TOGGLE = 30;
  22145. /**
  22146. * @hidden
  22147. */
  22148. var BLOCK_ALL = {
  22149. disable: [GESTURE_MENU_SWIPE, GESTURE_GO_BACK_SWIPE],
  22150. disableScroll: true
  22151. };
  22152. /**
  22153. * @hidden
  22154. */
  22155. var GestureController = (function () {
  22156. function GestureController(_app) {
  22157. this._app = _app;
  22158. this.id = 1;
  22159. this.requestedStart = {};
  22160. this.disabledGestures = {};
  22161. this.disabledScroll = new Set();
  22162. this.capturedID = null;
  22163. }
  22164. GestureController.prototype.createGesture = function (opts) {
  22165. if (!opts.name) {
  22166. throw new Error('name is undefined');
  22167. }
  22168. return new GestureDelegate(opts.name, this.newID(), this, opts.priority || 0, !!opts.disableScroll);
  22169. };
  22170. GestureController.prototype.createBlocker = function (opts) {
  22171. if (opts === void 0) { opts = {}; }
  22172. return new BlockerDelegate(this.newID(), this, opts.disable, !!opts.disableScroll);
  22173. };
  22174. GestureController.prototype.newID = function () {
  22175. var id = this.id;
  22176. this.id++;
  22177. return id;
  22178. };
  22179. GestureController.prototype.start = function (gestureName, id, priority) {
  22180. if (!this.canStart(gestureName)) {
  22181. delete this.requestedStart[id];
  22182. return false;
  22183. }
  22184. this.requestedStart[id] = priority;
  22185. return true;
  22186. };
  22187. GestureController.prototype.capture = function (gestureName, id, priority) {
  22188. if (!this.start(gestureName, id, priority)) {
  22189. return false;
  22190. }
  22191. var requestedStart = this.requestedStart;
  22192. var maxPriority = -10000;
  22193. for (var gestureID in requestedStart) {
  22194. maxPriority = Math.max(maxPriority, requestedStart[gestureID]);
  22195. }
  22196. if (maxPriority === priority) {
  22197. this.capturedID = id;
  22198. this.requestedStart = {};
  22199. (void 0) /* console.debug */;
  22200. return true;
  22201. }
  22202. delete requestedStart[id];
  22203. (void 0) /* console.debug */;
  22204. return false;
  22205. };
  22206. GestureController.prototype.release = function (id) {
  22207. delete this.requestedStart[id];
  22208. if (this.capturedID && id === this.capturedID) {
  22209. this.capturedID = null;
  22210. }
  22211. };
  22212. GestureController.prototype.disableGesture = function (gestureName, id) {
  22213. var set = this.disabledGestures[gestureName];
  22214. if (!set) {
  22215. set = new Set();
  22216. this.disabledGestures[gestureName] = set;
  22217. }
  22218. set.add(id);
  22219. };
  22220. GestureController.prototype.enableGesture = function (gestureName, id) {
  22221. var set = this.disabledGestures[gestureName];
  22222. if (set) {
  22223. set.delete(id);
  22224. }
  22225. };
  22226. GestureController.prototype.disableScroll = function (id) {
  22227. var isEnabled = !this.isScrollDisabled();
  22228. this.disabledScroll.add(id);
  22229. if (this._app && isEnabled && this.isScrollDisabled()) {
  22230. (void 0) /* console.debug */;
  22231. this._app._setDisableScroll(true);
  22232. }
  22233. };
  22234. GestureController.prototype.enableScroll = function (id) {
  22235. var isDisabled = this.isScrollDisabled();
  22236. this.disabledScroll.delete(id);
  22237. if (this._app && isDisabled && !this.isScrollDisabled()) {
  22238. (void 0) /* console.debug */;
  22239. this._app._setDisableScroll(false);
  22240. }
  22241. };
  22242. GestureController.prototype.canStart = function (gestureName) {
  22243. if (this.capturedID) {
  22244. (void 0) /* console.debug */;
  22245. // a gesture already captured
  22246. return false;
  22247. }
  22248. if (this.isDisabled(gestureName)) {
  22249. (void 0) /* console.debug */;
  22250. return false;
  22251. }
  22252. return true;
  22253. };
  22254. GestureController.prototype.isCaptured = function () {
  22255. return !!this.capturedID;
  22256. };
  22257. GestureController.prototype.isScrollDisabled = function () {
  22258. return this.disabledScroll.size > 0;
  22259. };
  22260. GestureController.prototype.isDisabled = function (gestureName) {
  22261. var disabled = this.disabledGestures[gestureName];
  22262. return !!(disabled && disabled.size > 0);
  22263. };
  22264. GestureController.decorators = [
  22265. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */] },
  22266. ];
  22267. /** @nocollapse */
  22268. GestureController.ctorParameters = function () { return [
  22269. { type: __WEBPACK_IMPORTED_MODULE_1__components_app_app__["a" /* App */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["z" /* Inject */], args: [Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_14" /* forwardRef */])(function () { return __WEBPACK_IMPORTED_MODULE_1__components_app_app__["a" /* App */]; }),] },] },
  22270. ]; };
  22271. return GestureController;
  22272. }());
  22273. /**
  22274. * @hidden
  22275. */
  22276. var GestureDelegate = (function () {
  22277. function GestureDelegate(name, id, controller, priority, disableScroll) {
  22278. this.name = name;
  22279. this.id = id;
  22280. this.controller = controller;
  22281. this.priority = priority;
  22282. this.disableScroll = disableScroll;
  22283. }
  22284. GestureDelegate.prototype.canStart = function () {
  22285. if (!this.controller) {
  22286. (void 0) /* assert */;
  22287. return false;
  22288. }
  22289. return this.controller.canStart(this.name);
  22290. };
  22291. GestureDelegate.prototype.start = function () {
  22292. if (!this.controller) {
  22293. (void 0) /* assert */;
  22294. return false;
  22295. }
  22296. return this.controller.start(this.name, this.id, this.priority);
  22297. };
  22298. GestureDelegate.prototype.capture = function () {
  22299. if (!this.controller) {
  22300. (void 0) /* assert */;
  22301. return false;
  22302. }
  22303. var captured = this.controller.capture(this.name, this.id, this.priority);
  22304. if (captured && this.disableScroll) {
  22305. this.controller.disableScroll(this.id);
  22306. }
  22307. return captured;
  22308. };
  22309. GestureDelegate.prototype.release = function () {
  22310. if (!this.controller) {
  22311. (void 0) /* assert */;
  22312. return;
  22313. }
  22314. this.controller.release(this.id);
  22315. if (this.disableScroll) {
  22316. this.controller.enableScroll(this.id);
  22317. }
  22318. };
  22319. GestureDelegate.prototype.destroy = function () {
  22320. this.release();
  22321. this.controller = null;
  22322. };
  22323. return GestureDelegate;
  22324. }());
  22325. /**
  22326. * @hidden
  22327. */
  22328. var BlockerDelegate = (function () {
  22329. function BlockerDelegate(id, controller, disable, disableScroll) {
  22330. this.id = id;
  22331. this.controller = controller;
  22332. this.disable = disable;
  22333. this.disableScroll = disableScroll;
  22334. this.blocked = false;
  22335. }
  22336. BlockerDelegate.prototype.block = function () {
  22337. var _this = this;
  22338. if (!this.controller) {
  22339. (void 0) /* assert */;
  22340. return;
  22341. }
  22342. if (this.disable) {
  22343. this.disable.forEach(function (gesture) {
  22344. _this.controller.disableGesture(gesture, _this.id);
  22345. });
  22346. }
  22347. if (this.disableScroll) {
  22348. this.controller.disableScroll(this.id);
  22349. }
  22350. this.blocked = true;
  22351. };
  22352. BlockerDelegate.prototype.unblock = function () {
  22353. var _this = this;
  22354. if (!this.controller) {
  22355. (void 0) /* assert */;
  22356. return;
  22357. }
  22358. if (this.disable) {
  22359. this.disable.forEach(function (gesture) {
  22360. _this.controller.enableGesture(gesture, _this.id);
  22361. });
  22362. }
  22363. if (this.disableScroll) {
  22364. this.controller.enableScroll(this.id);
  22365. }
  22366. this.blocked = false;
  22367. };
  22368. BlockerDelegate.prototype.destroy = function () {
  22369. this.unblock();
  22370. this.controller = null;
  22371. };
  22372. return BlockerDelegate;
  22373. }());
  22374. //# sourceMappingURL=gesture-controller.js.map
  22375. /***/ }),
  22376. /* 8 */
  22377. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22378. "use strict";
  22379. /* unused harmony export DomDebouncer */
  22380. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DomController; });
  22381. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  22382. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__platform__ = __webpack_require__(3);
  22383. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_util__ = __webpack_require__(2);
  22384. /**
  22385. * Adopted from FastDom
  22386. * https://github.com/wilsonpage/fastdom
  22387. * MIT License
  22388. */
  22389. /**
  22390. * @hidden
  22391. */
  22392. var DomDebouncer = (function () {
  22393. function DomDebouncer(dom) {
  22394. this.dom = dom;
  22395. this.writeTask = null;
  22396. this.readTask = null;
  22397. }
  22398. DomDebouncer.prototype.read = function (fn) {
  22399. var _this = this;
  22400. if (this.readTask) {
  22401. return;
  22402. }
  22403. return this.readTask = this.dom.read(function (t) {
  22404. _this.readTask = null;
  22405. fn(t);
  22406. });
  22407. };
  22408. DomDebouncer.prototype.write = function (fn) {
  22409. var _this = this;
  22410. if (this.writeTask) {
  22411. return;
  22412. }
  22413. return this.writeTask = this.dom.write(function (t) {
  22414. _this.writeTask = null;
  22415. fn(t);
  22416. });
  22417. };
  22418. DomDebouncer.prototype.cancel = function () {
  22419. var writeTask = this.writeTask;
  22420. writeTask && this.dom.cancel(writeTask);
  22421. var readTask = this.readTask;
  22422. readTask && this.dom.cancel(readTask);
  22423. this.readTask = this.writeTask = null;
  22424. };
  22425. return DomDebouncer;
  22426. }());
  22427. /**
  22428. * @hidden
  22429. */
  22430. var DomController = (function () {
  22431. function DomController(plt) {
  22432. this.plt = plt;
  22433. this.r = [];
  22434. this.w = [];
  22435. }
  22436. DomController.prototype.debouncer = function () {
  22437. return new DomDebouncer(this);
  22438. };
  22439. DomController.prototype.read = function (fn, timeout) {
  22440. var _this = this;
  22441. if (timeout) {
  22442. fn.timeoutId = this.plt.timeout(function () {
  22443. _this.r.push(fn);
  22444. _this._queue();
  22445. }, timeout);
  22446. }
  22447. else {
  22448. this.r.push(fn);
  22449. this._queue();
  22450. }
  22451. return fn;
  22452. };
  22453. DomController.prototype.write = function (fn, timeout) {
  22454. var _this = this;
  22455. if (timeout) {
  22456. fn.timeoutId = this.plt.timeout(function () {
  22457. _this.w.push(fn);
  22458. _this._queue();
  22459. }, timeout);
  22460. }
  22461. else {
  22462. this.w.push(fn);
  22463. this._queue();
  22464. }
  22465. return fn;
  22466. };
  22467. DomController.prototype.cancel = function (fn) {
  22468. if (fn) {
  22469. if (fn.timeoutId) {
  22470. this.plt.cancelTimeout(fn.timeoutId);
  22471. }
  22472. Object(__WEBPACK_IMPORTED_MODULE_2__util_util__["q" /* removeArrayItem */])(this.r, fn) || Object(__WEBPACK_IMPORTED_MODULE_2__util_util__["q" /* removeArrayItem */])(this.w, fn);
  22473. }
  22474. };
  22475. DomController.prototype._queue = function () {
  22476. var self = this;
  22477. if (!self.q) {
  22478. self.q = true;
  22479. self.plt.raf(function rafCallback(timeStamp) {
  22480. self._flush(timeStamp);
  22481. });
  22482. }
  22483. };
  22484. DomController.prototype._flush = function (timeStamp) {
  22485. var err;
  22486. try {
  22487. dispatch(timeStamp, this.r, this.w);
  22488. }
  22489. catch (e) {
  22490. err = e;
  22491. }
  22492. this.q = false;
  22493. if (this.r.length || this.w.length) {
  22494. this._queue();
  22495. }
  22496. if (err) {
  22497. throw err;
  22498. }
  22499. };
  22500. DomController.decorators = [
  22501. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */] },
  22502. ];
  22503. /** @nocollapse */
  22504. DomController.ctorParameters = function () { return [
  22505. { type: __WEBPACK_IMPORTED_MODULE_1__platform__["a" /* Platform */], },
  22506. ]; };
  22507. return DomController;
  22508. }());
  22509. function dispatch(timeStamp, r, w) {
  22510. var fn;
  22511. // ******** DOM READS ****************
  22512. while (fn = r.shift()) {
  22513. fn(timeStamp);
  22514. }
  22515. // ******** DOM WRITES ****************
  22516. while (fn = w.shift()) {
  22517. fn(timeStamp);
  22518. }
  22519. }
  22520. //# sourceMappingURL=dom-controller.js.map
  22521. /***/ }),
  22522. /* 9 */
  22523. /***/ (function(module, exports, __webpack_require__) {
  22524. "use strict";
  22525. var root_1 = __webpack_require__(29);
  22526. var toSubscriber_1 = __webpack_require__(206);
  22527. var observable_1 = __webpack_require__(108);
  22528. var pipe_1 = __webpack_require__(208);
  22529. /**
  22530. * A representation of any set of values over any amount of time. This is the most basic building block
  22531. * of RxJS.
  22532. *
  22533. * @class Observable<T>
  22534. */
  22535. var Observable = (function () {
  22536. /**
  22537. * @constructor
  22538. * @param {Function} subscribe the function that is called when the Observable is
  22539. * initially subscribed to. This function is given a Subscriber, to which new values
  22540. * can be `next`ed, or an `error` method can be called to raise an error, or
  22541. * `complete` can be called to notify of a successful completion.
  22542. */
  22543. function Observable(subscribe) {
  22544. this._isScalar = false;
  22545. if (subscribe) {
  22546. this._subscribe = subscribe;
  22547. }
  22548. }
  22549. /**
  22550. * Creates a new Observable, with this Observable as the source, and the passed
  22551. * operator defined as the new observable's operator.
  22552. * @method lift
  22553. * @param {Operator} operator the operator defining the operation to take on the observable
  22554. * @return {Observable} a new observable with the Operator applied
  22555. */
  22556. Observable.prototype.lift = function (operator) {
  22557. var observable = new Observable();
  22558. observable.source = this;
  22559. observable.operator = operator;
  22560. return observable;
  22561. };
  22562. /**
  22563. * Invokes an execution of an Observable and registers Observer handlers for notifications it will emit.
  22564. *
  22565. * <span class="informal">Use it when you have all these Observables, but still nothing is happening.</span>
  22566. *
  22567. * `subscribe` is not a regular operator, but a method that calls Observable's internal `subscribe` function. It
  22568. * might be for example a function that you passed to a {@link create} static factory, but most of the time it is
  22569. * a library implementation, which defines what and when will be emitted by an Observable. This means that calling
  22570. * `subscribe` is actually the moment when Observable starts its work, not when it is created, as it is often
  22571. * thought.
  22572. *
  22573. * Apart from starting the execution of an Observable, this method allows you to listen for values
  22574. * that an Observable emits, as well as for when it completes or errors. You can achieve this in two
  22575. * following ways.
  22576. *
  22577. * The first way is creating an object that implements {@link Observer} interface. It should have methods
  22578. * defined by that interface, but note that it should be just a regular JavaScript object, which you can create
  22579. * yourself in any way you want (ES6 class, classic function constructor, object literal etc.). In particular do
  22580. * not attempt to use any RxJS implementation details to create Observers - you don't need them. Remember also
  22581. * that your object does not have to implement all methods. If you find yourself creating a method that doesn't
  22582. * do anything, you can simply omit it. Note however, that if `error` method is not provided, all errors will
  22583. * be left uncaught.
  22584. *
  22585. * The second way is to give up on Observer object altogether and simply provide callback functions in place of its methods.
  22586. * This means you can provide three functions as arguments to `subscribe`, where first function is equivalent
  22587. * of a `next` method, second of an `error` method and third of a `complete` method. Just as in case of Observer,
  22588. * if you do not need to listen for something, you can omit a function, preferably by passing `undefined` or `null`,
  22589. * since `subscribe` recognizes these functions by where they were placed in function call. When it comes
  22590. * to `error` function, just as before, if not provided, errors emitted by an Observable will be thrown.
  22591. *
  22592. * Whatever style of calling `subscribe` you use, in both cases it returns a Subscription object.
  22593. * This object allows you to call `unsubscribe` on it, which in turn will stop work that an Observable does and will clean
  22594. * up all resources that an Observable used. Note that cancelling a subscription will not call `complete` callback
  22595. * provided to `subscribe` function, which is reserved for a regular completion signal that comes from an Observable.
  22596. *
  22597. * Remember that callbacks provided to `subscribe` are not guaranteed to be called asynchronously.
  22598. * It is an Observable itself that decides when these functions will be called. For example {@link of}
  22599. * by default emits all its values synchronously. Always check documentation for how given Observable
  22600. * will behave when subscribed and if its default behavior can be modified with a {@link Scheduler}.
  22601. *
  22602. * @example <caption>Subscribe with an Observer</caption>
  22603. * const sumObserver = {
  22604. * sum: 0,
  22605. * next(value) {
  22606. * console.log('Adding: ' + value);
  22607. * this.sum = this.sum + value;
  22608. * },
  22609. * error() { // We actually could just remove this method,
  22610. * }, // since we do not really care about errors right now.
  22611. * complete() {
  22612. * console.log('Sum equals: ' + this.sum);
  22613. * }
  22614. * };
  22615. *
  22616. * Rx.Observable.of(1, 2, 3) // Synchronously emits 1, 2, 3 and then completes.
  22617. * .subscribe(sumObserver);
  22618. *
  22619. * // Logs:
  22620. * // "Adding: 1"
  22621. * // "Adding: 2"
  22622. * // "Adding: 3"
  22623. * // "Sum equals: 6"
  22624. *
  22625. *
  22626. * @example <caption>Subscribe with functions</caption>
  22627. * let sum = 0;
  22628. *
  22629. * Rx.Observable.of(1, 2, 3)
  22630. * .subscribe(
  22631. * function(value) {
  22632. * console.log('Adding: ' + value);
  22633. * sum = sum + value;
  22634. * },
  22635. * undefined,
  22636. * function() {
  22637. * console.log('Sum equals: ' + sum);
  22638. * }
  22639. * );
  22640. *
  22641. * // Logs:
  22642. * // "Adding: 1"
  22643. * // "Adding: 2"
  22644. * // "Adding: 3"
  22645. * // "Sum equals: 6"
  22646. *
  22647. *
  22648. * @example <caption>Cancel a subscription</caption>
  22649. * const subscription = Rx.Observable.interval(1000).subscribe(
  22650. * num => console.log(num),
  22651. * undefined,
  22652. * () => console.log('completed!') // Will not be called, even
  22653. * ); // when cancelling subscription
  22654. *
  22655. *
  22656. * setTimeout(() => {
  22657. * subscription.unsubscribe();
  22658. * console.log('unsubscribed!');
  22659. * }, 2500);
  22660. *
  22661. * // Logs:
  22662. * // 0 after 1s
  22663. * // 1 after 2s
  22664. * // "unsubscribed!" after 2.5s
  22665. *
  22666. *
  22667. * @param {Observer|Function} observerOrNext (optional) Either an observer with methods to be called,
  22668. * or the first of three possible handlers, which is the handler for each value emitted from the subscribed
  22669. * Observable.
  22670. * @param {Function} error (optional) A handler for a terminal event resulting from an error. If no error handler is provided,
  22671. * the error will be thrown as unhandled.
  22672. * @param {Function} complete (optional) A handler for a terminal event resulting from successful completion.
  22673. * @return {ISubscription} a subscription reference to the registered handlers
  22674. * @method subscribe
  22675. */
  22676. Observable.prototype.subscribe = function (observerOrNext, error, complete) {
  22677. var operator = this.operator;
  22678. var sink = toSubscriber_1.toSubscriber(observerOrNext, error, complete);
  22679. if (operator) {
  22680. operator.call(sink, this.source);
  22681. }
  22682. else {
  22683. sink.add(this.source || !sink.syncErrorThrowable ? this._subscribe(sink) : this._trySubscribe(sink));
  22684. }
  22685. if (sink.syncErrorThrowable) {
  22686. sink.syncErrorThrowable = false;
  22687. if (sink.syncErrorThrown) {
  22688. throw sink.syncErrorValue;
  22689. }
  22690. }
  22691. return sink;
  22692. };
  22693. Observable.prototype._trySubscribe = function (sink) {
  22694. try {
  22695. return this._subscribe(sink);
  22696. }
  22697. catch (err) {
  22698. sink.syncErrorThrown = true;
  22699. sink.syncErrorValue = err;
  22700. sink.error(err);
  22701. }
  22702. };
  22703. /**
  22704. * @method forEach
  22705. * @param {Function} next a handler for each value emitted by the observable
  22706. * @param {PromiseConstructor} [PromiseCtor] a constructor function used to instantiate the Promise
  22707. * @return {Promise} a promise that either resolves on observable completion or
  22708. * rejects with the handled error
  22709. */
  22710. Observable.prototype.forEach = function (next, PromiseCtor) {
  22711. var _this = this;
  22712. if (!PromiseCtor) {
  22713. if (root_1.root.Rx && root_1.root.Rx.config && root_1.root.Rx.config.Promise) {
  22714. PromiseCtor = root_1.root.Rx.config.Promise;
  22715. }
  22716. else if (root_1.root.Promise) {
  22717. PromiseCtor = root_1.root.Promise;
  22718. }
  22719. }
  22720. if (!PromiseCtor) {
  22721. throw new Error('no Promise impl found');
  22722. }
  22723. return new PromiseCtor(function (resolve, reject) {
  22724. // Must be declared in a separate statement to avoid a RefernceError when
  22725. // accessing subscription below in the closure due to Temporal Dead Zone.
  22726. var subscription;
  22727. subscription = _this.subscribe(function (value) {
  22728. if (subscription) {
  22729. // if there is a subscription, then we can surmise
  22730. // the next handling is asynchronous. Any errors thrown
  22731. // need to be rejected explicitly and unsubscribe must be
  22732. // called manually
  22733. try {
  22734. next(value);
  22735. }
  22736. catch (err) {
  22737. reject(err);
  22738. subscription.unsubscribe();
  22739. }
  22740. }
  22741. else {
  22742. // if there is NO subscription, then we're getting a nexted
  22743. // value synchronously during subscription. We can just call it.
  22744. // If it errors, Observable's `subscribe` will ensure the
  22745. // unsubscription logic is called, then synchronously rethrow the error.
  22746. // After that, Promise will trap the error and send it
  22747. // down the rejection path.
  22748. next(value);
  22749. }
  22750. }, reject, resolve);
  22751. });
  22752. };
  22753. /** @deprecated internal use only */ Observable.prototype._subscribe = function (subscriber) {
  22754. return this.source.subscribe(subscriber);
  22755. };
  22756. /**
  22757. * An interop point defined by the es7-observable spec https://github.com/zenparsing/es-observable
  22758. * @method Symbol.observable
  22759. * @return {Observable} this instance of the observable
  22760. */
  22761. Observable.prototype[observable_1.observable] = function () {
  22762. return this;
  22763. };
  22764. /* tslint:enable:max-line-length */
  22765. /**
  22766. * Used to stitch together functional operators into a chain.
  22767. * @method pipe
  22768. * @return {Observable} the Observable result of all of the operators having
  22769. * been called in the order they were passed in.
  22770. *
  22771. * @example
  22772. *
  22773. * import { map, filter, scan } from 'rxjs/operators';
  22774. *
  22775. * Rx.Observable.interval(1000)
  22776. * .pipe(
  22777. * filter(x => x % 2 === 0),
  22778. * map(x => x + x),
  22779. * scan((acc, x) => acc + x)
  22780. * )
  22781. * .subscribe(x => console.log(x))
  22782. */
  22783. Observable.prototype.pipe = function () {
  22784. var operations = [];
  22785. for (var _i = 0; _i < arguments.length; _i++) {
  22786. operations[_i - 0] = arguments[_i];
  22787. }
  22788. if (operations.length === 0) {
  22789. return this;
  22790. }
  22791. return pipe_1.pipeFromArray(operations)(this);
  22792. };
  22793. /* tslint:enable:max-line-length */
  22794. Observable.prototype.toPromise = function (PromiseCtor) {
  22795. var _this = this;
  22796. if (!PromiseCtor) {
  22797. if (root_1.root.Rx && root_1.root.Rx.config && root_1.root.Rx.config.Promise) {
  22798. PromiseCtor = root_1.root.Rx.config.Promise;
  22799. }
  22800. else if (root_1.root.Promise) {
  22801. PromiseCtor = root_1.root.Promise;
  22802. }
  22803. }
  22804. if (!PromiseCtor) {
  22805. throw new Error('no Promise impl found');
  22806. }
  22807. return new PromiseCtor(function (resolve, reject) {
  22808. var value;
  22809. _this.subscribe(function (x) { return value = x; }, function (err) { return reject(err); }, function () { return resolve(value); });
  22810. });
  22811. };
  22812. // HACK: Since TypeScript inherits static properties too, we have to
  22813. // fight against TypeScript here so Subject can have a different static create signature
  22814. /**
  22815. * Creates a new cold Observable by calling the Observable constructor
  22816. * @static true
  22817. * @owner Observable
  22818. * @method create
  22819. * @param {Function} subscribe? the subscriber function to be passed to the Observable constructor
  22820. * @return {Observable} a new cold observable
  22821. */
  22822. Observable.create = function (subscribe) {
  22823. return new Observable(subscribe);
  22824. };
  22825. return Observable;
  22826. }());
  22827. exports.Observable = Observable;
  22828. //# sourceMappingURL=Observable.js.map
  22829. /***/ }),
  22830. /* 10 */
  22831. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22832. "use strict";
  22833. /* harmony export (immutable) */ __webpack_exports__["c"] = getCss;
  22834. /* harmony export (immutable) */ __webpack_exports__["f"] = pointerCoord;
  22835. /* harmony export (immutable) */ __webpack_exports__["d"] = hasPointerMoved;
  22836. /* harmony export (immutable) */ __webpack_exports__["e"] = isTextInput;
  22837. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return NON_TEXT_INPUT_REGEX; });
  22838. /* harmony export (immutable) */ __webpack_exports__["b"] = copyInputAttributes;
  22839. function getCss(docEle) {
  22840. var css = {};
  22841. // transform
  22842. var i;
  22843. var keys = ['webkitTransform', '-webkit-transform', 'webkit-transform', 'transform'];
  22844. for (i = 0; i < keys.length; i++) {
  22845. if (docEle.style[keys[i]] !== undefined) {
  22846. css.transform = keys[i];
  22847. break;
  22848. }
  22849. }
  22850. // transition
  22851. keys = ['webkitTransition', 'transition'];
  22852. for (i = 0; i < keys.length; i++) {
  22853. if (docEle.style[keys[i]] !== undefined) {
  22854. css.transition = keys[i];
  22855. break;
  22856. }
  22857. }
  22858. // The only prefix we care about is webkit for transitions.
  22859. var isWebkit = css.transition.indexOf('webkit') > -1;
  22860. // transition duration
  22861. css.transitionDuration = (isWebkit ? '-webkit-' : '') + 'transition-duration';
  22862. // transition timing function
  22863. css.transitionTimingFn = (isWebkit ? '-webkit-' : '') + 'transition-timing-function';
  22864. // transition delay
  22865. css.transitionDelay = (isWebkit ? '-webkit-' : '') + 'transition-delay';
  22866. // To be sure transitionend works everywhere, include *both* the webkit and non-webkit events
  22867. css.transitionEnd = (isWebkit ? 'webkitTransitionEnd ' : '') + 'transitionend';
  22868. // transform origin
  22869. css.transformOrigin = (isWebkit ? '-webkit-' : '') + 'transform-origin';
  22870. // animation delay
  22871. css.animationDelay = (isWebkit ? 'webkitAnimationDelay' : 'animationDelay');
  22872. return css;
  22873. }
  22874. function pointerCoord(ev) {
  22875. // get coordinates for either a mouse click
  22876. // or a touch depending on the given event
  22877. if (ev) {
  22878. var changedTouches = ev.changedTouches;
  22879. if (changedTouches && changedTouches.length > 0) {
  22880. var touch = changedTouches[0];
  22881. return { x: touch.clientX, y: touch.clientY };
  22882. }
  22883. var pageX = ev.pageX;
  22884. if (pageX !== undefined) {
  22885. return { x: pageX, y: ev.pageY };
  22886. }
  22887. }
  22888. return { x: 0, y: 0 };
  22889. }
  22890. function hasPointerMoved(threshold, startCoord, endCoord) {
  22891. if (startCoord && endCoord) {
  22892. var deltaX = (startCoord.x - endCoord.x);
  22893. var deltaY = (startCoord.y - endCoord.y);
  22894. var distance = deltaX * deltaX + deltaY * deltaY;
  22895. return distance > (threshold * threshold);
  22896. }
  22897. return false;
  22898. }
  22899. function isTextInput(ele) {
  22900. return !!ele &&
  22901. (ele.tagName === 'TEXTAREA' ||
  22902. ele.contentEditable === 'true' ||
  22903. (ele.tagName === 'INPUT' && !(NON_TEXT_INPUT_REGEX.test(ele.type))));
  22904. }
  22905. var NON_TEXT_INPUT_REGEX = /^(radio|checkbox|range|file|submit|reset|color|image|button)$/i;
  22906. var SKIP_INPUT_ATTR = ['value', 'checked', 'disabled', 'readonly', 'placeholder', 'type', 'class', 'style', 'id', 'autofocus', 'autocomplete', 'autocorrect'];
  22907. function copyInputAttributes(srcElement, destElement) {
  22908. // copy attributes from one element to another
  22909. // however, skip over a few of them as they're already
  22910. // handled in the angular world
  22911. var attrs = srcElement.attributes;
  22912. for (var i = 0; i < attrs.length; i++) {
  22913. var attr = attrs[i];
  22914. if (SKIP_INPUT_ATTR.indexOf(attr.name) === -1) {
  22915. destElement.setAttribute(attr.name, attr.value);
  22916. }
  22917. }
  22918. }
  22919. //# sourceMappingURL=dom.js.map
  22920. /***/ }),
  22921. /* 11 */
  22922. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22923. "use strict";
  22924. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Animation; });
  22925. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_util__ = __webpack_require__(2);
  22926. /**
  22927. * @hidden
  22928. */
  22929. var Animation = (function () {
  22930. function Animation(plt, ele, opts) {
  22931. this._dur = null;
  22932. this._es = null;
  22933. this._rvEs = null;
  22934. this.hasChildren = false;
  22935. this.isPlaying = false;
  22936. this.hasCompleted = false;
  22937. this.plt = plt;
  22938. this.element(ele);
  22939. this.opts = opts;
  22940. }
  22941. Animation.prototype.element = function (ele) {
  22942. if (ele) {
  22943. if (typeof ele === 'string') {
  22944. ele = this.plt.doc().querySelectorAll(ele);
  22945. for (var i = 0; i < ele.length; i++) {
  22946. this._addEle(ele[i]);
  22947. }
  22948. }
  22949. else if (ele.length) {
  22950. for (var i = 0; i < ele.length; i++) {
  22951. this._addEle(ele[i]);
  22952. }
  22953. }
  22954. else {
  22955. this._addEle(ele);
  22956. }
  22957. }
  22958. return this;
  22959. };
  22960. /**
  22961. * NO DOM
  22962. */
  22963. Animation.prototype._addEle = function (ele) {
  22964. if (ele.nativeElement) {
  22965. ele = ele.nativeElement;
  22966. }
  22967. if (ele.nodeType === 1) {
  22968. this._eL = (this._e = this._e || []).push(ele);
  22969. }
  22970. };
  22971. /**
  22972. * Add a child animation to this animation.
  22973. */
  22974. Animation.prototype.add = function (childAnimation) {
  22975. childAnimation.parent = this;
  22976. this.hasChildren = true;
  22977. this._cL = (this._c = this._c || []).push(childAnimation);
  22978. return this;
  22979. };
  22980. /**
  22981. * Get the duration of this animation. If this animation does
  22982. * not have a duration, then it'll get the duration from its parent.
  22983. */
  22984. Animation.prototype.getDuration = function (opts) {
  22985. if (opts && Object(__WEBPACK_IMPORTED_MODULE_0__util_util__["h" /* isDefined */])(opts.duration)) {
  22986. return opts.duration;
  22987. }
  22988. else if (this._dur !== null) {
  22989. return this._dur;
  22990. }
  22991. else if (this.parent) {
  22992. return this.parent.getDuration();
  22993. }
  22994. return 0;
  22995. };
  22996. /**
  22997. * Returns if the animation is a root one.
  22998. */
  22999. Animation.prototype.isRoot = function () {
  23000. return !this.parent;
  23001. };
  23002. /**
  23003. * Set the duration for this animation.
  23004. */
  23005. Animation.prototype.duration = function (milliseconds) {
  23006. this._dur = milliseconds;
  23007. return this;
  23008. };
  23009. /**
  23010. * Get the easing of this animation. If this animation does
  23011. * not have an easing, then it'll get the easing from its parent.
  23012. */
  23013. Animation.prototype.getEasing = function () {
  23014. if (this._rv && this._rvEs) {
  23015. return this._rvEs;
  23016. }
  23017. return this._es !== null ? this._es : (this.parent && this.parent.getEasing()) || null;
  23018. };
  23019. /**
  23020. * Set the easing for this animation.
  23021. */
  23022. Animation.prototype.easing = function (name) {
  23023. this._es = name;
  23024. return this;
  23025. };
  23026. /**
  23027. * Set the easing for this reversed animation.
  23028. */
  23029. Animation.prototype.easingReverse = function (name) {
  23030. this._rvEs = name;
  23031. return this;
  23032. };
  23033. /**
  23034. * Add the "from" value for a specific property.
  23035. */
  23036. Animation.prototype.from = function (prop, val) {
  23037. this._addProp('from', prop, val);
  23038. return this;
  23039. };
  23040. /**
  23041. * Add the "to" value for a specific property.
  23042. */
  23043. Animation.prototype.to = function (prop, val, clearProperyAfterTransition) {
  23044. var fx = this._addProp('to', prop, val);
  23045. if (clearProperyAfterTransition) {
  23046. // if this effect is a transform then clear the transform effect
  23047. // otherwise just clear the actual property
  23048. this.afterClearStyles([fx.trans ? this.plt.Css.transform : prop]);
  23049. }
  23050. return this;
  23051. };
  23052. /**
  23053. * Shortcut to add both the "from" and "to" for the same property.
  23054. */
  23055. Animation.prototype.fromTo = function (prop, fromVal, toVal, clearProperyAfterTransition) {
  23056. return this.from(prop, fromVal).to(prop, toVal, clearProperyAfterTransition);
  23057. };
  23058. /**
  23059. * @hidden
  23060. * NO DOM
  23061. */
  23062. Animation.prototype._getProp = function (name) {
  23063. if (this._fx) {
  23064. return this._fx.find(function (prop) { return prop.name === name; });
  23065. }
  23066. else {
  23067. this._fx = [];
  23068. }
  23069. return null;
  23070. };
  23071. Animation.prototype._addProp = function (state, prop, val) {
  23072. var fxProp = this._getProp(prop);
  23073. if (!fxProp) {
  23074. // first time we've see this EffectProperty
  23075. var shouldTrans = (ANIMATION_TRANSFORMS[prop] === 1);
  23076. fxProp = {
  23077. name: prop,
  23078. trans: shouldTrans,
  23079. // add the will-change property for transforms or opacity
  23080. wc: (shouldTrans ? this.plt.Css.transform : prop)
  23081. };
  23082. this._fx.push(fxProp);
  23083. }
  23084. // add from/to EffectState to the EffectProperty
  23085. var fxState = {
  23086. val: val,
  23087. num: null,
  23088. unit: '',
  23089. };
  23090. fxProp[state] = fxState;
  23091. if (typeof val === 'string' && val.indexOf(' ') < 0) {
  23092. var r = val.match(ANIMATION_CSS_VALUE_REGEX);
  23093. var num = parseFloat(r[1]);
  23094. if (!isNaN(num)) {
  23095. fxState.num = num;
  23096. }
  23097. fxState.unit = (r[0] !== r[2] ? r[2] : '');
  23098. }
  23099. else if (typeof val === 'number') {
  23100. fxState.num = val;
  23101. }
  23102. return fxProp;
  23103. };
  23104. /**
  23105. * Add CSS class to this animation's elements
  23106. * before the animation begins.
  23107. */
  23108. Animation.prototype.beforeAddClass = function (className) {
  23109. (this._bfAdd = this._bfAdd || []).push(className);
  23110. return this;
  23111. };
  23112. /**
  23113. * Remove CSS class from this animation's elements
  23114. * before the animation begins.
  23115. */
  23116. Animation.prototype.beforeRemoveClass = function (className) {
  23117. (this._bfRm = this._bfRm || []).push(className);
  23118. return this;
  23119. };
  23120. /**
  23121. * Set CSS inline styles to this animation's elements
  23122. * before the animation begins.
  23123. */
  23124. Animation.prototype.beforeStyles = function (styles) {
  23125. this._bfSty = styles;
  23126. return this;
  23127. };
  23128. /**
  23129. * Clear CSS inline styles from this animation's elements
  23130. * before the animation begins.
  23131. */
  23132. Animation.prototype.beforeClearStyles = function (propertyNames) {
  23133. this._bfSty = this._bfSty || {};
  23134. for (var i = 0; i < propertyNames.length; i++) {
  23135. this._bfSty[propertyNames[i]] = '';
  23136. }
  23137. return this;
  23138. };
  23139. /**
  23140. * Add a function which contains DOM reads, which will run
  23141. * before the animation begins.
  23142. */
  23143. Animation.prototype.beforeAddRead = function (domReadFn) {
  23144. (this._rdFn = this._rdFn || []).push(domReadFn);
  23145. return this;
  23146. };
  23147. /**
  23148. * Add a function which contains DOM writes, which will run
  23149. * before the animation begins.
  23150. */
  23151. Animation.prototype.beforeAddWrite = function (domWriteFn) {
  23152. (this._wrFn = this._wrFn || []).push(domWriteFn);
  23153. return this;
  23154. };
  23155. /**
  23156. * Add CSS class to this animation's elements
  23157. * after the animation finishes.
  23158. */
  23159. Animation.prototype.afterAddClass = function (className) {
  23160. (this._afAdd = this._afAdd || []).push(className);
  23161. return this;
  23162. };
  23163. /**
  23164. * Remove CSS class from this animation's elements
  23165. * after the animation finishes.
  23166. */
  23167. Animation.prototype.afterRemoveClass = function (className) {
  23168. (this._afRm = this._afRm || []).push(className);
  23169. return this;
  23170. };
  23171. /**
  23172. * Set CSS inline styles to this animation's elements
  23173. * after the animation finishes.
  23174. */
  23175. Animation.prototype.afterStyles = function (styles) {
  23176. this._afSty = styles;
  23177. return this;
  23178. };
  23179. /**
  23180. * Clear CSS inline styles from this animation's elements
  23181. * after the animation finishes.
  23182. */
  23183. Animation.prototype.afterClearStyles = function (propertyNames) {
  23184. this._afSty = this._afSty || {};
  23185. for (var i = 0; i < propertyNames.length; i++) {
  23186. this._afSty[propertyNames[i]] = '';
  23187. }
  23188. return this;
  23189. };
  23190. /**
  23191. * Play the animation.
  23192. */
  23193. Animation.prototype.play = function (opts) {
  23194. var _this = this;
  23195. // If the animation was already invalidated (it did finish), do nothing
  23196. if (!this.plt) {
  23197. return;
  23198. }
  23199. // this is the top level animation and is in full control
  23200. // of when the async play() should actually kick off
  23201. // if there is no duration then it'll set the TO property immediately
  23202. // if there is a duration, then it'll stage all animations at the
  23203. // FROM property and transition duration, wait a few frames, then
  23204. // kick off the animation by setting the TO property for each animation
  23205. this._isAsync = this._hasDuration(opts);
  23206. // ensure all past transition end events have been cleared
  23207. this._clearAsync();
  23208. // recursively kicks off the correct progress step for each child animation
  23209. // ******** DOM WRITE ****************
  23210. this._playInit(opts);
  23211. // doubling up RAFs since this animation was probably triggered
  23212. // from an input event, and just having one RAF would have this code
  23213. // run within the same frame as the triggering input event, and the
  23214. // input event probably already did way too much work for one frame
  23215. this.plt.raf(function () {
  23216. _this.plt.raf(_this._playDomInspect.bind(_this, opts));
  23217. });
  23218. };
  23219. Animation.prototype.syncPlay = function () {
  23220. // If the animation was already invalidated (it did finish), do nothing
  23221. if (!this.plt) {
  23222. return;
  23223. }
  23224. var opts = { duration: 0 };
  23225. this._isAsync = false;
  23226. this._clearAsync();
  23227. this._playInit(opts);
  23228. this._playDomInspect(opts);
  23229. };
  23230. /**
  23231. * @hidden
  23232. * DOM WRITE
  23233. * RECURSION
  23234. */
  23235. Animation.prototype._playInit = function (opts) {
  23236. // always default that an animation does not tween
  23237. // a tween requires that an Animation class has an element
  23238. // and that it has at least one FROM/TO effect
  23239. // and that the FROM/TO effect can tween numeric values
  23240. this._twn = false;
  23241. this.isPlaying = true;
  23242. this.hasCompleted = false;
  23243. this._hasDur = (this.getDuration(opts) > ANIMATION_DURATION_MIN);
  23244. var children = this._c;
  23245. for (var i = 0; i < this._cL; i++) {
  23246. // ******** DOM WRITE ****************
  23247. children[i]._playInit(opts);
  23248. }
  23249. if (this._hasDur) {
  23250. // if there is a duration then we want to start at step 0
  23251. // ******** DOM WRITE ****************
  23252. this._progress(0);
  23253. // add the will-change properties
  23254. // ******** DOM WRITE ****************
  23255. this._willChg(true);
  23256. }
  23257. };
  23258. /**
  23259. * @hidden
  23260. * DOM WRITE
  23261. * NO RECURSION
  23262. * ROOT ANIMATION
  23263. */
  23264. Animation.prototype._playDomInspect = function (opts) {
  23265. // fire off all the "before" function that have DOM READS in them
  23266. // elements will be in the DOM, however visibily hidden
  23267. // so we can read their dimensions if need be
  23268. // ******** DOM READ ****************
  23269. // ******** DOM WRITE ****************
  23270. this._beforeAnimation();
  23271. // for the root animation only
  23272. // set the async TRANSITION END event
  23273. // and run onFinishes when the transition ends
  23274. var dur = this.getDuration(opts);
  23275. if (this._isAsync) {
  23276. this._asyncEnd(dur, true);
  23277. }
  23278. // ******** DOM WRITE ****************
  23279. this._playProgress(opts);
  23280. if (this._isAsync && this.plt) {
  23281. // this animation has a duration so we need another RAF
  23282. // for the CSS TRANSITION properties to kick in
  23283. this.plt.raf(this._playToStep.bind(this, 1));
  23284. }
  23285. };
  23286. /**
  23287. * @hidden
  23288. * DOM WRITE
  23289. * RECURSION
  23290. */
  23291. Animation.prototype._playProgress = function (opts) {
  23292. var children = this._c;
  23293. for (var i = 0; i < this._cL; i++) {
  23294. // ******** DOM WRITE ****************
  23295. children[i]._playProgress(opts);
  23296. }
  23297. if (this._hasDur) {
  23298. // set the CSS TRANSITION duration/easing
  23299. // ******** DOM WRITE ****************
  23300. this._setTrans(this.getDuration(opts), false);
  23301. }
  23302. else {
  23303. // this animation does not have a duration, so it should not animate
  23304. // just go straight to the TO properties and call it done
  23305. // ******** DOM WRITE ****************
  23306. this._progress(1);
  23307. // since there was no animation, immediately run the after
  23308. // ******** DOM WRITE ****************
  23309. this._setAfterStyles();
  23310. // this animation has no duration, so it has finished
  23311. // other animations could still be running
  23312. this._didFinish(true);
  23313. }
  23314. };
  23315. /**
  23316. * @hidden
  23317. * DOM WRITE
  23318. * RECURSION
  23319. */
  23320. Animation.prototype._playToStep = function (stepValue) {
  23321. var children = this._c;
  23322. for (var i = 0; i < this._cL; i++) {
  23323. // ******** DOM WRITE ****************
  23324. children[i]._playToStep(stepValue);
  23325. }
  23326. if (this._hasDur) {
  23327. // browser had some time to render everything in place
  23328. // and the transition duration/easing is set
  23329. // now set the TO properties which will trigger the transition to begin
  23330. // ******** DOM WRITE ****************
  23331. this._progress(stepValue);
  23332. }
  23333. };
  23334. /**
  23335. * @hidden
  23336. * DOM WRITE
  23337. * NO RECURSION
  23338. * ROOT ANIMATION
  23339. */
  23340. Animation.prototype._asyncEnd = function (dur, shouldComplete) {
  23341. (void 0) /* assert */;
  23342. (void 0) /* assert */;
  23343. (void 0) /* assert */;
  23344. var self = this;
  23345. function onTransitionEnd() {
  23346. // congrats! a successful transition completed!
  23347. // ensure transition end events and timeouts have been cleared
  23348. self._clearAsync();
  23349. // ******** DOM WRITE ****************
  23350. self._playEnd();
  23351. // transition finished
  23352. self._didFinishAll(shouldComplete, true, false);
  23353. }
  23354. function onTransitionFallback() {
  23355. (void 0) /* console.debug */;
  23356. // oh noz! the transition end event didn't fire in time!
  23357. // instead the fallback timer when first
  23358. // if all goes well this fallback should never fire
  23359. // clear the other async end events from firing
  23360. self._tm = undefined;
  23361. self._clearAsync();
  23362. // set the after styles
  23363. // ******** DOM WRITE ****************
  23364. self._playEnd(shouldComplete ? 1 : 0);
  23365. // transition finished
  23366. self._didFinishAll(shouldComplete, true, false);
  23367. }
  23368. // set the TRANSITION END event on one of the transition elements
  23369. self._unrgTrns = this.plt.transitionEnd(self._transEl(), onTransitionEnd, false);
  23370. // set a fallback timeout if the transition end event never fires, or is too slow
  23371. // transition end fallback: (animation duration + XXms)
  23372. self._tm = self.plt.timeout(onTransitionFallback, (dur + ANIMATION_TRANSITION_END_FALLBACK_PADDING_MS));
  23373. };
  23374. /**
  23375. * @hidden
  23376. * DOM WRITE
  23377. * RECURSION
  23378. */
  23379. Animation.prototype._playEnd = function (stepValue) {
  23380. var children = this._c;
  23381. for (var i = 0; i < this._cL; i++) {
  23382. // ******** DOM WRITE ****************
  23383. children[i]._playEnd(stepValue);
  23384. }
  23385. if (this._hasDur) {
  23386. if (Object(__WEBPACK_IMPORTED_MODULE_0__util_util__["h" /* isDefined */])(stepValue)) {
  23387. // too late to have a smooth animation, just finish it
  23388. // ******** DOM WRITE ****************
  23389. this._setTrans(0, true);
  23390. // ensure the ending progress step gets rendered
  23391. // ******** DOM WRITE ****************
  23392. this._progress(stepValue);
  23393. }
  23394. // set the after styles
  23395. // ******** DOM WRITE ****************
  23396. this._setAfterStyles();
  23397. // remove the will-change properties
  23398. // ******** DOM WRITE ****************
  23399. this._willChg(false);
  23400. }
  23401. };
  23402. /**
  23403. * @hidden
  23404. * NO DOM
  23405. * RECURSION
  23406. */
  23407. Animation.prototype._hasDuration = function (opts) {
  23408. if (this.getDuration(opts) > ANIMATION_DURATION_MIN) {
  23409. return true;
  23410. }
  23411. var children = this._c;
  23412. for (var i = 0; i < this._cL; i++) {
  23413. if (children[i]._hasDuration(opts)) {
  23414. return true;
  23415. }
  23416. }
  23417. return false;
  23418. };
  23419. /**
  23420. * @hidden
  23421. * NO DOM
  23422. * RECURSION
  23423. */
  23424. Animation.prototype._hasDomReads = function () {
  23425. if (this._rdFn && this._rdFn.length) {
  23426. return true;
  23427. }
  23428. var children = this._c;
  23429. for (var i = 0; i < this._cL; i++) {
  23430. if (children[i]._hasDomReads()) {
  23431. return true;
  23432. }
  23433. }
  23434. return false;
  23435. };
  23436. /**
  23437. * Immediately stop at the end of the animation.
  23438. */
  23439. Animation.prototype.stop = function (stepValue) {
  23440. if (stepValue === void 0) { stepValue = 1; }
  23441. // ensure all past transition end events have been cleared
  23442. this._clearAsync();
  23443. this._hasDur = true;
  23444. this._playEnd(stepValue);
  23445. };
  23446. /**
  23447. * @hidden
  23448. * NO DOM
  23449. * NO RECURSION
  23450. */
  23451. Animation.prototype._clearAsync = function () {
  23452. this._unrgTrns && this._unrgTrns();
  23453. this._tm && clearTimeout(this._tm);
  23454. this._tm = this._unrgTrns = undefined;
  23455. };
  23456. /**
  23457. * @hidden
  23458. * DOM WRITE
  23459. * NO RECURSION
  23460. */
  23461. Animation.prototype._progress = function (stepValue) {
  23462. // bread 'n butter
  23463. var val;
  23464. var effects = this._fx;
  23465. var nuElements = this._eL;
  23466. if (!effects || !nuElements) {
  23467. return;
  23468. }
  23469. // flip the number if we're going in reverse
  23470. if (this._rv) {
  23471. stepValue = ((stepValue * -1) + 1);
  23472. }
  23473. var i, j;
  23474. var finalTransform = '';
  23475. var elements = this._e;
  23476. for (i = 0; i < effects.length; i++) {
  23477. var fx = effects[i];
  23478. if (fx.from && fx.to) {
  23479. var fromNum = fx.from.num;
  23480. var toNum = fx.to.num;
  23481. var tweenEffect = (fromNum !== toNum);
  23482. (void 0) /* assert */;
  23483. if (tweenEffect) {
  23484. this._twn = true;
  23485. }
  23486. if (stepValue === 0) {
  23487. // FROM
  23488. val = fx.from.val;
  23489. }
  23490. else if (stepValue === 1) {
  23491. // TO
  23492. val = fx.to.val;
  23493. }
  23494. else if (tweenEffect) {
  23495. // EVERYTHING IN BETWEEN
  23496. var valNum = (((toNum - fromNum) * stepValue) + fromNum);
  23497. var unit = fx.to.unit;
  23498. if (unit === 'px') {
  23499. valNum = Math.round(valNum);
  23500. }
  23501. val = valNum + unit;
  23502. }
  23503. if (val !== null) {
  23504. var prop = fx.name;
  23505. if (fx.trans) {
  23506. finalTransform += prop + '(' + val + ') ';
  23507. }
  23508. else {
  23509. for (j = 0; j < nuElements; j++) {
  23510. // ******** DOM WRITE ****************
  23511. elements[j].style[prop] = val;
  23512. }
  23513. }
  23514. }
  23515. }
  23516. }
  23517. // place all transforms on the same property
  23518. if (finalTransform.length) {
  23519. if (!this._rv && stepValue !== 1 || this._rv && stepValue !== 0) {
  23520. finalTransform += 'translateZ(0px)';
  23521. }
  23522. var cssTransform = this.plt.Css.transform;
  23523. for (i = 0; i < elements.length; i++) {
  23524. // ******** DOM WRITE ****************
  23525. elements[i].style[cssTransform] = finalTransform;
  23526. }
  23527. }
  23528. };
  23529. /**
  23530. * @hidden
  23531. * DOM WRITE
  23532. * NO RECURSION
  23533. */
  23534. Animation.prototype._setTrans = function (dur, forcedLinearEasing) {
  23535. // Transition is not enabled if there are not effects
  23536. if (!this._fx) {
  23537. return;
  23538. }
  23539. // set the TRANSITION properties inline on the element
  23540. var elements = this._e;
  23541. var easing = (forcedLinearEasing ? 'linear' : this.getEasing());
  23542. var durString = dur + 'ms';
  23543. var Css = this.plt.Css;
  23544. var cssTransform = Css.transition;
  23545. var cssTransitionDuration = Css.transitionDuration;
  23546. var cssTransitionTimingFn = Css.transitionTimingFn;
  23547. var eleStyle;
  23548. for (var i = 0; i < this._eL; i++) {
  23549. eleStyle = elements[i].style;
  23550. if (dur > 0) {
  23551. // ******** DOM WRITE ****************
  23552. eleStyle[cssTransform] = '';
  23553. eleStyle[cssTransitionDuration] = durString;
  23554. // each animation can have a different easing
  23555. if (easing) {
  23556. // ******** DOM WRITE ****************
  23557. eleStyle[cssTransitionTimingFn] = easing;
  23558. }
  23559. }
  23560. else {
  23561. eleStyle[cssTransform] = 'none';
  23562. }
  23563. }
  23564. };
  23565. /**
  23566. * @hidden
  23567. * DOM READ
  23568. * DOM WRITE
  23569. * RECURSION
  23570. */
  23571. Animation.prototype._beforeAnimation = function () {
  23572. // fire off all the "before" function that have DOM READS in them
  23573. // elements will be in the DOM, however visibily hidden
  23574. // so we can read their dimensions if need be
  23575. // ******** DOM READ ****************
  23576. this._fireBeforeReadFunc();
  23577. // ******** DOM READS ABOVE / DOM WRITES BELOW ****************
  23578. // fire off all the "before" function that have DOM WRITES in them
  23579. // ******** DOM WRITE ****************
  23580. this._fireBeforeWriteFunc();
  23581. // stage all of the before css classes and inline styles
  23582. // ******** DOM WRITE ****************
  23583. this._setBeforeStyles();
  23584. };
  23585. /**
  23586. * @hidden
  23587. * DOM WRITE
  23588. * RECURSION
  23589. */
  23590. Animation.prototype._setBeforeStyles = function () {
  23591. var i, j;
  23592. var children = this._c;
  23593. for (i = 0; i < this._cL; i++) {
  23594. children[i]._setBeforeStyles();
  23595. }
  23596. // before the animations have started
  23597. // only set before styles if animation is not reversed
  23598. if (this._rv) {
  23599. return;
  23600. }
  23601. var addClasses = this._bfAdd;
  23602. var removeClasses = this._bfRm;
  23603. var ele;
  23604. var eleClassList;
  23605. var prop;
  23606. for (i = 0; i < this._eL; i++) {
  23607. ele = this._e[i];
  23608. eleClassList = ele.classList;
  23609. // css classes to add before the animation
  23610. if (addClasses) {
  23611. for (j = 0; j < addClasses.length; j++) {
  23612. // ******** DOM WRITE ****************
  23613. eleClassList.add(addClasses[j]);
  23614. }
  23615. }
  23616. // css classes to remove before the animation
  23617. if (removeClasses) {
  23618. for (j = 0; j < removeClasses.length; j++) {
  23619. // ******** DOM WRITE ****************
  23620. eleClassList.remove(removeClasses[j]);
  23621. }
  23622. }
  23623. // inline styles to add before the animation
  23624. if (this._bfSty) {
  23625. for (prop in this._bfSty) {
  23626. // ******** DOM WRITE ****************
  23627. ele.style[prop] = this._bfSty[prop];
  23628. }
  23629. }
  23630. }
  23631. };
  23632. /**
  23633. * @hidden
  23634. * DOM READ
  23635. * RECURSION
  23636. */
  23637. Animation.prototype._fireBeforeReadFunc = function () {
  23638. var children = this._c;
  23639. for (var i = 0; i < this._cL; i++) {
  23640. // ******** DOM READ ****************
  23641. children[i]._fireBeforeReadFunc();
  23642. }
  23643. var readFunctions = this._rdFn;
  23644. if (readFunctions) {
  23645. for (var i = 0; i < readFunctions.length; i++) {
  23646. // ******** DOM READ ****************
  23647. readFunctions[i]();
  23648. }
  23649. }
  23650. };
  23651. /**
  23652. * @hidden
  23653. * DOM WRITE
  23654. * RECURSION
  23655. */
  23656. Animation.prototype._fireBeforeWriteFunc = function () {
  23657. var children = this._c;
  23658. for (var i = 0; i < this._cL; i++) {
  23659. // ******** DOM WRITE ****************
  23660. children[i]._fireBeforeWriteFunc();
  23661. }
  23662. var writeFunctions = this._wrFn;
  23663. if (this._wrFn) {
  23664. for (var i = 0; i < writeFunctions.length; i++) {
  23665. // ******** DOM WRITE ****************
  23666. writeFunctions[i]();
  23667. }
  23668. }
  23669. };
  23670. /**
  23671. * @hidden
  23672. * DOM WRITE
  23673. */
  23674. Animation.prototype._setAfterStyles = function () {
  23675. var i, j;
  23676. var ele;
  23677. var eleClassList;
  23678. var elements = this._e;
  23679. for (i = 0; i < this._eL; i++) {
  23680. ele = elements[i];
  23681. eleClassList = ele.classList;
  23682. // remove the transition duration/easing
  23683. // ******** DOM WRITE ****************
  23684. ele.style[this.plt.Css.transitionDuration] = ele.style[this.plt.Css.transitionTimingFn] = '';
  23685. if (this._rv) {
  23686. // finished in reverse direction
  23687. // css classes that were added before the animation should be removed
  23688. if (this._bfAdd) {
  23689. for (j = 0; j < this._bfAdd.length; j++) {
  23690. // ******** DOM WRITE ****************
  23691. eleClassList.remove(this._bfAdd[j]);
  23692. }
  23693. }
  23694. // css classes that were removed before the animation should be added
  23695. if (this._bfRm) {
  23696. for (j = 0; j < this._bfRm.length; j++) {
  23697. // ******** DOM WRITE ****************
  23698. eleClassList.add(this._bfRm[j]);
  23699. }
  23700. }
  23701. // inline styles that were added before the animation should be removed
  23702. if (this._bfSty) {
  23703. for (var prop in this._bfSty) {
  23704. // ******** DOM WRITE ****************
  23705. ele.style[prop] = '';
  23706. }
  23707. }
  23708. }
  23709. else {
  23710. // finished in forward direction
  23711. // css classes to add after the animation
  23712. if (this._afAdd) {
  23713. for (j = 0; j < this._afAdd.length; j++) {
  23714. // ******** DOM WRITE ****************
  23715. eleClassList.add(this._afAdd[j]);
  23716. }
  23717. }
  23718. // css classes to remove after the animation
  23719. if (this._afRm) {
  23720. for (j = 0; j < this._afRm.length; j++) {
  23721. // ******** DOM WRITE ****************
  23722. eleClassList.remove(this._afRm[j]);
  23723. }
  23724. }
  23725. // inline styles to add after the animation
  23726. if (this._afSty) {
  23727. for (var prop in this._afSty) {
  23728. // ******** DOM WRITE ****************
  23729. ele.style[prop] = this._afSty[prop];
  23730. }
  23731. }
  23732. }
  23733. }
  23734. };
  23735. /**
  23736. * @hidden
  23737. * DOM WRITE
  23738. * NO RECURSION
  23739. */
  23740. Animation.prototype._willChg = function (addWillChange) {
  23741. var wc;
  23742. var effects = this._fx;
  23743. var willChange;
  23744. if (addWillChange && effects) {
  23745. wc = [];
  23746. for (var i = 0; i < effects.length; i++) {
  23747. var propWC = effects[i].wc;
  23748. if (propWC === 'webkitTransform') {
  23749. wc.push('transform', '-webkit-transform');
  23750. }
  23751. else {
  23752. wc.push(propWC);
  23753. }
  23754. }
  23755. willChange = wc.join(',');
  23756. }
  23757. else {
  23758. willChange = '';
  23759. }
  23760. for (var i = 0; i < this._eL; i++) {
  23761. // ******** DOM WRITE ****************
  23762. this._e[i].style.willChange = willChange;
  23763. }
  23764. };
  23765. /**
  23766. * Start the animation with a user controlled progress.
  23767. */
  23768. Animation.prototype.progressStart = function () {
  23769. // ensure all past transition end events have been cleared
  23770. this._clearAsync();
  23771. // ******** DOM READ/WRITE ****************
  23772. this._beforeAnimation();
  23773. // ******** DOM WRITE ****************
  23774. this._progressStart();
  23775. };
  23776. /**
  23777. * @hidden
  23778. * DOM WRITE
  23779. * RECURSION
  23780. */
  23781. Animation.prototype._progressStart = function () {
  23782. var children = this._c;
  23783. for (var i = 0; i < this._cL; i++) {
  23784. // ******** DOM WRITE ****************
  23785. children[i]._progressStart();
  23786. }
  23787. // force no duration, linear easing
  23788. // ******** DOM WRITE ****************
  23789. this._setTrans(0, true);
  23790. // ******** DOM WRITE ****************
  23791. this._willChg(true);
  23792. };
  23793. /**
  23794. * Set the progress step for this animation.
  23795. * progressStep() is not debounced, so it should not be called faster than 60FPS.
  23796. */
  23797. Animation.prototype.progressStep = function (stepValue) {
  23798. // only update if the last update was more than 16ms ago
  23799. stepValue = Math.min(1, Math.max(0, stepValue));
  23800. var children = this._c;
  23801. for (var i = 0; i < this._cL; i++) {
  23802. // ******** DOM WRITE ****************
  23803. children[i].progressStep(stepValue);
  23804. }
  23805. if (this._rv) {
  23806. // if the animation is going in reverse then
  23807. // flip the step value: 0 becomes 1, 1 becomes 0
  23808. stepValue = ((stepValue * -1) + 1);
  23809. }
  23810. // ******** DOM WRITE ****************
  23811. this._progress(stepValue);
  23812. };
  23813. /**
  23814. * End the progress animation.
  23815. */
  23816. Animation.prototype.progressEnd = function (shouldComplete, currentStepValue, dur) {
  23817. if (dur === void 0) { dur = -1; }
  23818. (void 0) /* console.debug */;
  23819. if (this._rv) {
  23820. // if the animation is going in reverse then
  23821. // flip the step value: 0 becomes 1, 1 becomes 0
  23822. currentStepValue = ((currentStepValue * -1) + 1);
  23823. }
  23824. var stepValue = shouldComplete ? 1 : 0;
  23825. var diff = Math.abs(currentStepValue - stepValue);
  23826. if (diff < 0.05) {
  23827. dur = 0;
  23828. }
  23829. else if (dur < 0) {
  23830. dur = this._dur;
  23831. }
  23832. this._isAsync = (dur > 30);
  23833. this._progressEnd(shouldComplete, stepValue, dur, this._isAsync);
  23834. if (this._isAsync) {
  23835. // for the root animation only
  23836. // set the async TRANSITION END event
  23837. // and run onFinishes when the transition ends
  23838. // ******** DOM WRITE ****************
  23839. this._asyncEnd(dur, shouldComplete);
  23840. // this animation has a duration so we need another RAF
  23841. // for the CSS TRANSITION properties to kick in
  23842. this.plt && this.plt.raf(this._playToStep.bind(this, stepValue));
  23843. }
  23844. };
  23845. /**
  23846. * @hidden
  23847. * DOM WRITE
  23848. * RECURSION
  23849. */
  23850. Animation.prototype._progressEnd = function (shouldComplete, stepValue, dur, isAsync) {
  23851. var children = this._c;
  23852. for (var i = 0; i < this._cL; i++) {
  23853. // ******** DOM WRITE ****************
  23854. children[i]._progressEnd(shouldComplete, stepValue, dur, isAsync);
  23855. }
  23856. if (!isAsync) {
  23857. // stop immediately
  23858. // set all the animations to their final position
  23859. // ******** DOM WRITE ****************
  23860. this._progress(stepValue);
  23861. this._willChg(false);
  23862. this._setAfterStyles();
  23863. this._didFinish(shouldComplete);
  23864. }
  23865. else {
  23866. // animate it back to it's ending position
  23867. this.isPlaying = true;
  23868. this.hasCompleted = false;
  23869. this._hasDur = true;
  23870. // ******** DOM WRITE ****************
  23871. this._willChg(true);
  23872. this._setTrans(dur, false);
  23873. }
  23874. };
  23875. /**
  23876. * Add a callback to fire when the animation has finished.
  23877. */
  23878. Animation.prototype.onFinish = function (callback, onceTimeCallback, clearOnFinishCallacks) {
  23879. if (onceTimeCallback === void 0) { onceTimeCallback = false; }
  23880. if (clearOnFinishCallacks === void 0) { clearOnFinishCallacks = false; }
  23881. if (clearOnFinishCallacks) {
  23882. this._fFn = this._fOneFn = undefined;
  23883. }
  23884. if (onceTimeCallback) {
  23885. this._fOneFn = this._fOneFn || [];
  23886. this._fOneFn.push(callback);
  23887. }
  23888. else {
  23889. this._fFn = this._fFn || [];
  23890. this._fFn.push(callback);
  23891. }
  23892. return this;
  23893. };
  23894. /**
  23895. * @hidden
  23896. * NO DOM
  23897. * RECURSION
  23898. */
  23899. Animation.prototype._didFinishAll = function (hasCompleted, finishAsyncAnimations, finishNoDurationAnimations) {
  23900. var children = this._c;
  23901. for (var i = 0; i < this._cL; i++) {
  23902. children[i]._didFinishAll(hasCompleted, finishAsyncAnimations, finishNoDurationAnimations);
  23903. }
  23904. if (finishAsyncAnimations && this._isAsync || finishNoDurationAnimations && !this._isAsync) {
  23905. this._didFinish(hasCompleted);
  23906. }
  23907. };
  23908. /**
  23909. * @hidden
  23910. * NO RECURSION
  23911. */
  23912. Animation.prototype._didFinish = function (hasCompleted) {
  23913. this.isPlaying = false;
  23914. this.hasCompleted = hasCompleted;
  23915. if (this._fFn) {
  23916. // run all finish callbacks
  23917. for (var i = 0; i < this._fFn.length; i++) {
  23918. this._fFn[i](this);
  23919. }
  23920. }
  23921. if (this._fOneFn) {
  23922. // run all "onetime" finish callbacks
  23923. for (var i = 0; i < this._fOneFn.length; i++) {
  23924. this._fOneFn[i](this);
  23925. }
  23926. this._fOneFn.length = 0;
  23927. }
  23928. };
  23929. /**
  23930. * Reverse the animation.
  23931. */
  23932. Animation.prototype.reverse = function (shouldReverse) {
  23933. if (shouldReverse === void 0) { shouldReverse = true; }
  23934. var children = this._c;
  23935. for (var i = 0; i < this._cL; i++) {
  23936. children[i].reverse(shouldReverse);
  23937. }
  23938. this._rv = shouldReverse;
  23939. return this;
  23940. };
  23941. /**
  23942. * Recursively destroy this animation and all child animations.
  23943. */
  23944. Animation.prototype.destroy = function () {
  23945. var children = this._c;
  23946. for (var i = 0; i < this._cL; i++) {
  23947. children[i].destroy();
  23948. }
  23949. this._clearAsync();
  23950. this.parent = this.plt = this._e = this._rdFn = this._wrFn = null;
  23951. if (this._c) {
  23952. this._c.length = this._cL = 0;
  23953. }
  23954. if (this._fFn) {
  23955. this._fFn.length = 0;
  23956. }
  23957. if (this._fOneFn) {
  23958. this._fOneFn.length = 0;
  23959. }
  23960. };
  23961. /**
  23962. * @hidden
  23963. * NO DOM
  23964. */
  23965. Animation.prototype._transEl = function () {
  23966. // get the lowest level element that has an Animation
  23967. var targetEl;
  23968. for (var i = 0; i < this._cL; i++) {
  23969. targetEl = this._c[i]._transEl();
  23970. if (targetEl) {
  23971. return targetEl;
  23972. }
  23973. }
  23974. return (this._twn && this._hasDur && this._eL ? this._e[0] : null);
  23975. };
  23976. return Animation;
  23977. }());
  23978. var ANIMATION_TRANSFORMS = {
  23979. 'translateX': 1,
  23980. 'translateY': 1,
  23981. 'translateZ': 1,
  23982. 'scale': 1,
  23983. 'scaleX': 1,
  23984. 'scaleY': 1,
  23985. 'scaleZ': 1,
  23986. 'rotate': 1,
  23987. 'rotateX': 1,
  23988. 'rotateY': 1,
  23989. 'rotateZ': 1,
  23990. 'skewX': 1,
  23991. 'skewY': 1,
  23992. 'perspective': 1
  23993. };
  23994. var ANIMATION_CSS_VALUE_REGEX = /(^-?\d*\.?\d*)(.*)/;
  23995. var ANIMATION_DURATION_MIN = 32;
  23996. var ANIMATION_TRANSITION_END_FALLBACK_PADDING_MS = 400;
  23997. //# sourceMappingURL=animation.js.map
  23998. /***/ }),
  23999. /* 12 */
  24000. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  24001. "use strict";
  24002. /* harmony export (immutable) */ __webpack_exports__["m"] = round;
  24003. /* harmony export (immutable) */ __webpack_exports__["e"] = inlineStyle;
  24004. /* harmony export (immutable) */ __webpack_exports__["b"] = addClass;
  24005. /* harmony export (immutable) */ __webpack_exports__["l"] = removeClass;
  24006. /* harmony export (immutable) */ __webpack_exports__["d"] = getElementIndex;
  24007. /* harmony export (immutable) */ __webpack_exports__["k"] = queryChildren;
  24008. /* harmony export (immutable) */ __webpack_exports__["c"] = eachChild;
  24009. /* harmony export (immutable) */ __webpack_exports__["n"] = transform;
  24010. /* harmony export (immutable) */ __webpack_exports__["o"] = transition;
  24011. /* harmony export (immutable) */ __webpack_exports__["p"] = triggerTransitionEnd;
  24012. /* harmony export (immutable) */ __webpack_exports__["j"] = offset;
  24013. /* harmony export (immutable) */ __webpack_exports__["q"] = updateSlidesOffset;
  24014. /* harmony export (immutable) */ __webpack_exports__["g"] = isHorizontal;
  24015. /* harmony export (immutable) */ __webpack_exports__["f"] = isFormElement;
  24016. /* harmony export (immutable) */ __webpack_exports__["i"] = minTranslate;
  24017. /* harmony export (immutable) */ __webpack_exports__["h"] = maxTranslate;
  24018. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CLS; });
  24019. function round(a) {
  24020. return Math.floor(a);
  24021. }
  24022. function inlineStyle(ele, styles) {
  24023. if (ele) {
  24024. if (ele.length) {
  24025. for (var i = 0; i < ele.length; i++) {
  24026. inlineStyle(ele[i], styles);
  24027. }
  24028. }
  24029. else if (ele.nodeType) {
  24030. var cssProps = Object.keys(styles);
  24031. for (var i_1 = 0; i_1 < cssProps.length; i_1++) {
  24032. ele.style[cssProps[i_1]] = styles[cssProps[i_1]];
  24033. }
  24034. }
  24035. }
  24036. }
  24037. function addClass(ele, className) {
  24038. if (ele) {
  24039. if (ele.length) {
  24040. for (var i = 0; i < ele.length; i++) {
  24041. addClass(ele[i], className);
  24042. }
  24043. }
  24044. else if (ele.nodeType) {
  24045. if (Array.isArray(className)) {
  24046. className.forEach(function (cls) {
  24047. ele.classList.add(cls);
  24048. });
  24049. }
  24050. else {
  24051. ele.classList.add(className);
  24052. }
  24053. }
  24054. }
  24055. }
  24056. function removeClass(ele, className) {
  24057. if (ele) {
  24058. if (ele.length) {
  24059. for (var i = 0; i < ele.length; i++) {
  24060. removeClass(ele[i], className);
  24061. }
  24062. }
  24063. else if (ele.nodeType) {
  24064. if (Array.isArray(className)) {
  24065. className.forEach(function (cls) {
  24066. ele.classList.remove(cls);
  24067. });
  24068. }
  24069. else {
  24070. ele.classList.remove(className);
  24071. }
  24072. }
  24073. }
  24074. }
  24075. function getElementIndex(ele) {
  24076. var i = 0;
  24077. if (ele) {
  24078. while ((ele = ele.previousSibling) !== null) {
  24079. if (ele.nodeType === 1)
  24080. i++;
  24081. }
  24082. }
  24083. return i;
  24084. }
  24085. function queryChildren(parentEle, query) {
  24086. if (parentEle) {
  24087. return parentEle.querySelectorAll(query);
  24088. }
  24089. return [];
  24090. }
  24091. function eachChild(parentEle, query, callback) {
  24092. if (parentEle) {
  24093. var nodes = parentEle.querySelectorAll(query);
  24094. for (var i = 0; i < nodes.length; i++) {
  24095. callback(nodes[i]);
  24096. }
  24097. }
  24098. }
  24099. function transform(ele, val) {
  24100. if (ele) {
  24101. var elStyle = ele.style;
  24102. elStyle.webkitTransform = elStyle.MsTransform = elStyle.msTransform = elStyle.transform = val;
  24103. }
  24104. }
  24105. function transition(ele, duration) {
  24106. if (ele) {
  24107. if (typeof duration !== 'string') {
  24108. duration = duration + 'ms';
  24109. }
  24110. var elStyle = ele.style;
  24111. elStyle.webkitTransitionDuration = elStyle.MsTransitionDuration = elStyle.msTransitionDuration = elStyle.transitionDuration = duration;
  24112. }
  24113. }
  24114. function triggerTransitionEnd(plt, ele) {
  24115. try {
  24116. var win = plt.win();
  24117. var evt = new win.CustomEvent('transitionend', { bubbles: true, cancelable: true });
  24118. ele.dispatchEvent(evt);
  24119. }
  24120. catch (e) { }
  24121. }
  24122. function offset(ele, plt) {
  24123. if (ele) {
  24124. var box = plt.getElementBoundingClientRect(ele);
  24125. var body = plt.doc().body;
  24126. var win = plt.win();
  24127. var clientTop = ele.clientTop || body.clientTop || 0;
  24128. var clientLeft = ele.clientLeft || body.clientLeft || 0;
  24129. var scrollTop = win.pageYOffset || ele.scrollTop;
  24130. var scrollLeft = win.pageXOffset || ele.scrollLeft;
  24131. return {
  24132. top: box.top + scrollTop - clientTop,
  24133. left: box.left + scrollLeft - clientLeft
  24134. };
  24135. }
  24136. return null;
  24137. }
  24138. function updateSlidesOffset(s) {
  24139. for (var i = 0; i < s._slides.length; i++) {
  24140. s._slides[i].swiperSlideOffset = isHorizontal(s) ? s._slides[i].offsetLeft : s._slides[i].offsetTop;
  24141. }
  24142. }
  24143. function isHorizontal(s) {
  24144. return s.direction === 'horizontal';
  24145. }
  24146. var formElements = ['INPUT', 'SELECT', 'TEXTAREA', 'BUTTON', 'VIDEO'];
  24147. function isFormElement(el) {
  24148. return !!el && formElements.indexOf(el.tagName) > -1;
  24149. }
  24150. /*=========================
  24151. Min/Max Translate
  24152. ===========================*/
  24153. function minTranslate(s) {
  24154. return (-s._snapGrid[0]);
  24155. }
  24156. function maxTranslate(s) {
  24157. return (-s._snapGrid[s._snapGrid.length - 1]);
  24158. }
  24159. var CLS = {
  24160. // Classnames
  24161. noSwiping: 'swiper-no-swiping',
  24162. containerModifier: 'swiper-container-',
  24163. slide: 'swiper-slide',
  24164. slideActive: 'swiper-slide-active',
  24165. slideDuplicateActive: 'swiper-slide-duplicate-active',
  24166. slideVisible: 'swiper-slide-visible',
  24167. slideDuplicate: 'swiper-slide-duplicate',
  24168. slideNext: 'swiper-slide-next',
  24169. slideDuplicateNext: 'swiper-slide-duplicate-next',
  24170. slidePrev: 'swiper-slide-prev',
  24171. slideDuplicatePrev: 'swiper-slide-duplicate-prev',
  24172. wrapper: 'swiper-wrapper',
  24173. bullet: 'swiper-pagination-bullet',
  24174. bulletActive: 'swiper-pagination-bullet-active',
  24175. buttonDisabled: 'swiper-button-disabled',
  24176. paginationCurrent: 'swiper-pagination-current',
  24177. paginationTotal: 'swiper-pagination-total',
  24178. paginationHidden: 'swiper-pagination-hidden',
  24179. paginationProgressbar: 'swiper-pagination-progressbar',
  24180. paginationClickable: 'swiper-pagination-clickable',
  24181. paginationModifier: 'swiper-pagination-',
  24182. lazyLoading: 'swiper-lazy',
  24183. lazyStatusLoading: 'swiper-lazy-loading',
  24184. lazyStatusLoaded: 'swiper-lazy-loaded',
  24185. lazyPreloader: 'swiper-lazy-preloader',
  24186. notification: 'swiper-notification',
  24187. preloader: 'preloader',
  24188. zoomContainer: 'swiper-zoom-container',
  24189. };
  24190. //# sourceMappingURL=swiper-utils.js.map
  24191. /***/ }),
  24192. /* 13 */
  24193. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  24194. "use strict";
  24195. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return NavParams; });
  24196. /**
  24197. * @name NavParams
  24198. * @description
  24199. * NavParams are an object that exists on a page and can contain data for that particular view.
  24200. * Similar to how data was pass to a view in V1 with `$stateParams`, NavParams offer a much more flexible
  24201. * option with a simple `get` method.
  24202. *
  24203. * @usage
  24204. * ```ts
  24205. * import { NavParams } from 'ionic-angular';
  24206. *
  24207. * export class MyClass{
  24208. *
  24209. * constructor(navParams: NavParams){
  24210. * // userParams is an object we have in our nav-parameters
  24211. * navParams.get('userParams');
  24212. * }
  24213. *
  24214. * }
  24215. * ```
  24216. * @demo /docs/demos/src/nav-params/
  24217. * @see {@link /docs/components#navigation Navigation Component Docs}
  24218. * @see {@link ../NavController/ NavController API Docs}
  24219. * @see {@link /docs/api/components/nav/Nav/ Nav API Docs}
  24220. * @see {@link /docs/api/components/nav/NavPush/ NavPush API Docs}
  24221. */
  24222. var NavParams = (function () {
  24223. /**
  24224. * @hidden
  24225. * @param {TODO} data TODO
  24226. */
  24227. function NavParams(data) {
  24228. if (data === void 0) { data = {}; }
  24229. this.data = data;
  24230. }
  24231. /**
  24232. * Get the value of a nav-parameter for the current view
  24233. *
  24234. * ```ts
  24235. * import { NavParams } from 'ionic-angular';
  24236. *
  24237. * export class MyClass{
  24238. * constructor(public navParams: NavParams){
  24239. * // userParams is an object we have in our nav-parameters
  24240. * this.navParams.get('userParams');
  24241. * }
  24242. * }
  24243. * ```
  24244. *
  24245. *
  24246. * @param {string} param Which param you want to look up
  24247. */
  24248. NavParams.prototype.get = function (param) {
  24249. return this.data[param];
  24250. };
  24251. return NavParams;
  24252. }());
  24253. //# sourceMappingURL=nav-params.js.map
  24254. /***/ }),
  24255. /* 14 */
  24256. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  24257. "use strict";
  24258. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DeepLinker; });
  24259. /* harmony export (immutable) */ __webpack_exports__["b"] = setupDeepLinker;
  24260. /* unused harmony export normalizeUrl */
  24261. /* unused harmony export getNavFromTree */
  24262. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__nav_util__ = __webpack_require__(21);
  24263. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_util__ = __webpack_require__(2);
  24264. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__url_serializer__ = __webpack_require__(41);
  24265. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__view_controller__ = __webpack_require__(5);
  24266. /**
  24267. * @hidden
  24268. */
  24269. var DeepLinker = (function () {
  24270. function DeepLinker(_app, _serializer, _location, _moduleLoader, _baseCfr) {
  24271. this._app = _app;
  24272. this._serializer = _serializer;
  24273. this._location = _location;
  24274. this._moduleLoader = _moduleLoader;
  24275. this._baseCfr = _baseCfr;
  24276. /** @internal */
  24277. this._history = [];
  24278. }
  24279. /**
  24280. * @internal
  24281. */
  24282. DeepLinker.prototype.init = function () {
  24283. var _this = this;
  24284. // scenario 1: Initial load of all navs from the initial browser URL
  24285. var browserUrl = normalizeUrl(this._location.path());
  24286. (void 0) /* console.debug */;
  24287. // remember this URL in our internal history stack
  24288. this._historyPush(browserUrl);
  24289. // listen for browser URL changes
  24290. this._location.subscribe(function (locationChg) {
  24291. _this._urlChange(normalizeUrl(locationChg.url));
  24292. });
  24293. };
  24294. /**
  24295. * The browser's location has been updated somehow.
  24296. * @internal
  24297. */
  24298. DeepLinker.prototype._urlChange = function (browserUrl) {
  24299. var _this = this;
  24300. // do nothing if this url is the same as the current one
  24301. if (!this._isCurrentUrl(browserUrl)) {
  24302. var isGoingBack = true;
  24303. if (this._isBackUrl(browserUrl)) {
  24304. // scenario 2: user clicked the browser back button
  24305. // scenario 4: user changed the browser URL to what was the back url was
  24306. // scenario 5: user clicked a link href that was the back url
  24307. (void 0) /* console.debug */;
  24308. this._historyPop();
  24309. }
  24310. else {
  24311. // scenario 3: user click forward button
  24312. // scenario 4: user changed browser URL that wasn't the back url
  24313. // scenario 5: user clicked a link href that wasn't the back url
  24314. isGoingBack = false;
  24315. (void 0) /* console.debug */;
  24316. this._historyPush(browserUrl);
  24317. }
  24318. // get the app's root nav container
  24319. var activeNavContainers_1 = this._app.getActiveNavContainers();
  24320. if (activeNavContainers_1 && activeNavContainers_1.length) {
  24321. if (browserUrl === '/') {
  24322. // a url change to the index url
  24323. if (Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["l" /* isPresent */])(this._indexAliasUrl)) {
  24324. // we already know the indexAliasUrl
  24325. // update the url to use the know alias
  24326. browserUrl = this._indexAliasUrl;
  24327. }
  24328. else {
  24329. // the url change is to the root but we don't
  24330. // already know the url used. So let's just
  24331. // reset the root nav to its root page
  24332. activeNavContainers_1.forEach(function (navContainer) {
  24333. navContainer.goToRoot({
  24334. updateUrl: false,
  24335. isNavRoot: true
  24336. });
  24337. });
  24338. return;
  24339. }
  24340. }
  24341. // normal url
  24342. var segments = this.getCurrentSegments(browserUrl);
  24343. segments
  24344. .map(function (segment) {
  24345. // find the matching nav container
  24346. for (var _i = 0, activeNavContainers_2 = activeNavContainers_1; _i < activeNavContainers_2.length; _i++) {
  24347. var navContainer = activeNavContainers_2[_i];
  24348. var nav = getNavFromTree(navContainer, segment.navId);
  24349. if (nav) {
  24350. return {
  24351. segment: segment,
  24352. navContainer: nav
  24353. };
  24354. }
  24355. }
  24356. })
  24357. .filter(function (pair) { return !!pair; })
  24358. .forEach(function (pair) {
  24359. _this._loadViewForSegment(pair.navContainer, pair.segment, function () { });
  24360. });
  24361. }
  24362. }
  24363. };
  24364. DeepLinker.prototype.getCurrentSegments = function (browserUrl) {
  24365. if (!browserUrl) {
  24366. browserUrl = normalizeUrl(this._location.path());
  24367. }
  24368. return this._serializer.parse(browserUrl);
  24369. };
  24370. /**
  24371. * Update the deep linker using the NavController's current active view.
  24372. * @internal
  24373. */
  24374. DeepLinker.prototype.navChange = function (direction) {
  24375. if (direction) {
  24376. var activeNavContainers = this._app.getActiveNavContainers();
  24377. // the only time you'll ever get a TABS here is when loading directly from a URL
  24378. // this method will be called again when the TAB is loaded
  24379. // so just don't worry about the TABS for now
  24380. // if you encounter a TABS, just return
  24381. for (var _i = 0, activeNavContainers_3 = activeNavContainers; _i < activeNavContainers_3.length; _i++) {
  24382. var activeNavContainer = activeNavContainers_3[_i];
  24383. if (Object(__WEBPACK_IMPORTED_MODULE_0__nav_util__["m" /* isTabs */])(activeNavContainer) || activeNavContainer.isTransitioning()) {
  24384. return;
  24385. }
  24386. }
  24387. // okay, get the root navs and build the segments up
  24388. var segments = [];
  24389. var navContainers = this._app.getRootNavs();
  24390. for (var _a = 0, navContainers_1 = navContainers; _a < navContainers_1.length; _a++) {
  24391. var navContainer = navContainers_1[_a];
  24392. var segmentsForNav = this.getSegmentsFromNav(navContainer);
  24393. segments = segments.concat(segmentsForNav);
  24394. }
  24395. segments = segments.filter(function (segment) { return !!segment; });
  24396. if (segments.length) {
  24397. var browserUrl = this._serializer.serialize(segments);
  24398. this._updateLocation(browserUrl, direction);
  24399. }
  24400. }
  24401. };
  24402. DeepLinker.prototype.getSegmentsFromNav = function (nav) {
  24403. var _this = this;
  24404. var segments = [];
  24405. if (Object(__WEBPACK_IMPORTED_MODULE_0__nav_util__["k" /* isNav */])(nav)) {
  24406. segments.push(this.getSegmentFromNav(nav));
  24407. }
  24408. else if (Object(__WEBPACK_IMPORTED_MODULE_0__nav_util__["l" /* isTab */])(nav)) {
  24409. segments.push(this.getSegmentFromTab(nav));
  24410. }
  24411. nav.getActiveChildNavs().forEach(function (child) {
  24412. segments = segments.concat(_this.getSegmentsFromNav(child));
  24413. });
  24414. return segments;
  24415. };
  24416. DeepLinker.prototype.getSegmentFromNav = function (nav, component, data) {
  24417. if (!component) {
  24418. var viewController = nav.getActive(true);
  24419. if (viewController) {
  24420. component = viewController.component;
  24421. data = viewController.data;
  24422. }
  24423. }
  24424. return this._serializer.serializeComponent(nav, component, data);
  24425. };
  24426. DeepLinker.prototype.getSegmentFromTab = function (navContainer, component, data) {
  24427. if (navContainer && navContainer.parent) {
  24428. var tabsNavContainer = navContainer.parent;
  24429. var activeChildNavs = tabsNavContainer.getActiveChildNavs();
  24430. if (activeChildNavs && activeChildNavs.length) {
  24431. var activeChildNav = activeChildNavs[0];
  24432. var viewController = activeChildNav.getActive(true);
  24433. if (viewController) {
  24434. component = viewController.component;
  24435. data = viewController.data;
  24436. }
  24437. return this._serializer.serializeComponent(tabsNavContainer, component, data);
  24438. }
  24439. }
  24440. };
  24441. /**
  24442. * @internal
  24443. */
  24444. DeepLinker.prototype._updateLocation = function (browserUrl, direction) {
  24445. if (this._indexAliasUrl === browserUrl) {
  24446. browserUrl = '/';
  24447. }
  24448. if (direction === __WEBPACK_IMPORTED_MODULE_0__nav_util__["a" /* DIRECTION_BACK */] && this._isBackUrl(browserUrl)) {
  24449. // this URL is exactly the same as the back URL
  24450. // it's safe to use the browser's location.back()
  24451. (void 0) /* console.debug */;
  24452. this._historyPop();
  24453. this._location.back();
  24454. }
  24455. else if (!this._isCurrentUrl(browserUrl)) {
  24456. // probably navigating forward
  24457. (void 0) /* console.debug */;
  24458. this._historyPush(browserUrl);
  24459. this._location.go(browserUrl);
  24460. }
  24461. };
  24462. DeepLinker.prototype.getComponentFromName = function (componentName) {
  24463. var link = this._serializer.getLinkFromName(componentName);
  24464. if (link) {
  24465. // cool, we found the right link for this component name
  24466. return this.getNavLinkComponent(link);
  24467. }
  24468. // umm, idk
  24469. return Promise.reject("invalid link: " + componentName);
  24470. };
  24471. DeepLinker.prototype.getNavLinkComponent = function (link) {
  24472. if (link.component) {
  24473. // sweet, we're already got a component loaded for this link
  24474. return Promise.resolve(link.component);
  24475. }
  24476. if (link.loadChildren) {
  24477. // awesome, looks like we'll lazy load this component
  24478. // using loadChildren as the URL to request
  24479. return this._moduleLoader.load(link.loadChildren).then(function (response) {
  24480. link.component = response.component;
  24481. return response.component;
  24482. });
  24483. }
  24484. return Promise.reject("invalid link component: " + link.name);
  24485. };
  24486. /**
  24487. * @internal
  24488. */
  24489. DeepLinker.prototype.resolveComponent = function (component) {
  24490. var cfr = this._moduleLoader.getComponentFactoryResolver(component);
  24491. if (!cfr) {
  24492. cfr = this._baseCfr;
  24493. }
  24494. return cfr.resolveComponentFactory(component);
  24495. };
  24496. /**
  24497. * @internal
  24498. */
  24499. DeepLinker.prototype.createUrl = function (navContainer, nameOrComponent, _data, prepareExternalUrl) {
  24500. if (prepareExternalUrl === void 0) { prepareExternalUrl = true; }
  24501. // create a segment out of just the passed in name
  24502. var segment = this._serializer.createSegmentFromName(navContainer, nameOrComponent);
  24503. var allSegments = this.getCurrentSegments();
  24504. if (segment) {
  24505. for (var i = 0; i < allSegments.length; i++) {
  24506. if (allSegments[i].navId === navContainer.name || allSegments[i].navId === navContainer.id) {
  24507. allSegments[i] = segment;
  24508. var url = this._serializer.serialize(allSegments);
  24509. return prepareExternalUrl ? this._location.prepareExternalUrl(url) : url;
  24510. }
  24511. }
  24512. }
  24513. return '';
  24514. };
  24515. /**
  24516. * Each NavController will call this method when it initializes for
  24517. * the first time. This allows each NavController to figure out
  24518. * where it lives in the path and load up the correct component.
  24519. * @internal
  24520. */
  24521. DeepLinker.prototype.getSegmentByNavIdOrName = function (navId, name) {
  24522. var browserUrl = normalizeUrl(this._location.path());
  24523. var segments = this._serializer.parse(browserUrl);
  24524. for (var _i = 0, segments_1 = segments; _i < segments_1.length; _i++) {
  24525. var segment = segments_1[_i];
  24526. if (segment.navId === navId || segment.navId === name) {
  24527. return segment;
  24528. }
  24529. }
  24530. return null;
  24531. };
  24532. /**
  24533. * @internal
  24534. */
  24535. DeepLinker.prototype.initViews = function (segment) {
  24536. var _this = this;
  24537. var link = this._serializer.getLinkFromName(segment.name);
  24538. return this.getNavLinkComponent(link).then(function (component) {
  24539. segment.component = component;
  24540. var view = new __WEBPACK_IMPORTED_MODULE_3__view_controller__["a" /* ViewController */](component, segment.data);
  24541. view.id = segment.id;
  24542. if (Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["e" /* isArray */])(segment.defaultHistory)) {
  24543. return Object(__WEBPACK_IMPORTED_MODULE_0__nav_util__["i" /* convertToViews */])(_this, segment.defaultHistory).then(function (views) {
  24544. views.push(view);
  24545. return views;
  24546. });
  24547. }
  24548. return [view];
  24549. });
  24550. };
  24551. /**
  24552. * @internal
  24553. */
  24554. DeepLinker.prototype._isBackUrl = function (browserUrl) {
  24555. return (browserUrl === this._history[this._history.length - 2]);
  24556. };
  24557. /**
  24558. * @internal
  24559. */
  24560. DeepLinker.prototype._isCurrentUrl = function (browserUrl) {
  24561. return (browserUrl === this._history[this._history.length - 1]);
  24562. };
  24563. /**
  24564. * @internal
  24565. */
  24566. DeepLinker.prototype._historyPush = function (browserUrl) {
  24567. if (!this._isCurrentUrl(browserUrl)) {
  24568. this._history.push(browserUrl);
  24569. if (this._history.length > 30) {
  24570. this._history.shift();
  24571. }
  24572. }
  24573. };
  24574. /**
  24575. * @internal
  24576. */
  24577. DeepLinker.prototype._historyPop = function () {
  24578. this._history.pop();
  24579. if (!this._history.length) {
  24580. this._historyPush(this._location.path());
  24581. }
  24582. };
  24583. /**
  24584. * @internal
  24585. */
  24586. DeepLinker.prototype._getTabSelector = function (tab) {
  24587. if (Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["l" /* isPresent */])(tab.tabUrlPath)) {
  24588. return tab.tabUrlPath;
  24589. }
  24590. if (Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["l" /* isPresent */])(tab.tabTitle)) {
  24591. return Object(__WEBPACK_IMPORTED_MODULE_2__url_serializer__["c" /* formatUrlPart */])(tab.tabTitle);
  24592. }
  24593. return "tab-" + tab.index;
  24594. };
  24595. /**
  24596. * Using the known Path of Segments, walk down all descendents
  24597. * from the root NavController and load each NavController according
  24598. * to each Segment. This is usually called after a browser URL and
  24599. * Path changes and needs to update all NavControllers to match
  24600. * the new browser URL. Because the URL is already known, it will
  24601. * not update the browser's URL when transitions have completed.
  24602. *
  24603. * @internal
  24604. */
  24605. DeepLinker.prototype._loadViewForSegment = function (navContainer, segment, done) {
  24606. if (!segment) {
  24607. return done(false, false);
  24608. }
  24609. if (Object(__WEBPACK_IMPORTED_MODULE_0__nav_util__["m" /* isTabs */])(navContainer) || (Object(__WEBPACK_IMPORTED_MODULE_0__nav_util__["l" /* isTab */])(navContainer) && navContainer.parent)) {
  24610. var tabs = (Object(__WEBPACK_IMPORTED_MODULE_0__nav_util__["m" /* isTabs */])(navContainer) ? navContainer : navContainer.parent);
  24611. var selectedIndex = tabs._getSelectedTabIndex(segment.secondaryId);
  24612. var tab = tabs.getByIndex(selectedIndex);
  24613. tab._segment = segment;
  24614. tabs.select(tab, {
  24615. updateUrl: false,
  24616. animate: false
  24617. }, true);
  24618. return done(false, false);
  24619. }
  24620. var navController = navContainer;
  24621. var numViews = navController.length() - 1;
  24622. // walk backwards to see if the exact view we want to show here
  24623. // is already in the stack that we can just pop back to
  24624. for (var i = numViews; i >= 0; i--) {
  24625. var viewController = navController.getByIndex(i);
  24626. if (viewController && (viewController.id === segment.id || viewController.id === segment.name)) {
  24627. // hooray! we've already got a view loaded in the stack
  24628. // matching the view they wanted to show
  24629. if (i === numViews) {
  24630. // this is the last view in the stack and it's the same
  24631. // as the segment so there's no change needed
  24632. return done(false, false);
  24633. }
  24634. else {
  24635. // it's not the exact view as the end
  24636. // let's have this nav go back to this exact view
  24637. return navController.popTo(viewController, {
  24638. animate: false,
  24639. updateUrl: false,
  24640. }, done);
  24641. }
  24642. }
  24643. }
  24644. // ok, so we don't know about a view that they're navigating to
  24645. // so we might as well just call setRoot and make tthe view the first view
  24646. // this seems like the least bad option
  24647. return navController.setRoot(segment.component || segment.name, segment.data, {
  24648. id: segment.id, animate: false, updateUrl: false
  24649. }, done);
  24650. };
  24651. return DeepLinker;
  24652. }());
  24653. function setupDeepLinker(app, serializer, location, moduleLoader, cfr) {
  24654. var deepLinker = new DeepLinker(app, serializer, location, moduleLoader, cfr);
  24655. deepLinker.init();
  24656. return deepLinker;
  24657. }
  24658. function normalizeUrl(browserUrl) {
  24659. browserUrl = browserUrl.trim();
  24660. if (browserUrl.charAt(0) !== '/') {
  24661. // ensure first char is a /
  24662. browserUrl = '/' + browserUrl;
  24663. }
  24664. if (browserUrl.length > 1 && browserUrl.charAt(browserUrl.length - 1) === '/') {
  24665. // ensure last char is not a /
  24666. browserUrl = browserUrl.substr(0, browserUrl.length - 1);
  24667. }
  24668. return browserUrl;
  24669. }
  24670. function getNavFromTree(nav, id) {
  24671. while (nav) {
  24672. if (nav.id === id || nav.name === id) {
  24673. return nav;
  24674. }
  24675. nav = nav.parent;
  24676. }
  24677. return null;
  24678. }
  24679. //# sourceMappingURL=deep-linker.js.map
  24680. /***/ }),
  24681. /* 15 */
  24682. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  24683. "use strict";
  24684. /* unused harmony export AbstractControlDirective */
  24685. /* unused harmony export AbstractFormGroupDirective */
  24686. /* unused harmony export CheckboxControlValueAccessor */
  24687. /* unused harmony export ControlContainer */
  24688. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return NG_VALUE_ACCESSOR; });
  24689. /* unused harmony export COMPOSITION_BUFFER_MODE */
  24690. /* unused harmony export DefaultValueAccessor */
  24691. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return NgControl; });
  24692. /* unused harmony export NgControlStatus */
  24693. /* unused harmony export NgControlStatusGroup */
  24694. /* unused harmony export NgForm */
  24695. /* unused harmony export NgModel */
  24696. /* unused harmony export NgModelGroup */
  24697. /* unused harmony export RadioControlValueAccessor */
  24698. /* unused harmony export FormControlDirective */
  24699. /* unused harmony export FormControlName */
  24700. /* unused harmony export FormGroupDirective */
  24701. /* unused harmony export FormArrayName */
  24702. /* unused harmony export FormGroupName */
  24703. /* unused harmony export NgSelectOption */
  24704. /* unused harmony export SelectControlValueAccessor */
  24705. /* unused harmony export SelectMultipleControlValueAccessor */
  24706. /* unused harmony export CheckboxRequiredValidator */
  24707. /* unused harmony export EmailValidator */
  24708. /* unused harmony export MaxLengthValidator */
  24709. /* unused harmony export MinLengthValidator */
  24710. /* unused harmony export PatternValidator */
  24711. /* unused harmony export RequiredValidator */
  24712. /* unused harmony export FormBuilder */
  24713. /* unused harmony export AbstractControl */
  24714. /* unused harmony export FormArray */
  24715. /* unused harmony export FormControl */
  24716. /* unused harmony export FormGroup */
  24717. /* unused harmony export NG_ASYNC_VALIDATORS */
  24718. /* unused harmony export NG_VALIDATORS */
  24719. /* unused harmony export Validators */
  24720. /* unused harmony export VERSION */
  24721. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FormsModule; });
  24722. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return ReactiveFormsModule; });
  24723. /* unused harmony export ɵba */
  24724. /* unused harmony export ɵz */
  24725. /* unused harmony export ɵx */
  24726. /* unused harmony export ɵy */
  24727. /* unused harmony export ɵa */
  24728. /* unused harmony export ɵb */
  24729. /* unused harmony export ɵc */
  24730. /* unused harmony export ɵd */
  24731. /* unused harmony export ɵe */
  24732. /* unused harmony export ɵf */
  24733. /* unused harmony export ɵg */
  24734. /* unused harmony export ɵbf */
  24735. /* unused harmony export ɵbb */
  24736. /* unused harmony export ɵbc */
  24737. /* unused harmony export ɵh */
  24738. /* unused harmony export ɵi */
  24739. /* unused harmony export ɵbd */
  24740. /* unused harmony export ɵbe */
  24741. /* unused harmony export ɵj */
  24742. /* unused harmony export ɵk */
  24743. /* unused harmony export ɵl */
  24744. /* unused harmony export ɵn */
  24745. /* unused harmony export ɵm */
  24746. /* unused harmony export ɵo */
  24747. /* unused harmony export ɵq */
  24748. /* unused harmony export ɵp */
  24749. /* unused harmony export ɵs */
  24750. /* unused harmony export ɵt */
  24751. /* unused harmony export ɵv */
  24752. /* unused harmony export ɵu */
  24753. /* unused harmony export ɵw */
  24754. /* unused harmony export ɵr */
  24755. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(25);
  24756. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
  24757. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_observable_forkJoin__ = __webpack_require__(233);
  24758. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_observable_forkJoin___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_observable_forkJoin__);
  24759. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_observable_fromPromise__ = __webpack_require__(235);
  24760. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_observable_fromPromise___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_observable_fromPromise__);
  24761. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_map__ = __webpack_require__(127);
  24762. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_map___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_rxjs_operator_map__);
  24763. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__angular_platform_browser__ = __webpack_require__(31);
  24764. /**
  24765. * @license Angular v5.2.11
  24766. * (c) 2010-2018 Google, Inc. https://angular.io/
  24767. * License: MIT
  24768. */
  24769. /**
  24770. * @fileoverview added by tsickle
  24771. * @suppress {checkTypes} checked by tsc
  24772. */
  24773. /**
  24774. * @license
  24775. * Copyright Google Inc. All Rights Reserved.
  24776. *
  24777. * Use of this source code is governed by an MIT-style license that can be
  24778. * found in the LICENSE file at https://angular.io/license
  24779. */
  24780. /**
  24781. * Base class for control directives.
  24782. *
  24783. * Only used internally in the forms module.
  24784. *
  24785. * \@stable
  24786. * @abstract
  24787. */
  24788. var AbstractControlDirective = /** @class */ (function () {
  24789. function AbstractControlDirective() {
  24790. }
  24791. Object.defineProperty(AbstractControlDirective.prototype, "value", {
  24792. /** The value of the control. */
  24793. get: /**
  24794. * The value of the control.
  24795. * @return {?}
  24796. */
  24797. function () { return this.control ? this.control.value : null; },
  24798. enumerable: true,
  24799. configurable: true
  24800. });
  24801. Object.defineProperty(AbstractControlDirective.prototype, "valid", {
  24802. /**
  24803. * A control is `valid` when its `status === VALID`.
  24804. *
  24805. * In order to have this status, the control must have passed all its
  24806. * validation checks.
  24807. */
  24808. get: /**
  24809. * A control is `valid` when its `status === VALID`.
  24810. *
  24811. * In order to have this status, the control must have passed all its
  24812. * validation checks.
  24813. * @return {?}
  24814. */
  24815. function () { return this.control ? this.control.valid : null; },
  24816. enumerable: true,
  24817. configurable: true
  24818. });
  24819. Object.defineProperty(AbstractControlDirective.prototype, "invalid", {
  24820. /**
  24821. * A control is `invalid` when its `status === INVALID`.
  24822. *
  24823. * In order to have this status, the control must have failed
  24824. * at least one of its validation checks.
  24825. */
  24826. get: /**
  24827. * A control is `invalid` when its `status === INVALID`.
  24828. *
  24829. * In order to have this status, the control must have failed
  24830. * at least one of its validation checks.
  24831. * @return {?}
  24832. */
  24833. function () { return this.control ? this.control.invalid : null; },
  24834. enumerable: true,
  24835. configurable: true
  24836. });
  24837. Object.defineProperty(AbstractControlDirective.prototype, "pending", {
  24838. /**
  24839. * A control is `pending` when its `status === PENDING`.
  24840. *
  24841. * In order to have this status, the control must be in the
  24842. * middle of conducting a validation check.
  24843. */
  24844. get: /**
  24845. * A control is `pending` when its `status === PENDING`.
  24846. *
  24847. * In order to have this status, the control must be in the
  24848. * middle of conducting a validation check.
  24849. * @return {?}
  24850. */
  24851. function () { return this.control ? this.control.pending : null; },
  24852. enumerable: true,
  24853. configurable: true
  24854. });
  24855. Object.defineProperty(AbstractControlDirective.prototype, "disabled", {
  24856. /**
  24857. * A control is `disabled` when its `status === DISABLED`.
  24858. *
  24859. * Disabled controls are exempt from validation checks and
  24860. * are not included in the aggregate value of their ancestor
  24861. * controls.
  24862. */
  24863. get: /**
  24864. * A control is `disabled` when its `status === DISABLED`.
  24865. *
  24866. * Disabled controls are exempt from validation checks and
  24867. * are not included in the aggregate value of their ancestor
  24868. * controls.
  24869. * @return {?}
  24870. */
  24871. function () { return this.control ? this.control.disabled : null; },
  24872. enumerable: true,
  24873. configurable: true
  24874. });
  24875. Object.defineProperty(AbstractControlDirective.prototype, "enabled", {
  24876. /**
  24877. * A control is `enabled` as long as its `status !== DISABLED`.
  24878. *
  24879. * In other words, it has a status of `VALID`, `INVALID`, or
  24880. * `PENDING`.
  24881. */
  24882. get: /**
  24883. * A control is `enabled` as long as its `status !== DISABLED`.
  24884. *
  24885. * In other words, it has a status of `VALID`, `INVALID`, or
  24886. * `PENDING`.
  24887. * @return {?}
  24888. */
  24889. function () { return this.control ? this.control.enabled : null; },
  24890. enumerable: true,
  24891. configurable: true
  24892. });
  24893. Object.defineProperty(AbstractControlDirective.prototype, "errors", {
  24894. /**
  24895. * Returns any errors generated by failing validation. If there
  24896. * are no errors, it will return null.
  24897. */
  24898. get: /**
  24899. * Returns any errors generated by failing validation. If there
  24900. * are no errors, it will return null.
  24901. * @return {?}
  24902. */
  24903. function () { return this.control ? this.control.errors : null; },
  24904. enumerable: true,
  24905. configurable: true
  24906. });
  24907. Object.defineProperty(AbstractControlDirective.prototype, "pristine", {
  24908. /**
  24909. * A control is `pristine` if the user has not yet changed
  24910. * the value in the UI.
  24911. *
  24912. * Note that programmatic changes to a control's value will
  24913. * *not* mark it dirty.
  24914. */
  24915. get: /**
  24916. * A control is `pristine` if the user has not yet changed
  24917. * the value in the UI.
  24918. *
  24919. * Note that programmatic changes to a control's value will
  24920. * *not* mark it dirty.
  24921. * @return {?}
  24922. */
  24923. function () { return this.control ? this.control.pristine : null; },
  24924. enumerable: true,
  24925. configurable: true
  24926. });
  24927. Object.defineProperty(AbstractControlDirective.prototype, "dirty", {
  24928. /**
  24929. * A control is `dirty` if the user has changed the value
  24930. * in the UI.
  24931. *
  24932. * Note that programmatic changes to a control's value will
  24933. * *not* mark it dirty.
  24934. */
  24935. get: /**
  24936. * A control is `dirty` if the user has changed the value
  24937. * in the UI.
  24938. *
  24939. * Note that programmatic changes to a control's value will
  24940. * *not* mark it dirty.
  24941. * @return {?}
  24942. */
  24943. function () { return this.control ? this.control.dirty : null; },
  24944. enumerable: true,
  24945. configurable: true
  24946. });
  24947. Object.defineProperty(AbstractControlDirective.prototype, "touched", {
  24948. /**
  24949. * A control is marked `touched` once the user has triggered
  24950. * a `blur` event on it.
  24951. */
  24952. get: /**
  24953. * A control is marked `touched` once the user has triggered
  24954. * a `blur` event on it.
  24955. * @return {?}
  24956. */
  24957. function () { return this.control ? this.control.touched : null; },
  24958. enumerable: true,
  24959. configurable: true
  24960. });
  24961. Object.defineProperty(AbstractControlDirective.prototype, "status", {
  24962. get: /**
  24963. * @return {?}
  24964. */
  24965. function () { return this.control ? this.control.status : null; },
  24966. enumerable: true,
  24967. configurable: true
  24968. });
  24969. Object.defineProperty(AbstractControlDirective.prototype, "untouched", {
  24970. /**
  24971. * A control is `untouched` if the user has not yet triggered
  24972. * a `blur` event on it.
  24973. */
  24974. get: /**
  24975. * A control is `untouched` if the user has not yet triggered
  24976. * a `blur` event on it.
  24977. * @return {?}
  24978. */
  24979. function () { return this.control ? this.control.untouched : null; },
  24980. enumerable: true,
  24981. configurable: true
  24982. });
  24983. Object.defineProperty(AbstractControlDirective.prototype, "statusChanges", {
  24984. /**
  24985. * Emits an event every time the validation status of the control
  24986. * is re-calculated.
  24987. */
  24988. get: /**
  24989. * Emits an event every time the validation status of the control
  24990. * is re-calculated.
  24991. * @return {?}
  24992. */
  24993. function () {
  24994. return this.control ? this.control.statusChanges : null;
  24995. },
  24996. enumerable: true,
  24997. configurable: true
  24998. });
  24999. Object.defineProperty(AbstractControlDirective.prototype, "valueChanges", {
  25000. /**
  25001. * Emits an event every time the value of the control changes, in
  25002. * the UI or programmatically.
  25003. */
  25004. get: /**
  25005. * Emits an event every time the value of the control changes, in
  25006. * the UI or programmatically.
  25007. * @return {?}
  25008. */
  25009. function () {
  25010. return this.control ? this.control.valueChanges : null;
  25011. },
  25012. enumerable: true,
  25013. configurable: true
  25014. });
  25015. Object.defineProperty(AbstractControlDirective.prototype, "path", {
  25016. /**
  25017. * Returns an array that represents the path from the top-level form
  25018. * to this control. Each index is the string name of the control on
  25019. * that level.
  25020. */
  25021. get: /**
  25022. * Returns an array that represents the path from the top-level form
  25023. * to this control. Each index is the string name of the control on
  25024. * that level.
  25025. * @return {?}
  25026. */
  25027. function () { return null; },
  25028. enumerable: true,
  25029. configurable: true
  25030. });
  25031. /**
  25032. * Resets the form control. This means by default:
  25033. *
  25034. * * it is marked as `pristine`
  25035. * * it is marked as `untouched`
  25036. * * value is set to null
  25037. *
  25038. * For more information, see {@link AbstractControl}.
  25039. */
  25040. /**
  25041. * Resets the form control. This means by default:
  25042. *
  25043. * * it is marked as `pristine`
  25044. * * it is marked as `untouched`
  25045. * * value is set to null
  25046. *
  25047. * For more information, see {\@link AbstractControl}.
  25048. * @param {?=} value
  25049. * @return {?}
  25050. */
  25051. AbstractControlDirective.prototype.reset = /**
  25052. * Resets the form control. This means by default:
  25053. *
  25054. * * it is marked as `pristine`
  25055. * * it is marked as `untouched`
  25056. * * value is set to null
  25057. *
  25058. * For more information, see {\@link AbstractControl}.
  25059. * @param {?=} value
  25060. * @return {?}
  25061. */
  25062. function (value) {
  25063. if (value === void 0) { value = undefined; }
  25064. if (this.control)
  25065. this.control.reset(value);
  25066. };
  25067. /**
  25068. * Returns true if the control with the given path has the error specified. Otherwise
  25069. * returns false.
  25070. *
  25071. * If no path is given, it checks for the error on the present control.
  25072. */
  25073. /**
  25074. * Returns true if the control with the given path has the error specified. Otherwise
  25075. * returns false.
  25076. *
  25077. * If no path is given, it checks for the error on the present control.
  25078. * @param {?} errorCode
  25079. * @param {?=} path
  25080. * @return {?}
  25081. */
  25082. AbstractControlDirective.prototype.hasError = /**
  25083. * Returns true if the control with the given path has the error specified. Otherwise
  25084. * returns false.
  25085. *
  25086. * If no path is given, it checks for the error on the present control.
  25087. * @param {?} errorCode
  25088. * @param {?=} path
  25089. * @return {?}
  25090. */
  25091. function (errorCode, path) {
  25092. return this.control ? this.control.hasError(errorCode, path) : false;
  25093. };
  25094. /**
  25095. * Returns error data if the control with the given path has the error specified. Otherwise
  25096. * returns null or undefined.
  25097. *
  25098. * If no path is given, it checks for the error on the present control.
  25099. */
  25100. /**
  25101. * Returns error data if the control with the given path has the error specified. Otherwise
  25102. * returns null or undefined.
  25103. *
  25104. * If no path is given, it checks for the error on the present control.
  25105. * @param {?} errorCode
  25106. * @param {?=} path
  25107. * @return {?}
  25108. */
  25109. AbstractControlDirective.prototype.getError = /**
  25110. * Returns error data if the control with the given path has the error specified. Otherwise
  25111. * returns null or undefined.
  25112. *
  25113. * If no path is given, it checks for the error on the present control.
  25114. * @param {?} errorCode
  25115. * @param {?=} path
  25116. * @return {?}
  25117. */
  25118. function (errorCode, path) {
  25119. return this.control ? this.control.getError(errorCode, path) : null;
  25120. };
  25121. return AbstractControlDirective;
  25122. }());
  25123. /**
  25124. * @fileoverview added by tsickle
  25125. * @suppress {checkTypes} checked by tsc
  25126. */
  25127. /**
  25128. * @license
  25129. * Copyright Google Inc. All Rights Reserved.
  25130. *
  25131. * Use of this source code is governed by an MIT-style license that can be
  25132. * found in the LICENSE file at https://angular.io/license
  25133. */
  25134. /**
  25135. * A directive that contains multiple {\@link NgControl}s.
  25136. *
  25137. * Only used by the forms module.
  25138. *
  25139. * \@stable
  25140. * @abstract
  25141. */
  25142. var ControlContainer = /** @class */ (function (_super) {
  25143. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(ControlContainer, _super);
  25144. function ControlContainer() {
  25145. return _super !== null && _super.apply(this, arguments) || this;
  25146. }
  25147. Object.defineProperty(ControlContainer.prototype, "formDirective", {
  25148. /**
  25149. * Get the form to which this container belongs.
  25150. */
  25151. get: /**
  25152. * Get the form to which this container belongs.
  25153. * @return {?}
  25154. */
  25155. function () { return null; },
  25156. enumerable: true,
  25157. configurable: true
  25158. });
  25159. Object.defineProperty(ControlContainer.prototype, "path", {
  25160. /**
  25161. * Get the path to this container.
  25162. */
  25163. get: /**
  25164. * Get the path to this container.
  25165. * @return {?}
  25166. */
  25167. function () { return null; },
  25168. enumerable: true,
  25169. configurable: true
  25170. });
  25171. return ControlContainer;
  25172. }(AbstractControlDirective));
  25173. /**
  25174. * @fileoverview added by tsickle
  25175. * @suppress {checkTypes} checked by tsc
  25176. */
  25177. /**
  25178. * @license
  25179. * Copyright Google Inc. All Rights Reserved.
  25180. *
  25181. * Use of this source code is governed by an MIT-style license that can be
  25182. * found in the LICENSE file at https://angular.io/license
  25183. */
  25184. /**
  25185. * @param {?} value
  25186. * @return {?}
  25187. */
  25188. function isEmptyInputValue(value) {
  25189. // we don't check for string here so it also works with arrays
  25190. return value == null || value.length === 0;
  25191. }
  25192. /**
  25193. * Providers for validators to be used for {\@link FormControl}s in a form.
  25194. *
  25195. * Provide this using `multi: true` to add validators.
  25196. *
  25197. * ### Example
  25198. *
  25199. * ```typescript
  25200. * \@Directive({
  25201. * selector: '[custom-validator]',
  25202. * providers: [{provide: NG_VALIDATORS, useExisting: CustomValidatorDirective, multi: true}]
  25203. * })
  25204. * class CustomValidatorDirective implements Validator {
  25205. * validate(control: AbstractControl): ValidationErrors | null {
  25206. * return {"custom": true};
  25207. * }
  25208. * }
  25209. * ```
  25210. *
  25211. * \@stable
  25212. */
  25213. var NG_VALIDATORS = new __WEBPACK_IMPORTED_MODULE_1__angular_core__["B" /* InjectionToken */]('NgValidators');
  25214. /**
  25215. * Providers for asynchronous validators to be used for {\@link FormControl}s
  25216. * in a form.
  25217. *
  25218. * Provide this using `multi: true` to add validators.
  25219. *
  25220. * See {\@link NG_VALIDATORS} for more details.
  25221. *
  25222. * \@stable
  25223. */
  25224. var NG_ASYNC_VALIDATORS = new __WEBPACK_IMPORTED_MODULE_1__angular_core__["B" /* InjectionToken */]('NgAsyncValidators');
  25225. var EMAIL_REGEXP = /^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(\.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/;
  25226. /**
  25227. * Provides a set of validators used by form controls.
  25228. *
  25229. * A validator is a function that processes a {\@link FormControl} or collection of
  25230. * controls and returns a map of errors. A null map means that validation has passed.
  25231. *
  25232. * ### Example
  25233. *
  25234. * ```typescript
  25235. * var loginControl = new FormControl("", Validators.required)
  25236. * ```
  25237. *
  25238. * \@stable
  25239. */
  25240. var Validators = /** @class */ (function () {
  25241. function Validators() {
  25242. }
  25243. /**
  25244. * Validator that requires controls to have a value greater than a number.
  25245. *`min()` exists only as a function, not as a directive. For example,
  25246. * `control = new FormControl('', Validators.min(3));`.
  25247. */
  25248. /**
  25249. * Validator that requires controls to have a value greater than a number.
  25250. * `min()` exists only as a function, not as a directive. For example,
  25251. * `control = new FormControl('', Validators.min(3));`.
  25252. * @param {?} min
  25253. * @return {?}
  25254. */
  25255. Validators.min = /**
  25256. * Validator that requires controls to have a value greater than a number.
  25257. * `min()` exists only as a function, not as a directive. For example,
  25258. * `control = new FormControl('', Validators.min(3));`.
  25259. * @param {?} min
  25260. * @return {?}
  25261. */
  25262. function (min) {
  25263. return function (control) {
  25264. if (isEmptyInputValue(control.value) || isEmptyInputValue(min)) {
  25265. return null; // don't validate empty values to allow optional controls
  25266. }
  25267. var /** @type {?} */ value = parseFloat(control.value);
  25268. // Controls with NaN values after parsing should be treated as not having a
  25269. // minimum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-min
  25270. return !isNaN(value) && value < min ? { 'min': { 'min': min, 'actual': control.value } } : null;
  25271. };
  25272. };
  25273. /**
  25274. * Validator that requires controls to have a value less than a number.
  25275. * `max()` exists only as a function, not as a directive. For example,
  25276. * `control = new FormControl('', Validators.max(15));`.
  25277. */
  25278. /**
  25279. * Validator that requires controls to have a value less than a number.
  25280. * `max()` exists only as a function, not as a directive. For example,
  25281. * `control = new FormControl('', Validators.max(15));`.
  25282. * @param {?} max
  25283. * @return {?}
  25284. */
  25285. Validators.max = /**
  25286. * Validator that requires controls to have a value less than a number.
  25287. * `max()` exists only as a function, not as a directive. For example,
  25288. * `control = new FormControl('', Validators.max(15));`.
  25289. * @param {?} max
  25290. * @return {?}
  25291. */
  25292. function (max) {
  25293. return function (control) {
  25294. if (isEmptyInputValue(control.value) || isEmptyInputValue(max)) {
  25295. return null; // don't validate empty values to allow optional controls
  25296. }
  25297. var /** @type {?} */ value = parseFloat(control.value);
  25298. // Controls with NaN values after parsing should be treated as not having a
  25299. // maximum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-max
  25300. return !isNaN(value) && value > max ? { 'max': { 'max': max, 'actual': control.value } } : null;
  25301. };
  25302. };
  25303. /**
  25304. * Validator that requires controls to have a non-empty value.
  25305. */
  25306. /**
  25307. * Validator that requires controls to have a non-empty value.
  25308. * @param {?} control
  25309. * @return {?}
  25310. */
  25311. Validators.required = /**
  25312. * Validator that requires controls to have a non-empty value.
  25313. * @param {?} control
  25314. * @return {?}
  25315. */
  25316. function (control) {
  25317. return isEmptyInputValue(control.value) ? { 'required': true } : null;
  25318. };
  25319. /**
  25320. * Validator that requires control value to be true.
  25321. */
  25322. /**
  25323. * Validator that requires control value to be true.
  25324. * @param {?} control
  25325. * @return {?}
  25326. */
  25327. Validators.requiredTrue = /**
  25328. * Validator that requires control value to be true.
  25329. * @param {?} control
  25330. * @return {?}
  25331. */
  25332. function (control) {
  25333. return control.value === true ? null : { 'required': true };
  25334. };
  25335. /**
  25336. * Validator that performs email validation.
  25337. */
  25338. /**
  25339. * Validator that performs email validation.
  25340. * @param {?} control
  25341. * @return {?}
  25342. */
  25343. Validators.email = /**
  25344. * Validator that performs email validation.
  25345. * @param {?} control
  25346. * @return {?}
  25347. */
  25348. function (control) {
  25349. return EMAIL_REGEXP.test(control.value) ? null : { 'email': true };
  25350. };
  25351. /**
  25352. * Validator that requires controls to have a value of a minimum length.
  25353. */
  25354. /**
  25355. * Validator that requires controls to have a value of a minimum length.
  25356. * @param {?} minLength
  25357. * @return {?}
  25358. */
  25359. Validators.minLength = /**
  25360. * Validator that requires controls to have a value of a minimum length.
  25361. * @param {?} minLength
  25362. * @return {?}
  25363. */
  25364. function (minLength) {
  25365. return function (control) {
  25366. if (isEmptyInputValue(control.value)) {
  25367. return null; // don't validate empty values to allow optional controls
  25368. }
  25369. var /** @type {?} */ length = control.value ? control.value.length : 0;
  25370. return length < minLength ?
  25371. { 'minlength': { 'requiredLength': minLength, 'actualLength': length } } :
  25372. null;
  25373. };
  25374. };
  25375. /**
  25376. * Validator that requires controls to have a value of a maximum length.
  25377. */
  25378. /**
  25379. * Validator that requires controls to have a value of a maximum length.
  25380. * @param {?} maxLength
  25381. * @return {?}
  25382. */
  25383. Validators.maxLength = /**
  25384. * Validator that requires controls to have a value of a maximum length.
  25385. * @param {?} maxLength
  25386. * @return {?}
  25387. */
  25388. function (maxLength) {
  25389. return function (control) {
  25390. var /** @type {?} */ length = control.value ? control.value.length : 0;
  25391. return length > maxLength ?
  25392. { 'maxlength': { 'requiredLength': maxLength, 'actualLength': length } } :
  25393. null;
  25394. };
  25395. };
  25396. /**
  25397. * Validator that requires a control to match a regex to its value.
  25398. */
  25399. /**
  25400. * Validator that requires a control to match a regex to its value.
  25401. * @param {?} pattern
  25402. * @return {?}
  25403. */
  25404. Validators.pattern = /**
  25405. * Validator that requires a control to match a regex to its value.
  25406. * @param {?} pattern
  25407. * @return {?}
  25408. */
  25409. function (pattern) {
  25410. if (!pattern)
  25411. return Validators.nullValidator;
  25412. var /** @type {?} */ regex;
  25413. var /** @type {?} */ regexStr;
  25414. if (typeof pattern === 'string') {
  25415. regexStr = '';
  25416. if (pattern.charAt(0) !== '^')
  25417. regexStr += '^';
  25418. regexStr += pattern;
  25419. if (pattern.charAt(pattern.length - 1) !== '$')
  25420. regexStr += '$';
  25421. regex = new RegExp(regexStr);
  25422. }
  25423. else {
  25424. regexStr = pattern.toString();
  25425. regex = pattern;
  25426. }
  25427. return function (control) {
  25428. if (isEmptyInputValue(control.value)) {
  25429. return null; // don't validate empty values to allow optional controls
  25430. }
  25431. var /** @type {?} */ value = control.value;
  25432. return regex.test(value) ? null :
  25433. { 'pattern': { 'requiredPattern': regexStr, 'actualValue': value } };
  25434. };
  25435. };
  25436. /**
  25437. * No-op validator.
  25438. */
  25439. /**
  25440. * No-op validator.
  25441. * @param {?} c
  25442. * @return {?}
  25443. */
  25444. Validators.nullValidator = /**
  25445. * No-op validator.
  25446. * @param {?} c
  25447. * @return {?}
  25448. */
  25449. function (c) { return null; };
  25450. /**
  25451. * @param {?} validators
  25452. * @return {?}
  25453. */
  25454. Validators.compose = /**
  25455. * @param {?} validators
  25456. * @return {?}
  25457. */
  25458. function (validators) {
  25459. if (!validators)
  25460. return null;
  25461. var /** @type {?} */ presentValidators = /** @type {?} */ (validators.filter(isPresent));
  25462. if (presentValidators.length == 0)
  25463. return null;
  25464. return function (control) {
  25465. return _mergeErrors(_executeValidators(control, presentValidators));
  25466. };
  25467. };
  25468. /**
  25469. * @param {?} validators
  25470. * @return {?}
  25471. */
  25472. Validators.composeAsync = /**
  25473. * @param {?} validators
  25474. * @return {?}
  25475. */
  25476. function (validators) {
  25477. if (!validators)
  25478. return null;
  25479. var /** @type {?} */ presentValidators = /** @type {?} */ (validators.filter(isPresent));
  25480. if (presentValidators.length == 0)
  25481. return null;
  25482. return function (control) {
  25483. var /** @type {?} */ observables = _executeAsyncValidators(control, presentValidators).map(toObservable);
  25484. return __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_map__["map"].call(Object(__WEBPACK_IMPORTED_MODULE_2_rxjs_observable_forkJoin__["forkJoin"])(observables), _mergeErrors);
  25485. };
  25486. };
  25487. return Validators;
  25488. }());
  25489. /**
  25490. * @param {?} o
  25491. * @return {?}
  25492. */
  25493. function isPresent(o) {
  25494. return o != null;
  25495. }
  25496. /**
  25497. * @param {?} r
  25498. * @return {?}
  25499. */
  25500. function toObservable(r) {
  25501. var /** @type {?} */ obs = Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_35" /* ɵisPromise */])(r) ? Object(__WEBPACK_IMPORTED_MODULE_3_rxjs_observable_fromPromise__["fromPromise"])(r) : r;
  25502. if (!(Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_34" /* ɵisObservable */])(obs))) {
  25503. throw new Error("Expected validator to return Promise or Observable.");
  25504. }
  25505. return obs;
  25506. }
  25507. /**
  25508. * @param {?} control
  25509. * @param {?} validators
  25510. * @return {?}
  25511. */
  25512. function _executeValidators(control, validators) {
  25513. return validators.map(function (v) { return v(control); });
  25514. }
  25515. /**
  25516. * @param {?} control
  25517. * @param {?} validators
  25518. * @return {?}
  25519. */
  25520. function _executeAsyncValidators(control, validators) {
  25521. return validators.map(function (v) { return v(control); });
  25522. }
  25523. /**
  25524. * @param {?} arrayOfErrors
  25525. * @return {?}
  25526. */
  25527. function _mergeErrors(arrayOfErrors) {
  25528. var /** @type {?} */ res = arrayOfErrors.reduce(function (res, errors) {
  25529. return errors != null ? Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */])({}, /** @type {?} */ ((res)), errors) : /** @type {?} */ ((res));
  25530. }, {});
  25531. return Object.keys(res).length === 0 ? null : res;
  25532. }
  25533. /**
  25534. * @fileoverview added by tsickle
  25535. * @suppress {checkTypes} checked by tsc
  25536. */
  25537. /**
  25538. * @license
  25539. * Copyright Google Inc. All Rights Reserved.
  25540. *
  25541. * Use of this source code is governed by an MIT-style license that can be
  25542. * found in the LICENSE file at https://angular.io/license
  25543. */
  25544. /**
  25545. * A `ControlValueAccessor` acts as a bridge between the Angular forms API and a
  25546. * native element in the DOM.
  25547. *
  25548. * Implement this interface if you want to create a custom form control directive
  25549. * that integrates with Angular forms.
  25550. *
  25551. * \@stable
  25552. * @record
  25553. */
  25554. /**
  25555. * Used to provide a {\@link ControlValueAccessor} for form controls.
  25556. *
  25557. * See {\@link DefaultValueAccessor} for how to implement one.
  25558. * \@stable
  25559. */
  25560. var NG_VALUE_ACCESSOR = new __WEBPACK_IMPORTED_MODULE_1__angular_core__["B" /* InjectionToken */]('NgValueAccessor');
  25561. /**
  25562. * @fileoverview added by tsickle
  25563. * @suppress {checkTypes} checked by tsc
  25564. */
  25565. /**
  25566. * @license
  25567. * Copyright Google Inc. All Rights Reserved.
  25568. *
  25569. * Use of this source code is governed by an MIT-style license that can be
  25570. * found in the LICENSE file at https://angular.io/license
  25571. */
  25572. var CHECKBOX_VALUE_ACCESSOR = {
  25573. provide: NG_VALUE_ACCESSOR,
  25574. useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_14" /* forwardRef */])(function () { return CheckboxControlValueAccessor; }),
  25575. multi: true,
  25576. };
  25577. /**
  25578. * The accessor for writing a value and listening to changes on a checkbox input element.
  25579. *
  25580. * ### Example
  25581. * ```
  25582. * <input type="checkbox" name="rememberLogin" ngModel>
  25583. * ```
  25584. *
  25585. * \@stable
  25586. */
  25587. var CheckboxControlValueAccessor = /** @class */ (function () {
  25588. function CheckboxControlValueAccessor(_renderer, _elementRef) {
  25589. this._renderer = _renderer;
  25590. this._elementRef = _elementRef;
  25591. this.onChange = function (_) { };
  25592. this.onTouched = function () { };
  25593. }
  25594. /**
  25595. * @param {?} value
  25596. * @return {?}
  25597. */
  25598. CheckboxControlValueAccessor.prototype.writeValue = /**
  25599. * @param {?} value
  25600. * @return {?}
  25601. */
  25602. function (value) {
  25603. this._renderer.setProperty(this._elementRef.nativeElement, 'checked', value);
  25604. };
  25605. /**
  25606. * @param {?} fn
  25607. * @return {?}
  25608. */
  25609. CheckboxControlValueAccessor.prototype.registerOnChange = /**
  25610. * @param {?} fn
  25611. * @return {?}
  25612. */
  25613. function (fn) { this.onChange = fn; };
  25614. /**
  25615. * @param {?} fn
  25616. * @return {?}
  25617. */
  25618. CheckboxControlValueAccessor.prototype.registerOnTouched = /**
  25619. * @param {?} fn
  25620. * @return {?}
  25621. */
  25622. function (fn) { this.onTouched = fn; };
  25623. /**
  25624. * @param {?} isDisabled
  25625. * @return {?}
  25626. */
  25627. CheckboxControlValueAccessor.prototype.setDisabledState = /**
  25628. * @param {?} isDisabled
  25629. * @return {?}
  25630. */
  25631. function (isDisabled) {
  25632. this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);
  25633. };
  25634. CheckboxControlValueAccessor.decorators = [
  25635. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["s" /* Directive */], args: [{
  25636. selector: 'input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]',
  25637. host: { '(change)': 'onChange($event.target.checked)', '(blur)': 'onTouched()' },
  25638. providers: [CHECKBOX_VALUE_ACCESSOR]
  25639. },] },
  25640. ];
  25641. /** @nocollapse */
  25642. CheckboxControlValueAccessor.ctorParameters = function () { return [
  25643. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["W" /* Renderer2 */], },
  25644. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["t" /* ElementRef */], },
  25645. ]; };
  25646. return CheckboxControlValueAccessor;
  25647. }());
  25648. /**
  25649. * @fileoverview added by tsickle
  25650. * @suppress {checkTypes} checked by tsc
  25651. */
  25652. /**
  25653. * @license
  25654. * Copyright Google Inc. All Rights Reserved.
  25655. *
  25656. * Use of this source code is governed by an MIT-style license that can be
  25657. * found in the LICENSE file at https://angular.io/license
  25658. */
  25659. var DEFAULT_VALUE_ACCESSOR = {
  25660. provide: NG_VALUE_ACCESSOR,
  25661. useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_14" /* forwardRef */])(function () { return DefaultValueAccessor; }),
  25662. multi: true
  25663. };
  25664. /**
  25665. * We must check whether the agent is Android because composition events
  25666. * behave differently between iOS and Android.
  25667. * @return {?}
  25668. */
  25669. function _isAndroid() {
  25670. var /** @type {?} */ userAgent = Object(__WEBPACK_IMPORTED_MODULE_5__angular_platform_browser__["g" /* ɵgetDOM */])() ? Object(__WEBPACK_IMPORTED_MODULE_5__angular_platform_browser__["g" /* ɵgetDOM */])().getUserAgent() : '';
  25671. return /android (\d+)/.test(userAgent.toLowerCase());
  25672. }
  25673. /**
  25674. * Turn this mode on if you want form directives to buffer IME input until compositionend
  25675. * \@experimental
  25676. */
  25677. var COMPOSITION_BUFFER_MODE = new __WEBPACK_IMPORTED_MODULE_1__angular_core__["B" /* InjectionToken */]('CompositionEventMode');
  25678. /**
  25679. * The default accessor for writing a value and listening to changes that is used by the
  25680. * {\@link NgModel}, {\@link FormControlDirective}, and {\@link FormControlName} directives.
  25681. *
  25682. * ### Example
  25683. * ```
  25684. * <input type="text" name="searchQuery" ngModel>
  25685. * ```
  25686. *
  25687. * \@stable
  25688. */
  25689. var DefaultValueAccessor = /** @class */ (function () {
  25690. function DefaultValueAccessor(_renderer, _elementRef, _compositionMode) {
  25691. this._renderer = _renderer;
  25692. this._elementRef = _elementRef;
  25693. this._compositionMode = _compositionMode;
  25694. this.onChange = function (_) { };
  25695. this.onTouched = function () { };
  25696. /**
  25697. * Whether the user is creating a composition string (IME events).
  25698. */
  25699. this._composing = false;
  25700. if (this._compositionMode == null) {
  25701. this._compositionMode = !_isAndroid();
  25702. }
  25703. }
  25704. /**
  25705. * @param {?} value
  25706. * @return {?}
  25707. */
  25708. DefaultValueAccessor.prototype.writeValue = /**
  25709. * @param {?} value
  25710. * @return {?}
  25711. */
  25712. function (value) {
  25713. var /** @type {?} */ normalizedValue = value == null ? '' : value;
  25714. this._renderer.setProperty(this._elementRef.nativeElement, 'value', normalizedValue);
  25715. };
  25716. /**
  25717. * @param {?} fn
  25718. * @return {?}
  25719. */
  25720. DefaultValueAccessor.prototype.registerOnChange = /**
  25721. * @param {?} fn
  25722. * @return {?}
  25723. */
  25724. function (fn) { this.onChange = fn; };
  25725. /**
  25726. * @param {?} fn
  25727. * @return {?}
  25728. */
  25729. DefaultValueAccessor.prototype.registerOnTouched = /**
  25730. * @param {?} fn
  25731. * @return {?}
  25732. */
  25733. function (fn) { this.onTouched = fn; };
  25734. /**
  25735. * @param {?} isDisabled
  25736. * @return {?}
  25737. */
  25738. DefaultValueAccessor.prototype.setDisabledState = /**
  25739. * @param {?} isDisabled
  25740. * @return {?}
  25741. */
  25742. function (isDisabled) {
  25743. this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);
  25744. };
  25745. /** @internal */
  25746. /**
  25747. * \@internal
  25748. * @param {?} value
  25749. * @return {?}
  25750. */
  25751. DefaultValueAccessor.prototype._handleInput = /**
  25752. * \@internal
  25753. * @param {?} value
  25754. * @return {?}
  25755. */
  25756. function (value) {
  25757. if (!this._compositionMode || (this._compositionMode && !this._composing)) {
  25758. this.onChange(value);
  25759. }
  25760. };
  25761. /** @internal */
  25762. /**
  25763. * \@internal
  25764. * @return {?}
  25765. */
  25766. DefaultValueAccessor.prototype._compositionStart = /**
  25767. * \@internal
  25768. * @return {?}
  25769. */
  25770. function () { this._composing = true; };
  25771. /** @internal */
  25772. /**
  25773. * \@internal
  25774. * @param {?} value
  25775. * @return {?}
  25776. */
  25777. DefaultValueAccessor.prototype._compositionEnd = /**
  25778. * \@internal
  25779. * @param {?} value
  25780. * @return {?}
  25781. */
  25782. function (value) {
  25783. this._composing = false;
  25784. this._compositionMode && this.onChange(value);
  25785. };
  25786. DefaultValueAccessor.decorators = [
  25787. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["s" /* Directive */], args: [{
  25788. selector: 'input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]',
  25789. // TODO: vsavkin replace the above selector with the one below it once
  25790. // https://github.com/angular/angular/issues/3011 is implemented
  25791. // selector: '[ngModel],[formControl],[formControlName]',
  25792. host: {
  25793. '(input)': '$any(this)._handleInput($event.target.value)',
  25794. '(blur)': 'onTouched()',
  25795. '(compositionstart)': '$any(this)._compositionStart()',
  25796. '(compositionend)': '$any(this)._compositionEnd($event.target.value)'
  25797. },
  25798. providers: [DEFAULT_VALUE_ACCESSOR]
  25799. },] },
  25800. ];
  25801. /** @nocollapse */
  25802. DefaultValueAccessor.ctorParameters = function () { return [
  25803. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["W" /* Renderer2 */], },
  25804. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["t" /* ElementRef */], },
  25805. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["N" /* Optional */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["z" /* Inject */], args: [COMPOSITION_BUFFER_MODE,] },] },
  25806. ]; };
  25807. return DefaultValueAccessor;
  25808. }());
  25809. /**
  25810. * @fileoverview added by tsickle
  25811. * @suppress {checkTypes} checked by tsc
  25812. */
  25813. /**
  25814. * @license
  25815. * Copyright Google Inc. All Rights Reserved.
  25816. *
  25817. * Use of this source code is governed by an MIT-style license that can be
  25818. * found in the LICENSE file at https://angular.io/license
  25819. */
  25820. /**
  25821. * @param {?} validator
  25822. * @return {?}
  25823. */
  25824. function normalizeValidator(validator) {
  25825. if ((/** @type {?} */ (validator)).validate) {
  25826. return function (c) { return (/** @type {?} */ (validator)).validate(c); };
  25827. }
  25828. else {
  25829. return /** @type {?} */ (validator);
  25830. }
  25831. }
  25832. /**
  25833. * @param {?} validator
  25834. * @return {?}
  25835. */
  25836. function normalizeAsyncValidator(validator) {
  25837. if ((/** @type {?} */ (validator)).validate) {
  25838. return function (c) { return (/** @type {?} */ (validator)).validate(c); };
  25839. }
  25840. else {
  25841. return /** @type {?} */ (validator);
  25842. }
  25843. }
  25844. /**
  25845. * @fileoverview added by tsickle
  25846. * @suppress {checkTypes} checked by tsc
  25847. */
  25848. /**
  25849. * @license
  25850. * Copyright Google Inc. All Rights Reserved.
  25851. *
  25852. * Use of this source code is governed by an MIT-style license that can be
  25853. * found in the LICENSE file at https://angular.io/license
  25854. */
  25855. var NUMBER_VALUE_ACCESSOR = {
  25856. provide: NG_VALUE_ACCESSOR,
  25857. useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_14" /* forwardRef */])(function () { return NumberValueAccessor; }),
  25858. multi: true
  25859. };
  25860. /**
  25861. * The accessor for writing a number value and listening to changes that is used by the
  25862. * {\@link NgModel}, {\@link FormControlDirective}, and {\@link FormControlName} directives.
  25863. *
  25864. * ### Example
  25865. * ```
  25866. * <input type="number" [(ngModel)]="age">
  25867. * ```
  25868. */
  25869. var NumberValueAccessor = /** @class */ (function () {
  25870. function NumberValueAccessor(_renderer, _elementRef) {
  25871. this._renderer = _renderer;
  25872. this._elementRef = _elementRef;
  25873. this.onChange = function (_) { };
  25874. this.onTouched = function () { };
  25875. }
  25876. /**
  25877. * @param {?} value
  25878. * @return {?}
  25879. */
  25880. NumberValueAccessor.prototype.writeValue = /**
  25881. * @param {?} value
  25882. * @return {?}
  25883. */
  25884. function (value) {
  25885. // The value needs to be normalized for IE9, otherwise it is set to 'null' when null
  25886. var /** @type {?} */ normalizedValue = value == null ? '' : value;
  25887. this._renderer.setProperty(this._elementRef.nativeElement, 'value', normalizedValue);
  25888. };
  25889. /**
  25890. * @param {?} fn
  25891. * @return {?}
  25892. */
  25893. NumberValueAccessor.prototype.registerOnChange = /**
  25894. * @param {?} fn
  25895. * @return {?}
  25896. */
  25897. function (fn) {
  25898. this.onChange = function (value) { fn(value == '' ? null : parseFloat(value)); };
  25899. };
  25900. /**
  25901. * @param {?} fn
  25902. * @return {?}
  25903. */
  25904. NumberValueAccessor.prototype.registerOnTouched = /**
  25905. * @param {?} fn
  25906. * @return {?}
  25907. */
  25908. function (fn) { this.onTouched = fn; };
  25909. /**
  25910. * @param {?} isDisabled
  25911. * @return {?}
  25912. */
  25913. NumberValueAccessor.prototype.setDisabledState = /**
  25914. * @param {?} isDisabled
  25915. * @return {?}
  25916. */
  25917. function (isDisabled) {
  25918. this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);
  25919. };
  25920. NumberValueAccessor.decorators = [
  25921. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["s" /* Directive */], args: [{
  25922. selector: 'input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]',
  25923. host: {
  25924. '(change)': 'onChange($event.target.value)',
  25925. '(input)': 'onChange($event.target.value)',
  25926. '(blur)': 'onTouched()'
  25927. },
  25928. providers: [NUMBER_VALUE_ACCESSOR]
  25929. },] },
  25930. ];
  25931. /** @nocollapse */
  25932. NumberValueAccessor.ctorParameters = function () { return [
  25933. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["W" /* Renderer2 */], },
  25934. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["t" /* ElementRef */], },
  25935. ]; };
  25936. return NumberValueAccessor;
  25937. }());
  25938. /**
  25939. * @fileoverview added by tsickle
  25940. * @suppress {checkTypes} checked by tsc
  25941. */
  25942. /**
  25943. * @license
  25944. * Copyright Google Inc. All Rights Reserved.
  25945. *
  25946. * Use of this source code is governed by an MIT-style license that can be
  25947. * found in the LICENSE file at https://angular.io/license
  25948. */
  25949. /**
  25950. * @return {?}
  25951. */
  25952. function unimplemented() {
  25953. throw new Error('unimplemented');
  25954. }
  25955. /**
  25956. * A base class that all control directive extend.
  25957. * It binds a {\@link FormControl} object to a DOM element.
  25958. *
  25959. * Used internally by Angular forms.
  25960. *
  25961. * \@stable
  25962. * @abstract
  25963. */
  25964. var NgControl = /** @class */ (function (_super) {
  25965. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(NgControl, _super);
  25966. function NgControl() {
  25967. var _this = _super !== null && _super.apply(this, arguments) || this;
  25968. /**
  25969. * \@internal
  25970. */
  25971. _this._parent = null;
  25972. _this.name = null;
  25973. _this.valueAccessor = null;
  25974. /**
  25975. * \@internal
  25976. */
  25977. _this._rawValidators = [];
  25978. /**
  25979. * \@internal
  25980. */
  25981. _this._rawAsyncValidators = [];
  25982. return _this;
  25983. }
  25984. Object.defineProperty(NgControl.prototype, "validator", {
  25985. get: /**
  25986. * @return {?}
  25987. */
  25988. function () { return /** @type {?} */ (unimplemented()); },
  25989. enumerable: true,
  25990. configurable: true
  25991. });
  25992. Object.defineProperty(NgControl.prototype, "asyncValidator", {
  25993. get: /**
  25994. * @return {?}
  25995. */
  25996. function () { return /** @type {?} */ (unimplemented()); },
  25997. enumerable: true,
  25998. configurable: true
  25999. });
  26000. return NgControl;
  26001. }(AbstractControlDirective));
  26002. /**
  26003. * @fileoverview added by tsickle
  26004. * @suppress {checkTypes} checked by tsc
  26005. */
  26006. /**
  26007. * @license
  26008. * Copyright Google Inc. All Rights Reserved.
  26009. *
  26010. * Use of this source code is governed by an MIT-style license that can be
  26011. * found in the LICENSE file at https://angular.io/license
  26012. */
  26013. var RADIO_VALUE_ACCESSOR = {
  26014. provide: NG_VALUE_ACCESSOR,
  26015. useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_14" /* forwardRef */])(function () { return RadioControlValueAccessor; }),
  26016. multi: true
  26017. };
  26018. /**
  26019. * Internal class used by Angular to uncheck radio buttons with the matching name.
  26020. */
  26021. var RadioControlRegistry = /** @class */ (function () {
  26022. function RadioControlRegistry() {
  26023. this._accessors = [];
  26024. }
  26025. /**
  26026. * @param {?} control
  26027. * @param {?} accessor
  26028. * @return {?}
  26029. */
  26030. RadioControlRegistry.prototype.add = /**
  26031. * @param {?} control
  26032. * @param {?} accessor
  26033. * @return {?}
  26034. */
  26035. function (control, accessor) {
  26036. this._accessors.push([control, accessor]);
  26037. };
  26038. /**
  26039. * @param {?} accessor
  26040. * @return {?}
  26041. */
  26042. RadioControlRegistry.prototype.remove = /**
  26043. * @param {?} accessor
  26044. * @return {?}
  26045. */
  26046. function (accessor) {
  26047. for (var /** @type {?} */ i = this._accessors.length - 1; i >= 0; --i) {
  26048. if (this._accessors[i][1] === accessor) {
  26049. this._accessors.splice(i, 1);
  26050. return;
  26051. }
  26052. }
  26053. };
  26054. /**
  26055. * @param {?} accessor
  26056. * @return {?}
  26057. */
  26058. RadioControlRegistry.prototype.select = /**
  26059. * @param {?} accessor
  26060. * @return {?}
  26061. */
  26062. function (accessor) {
  26063. var _this = this;
  26064. this._accessors.forEach(function (c) {
  26065. if (_this._isSameGroup(c, accessor) && c[1] !== accessor) {
  26066. c[1].fireUncheck(accessor.value);
  26067. }
  26068. });
  26069. };
  26070. /**
  26071. * @param {?} controlPair
  26072. * @param {?} accessor
  26073. * @return {?}
  26074. */
  26075. RadioControlRegistry.prototype._isSameGroup = /**
  26076. * @param {?} controlPair
  26077. * @param {?} accessor
  26078. * @return {?}
  26079. */
  26080. function (controlPair, accessor) {
  26081. if (!controlPair[0].control)
  26082. return false;
  26083. return controlPair[0]._parent === accessor._control._parent &&
  26084. controlPair[1].name === accessor.name;
  26085. };
  26086. RadioControlRegistry.decorators = [
  26087. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["A" /* Injectable */] },
  26088. ];
  26089. /** @nocollapse */
  26090. RadioControlRegistry.ctorParameters = function () { return []; };
  26091. return RadioControlRegistry;
  26092. }());
  26093. /**
  26094. * \@whatItDoes Writes radio control values and listens to radio control changes.
  26095. *
  26096. * Used by {\@link NgModel}, {\@link FormControlDirective}, and {\@link FormControlName}
  26097. * to keep the view synced with the {\@link FormControl} model.
  26098. *
  26099. * \@howToUse
  26100. *
  26101. * If you have imported the {\@link FormsModule} or the {\@link ReactiveFormsModule}, this
  26102. * value accessor will be active on any radio control that has a form directive. You do
  26103. * **not** need to add a special selector to activate it.
  26104. *
  26105. * ### How to use radio buttons with form directives
  26106. *
  26107. * To use radio buttons in a template-driven form, you'll want to ensure that radio buttons
  26108. * in the same group have the same `name` attribute. Radio buttons with different `name`
  26109. * attributes do not affect each other.
  26110. *
  26111. * {\@example forms/ts/radioButtons/radio_button_example.ts region='TemplateDriven'}
  26112. *
  26113. * When using radio buttons in a reactive form, radio buttons in the same group should have the
  26114. * same `formControlName`. You can also add a `name` attribute, but it's optional.
  26115. *
  26116. * {\@example forms/ts/reactiveRadioButtons/reactive_radio_button_example.ts region='Reactive'}
  26117. *
  26118. * * **npm package**: `\@angular/forms`
  26119. *
  26120. * \@stable
  26121. */
  26122. var RadioControlValueAccessor = /** @class */ (function () {
  26123. function RadioControlValueAccessor(_renderer, _elementRef, _registry, _injector) {
  26124. this._renderer = _renderer;
  26125. this._elementRef = _elementRef;
  26126. this._registry = _registry;
  26127. this._injector = _injector;
  26128. this.onChange = function () { };
  26129. this.onTouched = function () { };
  26130. }
  26131. /**
  26132. * @return {?}
  26133. */
  26134. RadioControlValueAccessor.prototype.ngOnInit = /**
  26135. * @return {?}
  26136. */
  26137. function () {
  26138. this._control = this._injector.get(NgControl);
  26139. this._checkName();
  26140. this._registry.add(this._control, this);
  26141. };
  26142. /**
  26143. * @return {?}
  26144. */
  26145. RadioControlValueAccessor.prototype.ngOnDestroy = /**
  26146. * @return {?}
  26147. */
  26148. function () { this._registry.remove(this); };
  26149. /**
  26150. * @param {?} value
  26151. * @return {?}
  26152. */
  26153. RadioControlValueAccessor.prototype.writeValue = /**
  26154. * @param {?} value
  26155. * @return {?}
  26156. */
  26157. function (value) {
  26158. this._state = value === this.value;
  26159. this._renderer.setProperty(this._elementRef.nativeElement, 'checked', this._state);
  26160. };
  26161. /**
  26162. * @param {?} fn
  26163. * @return {?}
  26164. */
  26165. RadioControlValueAccessor.prototype.registerOnChange = /**
  26166. * @param {?} fn
  26167. * @return {?}
  26168. */
  26169. function (fn) {
  26170. var _this = this;
  26171. this._fn = fn;
  26172. this.onChange = function () {
  26173. fn(_this.value);
  26174. _this._registry.select(_this);
  26175. };
  26176. };
  26177. /**
  26178. * @param {?} value
  26179. * @return {?}
  26180. */
  26181. RadioControlValueAccessor.prototype.fireUncheck = /**
  26182. * @param {?} value
  26183. * @return {?}
  26184. */
  26185. function (value) { this.writeValue(value); };
  26186. /**
  26187. * @param {?} fn
  26188. * @return {?}
  26189. */
  26190. RadioControlValueAccessor.prototype.registerOnTouched = /**
  26191. * @param {?} fn
  26192. * @return {?}
  26193. */
  26194. function (fn) { this.onTouched = fn; };
  26195. /**
  26196. * @param {?} isDisabled
  26197. * @return {?}
  26198. */
  26199. RadioControlValueAccessor.prototype.setDisabledState = /**
  26200. * @param {?} isDisabled
  26201. * @return {?}
  26202. */
  26203. function (isDisabled) {
  26204. this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);
  26205. };
  26206. /**
  26207. * @return {?}
  26208. */
  26209. RadioControlValueAccessor.prototype._checkName = /**
  26210. * @return {?}
  26211. */
  26212. function () {
  26213. if (this.name && this.formControlName && this.name !== this.formControlName) {
  26214. this._throwNameError();
  26215. }
  26216. if (!this.name && this.formControlName)
  26217. this.name = this.formControlName;
  26218. };
  26219. /**
  26220. * @return {?}
  26221. */
  26222. RadioControlValueAccessor.prototype._throwNameError = /**
  26223. * @return {?}
  26224. */
  26225. function () {
  26226. throw new Error("\n If you define both a name and a formControlName attribute on your radio button, their values\n must match. Ex: <input type=\"radio\" formControlName=\"food\" name=\"food\">\n ");
  26227. };
  26228. RadioControlValueAccessor.decorators = [
  26229. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["s" /* Directive */], args: [{
  26230. selector: 'input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]',
  26231. host: { '(change)': 'onChange()', '(blur)': 'onTouched()' },
  26232. providers: [RADIO_VALUE_ACCESSOR]
  26233. },] },
  26234. ];
  26235. /** @nocollapse */
  26236. RadioControlValueAccessor.ctorParameters = function () { return [
  26237. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["W" /* Renderer2 */], },
  26238. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["t" /* ElementRef */], },
  26239. { type: RadioControlRegistry, },
  26240. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["C" /* Injector */], },
  26241. ]; };
  26242. RadioControlValueAccessor.propDecorators = {
  26243. "name": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["D" /* Input */] },],
  26244. "formControlName": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["D" /* Input */] },],
  26245. "value": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["D" /* Input */] },],
  26246. };
  26247. return RadioControlValueAccessor;
  26248. }());
  26249. /**
  26250. * @fileoverview added by tsickle
  26251. * @suppress {checkTypes} checked by tsc
  26252. */
  26253. /**
  26254. * @license
  26255. * Copyright Google Inc. All Rights Reserved.
  26256. *
  26257. * Use of this source code is governed by an MIT-style license that can be
  26258. * found in the LICENSE file at https://angular.io/license
  26259. */
  26260. var RANGE_VALUE_ACCESSOR = {
  26261. provide: NG_VALUE_ACCESSOR,
  26262. useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_14" /* forwardRef */])(function () { return RangeValueAccessor; }),
  26263. multi: true
  26264. };
  26265. /**
  26266. * The accessor for writing a range value and listening to changes that is used by the
  26267. * {\@link NgModel}, {\@link FormControlDirective}, and {\@link FormControlName} directives.
  26268. *
  26269. * ### Example
  26270. * ```
  26271. * <input type="range" [(ngModel)]="age" >
  26272. * ```
  26273. */
  26274. var RangeValueAccessor = /** @class */ (function () {
  26275. function RangeValueAccessor(_renderer, _elementRef) {
  26276. this._renderer = _renderer;
  26277. this._elementRef = _elementRef;
  26278. this.onChange = function (_) { };
  26279. this.onTouched = function () { };
  26280. }
  26281. /**
  26282. * @param {?} value
  26283. * @return {?}
  26284. */
  26285. RangeValueAccessor.prototype.writeValue = /**
  26286. * @param {?} value
  26287. * @return {?}
  26288. */
  26289. function (value) {
  26290. this._renderer.setProperty(this._elementRef.nativeElement, 'value', parseFloat(value));
  26291. };
  26292. /**
  26293. * @param {?} fn
  26294. * @return {?}
  26295. */
  26296. RangeValueAccessor.prototype.registerOnChange = /**
  26297. * @param {?} fn
  26298. * @return {?}
  26299. */
  26300. function (fn) {
  26301. this.onChange = function (value) { fn(value == '' ? null : parseFloat(value)); };
  26302. };
  26303. /**
  26304. * @param {?} fn
  26305. * @return {?}
  26306. */
  26307. RangeValueAccessor.prototype.registerOnTouched = /**
  26308. * @param {?} fn
  26309. * @return {?}
  26310. */
  26311. function (fn) { this.onTouched = fn; };
  26312. /**
  26313. * @param {?} isDisabled
  26314. * @return {?}
  26315. */
  26316. RangeValueAccessor.prototype.setDisabledState = /**
  26317. * @param {?} isDisabled
  26318. * @return {?}
  26319. */
  26320. function (isDisabled) {
  26321. this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);
  26322. };
  26323. RangeValueAccessor.decorators = [
  26324. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["s" /* Directive */], args: [{
  26325. selector: 'input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]',
  26326. host: {
  26327. '(change)': 'onChange($event.target.value)',
  26328. '(input)': 'onChange($event.target.value)',
  26329. '(blur)': 'onTouched()'
  26330. },
  26331. providers: [RANGE_VALUE_ACCESSOR]
  26332. },] },
  26333. ];
  26334. /** @nocollapse */
  26335. RangeValueAccessor.ctorParameters = function () { return [
  26336. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["W" /* Renderer2 */], },
  26337. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["t" /* ElementRef */], },
  26338. ]; };
  26339. return RangeValueAccessor;
  26340. }());
  26341. /**
  26342. * @fileoverview added by tsickle
  26343. * @suppress {checkTypes} checked by tsc
  26344. */
  26345. /**
  26346. * @license
  26347. * Copyright Google Inc. All Rights Reserved.
  26348. *
  26349. * Use of this source code is governed by an MIT-style license that can be
  26350. * found in the LICENSE file at https://angular.io/license
  26351. */
  26352. var SELECT_VALUE_ACCESSOR = {
  26353. provide: NG_VALUE_ACCESSOR,
  26354. useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_14" /* forwardRef */])(function () { return SelectControlValueAccessor; }),
  26355. multi: true
  26356. };
  26357. /**
  26358. * @param {?} id
  26359. * @param {?} value
  26360. * @return {?}
  26361. */
  26362. function _buildValueString(id, value) {
  26363. if (id == null)
  26364. return "" + value;
  26365. if (value && typeof value === 'object')
  26366. value = 'Object';
  26367. return (id + ": " + value).slice(0, 50);
  26368. }
  26369. /**
  26370. * @param {?} valueString
  26371. * @return {?}
  26372. */
  26373. function _extractId(valueString) {
  26374. return valueString.split(':')[0];
  26375. }
  26376. /**
  26377. * \@whatItDoes Writes values and listens to changes on a select element.
  26378. *
  26379. * Used by {\@link NgModel}, {\@link FormControlDirective}, and {\@link FormControlName}
  26380. * to keep the view synced with the {\@link FormControl} model.
  26381. *
  26382. * \@howToUse
  26383. *
  26384. * If you have imported the {\@link FormsModule} or the {\@link ReactiveFormsModule}, this
  26385. * value accessor will be active on any select control that has a form directive. You do
  26386. * **not** need to add a special selector to activate it.
  26387. *
  26388. * ### How to use select controls with form directives
  26389. *
  26390. * To use a select in a template-driven form, simply add an `ngModel` and a `name`
  26391. * attribute to the main `<select>` tag.
  26392. *
  26393. * If your option values are simple strings, you can bind to the normal `value` property
  26394. * on the option. If your option values happen to be objects (and you'd like to save the
  26395. * selection in your form as an object), use `ngValue` instead:
  26396. *
  26397. * {\@example forms/ts/selectControl/select_control_example.ts region='Component'}
  26398. *
  26399. * In reactive forms, you'll also want to add your form directive (`formControlName` or
  26400. * `formControl`) on the main `<select>` tag. Like in the former example, you have the
  26401. * choice of binding to the `value` or `ngValue` property on the select's options.
  26402. *
  26403. * {\@example forms/ts/reactiveSelectControl/reactive_select_control_example.ts region='Component'}
  26404. *
  26405. * ### Caveat: Option selection
  26406. *
  26407. * Angular uses object identity to select option. It's possible for the identities of items
  26408. * to change while the data does not. This can happen, for example, if the items are produced
  26409. * from an RPC to the server, and that RPC is re-run. Even if the data hasn't changed, the
  26410. * second response will produce objects with different identities.
  26411. *
  26412. * To customize the default option comparison algorithm, `<select>` supports `compareWith` input.
  26413. * `compareWith` takes a **function** which has two arguments: `option1` and `option2`.
  26414. * If `compareWith` is given, Angular selects option by the return value of the function.
  26415. *
  26416. * #### Syntax
  26417. *
  26418. * ```
  26419. * <select [compareWith]="compareFn" [(ngModel)]="selectedCountries">
  26420. * <option *ngFor="let country of countries" [ngValue]="country">
  26421. * {{country.name}}
  26422. * </option>
  26423. * </select>
  26424. *
  26425. * compareFn(c1: Country, c2: Country): boolean {
  26426. * return c1 && c2 ? c1.id === c2.id : c1 === c2;
  26427. * }
  26428. * ```
  26429. *
  26430. * Note: We listen to the 'change' event because 'input' events aren't fired
  26431. * for selects in Firefox and IE:
  26432. * https://bugzilla.mozilla.org/show_bug.cgi?id=1024350
  26433. * https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/4660045/
  26434. *
  26435. * * **npm package**: `\@angular/forms`
  26436. *
  26437. * \@stable
  26438. */
  26439. var SelectControlValueAccessor = /** @class */ (function () {
  26440. function SelectControlValueAccessor(_renderer, _elementRef) {
  26441. this._renderer = _renderer;
  26442. this._elementRef = _elementRef;
  26443. /**
  26444. * \@internal
  26445. */
  26446. this._optionMap = new Map();
  26447. /**
  26448. * \@internal
  26449. */
  26450. this._idCounter = 0;
  26451. this.onChange = function (_) { };
  26452. this.onTouched = function () { };
  26453. this._compareWith = __WEBPACK_IMPORTED_MODULE_1__angular_core__["_36" /* ɵlooseIdentical */];
  26454. }
  26455. Object.defineProperty(SelectControlValueAccessor.prototype, "compareWith", {
  26456. set: /**
  26457. * @param {?} fn
  26458. * @return {?}
  26459. */
  26460. function (fn) {
  26461. if (typeof fn !== 'function') {
  26462. throw new Error("compareWith must be a function, but received " + JSON.stringify(fn));
  26463. }
  26464. this._compareWith = fn;
  26465. },
  26466. enumerable: true,
  26467. configurable: true
  26468. });
  26469. /**
  26470. * @param {?} value
  26471. * @return {?}
  26472. */
  26473. SelectControlValueAccessor.prototype.writeValue = /**
  26474. * @param {?} value
  26475. * @return {?}
  26476. */
  26477. function (value) {
  26478. this.value = value;
  26479. var /** @type {?} */ id = this._getOptionId(value);
  26480. if (id == null) {
  26481. this._renderer.setProperty(this._elementRef.nativeElement, 'selectedIndex', -1);
  26482. }
  26483. var /** @type {?} */ valueString = _buildValueString(id, value);
  26484. this._renderer.setProperty(this._elementRef.nativeElement, 'value', valueString);
  26485. };
  26486. /**
  26487. * @param {?} fn
  26488. * @return {?}
  26489. */
  26490. SelectControlValueAccessor.prototype.registerOnChange = /**
  26491. * @param {?} fn
  26492. * @return {?}
  26493. */
  26494. function (fn) {
  26495. var _this = this;
  26496. this.onChange = function (valueString) {
  26497. _this.value = _this._getOptionValue(valueString);
  26498. fn(_this.value);
  26499. };
  26500. };
  26501. /**
  26502. * @param {?} fn
  26503. * @return {?}
  26504. */
  26505. SelectControlValueAccessor.prototype.registerOnTouched = /**
  26506. * @param {?} fn
  26507. * @return {?}
  26508. */
  26509. function (fn) { this.onTouched = fn; };
  26510. /**
  26511. * @param {?} isDisabled
  26512. * @return {?}
  26513. */
  26514. SelectControlValueAccessor.prototype.setDisabledState = /**
  26515. * @param {?} isDisabled
  26516. * @return {?}
  26517. */
  26518. function (isDisabled) {
  26519. this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);
  26520. };
  26521. /** @internal */
  26522. /**
  26523. * \@internal
  26524. * @return {?}
  26525. */
  26526. SelectControlValueAccessor.prototype._registerOption = /**
  26527. * \@internal
  26528. * @return {?}
  26529. */
  26530. function () { return (this._idCounter++).toString(); };
  26531. /** @internal */
  26532. /**
  26533. * \@internal
  26534. * @param {?} value
  26535. * @return {?}
  26536. */
  26537. SelectControlValueAccessor.prototype._getOptionId = /**
  26538. * \@internal
  26539. * @param {?} value
  26540. * @return {?}
  26541. */
  26542. function (value) {
  26543. for (var _i = 0, _a = Array.from(this._optionMap.keys()); _i < _a.length; _i++) {
  26544. var id = _a[_i];
  26545. if (this._compareWith(this._optionMap.get(id), value))
  26546. return id;
  26547. }
  26548. return null;
  26549. };
  26550. /** @internal */
  26551. /**
  26552. * \@internal
  26553. * @param {?} valueString
  26554. * @return {?}
  26555. */
  26556. SelectControlValueAccessor.prototype._getOptionValue = /**
  26557. * \@internal
  26558. * @param {?} valueString
  26559. * @return {?}
  26560. */
  26561. function (valueString) {
  26562. var /** @type {?} */ id = _extractId(valueString);
  26563. return this._optionMap.has(id) ? this._optionMap.get(id) : valueString;
  26564. };
  26565. SelectControlValueAccessor.decorators = [
  26566. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["s" /* Directive */], args: [{
  26567. selector: 'select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]',
  26568. host: { '(change)': 'onChange($event.target.value)', '(blur)': 'onTouched()' },
  26569. providers: [SELECT_VALUE_ACCESSOR]
  26570. },] },
  26571. ];
  26572. /** @nocollapse */
  26573. SelectControlValueAccessor.ctorParameters = function () { return [
  26574. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["W" /* Renderer2 */], },
  26575. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["t" /* ElementRef */], },
  26576. ]; };
  26577. SelectControlValueAccessor.propDecorators = {
  26578. "compareWith": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["D" /* Input */] },],
  26579. };
  26580. return SelectControlValueAccessor;
  26581. }());
  26582. /**
  26583. * \@whatItDoes Marks `<option>` as dynamic, so Angular can be notified when options change.
  26584. *
  26585. * \@howToUse
  26586. *
  26587. * See docs for {\@link SelectControlValueAccessor} for usage examples.
  26588. *
  26589. * \@stable
  26590. */
  26591. var NgSelectOption = /** @class */ (function () {
  26592. function NgSelectOption(_element, _renderer, _select) {
  26593. this._element = _element;
  26594. this._renderer = _renderer;
  26595. this._select = _select;
  26596. if (this._select)
  26597. this.id = this._select._registerOption();
  26598. }
  26599. Object.defineProperty(NgSelectOption.prototype, "ngValue", {
  26600. set: /**
  26601. * @param {?} value
  26602. * @return {?}
  26603. */
  26604. function (value) {
  26605. if (this._select == null)
  26606. return;
  26607. this._select._optionMap.set(this.id, value);
  26608. this._setElementValue(_buildValueString(this.id, value));
  26609. this._select.writeValue(this._select.value);
  26610. },
  26611. enumerable: true,
  26612. configurable: true
  26613. });
  26614. Object.defineProperty(NgSelectOption.prototype, "value", {
  26615. set: /**
  26616. * @param {?} value
  26617. * @return {?}
  26618. */
  26619. function (value) {
  26620. this._setElementValue(value);
  26621. if (this._select)
  26622. this._select.writeValue(this._select.value);
  26623. },
  26624. enumerable: true,
  26625. configurable: true
  26626. });
  26627. /** @internal */
  26628. /**
  26629. * \@internal
  26630. * @param {?} value
  26631. * @return {?}
  26632. */
  26633. NgSelectOption.prototype._setElementValue = /**
  26634. * \@internal
  26635. * @param {?} value
  26636. * @return {?}
  26637. */
  26638. function (value) {
  26639. this._renderer.setProperty(this._element.nativeElement, 'value', value);
  26640. };
  26641. /**
  26642. * @return {?}
  26643. */
  26644. NgSelectOption.prototype.ngOnDestroy = /**
  26645. * @return {?}
  26646. */
  26647. function () {
  26648. if (this._select) {
  26649. this._select._optionMap.delete(this.id);
  26650. this._select.writeValue(this._select.value);
  26651. }
  26652. };
  26653. NgSelectOption.decorators = [
  26654. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["s" /* Directive */], args: [{ selector: 'option' },] },
  26655. ];
  26656. /** @nocollapse */
  26657. NgSelectOption.ctorParameters = function () { return [
  26658. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["t" /* ElementRef */], },
  26659. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["W" /* Renderer2 */], },
  26660. { type: SelectControlValueAccessor, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["N" /* Optional */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["w" /* Host */] },] },
  26661. ]; };
  26662. NgSelectOption.propDecorators = {
  26663. "ngValue": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["D" /* Input */], args: ['ngValue',] },],
  26664. "value": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["D" /* Input */], args: ['value',] },],
  26665. };
  26666. return NgSelectOption;
  26667. }());
  26668. /**
  26669. * @fileoverview added by tsickle
  26670. * @suppress {checkTypes} checked by tsc
  26671. */
  26672. /**
  26673. * @license
  26674. * Copyright Google Inc. All Rights Reserved.
  26675. *
  26676. * Use of this source code is governed by an MIT-style license that can be
  26677. * found in the LICENSE file at https://angular.io/license
  26678. */
  26679. var SELECT_MULTIPLE_VALUE_ACCESSOR = {
  26680. provide: NG_VALUE_ACCESSOR,
  26681. useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_14" /* forwardRef */])(function () { return SelectMultipleControlValueAccessor; }),
  26682. multi: true
  26683. };
  26684. /**
  26685. * @param {?} id
  26686. * @param {?} value
  26687. * @return {?}
  26688. */
  26689. function _buildValueString$1(id, value) {
  26690. if (id == null)
  26691. return "" + value;
  26692. if (typeof value === 'string')
  26693. value = "'" + value + "'";
  26694. if (value && typeof value === 'object')
  26695. value = 'Object';
  26696. return (id + ": " + value).slice(0, 50);
  26697. }
  26698. /**
  26699. * @param {?} valueString
  26700. * @return {?}
  26701. */
  26702. function _extractId$1(valueString) {
  26703. return valueString.split(':')[0];
  26704. }
  26705. /**
  26706. * The accessor for writing a value and listening to changes on a select element.
  26707. *
  26708. * ### Caveat: Options selection
  26709. *
  26710. * Angular uses object identity to select options. It's possible for the identities of items
  26711. * to change while the data does not. This can happen, for example, if the items are produced
  26712. * from an RPC to the server, and that RPC is re-run. Even if the data hasn't changed, the
  26713. * second response will produce objects with different identities.
  26714. *
  26715. * To customize the default option comparison algorithm, `<select multiple>` supports `compareWith`
  26716. * input. `compareWith` takes a **function** which has two arguments: `option1` and `option2`.
  26717. * If `compareWith` is given, Angular selects options by the return value of the function.
  26718. *
  26719. * #### Syntax
  26720. *
  26721. * ```
  26722. * <select multiple [compareWith]="compareFn" [(ngModel)]="selectedCountries">
  26723. * <option *ngFor="let country of countries" [ngValue]="country">
  26724. * {{country.name}}
  26725. * </option>
  26726. * </select>
  26727. *
  26728. * compareFn(c1: Country, c2: Country): boolean {
  26729. * return c1 && c2 ? c1.id === c2.id : c1 === c2;
  26730. * }
  26731. * ```
  26732. *
  26733. * \@stable
  26734. */
  26735. var SelectMultipleControlValueAccessor = /** @class */ (function () {
  26736. function SelectMultipleControlValueAccessor(_renderer, _elementRef) {
  26737. this._renderer = _renderer;
  26738. this._elementRef = _elementRef;
  26739. /**
  26740. * \@internal
  26741. */
  26742. this._optionMap = new Map();
  26743. /**
  26744. * \@internal
  26745. */
  26746. this._idCounter = 0;
  26747. this.onChange = function (_) { };
  26748. this.onTouched = function () { };
  26749. this._compareWith = __WEBPACK_IMPORTED_MODULE_1__angular_core__["_36" /* ɵlooseIdentical */];
  26750. }
  26751. Object.defineProperty(SelectMultipleControlValueAccessor.prototype, "compareWith", {
  26752. set: /**
  26753. * @param {?} fn
  26754. * @return {?}
  26755. */
  26756. function (fn) {
  26757. if (typeof fn !== 'function') {
  26758. throw new Error("compareWith must be a function, but received " + JSON.stringify(fn));
  26759. }
  26760. this._compareWith = fn;
  26761. },
  26762. enumerable: true,
  26763. configurable: true
  26764. });
  26765. /**
  26766. * @param {?} value
  26767. * @return {?}
  26768. */
  26769. SelectMultipleControlValueAccessor.prototype.writeValue = /**
  26770. * @param {?} value
  26771. * @return {?}
  26772. */
  26773. function (value) {
  26774. var _this = this;
  26775. this.value = value;
  26776. var /** @type {?} */ optionSelectedStateSetter;
  26777. if (Array.isArray(value)) {
  26778. // convert values to ids
  26779. var /** @type {?} */ ids_1 = value.map(function (v) { return _this._getOptionId(v); });
  26780. optionSelectedStateSetter = function (opt, o) { opt._setSelected(ids_1.indexOf(o.toString()) > -1); };
  26781. }
  26782. else {
  26783. optionSelectedStateSetter = function (opt, o) { opt._setSelected(false); };
  26784. }
  26785. this._optionMap.forEach(optionSelectedStateSetter);
  26786. };
  26787. /**
  26788. * @param {?} fn
  26789. * @return {?}
  26790. */
  26791. SelectMultipleControlValueAccessor.prototype.registerOnChange = /**
  26792. * @param {?} fn
  26793. * @return {?}
  26794. */
  26795. function (fn) {
  26796. var _this = this;
  26797. this.onChange = function (_) {
  26798. var /** @type {?} */ selected = [];
  26799. if (_.hasOwnProperty('selectedOptions')) {
  26800. var /** @type {?} */ options = _.selectedOptions;
  26801. for (var /** @type {?} */ i = 0; i < options.length; i++) {
  26802. var /** @type {?} */ opt = options.item(i);
  26803. var /** @type {?} */ val = _this._getOptionValue(opt.value);
  26804. selected.push(val);
  26805. }
  26806. }
  26807. else {
  26808. var /** @type {?} */ options = /** @type {?} */ (_.options);
  26809. for (var /** @type {?} */ i = 0; i < options.length; i++) {
  26810. var /** @type {?} */ opt = options.item(i);
  26811. if (opt.selected) {
  26812. var /** @type {?} */ val = _this._getOptionValue(opt.value);
  26813. selected.push(val);
  26814. }
  26815. }
  26816. }
  26817. _this.value = selected;
  26818. fn(selected);
  26819. };
  26820. };
  26821. /**
  26822. * @param {?} fn
  26823. * @return {?}
  26824. */
  26825. SelectMultipleControlValueAccessor.prototype.registerOnTouched = /**
  26826. * @param {?} fn
  26827. * @return {?}
  26828. */
  26829. function (fn) { this.onTouched = fn; };
  26830. /**
  26831. * @param {?} isDisabled
  26832. * @return {?}
  26833. */
  26834. SelectMultipleControlValueAccessor.prototype.setDisabledState = /**
  26835. * @param {?} isDisabled
  26836. * @return {?}
  26837. */
  26838. function (isDisabled) {
  26839. this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);
  26840. };
  26841. /** @internal */
  26842. /**
  26843. * \@internal
  26844. * @param {?} value
  26845. * @return {?}
  26846. */
  26847. SelectMultipleControlValueAccessor.prototype._registerOption = /**
  26848. * \@internal
  26849. * @param {?} value
  26850. * @return {?}
  26851. */
  26852. function (value) {
  26853. var /** @type {?} */ id = (this._idCounter++).toString();
  26854. this._optionMap.set(id, value);
  26855. return id;
  26856. };
  26857. /** @internal */
  26858. /**
  26859. * \@internal
  26860. * @param {?} value
  26861. * @return {?}
  26862. */
  26863. SelectMultipleControlValueAccessor.prototype._getOptionId = /**
  26864. * \@internal
  26865. * @param {?} value
  26866. * @return {?}
  26867. */
  26868. function (value) {
  26869. for (var _i = 0, _a = Array.from(this._optionMap.keys()); _i < _a.length; _i++) {
  26870. var id = _a[_i];
  26871. if (this._compareWith(/** @type {?} */ ((this._optionMap.get(id)))._value, value))
  26872. return id;
  26873. }
  26874. return null;
  26875. };
  26876. /** @internal */
  26877. /**
  26878. * \@internal
  26879. * @param {?} valueString
  26880. * @return {?}
  26881. */
  26882. SelectMultipleControlValueAccessor.prototype._getOptionValue = /**
  26883. * \@internal
  26884. * @param {?} valueString
  26885. * @return {?}
  26886. */
  26887. function (valueString) {
  26888. var /** @type {?} */ id = _extractId$1(valueString);
  26889. return this._optionMap.has(id) ? /** @type {?} */ ((this._optionMap.get(id)))._value : valueString;
  26890. };
  26891. SelectMultipleControlValueAccessor.decorators = [
  26892. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["s" /* Directive */], args: [{
  26893. selector: 'select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]',
  26894. host: { '(change)': 'onChange($event.target)', '(blur)': 'onTouched()' },
  26895. providers: [SELECT_MULTIPLE_VALUE_ACCESSOR]
  26896. },] },
  26897. ];
  26898. /** @nocollapse */
  26899. SelectMultipleControlValueAccessor.ctorParameters = function () { return [
  26900. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["W" /* Renderer2 */], },
  26901. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["t" /* ElementRef */], },
  26902. ]; };
  26903. SelectMultipleControlValueAccessor.propDecorators = {
  26904. "compareWith": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["D" /* Input */] },],
  26905. };
  26906. return SelectMultipleControlValueAccessor;
  26907. }());
  26908. /**
  26909. * Marks `<option>` as dynamic, so Angular can be notified when options change.
  26910. *
  26911. * ### Example
  26912. *
  26913. * ```
  26914. * <select multiple name="city" ngModel>
  26915. * <option *ngFor="let c of cities" [value]="c"></option>
  26916. * </select>
  26917. * ```
  26918. */
  26919. var NgSelectMultipleOption = /** @class */ (function () {
  26920. function NgSelectMultipleOption(_element, _renderer, _select) {
  26921. this._element = _element;
  26922. this._renderer = _renderer;
  26923. this._select = _select;
  26924. if (this._select) {
  26925. this.id = this._select._registerOption(this);
  26926. }
  26927. }
  26928. Object.defineProperty(NgSelectMultipleOption.prototype, "ngValue", {
  26929. set: /**
  26930. * @param {?} value
  26931. * @return {?}
  26932. */
  26933. function (value) {
  26934. if (this._select == null)
  26935. return;
  26936. this._value = value;
  26937. this._setElementValue(_buildValueString$1(this.id, value));
  26938. this._select.writeValue(this._select.value);
  26939. },
  26940. enumerable: true,
  26941. configurable: true
  26942. });
  26943. Object.defineProperty(NgSelectMultipleOption.prototype, "value", {
  26944. set: /**
  26945. * @param {?} value
  26946. * @return {?}
  26947. */
  26948. function (value) {
  26949. if (this._select) {
  26950. this._value = value;
  26951. this._setElementValue(_buildValueString$1(this.id, value));
  26952. this._select.writeValue(this._select.value);
  26953. }
  26954. else {
  26955. this._setElementValue(value);
  26956. }
  26957. },
  26958. enumerable: true,
  26959. configurable: true
  26960. });
  26961. /** @internal */
  26962. /**
  26963. * \@internal
  26964. * @param {?} value
  26965. * @return {?}
  26966. */
  26967. NgSelectMultipleOption.prototype._setElementValue = /**
  26968. * \@internal
  26969. * @param {?} value
  26970. * @return {?}
  26971. */
  26972. function (value) {
  26973. this._renderer.setProperty(this._element.nativeElement, 'value', value);
  26974. };
  26975. /** @internal */
  26976. /**
  26977. * \@internal
  26978. * @param {?} selected
  26979. * @return {?}
  26980. */
  26981. NgSelectMultipleOption.prototype._setSelected = /**
  26982. * \@internal
  26983. * @param {?} selected
  26984. * @return {?}
  26985. */
  26986. function (selected) {
  26987. this._renderer.setProperty(this._element.nativeElement, 'selected', selected);
  26988. };
  26989. /**
  26990. * @return {?}
  26991. */
  26992. NgSelectMultipleOption.prototype.ngOnDestroy = /**
  26993. * @return {?}
  26994. */
  26995. function () {
  26996. if (this._select) {
  26997. this._select._optionMap.delete(this.id);
  26998. this._select.writeValue(this._select.value);
  26999. }
  27000. };
  27001. NgSelectMultipleOption.decorators = [
  27002. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["s" /* Directive */], args: [{ selector: 'option' },] },
  27003. ];
  27004. /** @nocollapse */
  27005. NgSelectMultipleOption.ctorParameters = function () { return [
  27006. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["t" /* ElementRef */], },
  27007. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["W" /* Renderer2 */], },
  27008. { type: SelectMultipleControlValueAccessor, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["N" /* Optional */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["w" /* Host */] },] },
  27009. ]; };
  27010. NgSelectMultipleOption.propDecorators = {
  27011. "ngValue": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["D" /* Input */], args: ['ngValue',] },],
  27012. "value": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["D" /* Input */], args: ['value',] },],
  27013. };
  27014. return NgSelectMultipleOption;
  27015. }());
  27016. /**
  27017. * @fileoverview added by tsickle
  27018. * @suppress {checkTypes} checked by tsc
  27019. */
  27020. /**
  27021. * @license
  27022. * Copyright Google Inc. All Rights Reserved.
  27023. *
  27024. * Use of this source code is governed by an MIT-style license that can be
  27025. * found in the LICENSE file at https://angular.io/license
  27026. */
  27027. /**
  27028. * @param {?} name
  27029. * @param {?} parent
  27030. * @return {?}
  27031. */
  27032. function controlPath(name, parent) {
  27033. return /** @type {?} */ ((parent.path)).concat([name]);
  27034. }
  27035. /**
  27036. * @param {?} control
  27037. * @param {?} dir
  27038. * @return {?}
  27039. */
  27040. function setUpControl(control, dir) {
  27041. if (!control)
  27042. _throwError(dir, 'Cannot find control with');
  27043. if (!dir.valueAccessor)
  27044. _throwError(dir, 'No value accessor for form control with');
  27045. control.validator = Validators.compose([/** @type {?} */ ((control.validator)), dir.validator]);
  27046. control.asyncValidator = Validators.composeAsync([/** @type {?} */ ((control.asyncValidator)), dir.asyncValidator]); /** @type {?} */
  27047. ((dir.valueAccessor)).writeValue(control.value);
  27048. setUpViewChangePipeline(control, dir);
  27049. setUpModelChangePipeline(control, dir);
  27050. setUpBlurPipeline(control, dir);
  27051. if (/** @type {?} */ ((dir.valueAccessor)).setDisabledState) {
  27052. control.registerOnDisabledChange(function (isDisabled) { /** @type {?} */ ((/** @type {?} */ ((dir.valueAccessor)).setDisabledState))(isDisabled); });
  27053. }
  27054. // re-run validation when validator binding changes, e.g. minlength=3 -> minlength=4
  27055. dir._rawValidators.forEach(function (validator) {
  27056. if ((/** @type {?} */ (validator)).registerOnValidatorChange)
  27057. /** @type {?} */ (((/** @type {?} */ (validator)).registerOnValidatorChange))(function () { return control.updateValueAndValidity(); });
  27058. });
  27059. dir._rawAsyncValidators.forEach(function (validator) {
  27060. if ((/** @type {?} */ (validator)).registerOnValidatorChange)
  27061. /** @type {?} */ (((/** @type {?} */ (validator)).registerOnValidatorChange))(function () { return control.updateValueAndValidity(); });
  27062. });
  27063. }
  27064. /**
  27065. * @param {?} control
  27066. * @param {?} dir
  27067. * @return {?}
  27068. */
  27069. function cleanUpControl(control, dir) {
  27070. /** @type {?} */ ((dir.valueAccessor)).registerOnChange(function () { return _noControlError(dir); }); /** @type {?} */
  27071. ((dir.valueAccessor)).registerOnTouched(function () { return _noControlError(dir); });
  27072. dir._rawValidators.forEach(function (validator) {
  27073. if (validator.registerOnValidatorChange) {
  27074. validator.registerOnValidatorChange(null);
  27075. }
  27076. });
  27077. dir._rawAsyncValidators.forEach(function (validator) {
  27078. if (validator.registerOnValidatorChange) {
  27079. validator.registerOnValidatorChange(null);
  27080. }
  27081. });
  27082. if (control)
  27083. control._clearChangeFns();
  27084. }
  27085. /**
  27086. * @param {?} control
  27087. * @param {?} dir
  27088. * @return {?}
  27089. */
  27090. function setUpViewChangePipeline(control, dir) {
  27091. /** @type {?} */ ((dir.valueAccessor)).registerOnChange(function (newValue) {
  27092. control._pendingValue = newValue;
  27093. control._pendingChange = true;
  27094. control._pendingDirty = true;
  27095. if (control.updateOn === 'change')
  27096. updateControl(control, dir);
  27097. });
  27098. }
  27099. /**
  27100. * @param {?} control
  27101. * @param {?} dir
  27102. * @return {?}
  27103. */
  27104. function setUpBlurPipeline(control, dir) {
  27105. /** @type {?} */ ((dir.valueAccessor)).registerOnTouched(function () {
  27106. control._pendingTouched = true;
  27107. if (control.updateOn === 'blur' && control._pendingChange)
  27108. updateControl(control, dir);
  27109. if (control.updateOn !== 'submit')
  27110. control.markAsTouched();
  27111. });
  27112. }
  27113. /**
  27114. * @param {?} control
  27115. * @param {?} dir
  27116. * @return {?}
  27117. */
  27118. function updateControl(control, dir) {
  27119. dir.viewToModelUpdate(control._pendingValue);
  27120. if (control._pendingDirty)
  27121. control.markAsDirty();
  27122. control.setValue(control._pendingValue, { emitModelToViewChange: false });
  27123. control._pendingChange = false;
  27124. }
  27125. /**
  27126. * @param {?} control
  27127. * @param {?} dir
  27128. * @return {?}
  27129. */
  27130. function setUpModelChangePipeline(control, dir) {
  27131. control.registerOnChange(function (newValue, emitModelEvent) {
  27132. /** @type {?} */ ((
  27133. // control -> view
  27134. dir.valueAccessor)).writeValue(newValue);
  27135. // control -> ngModel
  27136. if (emitModelEvent)
  27137. dir.viewToModelUpdate(newValue);
  27138. });
  27139. }
  27140. /**
  27141. * @param {?} control
  27142. * @param {?} dir
  27143. * @return {?}
  27144. */
  27145. function setUpFormContainer(control, dir) {
  27146. if (control == null)
  27147. _throwError(dir, 'Cannot find control with');
  27148. control.validator = Validators.compose([control.validator, dir.validator]);
  27149. control.asyncValidator = Validators.composeAsync([control.asyncValidator, dir.asyncValidator]);
  27150. }
  27151. /**
  27152. * @param {?} dir
  27153. * @return {?}
  27154. */
  27155. function _noControlError(dir) {
  27156. return _throwError(dir, 'There is no FormControl instance attached to form control element with');
  27157. }
  27158. /**
  27159. * @param {?} dir
  27160. * @param {?} message
  27161. * @return {?}
  27162. */
  27163. function _throwError(dir, message) {
  27164. var /** @type {?} */ messageEnd;
  27165. if (/** @type {?} */ ((dir.path)).length > 1) {
  27166. messageEnd = "path: '" + (/** @type {?} */ ((dir.path))).join(' -> ') + "'";
  27167. }
  27168. else if (/** @type {?} */ ((dir.path))[0]) {
  27169. messageEnd = "name: '" + dir.path + "'";
  27170. }
  27171. else {
  27172. messageEnd = 'unspecified name attribute';
  27173. }
  27174. throw new Error(message + " " + messageEnd);
  27175. }
  27176. /**
  27177. * @param {?} validators
  27178. * @return {?}
  27179. */
  27180. function composeValidators(validators) {
  27181. return validators != null ? Validators.compose(validators.map(normalizeValidator)) : null;
  27182. }
  27183. /**
  27184. * @param {?} validators
  27185. * @return {?}
  27186. */
  27187. function composeAsyncValidators(validators) {
  27188. return validators != null ? Validators.composeAsync(validators.map(normalizeAsyncValidator)) :
  27189. null;
  27190. }
  27191. /**
  27192. * @param {?} changes
  27193. * @param {?} viewModel
  27194. * @return {?}
  27195. */
  27196. function isPropertyUpdated(changes, viewModel) {
  27197. if (!changes.hasOwnProperty('model'))
  27198. return false;
  27199. var /** @type {?} */ change = changes['model'];
  27200. if (change.isFirstChange())
  27201. return true;
  27202. return !Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_36" /* ɵlooseIdentical */])(viewModel, change.currentValue);
  27203. }
  27204. var BUILTIN_ACCESSORS = [
  27205. CheckboxControlValueAccessor,
  27206. RangeValueAccessor,
  27207. NumberValueAccessor,
  27208. SelectControlValueAccessor,
  27209. SelectMultipleControlValueAccessor,
  27210. RadioControlValueAccessor,
  27211. ];
  27212. /**
  27213. * @param {?} valueAccessor
  27214. * @return {?}
  27215. */
  27216. function isBuiltInAccessor(valueAccessor) {
  27217. return BUILTIN_ACCESSORS.some(function (a) { return valueAccessor.constructor === a; });
  27218. }
  27219. /**
  27220. * @param {?} form
  27221. * @param {?} directives
  27222. * @return {?}
  27223. */
  27224. function syncPendingControls(form, directives) {
  27225. form._syncPendingControls();
  27226. directives.forEach(function (dir) {
  27227. var /** @type {?} */ control = /** @type {?} */ (dir.control);
  27228. if (control.updateOn === 'submit' && control._pendingChange) {
  27229. dir.viewToModelUpdate(control._pendingValue);
  27230. control._pendingChange = false;
  27231. }
  27232. });
  27233. }
  27234. /**
  27235. * @param {?} dir
  27236. * @param {?} valueAccessors
  27237. * @return {?}
  27238. */
  27239. function selectValueAccessor(dir, valueAccessors) {
  27240. if (!valueAccessors)
  27241. return null;
  27242. if (!Array.isArray(valueAccessors))
  27243. _throwError(dir, 'Value accessor was not provided as an array for form control with');
  27244. var /** @type {?} */ defaultAccessor = undefined;
  27245. var /** @type {?} */ builtinAccessor = undefined;
  27246. var /** @type {?} */ customAccessor = undefined;
  27247. valueAccessors.forEach(function (v) {
  27248. if (v.constructor === DefaultValueAccessor) {
  27249. defaultAccessor = v;
  27250. }
  27251. else if (isBuiltInAccessor(v)) {
  27252. if (builtinAccessor)
  27253. _throwError(dir, 'More than one built-in value accessor matches form control with');
  27254. builtinAccessor = v;
  27255. }
  27256. else {
  27257. if (customAccessor)
  27258. _throwError(dir, 'More than one custom value accessor matches form control with');
  27259. customAccessor = v;
  27260. }
  27261. });
  27262. if (customAccessor)
  27263. return customAccessor;
  27264. if (builtinAccessor)
  27265. return builtinAccessor;
  27266. if (defaultAccessor)
  27267. return defaultAccessor;
  27268. _throwError(dir, 'No valid value accessor for form control with');
  27269. return null;
  27270. }
  27271. /**
  27272. * @template T
  27273. * @param {?} list
  27274. * @param {?} el
  27275. * @return {?}
  27276. */
  27277. function removeDir(list, el) {
  27278. var /** @type {?} */ index = list.indexOf(el);
  27279. if (index > -1)
  27280. list.splice(index, 1);
  27281. }
  27282. /**
  27283. * @fileoverview added by tsickle
  27284. * @suppress {checkTypes} checked by tsc
  27285. */
  27286. /**
  27287. * @license
  27288. * Copyright Google Inc. All Rights Reserved.
  27289. *
  27290. * Use of this source code is governed by an MIT-style license that can be
  27291. * found in the LICENSE file at https://angular.io/license
  27292. */
  27293. /**
  27294. * This is a base class for code shared between {\@link NgModelGroup} and {\@link FormGroupName}.
  27295. *
  27296. * \@stable
  27297. */
  27298. var AbstractFormGroupDirective = /** @class */ (function (_super) {
  27299. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(AbstractFormGroupDirective, _super);
  27300. function AbstractFormGroupDirective() {
  27301. return _super !== null && _super.apply(this, arguments) || this;
  27302. }
  27303. /**
  27304. * @return {?}
  27305. */
  27306. AbstractFormGroupDirective.prototype.ngOnInit = /**
  27307. * @return {?}
  27308. */
  27309. function () {
  27310. this._checkParentType(); /** @type {?} */
  27311. ((this.formDirective)).addFormGroup(this);
  27312. };
  27313. /**
  27314. * @return {?}
  27315. */
  27316. AbstractFormGroupDirective.prototype.ngOnDestroy = /**
  27317. * @return {?}
  27318. */
  27319. function () {
  27320. if (this.formDirective) {
  27321. this.formDirective.removeFormGroup(this);
  27322. }
  27323. };
  27324. Object.defineProperty(AbstractFormGroupDirective.prototype, "control", {
  27325. /**
  27326. * Get the {@link FormGroup} backing this binding.
  27327. */
  27328. get: /**
  27329. * Get the {\@link FormGroup} backing this binding.
  27330. * @return {?}
  27331. */
  27332. function () { return /** @type {?} */ ((this.formDirective)).getFormGroup(this); },
  27333. enumerable: true,
  27334. configurable: true
  27335. });
  27336. Object.defineProperty(AbstractFormGroupDirective.prototype, "path", {
  27337. /**
  27338. * Get the path to this control group.
  27339. */
  27340. get: /**
  27341. * Get the path to this control group.
  27342. * @return {?}
  27343. */
  27344. function () { return controlPath(this.name, this._parent); },
  27345. enumerable: true,
  27346. configurable: true
  27347. });
  27348. Object.defineProperty(AbstractFormGroupDirective.prototype, "formDirective", {
  27349. /**
  27350. * Get the {@link Form} to which this group belongs.
  27351. */
  27352. get: /**
  27353. * Get the {\@link Form} to which this group belongs.
  27354. * @return {?}
  27355. */
  27356. function () { return this._parent ? this._parent.formDirective : null; },
  27357. enumerable: true,
  27358. configurable: true
  27359. });
  27360. Object.defineProperty(AbstractFormGroupDirective.prototype, "validator", {
  27361. get: /**
  27362. * @return {?}
  27363. */
  27364. function () { return composeValidators(this._validators); },
  27365. enumerable: true,
  27366. configurable: true
  27367. });
  27368. Object.defineProperty(AbstractFormGroupDirective.prototype, "asyncValidator", {
  27369. get: /**
  27370. * @return {?}
  27371. */
  27372. function () {
  27373. return composeAsyncValidators(this._asyncValidators);
  27374. },
  27375. enumerable: true,
  27376. configurable: true
  27377. });
  27378. /** @internal */
  27379. /**
  27380. * \@internal
  27381. * @return {?}
  27382. */
  27383. AbstractFormGroupDirective.prototype._checkParentType = /**
  27384. * \@internal
  27385. * @return {?}
  27386. */
  27387. function () { };
  27388. return AbstractFormGroupDirective;
  27389. }(ControlContainer));
  27390. /**
  27391. * @fileoverview added by tsickle
  27392. * @suppress {checkTypes} checked by tsc
  27393. */
  27394. /**
  27395. * @license
  27396. * Copyright Google Inc. All Rights Reserved.
  27397. *
  27398. * Use of this source code is governed by an MIT-style license that can be
  27399. * found in the LICENSE file at https://angular.io/license
  27400. */
  27401. var AbstractControlStatus = /** @class */ (function () {
  27402. function AbstractControlStatus(cd) {
  27403. this._cd = cd;
  27404. }
  27405. Object.defineProperty(AbstractControlStatus.prototype, "ngClassUntouched", {
  27406. get: /**
  27407. * @return {?}
  27408. */
  27409. function () { return this._cd.control ? this._cd.control.untouched : false; },
  27410. enumerable: true,
  27411. configurable: true
  27412. });
  27413. Object.defineProperty(AbstractControlStatus.prototype, "ngClassTouched", {
  27414. get: /**
  27415. * @return {?}
  27416. */
  27417. function () { return this._cd.control ? this._cd.control.touched : false; },
  27418. enumerable: true,
  27419. configurable: true
  27420. });
  27421. Object.defineProperty(AbstractControlStatus.prototype, "ngClassPristine", {
  27422. get: /**
  27423. * @return {?}
  27424. */
  27425. function () { return this._cd.control ? this._cd.control.pristine : false; },
  27426. enumerable: true,
  27427. configurable: true
  27428. });
  27429. Object.defineProperty(AbstractControlStatus.prototype, "ngClassDirty", {
  27430. get: /**
  27431. * @return {?}
  27432. */
  27433. function () { return this._cd.control ? this._cd.control.dirty : false; },
  27434. enumerable: true,
  27435. configurable: true
  27436. });
  27437. Object.defineProperty(AbstractControlStatus.prototype, "ngClassValid", {
  27438. get: /**
  27439. * @return {?}
  27440. */
  27441. function () { return this._cd.control ? this._cd.control.valid : false; },
  27442. enumerable: true,
  27443. configurable: true
  27444. });
  27445. Object.defineProperty(AbstractControlStatus.prototype, "ngClassInvalid", {
  27446. get: /**
  27447. * @return {?}
  27448. */
  27449. function () { return this._cd.control ? this._cd.control.invalid : false; },
  27450. enumerable: true,
  27451. configurable: true
  27452. });
  27453. Object.defineProperty(AbstractControlStatus.prototype, "ngClassPending", {
  27454. get: /**
  27455. * @return {?}
  27456. */
  27457. function () { return this._cd.control ? this._cd.control.pending : false; },
  27458. enumerable: true,
  27459. configurable: true
  27460. });
  27461. return AbstractControlStatus;
  27462. }());
  27463. var ngControlStatusHost = {
  27464. '[class.ng-untouched]': 'ngClassUntouched',
  27465. '[class.ng-touched]': 'ngClassTouched',
  27466. '[class.ng-pristine]': 'ngClassPristine',
  27467. '[class.ng-dirty]': 'ngClassDirty',
  27468. '[class.ng-valid]': 'ngClassValid',
  27469. '[class.ng-invalid]': 'ngClassInvalid',
  27470. '[class.ng-pending]': 'ngClassPending',
  27471. };
  27472. /**
  27473. * Directive automatically applied to Angular form controls that sets CSS classes
  27474. * based on control status. The following classes are applied as the properties
  27475. * become true:
  27476. *
  27477. * * ng-valid
  27478. * * ng-invalid
  27479. * * ng-pending
  27480. * * ng-pristine
  27481. * * ng-dirty
  27482. * * ng-untouched
  27483. * * ng-touched
  27484. *
  27485. * \@stable
  27486. */
  27487. var NgControlStatus = /** @class */ (function (_super) {
  27488. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(NgControlStatus, _super);
  27489. function NgControlStatus(cd) {
  27490. return _super.call(this, cd) || this;
  27491. }
  27492. NgControlStatus.decorators = [
  27493. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["s" /* Directive */], args: [{ selector: '[formControlName],[ngModel],[formControl]', host: ngControlStatusHost },] },
  27494. ];
  27495. /** @nocollapse */
  27496. NgControlStatus.ctorParameters = function () { return [
  27497. { type: NgControl, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["_1" /* Self */] },] },
  27498. ]; };
  27499. return NgControlStatus;
  27500. }(AbstractControlStatus));
  27501. /**
  27502. * Directive automatically applied to Angular form groups that sets CSS classes
  27503. * based on control status (valid/invalid/dirty/etc).
  27504. *
  27505. * \@stable
  27506. */
  27507. var NgControlStatusGroup = /** @class */ (function (_super) {
  27508. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(NgControlStatusGroup, _super);
  27509. function NgControlStatusGroup(cd) {
  27510. return _super.call(this, cd) || this;
  27511. }
  27512. NgControlStatusGroup.decorators = [
  27513. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["s" /* Directive */], args: [{
  27514. selector: '[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]',
  27515. host: ngControlStatusHost
  27516. },] },
  27517. ];
  27518. /** @nocollapse */
  27519. NgControlStatusGroup.ctorParameters = function () { return [
  27520. { type: ControlContainer, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["_1" /* Self */] },] },
  27521. ]; };
  27522. return NgControlStatusGroup;
  27523. }(AbstractControlStatus));
  27524. /**
  27525. * @fileoverview added by tsickle
  27526. * @suppress {checkTypes} checked by tsc
  27527. */
  27528. /**
  27529. * @license
  27530. * Copyright Google Inc. All Rights Reserved.
  27531. *
  27532. * Use of this source code is governed by an MIT-style license that can be
  27533. * found in the LICENSE file at https://angular.io/license
  27534. */
  27535. /**
  27536. * Indicates that a FormControl is valid, i.e. that no errors exist in the input value.
  27537. */
  27538. var VALID = 'VALID';
  27539. /**
  27540. * Indicates that a FormControl is invalid, i.e. that an error exists in the input value.
  27541. */
  27542. var INVALID = 'INVALID';
  27543. /**
  27544. * Indicates that a FormControl is pending, i.e. that async validation is occurring and
  27545. * errors are not yet available for the input value.
  27546. */
  27547. var PENDING = 'PENDING';
  27548. /**
  27549. * Indicates that a FormControl is disabled, i.e. that the control is exempt from ancestor
  27550. * calculations of validity or value.
  27551. */
  27552. var DISABLED = 'DISABLED';
  27553. /**
  27554. * @param {?} control
  27555. * @param {?} path
  27556. * @param {?} delimiter
  27557. * @return {?}
  27558. */
  27559. function _find(control, path, delimiter) {
  27560. if (path == null)
  27561. return null;
  27562. if (!(path instanceof Array)) {
  27563. path = (/** @type {?} */ (path)).split(delimiter);
  27564. }
  27565. if (path instanceof Array && (path.length === 0))
  27566. return null;
  27567. return (/** @type {?} */ (path)).reduce(function (v, name) {
  27568. if (v instanceof FormGroup) {
  27569. return v.controls[name] || null;
  27570. }
  27571. if (v instanceof FormArray) {
  27572. return v.at(/** @type {?} */ (name)) || null;
  27573. }
  27574. return null;
  27575. }, control);
  27576. }
  27577. /**
  27578. * @param {?=} validatorOrOpts
  27579. * @return {?}
  27580. */
  27581. function coerceToValidator(validatorOrOpts) {
  27582. var /** @type {?} */ validator = /** @type {?} */ ((isOptionsObj(validatorOrOpts) ? (/** @type {?} */ (validatorOrOpts)).validators :
  27583. validatorOrOpts));
  27584. return Array.isArray(validator) ? composeValidators(validator) : validator || null;
  27585. }
  27586. /**
  27587. * @param {?=} asyncValidator
  27588. * @param {?=} validatorOrOpts
  27589. * @return {?}
  27590. */
  27591. function coerceToAsyncValidator(asyncValidator, validatorOrOpts) {
  27592. var /** @type {?} */ origAsyncValidator = /** @type {?} */ ((isOptionsObj(validatorOrOpts) ? (/** @type {?} */ (validatorOrOpts)).asyncValidators :
  27593. asyncValidator));
  27594. return Array.isArray(origAsyncValidator) ? composeAsyncValidators(origAsyncValidator) :
  27595. origAsyncValidator || null;
  27596. }
  27597. /**
  27598. * @record
  27599. */
  27600. /**
  27601. * @param {?=} validatorOrOpts
  27602. * @return {?}
  27603. */
  27604. function isOptionsObj(validatorOrOpts) {
  27605. return validatorOrOpts != null && !Array.isArray(validatorOrOpts) &&
  27606. typeof validatorOrOpts === 'object';
  27607. }
  27608. /**
  27609. * \@whatItDoes This is the base class for {\@link FormControl}, {\@link FormGroup}, and
  27610. * {\@link FormArray}.
  27611. *
  27612. * It provides some of the shared behavior that all controls and groups of controls have, like
  27613. * running validators, calculating status, and resetting state. It also defines the properties
  27614. * that are shared between all sub-classes, like `value`, `valid`, and `dirty`. It shouldn't be
  27615. * instantiated directly.
  27616. *
  27617. * \@stable
  27618. * @abstract
  27619. */
  27620. var AbstractControl = /** @class */ (function () {
  27621. function AbstractControl(validator, asyncValidator) {
  27622. this.validator = validator;
  27623. this.asyncValidator = asyncValidator;
  27624. /**
  27625. * \@internal
  27626. */
  27627. this._onCollectionChange = function () { };
  27628. /**
  27629. * A control is `pristine` if the user has not yet changed
  27630. * the value in the UI.
  27631. *
  27632. * Note that programmatic changes to a control's value will
  27633. * *not* mark it dirty.
  27634. */
  27635. this.pristine = true;
  27636. /**
  27637. * A control is marked `touched` once the user has triggered
  27638. * a `blur` event on it.
  27639. */
  27640. this.touched = false;
  27641. /**
  27642. * \@internal
  27643. */
  27644. this._onDisabledChange = [];
  27645. }
  27646. Object.defineProperty(AbstractControl.prototype, "parent", {
  27647. /**
  27648. * The parent control.
  27649. */
  27650. get: /**
  27651. * The parent control.
  27652. * @return {?}
  27653. */
  27654. function () { return this._parent; },
  27655. enumerable: true,
  27656. configurable: true
  27657. });
  27658. Object.defineProperty(AbstractControl.prototype, "valid", {
  27659. /**
  27660. * A control is `valid` when its `status === VALID`.
  27661. *
  27662. * In order to have this status, the control must have passed all its
  27663. * validation checks.
  27664. */
  27665. get: /**
  27666. * A control is `valid` when its `status === VALID`.
  27667. *
  27668. * In order to have this status, the control must have passed all its
  27669. * validation checks.
  27670. * @return {?}
  27671. */
  27672. function () { return this.status === VALID; },
  27673. enumerable: true,
  27674. configurable: true
  27675. });
  27676. Object.defineProperty(AbstractControl.prototype, "invalid", {
  27677. /**
  27678. * A control is `invalid` when its `status === INVALID`.
  27679. *
  27680. * In order to have this status, the control must have failed
  27681. * at least one of its validation checks.
  27682. */
  27683. get: /**
  27684. * A control is `invalid` when its `status === INVALID`.
  27685. *
  27686. * In order to have this status, the control must have failed
  27687. * at least one of its validation checks.
  27688. * @return {?}
  27689. */
  27690. function () { return this.status === INVALID; },
  27691. enumerable: true,
  27692. configurable: true
  27693. });
  27694. Object.defineProperty(AbstractControl.prototype, "pending", {
  27695. /**
  27696. * A control is `pending` when its `status === PENDING`.
  27697. *
  27698. * In order to have this status, the control must be in the
  27699. * middle of conducting a validation check.
  27700. */
  27701. get: /**
  27702. * A control is `pending` when its `status === PENDING`.
  27703. *
  27704. * In order to have this status, the control must be in the
  27705. * middle of conducting a validation check.
  27706. * @return {?}
  27707. */
  27708. function () { return this.status == PENDING; },
  27709. enumerable: true,
  27710. configurable: true
  27711. });
  27712. Object.defineProperty(AbstractControl.prototype, "disabled", {
  27713. /**
  27714. * A control is `disabled` when its `status === DISABLED`.
  27715. *
  27716. * Disabled controls are exempt from validation checks and
  27717. * are not included in the aggregate value of their ancestor
  27718. * controls.
  27719. */
  27720. get: /**
  27721. * A control is `disabled` when its `status === DISABLED`.
  27722. *
  27723. * Disabled controls are exempt from validation checks and
  27724. * are not included in the aggregate value of their ancestor
  27725. * controls.
  27726. * @return {?}
  27727. */
  27728. function () { return this.status === DISABLED; },
  27729. enumerable: true,
  27730. configurable: true
  27731. });
  27732. Object.defineProperty(AbstractControl.prototype, "enabled", {
  27733. /**
  27734. * A control is `enabled` as long as its `status !== DISABLED`.
  27735. *
  27736. * In other words, it has a status of `VALID`, `INVALID`, or
  27737. * `PENDING`.
  27738. */
  27739. get: /**
  27740. * A control is `enabled` as long as its `status !== DISABLED`.
  27741. *
  27742. * In other words, it has a status of `VALID`, `INVALID`, or
  27743. * `PENDING`.
  27744. * @return {?}
  27745. */
  27746. function () { return this.status !== DISABLED; },
  27747. enumerable: true,
  27748. configurable: true
  27749. });
  27750. Object.defineProperty(AbstractControl.prototype, "dirty", {
  27751. /**
  27752. * A control is `dirty` if the user has changed the value
  27753. * in the UI.
  27754. *
  27755. * Note that programmatic changes to a control's value will
  27756. * *not* mark it dirty.
  27757. */
  27758. get: /**
  27759. * A control is `dirty` if the user has changed the value
  27760. * in the UI.
  27761. *
  27762. * Note that programmatic changes to a control's value will
  27763. * *not* mark it dirty.
  27764. * @return {?}
  27765. */
  27766. function () { return !this.pristine; },
  27767. enumerable: true,
  27768. configurable: true
  27769. });
  27770. Object.defineProperty(AbstractControl.prototype, "untouched", {
  27771. /**
  27772. * A control is `untouched` if the user has not yet triggered
  27773. * a `blur` event on it.
  27774. */
  27775. get: /**
  27776. * A control is `untouched` if the user has not yet triggered
  27777. * a `blur` event on it.
  27778. * @return {?}
  27779. */
  27780. function () { return !this.touched; },
  27781. enumerable: true,
  27782. configurable: true
  27783. });
  27784. Object.defineProperty(AbstractControl.prototype, "updateOn", {
  27785. /**
  27786. * Returns the update strategy of the `AbstractControl` (i.e.
  27787. * the event on which the control will update itself).
  27788. * Possible values: `'change'` (default) | `'blur'` | `'submit'`
  27789. */
  27790. get: /**
  27791. * Returns the update strategy of the `AbstractControl` (i.e.
  27792. * the event on which the control will update itself).
  27793. * Possible values: `'change'` (default) | `'blur'` | `'submit'`
  27794. * @return {?}
  27795. */
  27796. function () {
  27797. return this._updateOn ? this._updateOn : (this.parent ? this.parent.updateOn : 'change');
  27798. },
  27799. enumerable: true,
  27800. configurable: true
  27801. });
  27802. /**
  27803. * Sets the synchronous validators that are active on this control. Calling
  27804. * this will overwrite any existing sync validators.
  27805. */
  27806. /**
  27807. * Sets the synchronous validators that are active on this control. Calling
  27808. * this will overwrite any existing sync validators.
  27809. * @param {?} newValidator
  27810. * @return {?}
  27811. */
  27812. AbstractControl.prototype.setValidators = /**
  27813. * Sets the synchronous validators that are active on this control. Calling
  27814. * this will overwrite any existing sync validators.
  27815. * @param {?} newValidator
  27816. * @return {?}
  27817. */
  27818. function (newValidator) {
  27819. this.validator = coerceToValidator(newValidator);
  27820. };
  27821. /**
  27822. * Sets the async validators that are active on this control. Calling this
  27823. * will overwrite any existing async validators.
  27824. */
  27825. /**
  27826. * Sets the async validators that are active on this control. Calling this
  27827. * will overwrite any existing async validators.
  27828. * @param {?} newValidator
  27829. * @return {?}
  27830. */
  27831. AbstractControl.prototype.setAsyncValidators = /**
  27832. * Sets the async validators that are active on this control. Calling this
  27833. * will overwrite any existing async validators.
  27834. * @param {?} newValidator
  27835. * @return {?}
  27836. */
  27837. function (newValidator) {
  27838. this.asyncValidator = coerceToAsyncValidator(newValidator);
  27839. };
  27840. /**
  27841. * Empties out the sync validator list.
  27842. */
  27843. /**
  27844. * Empties out the sync validator list.
  27845. * @return {?}
  27846. */
  27847. AbstractControl.prototype.clearValidators = /**
  27848. * Empties out the sync validator list.
  27849. * @return {?}
  27850. */
  27851. function () { this.validator = null; };
  27852. /**
  27853. * Empties out the async validator list.
  27854. */
  27855. /**
  27856. * Empties out the async validator list.
  27857. * @return {?}
  27858. */
  27859. AbstractControl.prototype.clearAsyncValidators = /**
  27860. * Empties out the async validator list.
  27861. * @return {?}
  27862. */
  27863. function () { this.asyncValidator = null; };
  27864. /**
  27865. * Marks the control as `touched`.
  27866. *
  27867. * This will also mark all direct ancestors as `touched` to maintain
  27868. * the model.
  27869. */
  27870. /**
  27871. * Marks the control as `touched`.
  27872. *
  27873. * This will also mark all direct ancestors as `touched` to maintain
  27874. * the model.
  27875. * @param {?=} opts
  27876. * @return {?}
  27877. */
  27878. AbstractControl.prototype.markAsTouched = /**
  27879. * Marks the control as `touched`.
  27880. *
  27881. * This will also mark all direct ancestors as `touched` to maintain
  27882. * the model.
  27883. * @param {?=} opts
  27884. * @return {?}
  27885. */
  27886. function (opts) {
  27887. if (opts === void 0) { opts = {}; }
  27888. (/** @type {?} */ (this)).touched = true;
  27889. if (this._parent && !opts.onlySelf) {
  27890. this._parent.markAsTouched(opts);
  27891. }
  27892. };
  27893. /**
  27894. * Marks the control as `untouched`.
  27895. *
  27896. * If the control has any children, it will also mark all children as `untouched`
  27897. * to maintain the model, and re-calculate the `touched` status of all parent
  27898. * controls.
  27899. */
  27900. /**
  27901. * Marks the control as `untouched`.
  27902. *
  27903. * If the control has any children, it will also mark all children as `untouched`
  27904. * to maintain the model, and re-calculate the `touched` status of all parent
  27905. * controls.
  27906. * @param {?=} opts
  27907. * @return {?}
  27908. */
  27909. AbstractControl.prototype.markAsUntouched = /**
  27910. * Marks the control as `untouched`.
  27911. *
  27912. * If the control has any children, it will also mark all children as `untouched`
  27913. * to maintain the model, and re-calculate the `touched` status of all parent
  27914. * controls.
  27915. * @param {?=} opts
  27916. * @return {?}
  27917. */
  27918. function (opts) {
  27919. if (opts === void 0) { opts = {}; }
  27920. (/** @type {?} */ (this)).touched = false;
  27921. this._pendingTouched = false;
  27922. this._forEachChild(function (control) { control.markAsUntouched({ onlySelf: true }); });
  27923. if (this._parent && !opts.onlySelf) {
  27924. this._parent._updateTouched(opts);
  27925. }
  27926. };
  27927. /**
  27928. * Marks the control as `dirty`.
  27929. *
  27930. * This will also mark all direct ancestors as `dirty` to maintain
  27931. * the model.
  27932. */
  27933. /**
  27934. * Marks the control as `dirty`.
  27935. *
  27936. * This will also mark all direct ancestors as `dirty` to maintain
  27937. * the model.
  27938. * @param {?=} opts
  27939. * @return {?}
  27940. */
  27941. AbstractControl.prototype.markAsDirty = /**
  27942. * Marks the control as `dirty`.
  27943. *
  27944. * This will also mark all direct ancestors as `dirty` to maintain
  27945. * the model.
  27946. * @param {?=} opts
  27947. * @return {?}
  27948. */
  27949. function (opts) {
  27950. if (opts === void 0) { opts = {}; }
  27951. (/** @type {?} */ (this)).pristine = false;
  27952. if (this._parent && !opts.onlySelf) {
  27953. this._parent.markAsDirty(opts);
  27954. }
  27955. };
  27956. /**
  27957. * Marks the control as `pristine`.
  27958. *
  27959. * If the control has any children, it will also mark all children as `pristine`
  27960. * to maintain the model, and re-calculate the `pristine` status of all parent
  27961. * controls.
  27962. */
  27963. /**
  27964. * Marks the control as `pristine`.
  27965. *
  27966. * If the control has any children, it will also mark all children as `pristine`
  27967. * to maintain the model, and re-calculate the `pristine` status of all parent
  27968. * controls.
  27969. * @param {?=} opts
  27970. * @return {?}
  27971. */
  27972. AbstractControl.prototype.markAsPristine = /**
  27973. * Marks the control as `pristine`.
  27974. *
  27975. * If the control has any children, it will also mark all children as `pristine`
  27976. * to maintain the model, and re-calculate the `pristine` status of all parent
  27977. * controls.
  27978. * @param {?=} opts
  27979. * @return {?}
  27980. */
  27981. function (opts) {
  27982. if (opts === void 0) { opts = {}; }
  27983. (/** @type {?} */ (this)).pristine = true;
  27984. this._pendingDirty = false;
  27985. this._forEachChild(function (control) { control.markAsPristine({ onlySelf: true }); });
  27986. if (this._parent && !opts.onlySelf) {
  27987. this._parent._updatePristine(opts);
  27988. }
  27989. };
  27990. /**
  27991. * Marks the control as `pending`.
  27992. */
  27993. /**
  27994. * Marks the control as `pending`.
  27995. * @param {?=} opts
  27996. * @return {?}
  27997. */
  27998. AbstractControl.prototype.markAsPending = /**
  27999. * Marks the control as `pending`.
  28000. * @param {?=} opts
  28001. * @return {?}
  28002. */
  28003. function (opts) {
  28004. if (opts === void 0) { opts = {}; }
  28005. (/** @type {?} */ (this)).status = PENDING;
  28006. if (this._parent && !opts.onlySelf) {
  28007. this._parent.markAsPending(opts);
  28008. }
  28009. };
  28010. /**
  28011. * Disables the control. This means the control will be exempt from validation checks and
  28012. * excluded from the aggregate value of any parent. Its status is `DISABLED`.
  28013. *
  28014. * If the control has children, all children will be disabled to maintain the model.
  28015. */
  28016. /**
  28017. * Disables the control. This means the control will be exempt from validation checks and
  28018. * excluded from the aggregate value of any parent. Its status is `DISABLED`.
  28019. *
  28020. * If the control has children, all children will be disabled to maintain the model.
  28021. * @param {?=} opts
  28022. * @return {?}
  28023. */
  28024. AbstractControl.prototype.disable = /**
  28025. * Disables the control. This means the control will be exempt from validation checks and
  28026. * excluded from the aggregate value of any parent. Its status is `DISABLED`.
  28027. *
  28028. * If the control has children, all children will be disabled to maintain the model.
  28029. * @param {?=} opts
  28030. * @return {?}
  28031. */
  28032. function (opts) {
  28033. if (opts === void 0) { opts = {}; }
  28034. (/** @type {?} */ (this)).status = DISABLED;
  28035. (/** @type {?} */ (this)).errors = null;
  28036. this._forEachChild(function (control) { control.disable(Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */])({}, opts, { onlySelf: true })); });
  28037. this._updateValue();
  28038. if (opts.emitEvent !== false) {
  28039. (/** @type {?} */ (this.valueChanges)).emit(this.value);
  28040. (/** @type {?} */ (this.statusChanges)).emit(this.status);
  28041. }
  28042. this._updateAncestors(opts);
  28043. this._onDisabledChange.forEach(function (changeFn) { return changeFn(true); });
  28044. };
  28045. /**
  28046. * Enables the control. This means the control will be included in validation checks and
  28047. * the aggregate value of its parent. Its status is re-calculated based on its value and
  28048. * its validators.
  28049. *
  28050. * If the control has children, all children will be enabled.
  28051. */
  28052. /**
  28053. * Enables the control. This means the control will be included in validation checks and
  28054. * the aggregate value of its parent. Its status is re-calculated based on its value and
  28055. * its validators.
  28056. *
  28057. * If the control has children, all children will be enabled.
  28058. * @param {?=} opts
  28059. * @return {?}
  28060. */
  28061. AbstractControl.prototype.enable = /**
  28062. * Enables the control. This means the control will be included in validation checks and
  28063. * the aggregate value of its parent. Its status is re-calculated based on its value and
  28064. * its validators.
  28065. *
  28066. * If the control has children, all children will be enabled.
  28067. * @param {?=} opts
  28068. * @return {?}
  28069. */
  28070. function (opts) {
  28071. if (opts === void 0) { opts = {}; }
  28072. (/** @type {?} */ (this)).status = VALID;
  28073. this._forEachChild(function (control) { control.enable(Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */])({}, opts, { onlySelf: true })); });
  28074. this.updateValueAndValidity({ onlySelf: true, emitEvent: opts.emitEvent });
  28075. this._updateAncestors(opts);
  28076. this._onDisabledChange.forEach(function (changeFn) { return changeFn(false); });
  28077. };
  28078. /**
  28079. * @param {?} opts
  28080. * @return {?}
  28081. */
  28082. AbstractControl.prototype._updateAncestors = /**
  28083. * @param {?} opts
  28084. * @return {?}
  28085. */
  28086. function (opts) {
  28087. if (this._parent && !opts.onlySelf) {
  28088. this._parent.updateValueAndValidity(opts);
  28089. this._parent._updatePristine();
  28090. this._parent._updateTouched();
  28091. }
  28092. };
  28093. /**
  28094. * @param {?} parent
  28095. * @return {?}
  28096. */
  28097. AbstractControl.prototype.setParent = /**
  28098. * @param {?} parent
  28099. * @return {?}
  28100. */
  28101. function (parent) { this._parent = parent; };
  28102. /**
  28103. * Re-calculates the value and validation status of the control.
  28104. *
  28105. * By default, it will also update the value and validity of its ancestors.
  28106. */
  28107. /**
  28108. * Re-calculates the value and validation status of the control.
  28109. *
  28110. * By default, it will also update the value and validity of its ancestors.
  28111. * @param {?=} opts
  28112. * @return {?}
  28113. */
  28114. AbstractControl.prototype.updateValueAndValidity = /**
  28115. * Re-calculates the value and validation status of the control.
  28116. *
  28117. * By default, it will also update the value and validity of its ancestors.
  28118. * @param {?=} opts
  28119. * @return {?}
  28120. */
  28121. function (opts) {
  28122. if (opts === void 0) { opts = {}; }
  28123. this._setInitialStatus();
  28124. this._updateValue();
  28125. if (this.enabled) {
  28126. this._cancelExistingSubscription();
  28127. (/** @type {?} */ (this)).errors = this._runValidator();
  28128. (/** @type {?} */ (this)).status = this._calculateStatus();
  28129. if (this.status === VALID || this.status === PENDING) {
  28130. this._runAsyncValidator(opts.emitEvent);
  28131. }
  28132. }
  28133. if (opts.emitEvent !== false) {
  28134. (/** @type {?} */ (this.valueChanges)).emit(this.value);
  28135. (/** @type {?} */ (this.statusChanges)).emit(this.status);
  28136. }
  28137. if (this._parent && !opts.onlySelf) {
  28138. this._parent.updateValueAndValidity(opts);
  28139. }
  28140. };
  28141. /** @internal */
  28142. /**
  28143. * \@internal
  28144. * @param {?=} opts
  28145. * @return {?}
  28146. */
  28147. AbstractControl.prototype._updateTreeValidity = /**
  28148. * \@internal
  28149. * @param {?=} opts
  28150. * @return {?}
  28151. */
  28152. function (opts) {
  28153. if (opts === void 0) { opts = { emitEvent: true }; }
  28154. this._forEachChild(function (ctrl) { return ctrl._updateTreeValidity(opts); });
  28155. this.updateValueAndValidity({ onlySelf: true, emitEvent: opts.emitEvent });
  28156. };
  28157. /**
  28158. * @return {?}
  28159. */
  28160. AbstractControl.prototype._setInitialStatus = /**
  28161. * @return {?}
  28162. */
  28163. function () {
  28164. (/** @type {?} */ (this)).status = this._allControlsDisabled() ? DISABLED : VALID;
  28165. };
  28166. /**
  28167. * @return {?}
  28168. */
  28169. AbstractControl.prototype._runValidator = /**
  28170. * @return {?}
  28171. */
  28172. function () {
  28173. return this.validator ? this.validator(this) : null;
  28174. };
  28175. /**
  28176. * @param {?=} emitEvent
  28177. * @return {?}
  28178. */
  28179. AbstractControl.prototype._runAsyncValidator = /**
  28180. * @param {?=} emitEvent
  28181. * @return {?}
  28182. */
  28183. function (emitEvent) {
  28184. var _this = this;
  28185. if (this.asyncValidator) {
  28186. (/** @type {?} */ (this)).status = PENDING;
  28187. var /** @type {?} */ obs = toObservable(this.asyncValidator(this));
  28188. this._asyncValidationSubscription =
  28189. obs.subscribe(function (errors) { return _this.setErrors(errors, { emitEvent: emitEvent }); });
  28190. }
  28191. };
  28192. /**
  28193. * @return {?}
  28194. */
  28195. AbstractControl.prototype._cancelExistingSubscription = /**
  28196. * @return {?}
  28197. */
  28198. function () {
  28199. if (this._asyncValidationSubscription) {
  28200. this._asyncValidationSubscription.unsubscribe();
  28201. }
  28202. };
  28203. /**
  28204. * Sets errors on a form control.
  28205. *
  28206. * This is used when validations are run manually by the user, rather than automatically.
  28207. *
  28208. * Calling `setErrors` will also update the validity of the parent control.
  28209. *
  28210. * ### Example
  28211. *
  28212. * ```
  28213. * const login = new FormControl("someLogin");
  28214. * login.setErrors({
  28215. * "notUnique": true
  28216. * });
  28217. *
  28218. * expect(login.valid).toEqual(false);
  28219. * expect(login.errors).toEqual({"notUnique": true});
  28220. *
  28221. * login.setValue("someOtherLogin");
  28222. *
  28223. * expect(login.valid).toEqual(true);
  28224. * ```
  28225. */
  28226. /**
  28227. * Sets errors on a form control.
  28228. *
  28229. * This is used when validations are run manually by the user, rather than automatically.
  28230. *
  28231. * Calling `setErrors` will also update the validity of the parent control.
  28232. *
  28233. * ### Example
  28234. *
  28235. * ```
  28236. * const login = new FormControl("someLogin");
  28237. * login.setErrors({
  28238. * "notUnique": true
  28239. * });
  28240. *
  28241. * expect(login.valid).toEqual(false);
  28242. * expect(login.errors).toEqual({"notUnique": true});
  28243. *
  28244. * login.setValue("someOtherLogin");
  28245. *
  28246. * expect(login.valid).toEqual(true);
  28247. * ```
  28248. * @param {?} errors
  28249. * @param {?=} opts
  28250. * @return {?}
  28251. */
  28252. AbstractControl.prototype.setErrors = /**
  28253. * Sets errors on a form control.
  28254. *
  28255. * This is used when validations are run manually by the user, rather than automatically.
  28256. *
  28257. * Calling `setErrors` will also update the validity of the parent control.
  28258. *
  28259. * ### Example
  28260. *
  28261. * ```
  28262. * const login = new FormControl("someLogin");
  28263. * login.setErrors({
  28264. * "notUnique": true
  28265. * });
  28266. *
  28267. * expect(login.valid).toEqual(false);
  28268. * expect(login.errors).toEqual({"notUnique": true});
  28269. *
  28270. * login.setValue("someOtherLogin");
  28271. *
  28272. * expect(login.valid).toEqual(true);
  28273. * ```
  28274. * @param {?} errors
  28275. * @param {?=} opts
  28276. * @return {?}
  28277. */
  28278. function (errors, opts) {
  28279. if (opts === void 0) { opts = {}; }
  28280. (/** @type {?} */ (this)).errors = errors;
  28281. this._updateControlsErrors(opts.emitEvent !== false);
  28282. };
  28283. /**
  28284. * Retrieves a child control given the control's name or path.
  28285. *
  28286. * Paths can be passed in as an array or a string delimited by a dot.
  28287. *
  28288. * To get a control nested within a `person` sub-group:
  28289. *
  28290. * * `this.form.get('person.name');`
  28291. *
  28292. * -OR-
  28293. *
  28294. * * `this.form.get(['person', 'name']);`
  28295. */
  28296. /**
  28297. * Retrieves a child control given the control's name or path.
  28298. *
  28299. * Paths can be passed in as an array or a string delimited by a dot.
  28300. *
  28301. * To get a control nested within a `person` sub-group:
  28302. *
  28303. * * `this.form.get('person.name');`
  28304. *
  28305. * -OR-
  28306. *
  28307. * * `this.form.get(['person', 'name']);`
  28308. * @param {?} path
  28309. * @return {?}
  28310. */
  28311. AbstractControl.prototype.get = /**
  28312. * Retrieves a child control given the control's name or path.
  28313. *
  28314. * Paths can be passed in as an array or a string delimited by a dot.
  28315. *
  28316. * To get a control nested within a `person` sub-group:
  28317. *
  28318. * * `this.form.get('person.name');`
  28319. *
  28320. * -OR-
  28321. *
  28322. * * `this.form.get(['person', 'name']);`
  28323. * @param {?} path
  28324. * @return {?}
  28325. */
  28326. function (path) { return _find(this, path, '.'); };
  28327. /**
  28328. * Returns error data if the control with the given path has the error specified. Otherwise
  28329. * returns null or undefined.
  28330. *
  28331. * If no path is given, it checks for the error on the present control.
  28332. */
  28333. /**
  28334. * Returns error data if the control with the given path has the error specified. Otherwise
  28335. * returns null or undefined.
  28336. *
  28337. * If no path is given, it checks for the error on the present control.
  28338. * @param {?} errorCode
  28339. * @param {?=} path
  28340. * @return {?}
  28341. */
  28342. AbstractControl.prototype.getError = /**
  28343. * Returns error data if the control with the given path has the error specified. Otherwise
  28344. * returns null or undefined.
  28345. *
  28346. * If no path is given, it checks for the error on the present control.
  28347. * @param {?} errorCode
  28348. * @param {?=} path
  28349. * @return {?}
  28350. */
  28351. function (errorCode, path) {
  28352. var /** @type {?} */ control = path ? this.get(path) : this;
  28353. return control && control.errors ? control.errors[errorCode] : null;
  28354. };
  28355. /**
  28356. * Returns true if the control with the given path has the error specified. Otherwise
  28357. * returns false.
  28358. *
  28359. * If no path is given, it checks for the error on the present control.
  28360. */
  28361. /**
  28362. * Returns true if the control with the given path has the error specified. Otherwise
  28363. * returns false.
  28364. *
  28365. * If no path is given, it checks for the error on the present control.
  28366. * @param {?} errorCode
  28367. * @param {?=} path
  28368. * @return {?}
  28369. */
  28370. AbstractControl.prototype.hasError = /**
  28371. * Returns true if the control with the given path has the error specified. Otherwise
  28372. * returns false.
  28373. *
  28374. * If no path is given, it checks for the error on the present control.
  28375. * @param {?} errorCode
  28376. * @param {?=} path
  28377. * @return {?}
  28378. */
  28379. function (errorCode, path) { return !!this.getError(errorCode, path); };
  28380. Object.defineProperty(AbstractControl.prototype, "root", {
  28381. /**
  28382. * Retrieves the top-level ancestor of this control.
  28383. */
  28384. get: /**
  28385. * Retrieves the top-level ancestor of this control.
  28386. * @return {?}
  28387. */
  28388. function () {
  28389. var /** @type {?} */ x = this;
  28390. while (x._parent) {
  28391. x = x._parent;
  28392. }
  28393. return x;
  28394. },
  28395. enumerable: true,
  28396. configurable: true
  28397. });
  28398. /** @internal */
  28399. /**
  28400. * \@internal
  28401. * @param {?} emitEvent
  28402. * @return {?}
  28403. */
  28404. AbstractControl.prototype._updateControlsErrors = /**
  28405. * \@internal
  28406. * @param {?} emitEvent
  28407. * @return {?}
  28408. */
  28409. function (emitEvent) {
  28410. (/** @type {?} */ (this)).status = this._calculateStatus();
  28411. if (emitEvent) {
  28412. (/** @type {?} */ (this.statusChanges)).emit(this.status);
  28413. }
  28414. if (this._parent) {
  28415. this._parent._updateControlsErrors(emitEvent);
  28416. }
  28417. };
  28418. /** @internal */
  28419. /**
  28420. * \@internal
  28421. * @return {?}
  28422. */
  28423. AbstractControl.prototype._initObservables = /**
  28424. * \@internal
  28425. * @return {?}
  28426. */
  28427. function () {
  28428. (/** @type {?} */ (this)).valueChanges = new __WEBPACK_IMPORTED_MODULE_1__angular_core__["v" /* EventEmitter */]();
  28429. (/** @type {?} */ (this)).statusChanges = new __WEBPACK_IMPORTED_MODULE_1__angular_core__["v" /* EventEmitter */]();
  28430. };
  28431. /**
  28432. * @return {?}
  28433. */
  28434. AbstractControl.prototype._calculateStatus = /**
  28435. * @return {?}
  28436. */
  28437. function () {
  28438. if (this._allControlsDisabled())
  28439. return DISABLED;
  28440. if (this.errors)
  28441. return INVALID;
  28442. if (this._anyControlsHaveStatus(PENDING))
  28443. return PENDING;
  28444. if (this._anyControlsHaveStatus(INVALID))
  28445. return INVALID;
  28446. return VALID;
  28447. };
  28448. /** @internal */
  28449. /**
  28450. * \@internal
  28451. * @param {?} status
  28452. * @return {?}
  28453. */
  28454. AbstractControl.prototype._anyControlsHaveStatus = /**
  28455. * \@internal
  28456. * @param {?} status
  28457. * @return {?}
  28458. */
  28459. function (status) {
  28460. return this._anyControls(function (control) { return control.status === status; });
  28461. };
  28462. /** @internal */
  28463. /**
  28464. * \@internal
  28465. * @return {?}
  28466. */
  28467. AbstractControl.prototype._anyControlsDirty = /**
  28468. * \@internal
  28469. * @return {?}
  28470. */
  28471. function () {
  28472. return this._anyControls(function (control) { return control.dirty; });
  28473. };
  28474. /** @internal */
  28475. /**
  28476. * \@internal
  28477. * @return {?}
  28478. */
  28479. AbstractControl.prototype._anyControlsTouched = /**
  28480. * \@internal
  28481. * @return {?}
  28482. */
  28483. function () {
  28484. return this._anyControls(function (control) { return control.touched; });
  28485. };
  28486. /** @internal */
  28487. /**
  28488. * \@internal
  28489. * @param {?=} opts
  28490. * @return {?}
  28491. */
  28492. AbstractControl.prototype._updatePristine = /**
  28493. * \@internal
  28494. * @param {?=} opts
  28495. * @return {?}
  28496. */
  28497. function (opts) {
  28498. if (opts === void 0) { opts = {}; }
  28499. (/** @type {?} */ (this)).pristine = !this._anyControlsDirty();
  28500. if (this._parent && !opts.onlySelf) {
  28501. this._parent._updatePristine(opts);
  28502. }
  28503. };
  28504. /** @internal */
  28505. /**
  28506. * \@internal
  28507. * @param {?=} opts
  28508. * @return {?}
  28509. */
  28510. AbstractControl.prototype._updateTouched = /**
  28511. * \@internal
  28512. * @param {?=} opts
  28513. * @return {?}
  28514. */
  28515. function (opts) {
  28516. if (opts === void 0) { opts = {}; }
  28517. (/** @type {?} */ (this)).touched = this._anyControlsTouched();
  28518. if (this._parent && !opts.onlySelf) {
  28519. this._parent._updateTouched(opts);
  28520. }
  28521. };
  28522. /** @internal */
  28523. /**
  28524. * \@internal
  28525. * @param {?} formState
  28526. * @return {?}
  28527. */
  28528. AbstractControl.prototype._isBoxedValue = /**
  28529. * \@internal
  28530. * @param {?} formState
  28531. * @return {?}
  28532. */
  28533. function (formState) {
  28534. return typeof formState === 'object' && formState !== null &&
  28535. Object.keys(formState).length === 2 && 'value' in formState && 'disabled' in formState;
  28536. };
  28537. /** @internal */
  28538. /**
  28539. * \@internal
  28540. * @param {?} fn
  28541. * @return {?}
  28542. */
  28543. AbstractControl.prototype._registerOnCollectionChange = /**
  28544. * \@internal
  28545. * @param {?} fn
  28546. * @return {?}
  28547. */
  28548. function (fn) { this._onCollectionChange = fn; };
  28549. /** @internal */
  28550. /**
  28551. * \@internal
  28552. * @param {?=} opts
  28553. * @return {?}
  28554. */
  28555. AbstractControl.prototype._setUpdateStrategy = /**
  28556. * \@internal
  28557. * @param {?=} opts
  28558. * @return {?}
  28559. */
  28560. function (opts) {
  28561. if (isOptionsObj(opts) && (/** @type {?} */ (opts)).updateOn != null) {
  28562. this._updateOn = /** @type {?} */ (((/** @type {?} */ (opts)).updateOn));
  28563. }
  28564. };
  28565. return AbstractControl;
  28566. }());
  28567. /**
  28568. * \@whatItDoes Tracks the value and validation status of an individual form control.
  28569. *
  28570. * It is one of the three fundamental building blocks of Angular forms, along with
  28571. * {\@link FormGroup} and {\@link FormArray}.
  28572. *
  28573. * \@howToUse
  28574. *
  28575. * When instantiating a {\@link FormControl}, you can pass in an initial value as the
  28576. * first argument. Example:
  28577. *
  28578. * ```ts
  28579. * const ctrl = new FormControl('some value');
  28580. * console.log(ctrl.value); // 'some value'
  28581. * ```
  28582. *
  28583. * You can also initialize the control with a form state object on instantiation,
  28584. * which includes both the value and whether or not the control is disabled.
  28585. * You can't use the value key without the disabled key; both are required
  28586. * to use this way of initialization.
  28587. *
  28588. * ```ts
  28589. * const ctrl = new FormControl({value: 'n/a', disabled: true});
  28590. * console.log(ctrl.value); // 'n/a'
  28591. * console.log(ctrl.status); // 'DISABLED'
  28592. * ```
  28593. *
  28594. * The second {\@link FormControl} argument can accept one of three things:
  28595. * * a sync validator function
  28596. * * an array of sync validator functions
  28597. * * an options object containing validator and/or async validator functions
  28598. *
  28599. * Example of a single sync validator function:
  28600. *
  28601. * ```ts
  28602. * const ctrl = new FormControl('', Validators.required);
  28603. * console.log(ctrl.value); // ''
  28604. * console.log(ctrl.status); // 'INVALID'
  28605. * ```
  28606. *
  28607. * Example using options object:
  28608. *
  28609. * ```ts
  28610. * const ctrl = new FormControl('', {
  28611. * validators: Validators.required,
  28612. * asyncValidators: myAsyncValidator
  28613. * });
  28614. * ```
  28615. *
  28616. * The options object can also be used to define when the control should update.
  28617. * By default, the value and validity of a control updates whenever the value
  28618. * changes. You can configure it to update on the blur event instead by setting
  28619. * the `updateOn` option to `'blur'`.
  28620. *
  28621. * ```ts
  28622. * const c = new FormControl('', { updateOn: 'blur' });
  28623. * ```
  28624. *
  28625. * You can also set `updateOn` to `'submit'`, which will delay value and validity
  28626. * updates until the parent form of the control fires a submit event.
  28627. *
  28628. * See its superclass, {\@link AbstractControl}, for more properties and methods.
  28629. *
  28630. * * **npm package**: `\@angular/forms`
  28631. *
  28632. * \@stable
  28633. */
  28634. var FormControl = /** @class */ (function (_super) {
  28635. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(FormControl, _super);
  28636. function FormControl(formState, validatorOrOpts, asyncValidator) {
  28637. if (formState === void 0) { formState = null; }
  28638. var _this = _super.call(this, coerceToValidator(validatorOrOpts), coerceToAsyncValidator(asyncValidator, validatorOrOpts)) || this;
  28639. /**
  28640. * \@internal
  28641. */
  28642. _this._onChange = [];
  28643. _this._applyFormState(formState);
  28644. _this._setUpdateStrategy(validatorOrOpts);
  28645. _this.updateValueAndValidity({ onlySelf: true, emitEvent: false });
  28646. _this._initObservables();
  28647. return _this;
  28648. }
  28649. /**
  28650. * Set the value of the form control to `value`.
  28651. *
  28652. * If `onlySelf` is `true`, this change will only affect the validation of this `FormControl`
  28653. * and not its parent component. This defaults to false.
  28654. *
  28655. * If `emitEvent` is `true`, this
  28656. * change will cause a `valueChanges` event on the `FormControl` to be emitted. This defaults
  28657. * to true (as it falls through to `updateValueAndValidity`).
  28658. *
  28659. * If `emitModelToViewChange` is `true`, the view will be notified about the new value
  28660. * via an `onChange` event. This is the default behavior if `emitModelToViewChange` is not
  28661. * specified.
  28662. *
  28663. * If `emitViewToModelChange` is `true`, an ngModelChange event will be fired to update the
  28664. * model. This is the default behavior if `emitViewToModelChange` is not specified.
  28665. */
  28666. /**
  28667. * Set the value of the form control to `value`.
  28668. *
  28669. * If `onlySelf` is `true`, this change will only affect the validation of this `FormControl`
  28670. * and not its parent component. This defaults to false.
  28671. *
  28672. * If `emitEvent` is `true`, this
  28673. * change will cause a `valueChanges` event on the `FormControl` to be emitted. This defaults
  28674. * to true (as it falls through to `updateValueAndValidity`).
  28675. *
  28676. * If `emitModelToViewChange` is `true`, the view will be notified about the new value
  28677. * via an `onChange` event. This is the default behavior if `emitModelToViewChange` is not
  28678. * specified.
  28679. *
  28680. * If `emitViewToModelChange` is `true`, an ngModelChange event will be fired to update the
  28681. * model. This is the default behavior if `emitViewToModelChange` is not specified.
  28682. * @param {?} value
  28683. * @param {?=} options
  28684. * @return {?}
  28685. */
  28686. FormControl.prototype.setValue = /**
  28687. * Set the value of the form control to `value`.
  28688. *
  28689. * If `onlySelf` is `true`, this change will only affect the validation of this `FormControl`
  28690. * and not its parent component. This defaults to false.
  28691. *
  28692. * If `emitEvent` is `true`, this
  28693. * change will cause a `valueChanges` event on the `FormControl` to be emitted. This defaults
  28694. * to true (as it falls through to `updateValueAndValidity`).
  28695. *
  28696. * If `emitModelToViewChange` is `true`, the view will be notified about the new value
  28697. * via an `onChange` event. This is the default behavior if `emitModelToViewChange` is not
  28698. * specified.
  28699. *
  28700. * If `emitViewToModelChange` is `true`, an ngModelChange event will be fired to update the
  28701. * model. This is the default behavior if `emitViewToModelChange` is not specified.
  28702. * @param {?} value
  28703. * @param {?=} options
  28704. * @return {?}
  28705. */
  28706. function (value, options) {
  28707. var _this = this;
  28708. if (options === void 0) { options = {}; }
  28709. (/** @type {?} */ (this)).value = this._pendingValue = value;
  28710. if (this._onChange.length && options.emitModelToViewChange !== false) {
  28711. this._onChange.forEach(function (changeFn) { return changeFn(_this.value, options.emitViewToModelChange !== false); });
  28712. }
  28713. this.updateValueAndValidity(options);
  28714. };
  28715. /**
  28716. * Patches the value of a control.
  28717. *
  28718. * This function is functionally the same as {@link FormControl#setValue setValue} at this level.
  28719. * It exists for symmetry with {@link FormGroup#patchValue patchValue} on `FormGroups` and
  28720. * `FormArrays`, where it does behave differently.
  28721. */
  28722. /**
  28723. * Patches the value of a control.
  28724. *
  28725. * This function is functionally the same as {\@link FormControl#setValue setValue} at this level.
  28726. * It exists for symmetry with {\@link FormGroup#patchValue patchValue} on `FormGroups` and
  28727. * `FormArrays`, where it does behave differently.
  28728. * @param {?} value
  28729. * @param {?=} options
  28730. * @return {?}
  28731. */
  28732. FormControl.prototype.patchValue = /**
  28733. * Patches the value of a control.
  28734. *
  28735. * This function is functionally the same as {\@link FormControl#setValue setValue} at this level.
  28736. * It exists for symmetry with {\@link FormGroup#patchValue patchValue} on `FormGroups` and
  28737. * `FormArrays`, where it does behave differently.
  28738. * @param {?} value
  28739. * @param {?=} options
  28740. * @return {?}
  28741. */
  28742. function (value, options) {
  28743. if (options === void 0) { options = {}; }
  28744. this.setValue(value, options);
  28745. };
  28746. /**
  28747. * Resets the form control. This means by default:
  28748. *
  28749. * * it is marked as `pristine`
  28750. * * it is marked as `untouched`
  28751. * * value is set to null
  28752. *
  28753. * You can also reset to a specific form state by passing through a standalone
  28754. * value or a form state object that contains both a value and a disabled state
  28755. * (these are the only two properties that cannot be calculated).
  28756. *
  28757. * Ex:
  28758. *
  28759. * ```ts
  28760. * this.control.reset('Nancy');
  28761. *
  28762. * console.log(this.control.value); // 'Nancy'
  28763. * ```
  28764. *
  28765. * OR
  28766. *
  28767. * ```
  28768. * this.control.reset({value: 'Nancy', disabled: true});
  28769. *
  28770. * console.log(this.control.value); // 'Nancy'
  28771. * console.log(this.control.status); // 'DISABLED'
  28772. * ```
  28773. */
  28774. /**
  28775. * Resets the form control. This means by default:
  28776. *
  28777. * * it is marked as `pristine`
  28778. * * it is marked as `untouched`
  28779. * * value is set to null
  28780. *
  28781. * You can also reset to a specific form state by passing through a standalone
  28782. * value or a form state object that contains both a value and a disabled state
  28783. * (these are the only two properties that cannot be calculated).
  28784. *
  28785. * Ex:
  28786. *
  28787. * ```ts
  28788. * this.control.reset('Nancy');
  28789. *
  28790. * console.log(this.control.value); // 'Nancy'
  28791. * ```
  28792. *
  28793. * OR
  28794. *
  28795. * ```
  28796. * this.control.reset({value: 'Nancy', disabled: true});
  28797. *
  28798. * console.log(this.control.value); // 'Nancy'
  28799. * console.log(this.control.status); // 'DISABLED'
  28800. * ```
  28801. * @param {?=} formState
  28802. * @param {?=} options
  28803. * @return {?}
  28804. */
  28805. FormControl.prototype.reset = /**
  28806. * Resets the form control. This means by default:
  28807. *
  28808. * * it is marked as `pristine`
  28809. * * it is marked as `untouched`
  28810. * * value is set to null
  28811. *
  28812. * You can also reset to a specific form state by passing through a standalone
  28813. * value or a form state object that contains both a value and a disabled state
  28814. * (these are the only two properties that cannot be calculated).
  28815. *
  28816. * Ex:
  28817. *
  28818. * ```ts
  28819. * this.control.reset('Nancy');
  28820. *
  28821. * console.log(this.control.value); // 'Nancy'
  28822. * ```
  28823. *
  28824. * OR
  28825. *
  28826. * ```
  28827. * this.control.reset({value: 'Nancy', disabled: true});
  28828. *
  28829. * console.log(this.control.value); // 'Nancy'
  28830. * console.log(this.control.status); // 'DISABLED'
  28831. * ```
  28832. * @param {?=} formState
  28833. * @param {?=} options
  28834. * @return {?}
  28835. */
  28836. function (formState, options) {
  28837. if (formState === void 0) { formState = null; }
  28838. if (options === void 0) { options = {}; }
  28839. this._applyFormState(formState);
  28840. this.markAsPristine(options);
  28841. this.markAsUntouched(options);
  28842. this.setValue(this.value, options);
  28843. this._pendingChange = false;
  28844. };
  28845. /**
  28846. * @internal
  28847. */
  28848. /**
  28849. * \@internal
  28850. * @return {?}
  28851. */
  28852. FormControl.prototype._updateValue = /**
  28853. * \@internal
  28854. * @return {?}
  28855. */
  28856. function () { };
  28857. /**
  28858. * @internal
  28859. */
  28860. /**
  28861. * \@internal
  28862. * @param {?} condition
  28863. * @return {?}
  28864. */
  28865. FormControl.prototype._anyControls = /**
  28866. * \@internal
  28867. * @param {?} condition
  28868. * @return {?}
  28869. */
  28870. function (condition) { return false; };
  28871. /**
  28872. * @internal
  28873. */
  28874. /**
  28875. * \@internal
  28876. * @return {?}
  28877. */
  28878. FormControl.prototype._allControlsDisabled = /**
  28879. * \@internal
  28880. * @return {?}
  28881. */
  28882. function () { return this.disabled; };
  28883. /**
  28884. * Register a listener for change events.
  28885. */
  28886. /**
  28887. * Register a listener for change events.
  28888. * @param {?} fn
  28889. * @return {?}
  28890. */
  28891. FormControl.prototype.registerOnChange = /**
  28892. * Register a listener for change events.
  28893. * @param {?} fn
  28894. * @return {?}
  28895. */
  28896. function (fn) { this._onChange.push(fn); };
  28897. /**
  28898. * @internal
  28899. */
  28900. /**
  28901. * \@internal
  28902. * @return {?}
  28903. */
  28904. FormControl.prototype._clearChangeFns = /**
  28905. * \@internal
  28906. * @return {?}
  28907. */
  28908. function () {
  28909. this._onChange = [];
  28910. this._onDisabledChange = [];
  28911. this._onCollectionChange = function () { };
  28912. };
  28913. /**
  28914. * Register a listener for disabled events.
  28915. */
  28916. /**
  28917. * Register a listener for disabled events.
  28918. * @param {?} fn
  28919. * @return {?}
  28920. */
  28921. FormControl.prototype.registerOnDisabledChange = /**
  28922. * Register a listener for disabled events.
  28923. * @param {?} fn
  28924. * @return {?}
  28925. */
  28926. function (fn) {
  28927. this._onDisabledChange.push(fn);
  28928. };
  28929. /**
  28930. * @internal
  28931. */
  28932. /**
  28933. * \@internal
  28934. * @param {?} cb
  28935. * @return {?}
  28936. */
  28937. FormControl.prototype._forEachChild = /**
  28938. * \@internal
  28939. * @param {?} cb
  28940. * @return {?}
  28941. */
  28942. function (cb) { };
  28943. /** @internal */
  28944. /**
  28945. * \@internal
  28946. * @return {?}
  28947. */
  28948. FormControl.prototype._syncPendingControls = /**
  28949. * \@internal
  28950. * @return {?}
  28951. */
  28952. function () {
  28953. if (this.updateOn === 'submit') {
  28954. if (this._pendingDirty)
  28955. this.markAsDirty();
  28956. if (this._pendingTouched)
  28957. this.markAsTouched();
  28958. if (this._pendingChange) {
  28959. this.setValue(this._pendingValue, { onlySelf: true, emitModelToViewChange: false });
  28960. return true;
  28961. }
  28962. }
  28963. return false;
  28964. };
  28965. /**
  28966. * @param {?} formState
  28967. * @return {?}
  28968. */
  28969. FormControl.prototype._applyFormState = /**
  28970. * @param {?} formState
  28971. * @return {?}
  28972. */
  28973. function (formState) {
  28974. if (this._isBoxedValue(formState)) {
  28975. (/** @type {?} */ (this)).value = this._pendingValue = formState.value;
  28976. formState.disabled ? this.disable({ onlySelf: true, emitEvent: false }) :
  28977. this.enable({ onlySelf: true, emitEvent: false });
  28978. }
  28979. else {
  28980. (/** @type {?} */ (this)).value = this._pendingValue = formState;
  28981. }
  28982. };
  28983. return FormControl;
  28984. }(AbstractControl));
  28985. /**
  28986. * \@whatItDoes Tracks the value and validity state of a group of {\@link FormControl}
  28987. * instances.
  28988. *
  28989. * A `FormGroup` aggregates the values of each child {\@link FormControl} into one object,
  28990. * with each control name as the key. It calculates its status by reducing the statuses
  28991. * of its children. For example, if one of the controls in a group is invalid, the entire
  28992. * group becomes invalid.
  28993. *
  28994. * `FormGroup` is one of the three fundamental building blocks used to define forms in Angular,
  28995. * along with {\@link FormControl} and {\@link FormArray}.
  28996. *
  28997. * \@howToUse
  28998. *
  28999. * When instantiating a {\@link FormGroup}, pass in a collection of child controls as the first
  29000. * argument. The key for each child will be the name under which it is registered.
  29001. *
  29002. * ### Example
  29003. *
  29004. * ```
  29005. * const form = new FormGroup({
  29006. * first: new FormControl('Nancy', Validators.minLength(2)),
  29007. * last: new FormControl('Drew'),
  29008. * });
  29009. *
  29010. * console.log(form.value); // {first: 'Nancy', last; 'Drew'}
  29011. * console.log(form.status); // 'VALID'
  29012. * ```
  29013. *
  29014. * You can also include group-level validators as the second arg, or group-level async
  29015. * validators as the third arg. These come in handy when you want to perform validation
  29016. * that considers the value of more than one child control.
  29017. *
  29018. * ### Example
  29019. *
  29020. * ```
  29021. * const form = new FormGroup({
  29022. * password: new FormControl('', Validators.minLength(2)),
  29023. * passwordConfirm: new FormControl('', Validators.minLength(2)),
  29024. * }, passwordMatchValidator);
  29025. *
  29026. *
  29027. * function passwordMatchValidator(g: FormGroup) {
  29028. * return g.get('password').value === g.get('passwordConfirm').value
  29029. * ? null : {'mismatch': true};
  29030. * }
  29031. * ```
  29032. *
  29033. * Like {\@link FormControl} instances, you can alternatively choose to pass in
  29034. * validators and async validators as part of an options object.
  29035. *
  29036. * ```
  29037. * const form = new FormGroup({
  29038. * password: new FormControl('')
  29039. * passwordConfirm: new FormControl('')
  29040. * }, {validators: passwordMatchValidator, asyncValidators: otherValidator});
  29041. * ```
  29042. *
  29043. * The options object can also be used to set a default value for each child
  29044. * control's `updateOn` property. If you set `updateOn` to `'blur'` at the
  29045. * group level, all child controls will default to 'blur', unless the child
  29046. * has explicitly specified a different `updateOn` value.
  29047. *
  29048. * ```ts
  29049. * const c = new FormGroup({
  29050. * one: new FormControl()
  29051. * }, {updateOn: 'blur'});
  29052. * ```
  29053. *
  29054. * * **npm package**: `\@angular/forms`
  29055. *
  29056. * \@stable
  29057. */
  29058. var FormGroup = /** @class */ (function (_super) {
  29059. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(FormGroup, _super);
  29060. function FormGroup(controls, validatorOrOpts, asyncValidator) {
  29061. var _this = _super.call(this, coerceToValidator(validatorOrOpts), coerceToAsyncValidator(asyncValidator, validatorOrOpts)) || this;
  29062. _this.controls = controls;
  29063. _this._initObservables();
  29064. _this._setUpdateStrategy(validatorOrOpts);
  29065. _this._setUpControls();
  29066. _this.updateValueAndValidity({ onlySelf: true, emitEvent: false });
  29067. return _this;
  29068. }
  29069. /**
  29070. * Registers a control with the group's list of controls.
  29071. *
  29072. * This method does not update the value or validity of the control, so for most cases you'll want
  29073. * to use {@link FormGroup#addControl addControl} instead.
  29074. */
  29075. /**
  29076. * Registers a control with the group's list of controls.
  29077. *
  29078. * This method does not update the value or validity of the control, so for most cases you'll want
  29079. * to use {\@link FormGroup#addControl addControl} instead.
  29080. * @param {?} name
  29081. * @param {?} control
  29082. * @return {?}
  29083. */
  29084. FormGroup.prototype.registerControl = /**
  29085. * Registers a control with the group's list of controls.
  29086. *
  29087. * This method does not update the value or validity of the control, so for most cases you'll want
  29088. * to use {\@link FormGroup#addControl addControl} instead.
  29089. * @param {?} name
  29090. * @param {?} control
  29091. * @return {?}
  29092. */
  29093. function (name, control) {
  29094. if (this.controls[name])
  29095. return this.controls[name];
  29096. this.controls[name] = control;
  29097. control.setParent(this);
  29098. control._registerOnCollectionChange(this._onCollectionChange);
  29099. return control;
  29100. };
  29101. /**
  29102. * Add a control to this group.
  29103. */
  29104. /**
  29105. * Add a control to this group.
  29106. * @param {?} name
  29107. * @param {?} control
  29108. * @return {?}
  29109. */
  29110. FormGroup.prototype.addControl = /**
  29111. * Add a control to this group.
  29112. * @param {?} name
  29113. * @param {?} control
  29114. * @return {?}
  29115. */
  29116. function (name, control) {
  29117. this.registerControl(name, control);
  29118. this.updateValueAndValidity();
  29119. this._onCollectionChange();
  29120. };
  29121. /**
  29122. * Remove a control from this group.
  29123. */
  29124. /**
  29125. * Remove a control from this group.
  29126. * @param {?} name
  29127. * @return {?}
  29128. */
  29129. FormGroup.prototype.removeControl = /**
  29130. * Remove a control from this group.
  29131. * @param {?} name
  29132. * @return {?}
  29133. */
  29134. function (name) {
  29135. if (this.controls[name])
  29136. this.controls[name]._registerOnCollectionChange(function () { });
  29137. delete (this.controls[name]);
  29138. this.updateValueAndValidity();
  29139. this._onCollectionChange();
  29140. };
  29141. /**
  29142. * Replace an existing control.
  29143. */
  29144. /**
  29145. * Replace an existing control.
  29146. * @param {?} name
  29147. * @param {?} control
  29148. * @return {?}
  29149. */
  29150. FormGroup.prototype.setControl = /**
  29151. * Replace an existing control.
  29152. * @param {?} name
  29153. * @param {?} control
  29154. * @return {?}
  29155. */
  29156. function (name, control) {
  29157. if (this.controls[name])
  29158. this.controls[name]._registerOnCollectionChange(function () { });
  29159. delete (this.controls[name]);
  29160. if (control)
  29161. this.registerControl(name, control);
  29162. this.updateValueAndValidity();
  29163. this._onCollectionChange();
  29164. };
  29165. /**
  29166. * Check whether there is an enabled control with the given name in the group.
  29167. *
  29168. * It will return false for disabled controls. If you'd like to check for existence in the group
  29169. * only, use {@link AbstractControl#get get} instead.
  29170. */
  29171. /**
  29172. * Check whether there is an enabled control with the given name in the group.
  29173. *
  29174. * It will return false for disabled controls. If you'd like to check for existence in the group
  29175. * only, use {\@link AbstractControl#get get} instead.
  29176. * @param {?} controlName
  29177. * @return {?}
  29178. */
  29179. FormGroup.prototype.contains = /**
  29180. * Check whether there is an enabled control with the given name in the group.
  29181. *
  29182. * It will return false for disabled controls. If you'd like to check for existence in the group
  29183. * only, use {\@link AbstractControl#get get} instead.
  29184. * @param {?} controlName
  29185. * @return {?}
  29186. */
  29187. function (controlName) {
  29188. return this.controls.hasOwnProperty(controlName) && this.controls[controlName].enabled;
  29189. };
  29190. /**
  29191. * Sets the value of the {@link FormGroup}. It accepts an object that matches
  29192. * the structure of the group, with control names as keys.
  29193. *
  29194. * This method performs strict checks, so it will throw an error if you try
  29195. * to set the value of a control that doesn't exist or if you exclude the
  29196. * value of a control.
  29197. *
  29198. * ### Example
  29199. *
  29200. * ```
  29201. * const form = new FormGroup({
  29202. * first: new FormControl(),
  29203. * last: new FormControl()
  29204. * });
  29205. * console.log(form.value); // {first: null, last: null}
  29206. *
  29207. * form.setValue({first: 'Nancy', last: 'Drew'});
  29208. * console.log(form.value); // {first: 'Nancy', last: 'Drew'}
  29209. *
  29210. * ```
  29211. */
  29212. /**
  29213. * Sets the value of the {\@link FormGroup}. It accepts an object that matches
  29214. * the structure of the group, with control names as keys.
  29215. *
  29216. * This method performs strict checks, so it will throw an error if you try
  29217. * to set the value of a control that doesn't exist or if you exclude the
  29218. * value of a control.
  29219. *
  29220. * ### Example
  29221. *
  29222. * ```
  29223. * const form = new FormGroup({
  29224. * first: new FormControl(),
  29225. * last: new FormControl()
  29226. * });
  29227. * console.log(form.value); // {first: null, last: null}
  29228. *
  29229. * form.setValue({first: 'Nancy', last: 'Drew'});
  29230. * console.log(form.value); // {first: 'Nancy', last: 'Drew'}
  29231. *
  29232. * ```
  29233. * @param {?} value
  29234. * @param {?=} options
  29235. * @return {?}
  29236. */
  29237. FormGroup.prototype.setValue = /**
  29238. * Sets the value of the {\@link FormGroup}. It accepts an object that matches
  29239. * the structure of the group, with control names as keys.
  29240. *
  29241. * This method performs strict checks, so it will throw an error if you try
  29242. * to set the value of a control that doesn't exist or if you exclude the
  29243. * value of a control.
  29244. *
  29245. * ### Example
  29246. *
  29247. * ```
  29248. * const form = new FormGroup({
  29249. * first: new FormControl(),
  29250. * last: new FormControl()
  29251. * });
  29252. * console.log(form.value); // {first: null, last: null}
  29253. *
  29254. * form.setValue({first: 'Nancy', last: 'Drew'});
  29255. * console.log(form.value); // {first: 'Nancy', last: 'Drew'}
  29256. *
  29257. * ```
  29258. * @param {?} value
  29259. * @param {?=} options
  29260. * @return {?}
  29261. */
  29262. function (value, options) {
  29263. var _this = this;
  29264. if (options === void 0) { options = {}; }
  29265. this._checkAllValuesPresent(value);
  29266. Object.keys(value).forEach(function (name) {
  29267. _this._throwIfControlMissing(name);
  29268. _this.controls[name].setValue(value[name], { onlySelf: true, emitEvent: options.emitEvent });
  29269. });
  29270. this.updateValueAndValidity(options);
  29271. };
  29272. /**
  29273. * Patches the value of the {@link FormGroup}. It accepts an object with control
  29274. * names as keys, and will do its best to match the values to the correct controls
  29275. * in the group.
  29276. *
  29277. * It accepts both super-sets and sub-sets of the group without throwing an error.
  29278. *
  29279. * ### Example
  29280. *
  29281. * ```
  29282. * const form = new FormGroup({
  29283. * first: new FormControl(),
  29284. * last: new FormControl()
  29285. * });
  29286. * console.log(form.value); // {first: null, last: null}
  29287. *
  29288. * form.patchValue({first: 'Nancy'});
  29289. * console.log(form.value); // {first: 'Nancy', last: null}
  29290. *
  29291. * ```
  29292. */
  29293. /**
  29294. * Patches the value of the {\@link FormGroup}. It accepts an object with control
  29295. * names as keys, and will do its best to match the values to the correct controls
  29296. * in the group.
  29297. *
  29298. * It accepts both super-sets and sub-sets of the group without throwing an error.
  29299. *
  29300. * ### Example
  29301. *
  29302. * ```
  29303. * const form = new FormGroup({
  29304. * first: new FormControl(),
  29305. * last: new FormControl()
  29306. * });
  29307. * console.log(form.value); // {first: null, last: null}
  29308. *
  29309. * form.patchValue({first: 'Nancy'});
  29310. * console.log(form.value); // {first: 'Nancy', last: null}
  29311. *
  29312. * ```
  29313. * @param {?} value
  29314. * @param {?=} options
  29315. * @return {?}
  29316. */
  29317. FormGroup.prototype.patchValue = /**
  29318. * Patches the value of the {\@link FormGroup}. It accepts an object with control
  29319. * names as keys, and will do its best to match the values to the correct controls
  29320. * in the group.
  29321. *
  29322. * It accepts both super-sets and sub-sets of the group without throwing an error.
  29323. *
  29324. * ### Example
  29325. *
  29326. * ```
  29327. * const form = new FormGroup({
  29328. * first: new FormControl(),
  29329. * last: new FormControl()
  29330. * });
  29331. * console.log(form.value); // {first: null, last: null}
  29332. *
  29333. * form.patchValue({first: 'Nancy'});
  29334. * console.log(form.value); // {first: 'Nancy', last: null}
  29335. *
  29336. * ```
  29337. * @param {?} value
  29338. * @param {?=} options
  29339. * @return {?}
  29340. */
  29341. function (value, options) {
  29342. var _this = this;
  29343. if (options === void 0) { options = {}; }
  29344. Object.keys(value).forEach(function (name) {
  29345. if (_this.controls[name]) {
  29346. _this.controls[name].patchValue(value[name], { onlySelf: true, emitEvent: options.emitEvent });
  29347. }
  29348. });
  29349. this.updateValueAndValidity(options);
  29350. };
  29351. /**
  29352. * Resets the {@link FormGroup}. This means by default:
  29353. *
  29354. * * The group and all descendants are marked `pristine`
  29355. * * The group and all descendants are marked `untouched`
  29356. * * The value of all descendants will be null or null maps
  29357. *
  29358. * You can also reset to a specific form state by passing in a map of states
  29359. * that matches the structure of your form, with control names as keys. The state
  29360. * can be a standalone value or a form state object with both a value and a disabled
  29361. * status.
  29362. *
  29363. * ### Example
  29364. *
  29365. * ```ts
  29366. * this.form.reset({first: 'name', last: 'last name'});
  29367. *
  29368. * console.log(this.form.value); // {first: 'name', last: 'last name'}
  29369. * ```
  29370. *
  29371. * - OR -
  29372. *
  29373. * ```
  29374. * this.form.reset({
  29375. * first: {value: 'name', disabled: true},
  29376. * last: 'last'
  29377. * });
  29378. *
  29379. * console.log(this.form.value); // {first: 'name', last: 'last name'}
  29380. * console.log(this.form.get('first').status); // 'DISABLED'
  29381. * ```
  29382. */
  29383. /**
  29384. * Resets the {\@link FormGroup}. This means by default:
  29385. *
  29386. * * The group and all descendants are marked `pristine`
  29387. * * The group and all descendants are marked `untouched`
  29388. * * The value of all descendants will be null or null maps
  29389. *
  29390. * You can also reset to a specific form state by passing in a map of states
  29391. * that matches the structure of your form, with control names as keys. The state
  29392. * can be a standalone value or a form state object with both a value and a disabled
  29393. * status.
  29394. *
  29395. * ### Example
  29396. *
  29397. * ```ts
  29398. * this.form.reset({first: 'name', last: 'last name'});
  29399. *
  29400. * console.log(this.form.value); // {first: 'name', last: 'last name'}
  29401. * ```
  29402. *
  29403. * - OR -
  29404. *
  29405. * ```
  29406. * this.form.reset({
  29407. * first: {value: 'name', disabled: true},
  29408. * last: 'last'
  29409. * });
  29410. *
  29411. * console.log(this.form.value); // {first: 'name', last: 'last name'}
  29412. * console.log(this.form.get('first').status); // 'DISABLED'
  29413. * ```
  29414. * @param {?=} value
  29415. * @param {?=} options
  29416. * @return {?}
  29417. */
  29418. FormGroup.prototype.reset = /**
  29419. * Resets the {\@link FormGroup}. This means by default:
  29420. *
  29421. * * The group and all descendants are marked `pristine`
  29422. * * The group and all descendants are marked `untouched`
  29423. * * The value of all descendants will be null or null maps
  29424. *
  29425. * You can also reset to a specific form state by passing in a map of states
  29426. * that matches the structure of your form, with control names as keys. The state
  29427. * can be a standalone value or a form state object with both a value and a disabled
  29428. * status.
  29429. *
  29430. * ### Example
  29431. *
  29432. * ```ts
  29433. * this.form.reset({first: 'name', last: 'last name'});
  29434. *
  29435. * console.log(this.form.value); // {first: 'name', last: 'last name'}
  29436. * ```
  29437. *
  29438. * - OR -
  29439. *
  29440. * ```
  29441. * this.form.reset({
  29442. * first: {value: 'name', disabled: true},
  29443. * last: 'last'
  29444. * });
  29445. *
  29446. * console.log(this.form.value); // {first: 'name', last: 'last name'}
  29447. * console.log(this.form.get('first').status); // 'DISABLED'
  29448. * ```
  29449. * @param {?=} value
  29450. * @param {?=} options
  29451. * @return {?}
  29452. */
  29453. function (value, options) {
  29454. if (value === void 0) { value = {}; }
  29455. if (options === void 0) { options = {}; }
  29456. this._forEachChild(function (control, name) {
  29457. control.reset(value[name], { onlySelf: true, emitEvent: options.emitEvent });
  29458. });
  29459. this.updateValueAndValidity(options);
  29460. this._updatePristine(options);
  29461. this._updateTouched(options);
  29462. };
  29463. /**
  29464. * The aggregate value of the {@link FormGroup}, including any disabled controls.
  29465. *
  29466. * If you'd like to include all values regardless of disabled status, use this method.
  29467. * Otherwise, the `value` property is the best way to get the value of the group.
  29468. */
  29469. /**
  29470. * The aggregate value of the {\@link FormGroup}, including any disabled controls.
  29471. *
  29472. * If you'd like to include all values regardless of disabled status, use this method.
  29473. * Otherwise, the `value` property is the best way to get the value of the group.
  29474. * @return {?}
  29475. */
  29476. FormGroup.prototype.getRawValue = /**
  29477. * The aggregate value of the {\@link FormGroup}, including any disabled controls.
  29478. *
  29479. * If you'd like to include all values regardless of disabled status, use this method.
  29480. * Otherwise, the `value` property is the best way to get the value of the group.
  29481. * @return {?}
  29482. */
  29483. function () {
  29484. return this._reduceChildren({}, function (acc, control, name) {
  29485. acc[name] = control instanceof FormControl ? control.value : (/** @type {?} */ (control)).getRawValue();
  29486. return acc;
  29487. });
  29488. };
  29489. /** @internal */
  29490. /**
  29491. * \@internal
  29492. * @return {?}
  29493. */
  29494. FormGroup.prototype._syncPendingControls = /**
  29495. * \@internal
  29496. * @return {?}
  29497. */
  29498. function () {
  29499. var /** @type {?} */ subtreeUpdated = this._reduceChildren(false, function (updated, child) {
  29500. return child._syncPendingControls() ? true : updated;
  29501. });
  29502. if (subtreeUpdated)
  29503. this.updateValueAndValidity({ onlySelf: true });
  29504. return subtreeUpdated;
  29505. };
  29506. /** @internal */
  29507. /**
  29508. * \@internal
  29509. * @param {?} name
  29510. * @return {?}
  29511. */
  29512. FormGroup.prototype._throwIfControlMissing = /**
  29513. * \@internal
  29514. * @param {?} name
  29515. * @return {?}
  29516. */
  29517. function (name) {
  29518. if (!Object.keys(this.controls).length) {
  29519. throw new Error("\n There are no form controls registered with this group yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");
  29520. }
  29521. if (!this.controls[name]) {
  29522. throw new Error("Cannot find form control with name: " + name + ".");
  29523. }
  29524. };
  29525. /** @internal */
  29526. /**
  29527. * \@internal
  29528. * @param {?} cb
  29529. * @return {?}
  29530. */
  29531. FormGroup.prototype._forEachChild = /**
  29532. * \@internal
  29533. * @param {?} cb
  29534. * @return {?}
  29535. */
  29536. function (cb) {
  29537. var _this = this;
  29538. Object.keys(this.controls).forEach(function (k) { return cb(_this.controls[k], k); });
  29539. };
  29540. /** @internal */
  29541. /**
  29542. * \@internal
  29543. * @return {?}
  29544. */
  29545. FormGroup.prototype._setUpControls = /**
  29546. * \@internal
  29547. * @return {?}
  29548. */
  29549. function () {
  29550. var _this = this;
  29551. this._forEachChild(function (control) {
  29552. control.setParent(_this);
  29553. control._registerOnCollectionChange(_this._onCollectionChange);
  29554. });
  29555. };
  29556. /** @internal */
  29557. /**
  29558. * \@internal
  29559. * @return {?}
  29560. */
  29561. FormGroup.prototype._updateValue = /**
  29562. * \@internal
  29563. * @return {?}
  29564. */
  29565. function () { (/** @type {?} */ (this)).value = this._reduceValue(); };
  29566. /** @internal */
  29567. /**
  29568. * \@internal
  29569. * @param {?} condition
  29570. * @return {?}
  29571. */
  29572. FormGroup.prototype._anyControls = /**
  29573. * \@internal
  29574. * @param {?} condition
  29575. * @return {?}
  29576. */
  29577. function (condition) {
  29578. var _this = this;
  29579. var /** @type {?} */ res = false;
  29580. this._forEachChild(function (control, name) {
  29581. res = res || (_this.contains(name) && condition(control));
  29582. });
  29583. return res;
  29584. };
  29585. /** @internal */
  29586. /**
  29587. * \@internal
  29588. * @return {?}
  29589. */
  29590. FormGroup.prototype._reduceValue = /**
  29591. * \@internal
  29592. * @return {?}
  29593. */
  29594. function () {
  29595. var _this = this;
  29596. return this._reduceChildren({}, function (acc, control, name) {
  29597. if (control.enabled || _this.disabled) {
  29598. acc[name] = control.value;
  29599. }
  29600. return acc;
  29601. });
  29602. };
  29603. /** @internal */
  29604. /**
  29605. * \@internal
  29606. * @param {?} initValue
  29607. * @param {?} fn
  29608. * @return {?}
  29609. */
  29610. FormGroup.prototype._reduceChildren = /**
  29611. * \@internal
  29612. * @param {?} initValue
  29613. * @param {?} fn
  29614. * @return {?}
  29615. */
  29616. function (initValue, fn) {
  29617. var /** @type {?} */ res = initValue;
  29618. this._forEachChild(function (control, name) { res = fn(res, control, name); });
  29619. return res;
  29620. };
  29621. /** @internal */
  29622. /**
  29623. * \@internal
  29624. * @return {?}
  29625. */
  29626. FormGroup.prototype._allControlsDisabled = /**
  29627. * \@internal
  29628. * @return {?}
  29629. */
  29630. function () {
  29631. for (var _i = 0, _a = Object.keys(this.controls); _i < _a.length; _i++) {
  29632. var controlName = _a[_i];
  29633. if (this.controls[controlName].enabled) {
  29634. return false;
  29635. }
  29636. }
  29637. return Object.keys(this.controls).length > 0 || this.disabled;
  29638. };
  29639. /** @internal */
  29640. /**
  29641. * \@internal
  29642. * @param {?} value
  29643. * @return {?}
  29644. */
  29645. FormGroup.prototype._checkAllValuesPresent = /**
  29646. * \@internal
  29647. * @param {?} value
  29648. * @return {?}
  29649. */
  29650. function (value) {
  29651. this._forEachChild(function (control, name) {
  29652. if (value[name] === undefined) {
  29653. throw new Error("Must supply a value for form control with name: '" + name + "'.");
  29654. }
  29655. });
  29656. };
  29657. return FormGroup;
  29658. }(AbstractControl));
  29659. /**
  29660. * \@whatItDoes Tracks the value and validity state of an array of {\@link FormControl},
  29661. * {\@link FormGroup} or {\@link FormArray} instances.
  29662. *
  29663. * A `FormArray` aggregates the values of each child {\@link FormControl} into an array.
  29664. * It calculates its status by reducing the statuses of its children. For example, if one of
  29665. * the controls in a `FormArray` is invalid, the entire array becomes invalid.
  29666. *
  29667. * `FormArray` is one of the three fundamental building blocks used to define forms in Angular,
  29668. * along with {\@link FormControl} and {\@link FormGroup}.
  29669. *
  29670. * \@howToUse
  29671. *
  29672. * When instantiating a {\@link FormArray}, pass in an array of child controls as the first
  29673. * argument.
  29674. *
  29675. * ### Example
  29676. *
  29677. * ```
  29678. * const arr = new FormArray([
  29679. * new FormControl('Nancy', Validators.minLength(2)),
  29680. * new FormControl('Drew'),
  29681. * ]);
  29682. *
  29683. * console.log(arr.value); // ['Nancy', 'Drew']
  29684. * console.log(arr.status); // 'VALID'
  29685. * ```
  29686. *
  29687. * You can also include array-level validators and async validators. These come in handy
  29688. * when you want to perform validation that considers the value of more than one child
  29689. * control.
  29690. *
  29691. * The two types of validators can be passed in separately as the second and third arg
  29692. * respectively, or together as part of an options object.
  29693. *
  29694. * ```
  29695. * const arr = new FormArray([
  29696. * new FormControl('Nancy'),
  29697. * new FormControl('Drew')
  29698. * ], {validators: myValidator, asyncValidators: myAsyncValidator});
  29699. * ```
  29700. *
  29701. * The options object can also be used to set a default value for each child
  29702. * control's `updateOn` property. If you set `updateOn` to `'blur'` at the
  29703. * array level, all child controls will default to 'blur', unless the child
  29704. * has explicitly specified a different `updateOn` value.
  29705. *
  29706. * ```ts
  29707. * const c = new FormArray([
  29708. * new FormControl()
  29709. * ], {updateOn: 'blur'});
  29710. * ```
  29711. *
  29712. * ### Adding or removing controls
  29713. *
  29714. * To change the controls in the array, use the `push`, `insert`, or `removeAt` methods
  29715. * in `FormArray` itself. These methods ensure the controls are properly tracked in the
  29716. * form's hierarchy. Do not modify the array of `AbstractControl`s used to instantiate
  29717. * the `FormArray` directly, as that will result in strange and unexpected behavior such
  29718. * as broken change detection.
  29719. *
  29720. * * **npm package**: `\@angular/forms`
  29721. *
  29722. * \@stable
  29723. */
  29724. var FormArray = /** @class */ (function (_super) {
  29725. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(FormArray, _super);
  29726. function FormArray(controls, validatorOrOpts, asyncValidator) {
  29727. var _this = _super.call(this, coerceToValidator(validatorOrOpts), coerceToAsyncValidator(asyncValidator, validatorOrOpts)) || this;
  29728. _this.controls = controls;
  29729. _this._initObservables();
  29730. _this._setUpdateStrategy(validatorOrOpts);
  29731. _this._setUpControls();
  29732. _this.updateValueAndValidity({ onlySelf: true, emitEvent: false });
  29733. return _this;
  29734. }
  29735. /**
  29736. * Get the {@link AbstractControl} at the given `index` in the array.
  29737. */
  29738. /**
  29739. * Get the {\@link AbstractControl} at the given `index` in the array.
  29740. * @param {?} index
  29741. * @return {?}
  29742. */
  29743. FormArray.prototype.at = /**
  29744. * Get the {\@link AbstractControl} at the given `index` in the array.
  29745. * @param {?} index
  29746. * @return {?}
  29747. */
  29748. function (index) { return this.controls[index]; };
  29749. /**
  29750. * Insert a new {@link AbstractControl} at the end of the array.
  29751. */
  29752. /**
  29753. * Insert a new {\@link AbstractControl} at the end of the array.
  29754. * @param {?} control
  29755. * @return {?}
  29756. */
  29757. FormArray.prototype.push = /**
  29758. * Insert a new {\@link AbstractControl} at the end of the array.
  29759. * @param {?} control
  29760. * @return {?}
  29761. */
  29762. function (control) {
  29763. this.controls.push(control);
  29764. this._registerControl(control);
  29765. this.updateValueAndValidity();
  29766. this._onCollectionChange();
  29767. };
  29768. /** Insert a new {@link AbstractControl} at the given `index` in the array. */
  29769. /**
  29770. * Insert a new {\@link AbstractControl} at the given `index` in the array.
  29771. * @param {?} index
  29772. * @param {?} control
  29773. * @return {?}
  29774. */
  29775. FormArray.prototype.insert = /**
  29776. * Insert a new {\@link AbstractControl} at the given `index` in the array.
  29777. * @param {?} index
  29778. * @param {?} control
  29779. * @return {?}
  29780. */
  29781. function (index, control) {
  29782. this.controls.splice(index, 0, control);
  29783. this._registerControl(control);
  29784. this.updateValueAndValidity();
  29785. };
  29786. /** Remove the control at the given `index` in the array. */
  29787. /**
  29788. * Remove the control at the given `index` in the array.
  29789. * @param {?} index
  29790. * @return {?}
  29791. */
  29792. FormArray.prototype.removeAt = /**
  29793. * Remove the control at the given `index` in the array.
  29794. * @param {?} index
  29795. * @return {?}
  29796. */
  29797. function (index) {
  29798. if (this.controls[index])
  29799. this.controls[index]._registerOnCollectionChange(function () { });
  29800. this.controls.splice(index, 1);
  29801. this.updateValueAndValidity();
  29802. };
  29803. /**
  29804. * Replace an existing control.
  29805. */
  29806. /**
  29807. * Replace an existing control.
  29808. * @param {?} index
  29809. * @param {?} control
  29810. * @return {?}
  29811. */
  29812. FormArray.prototype.setControl = /**
  29813. * Replace an existing control.
  29814. * @param {?} index
  29815. * @param {?} control
  29816. * @return {?}
  29817. */
  29818. function (index, control) {
  29819. if (this.controls[index])
  29820. this.controls[index]._registerOnCollectionChange(function () { });
  29821. this.controls.splice(index, 1);
  29822. if (control) {
  29823. this.controls.splice(index, 0, control);
  29824. this._registerControl(control);
  29825. }
  29826. this.updateValueAndValidity();
  29827. this._onCollectionChange();
  29828. };
  29829. Object.defineProperty(FormArray.prototype, "length", {
  29830. /**
  29831. * Length of the control array.
  29832. */
  29833. get: /**
  29834. * Length of the control array.
  29835. * @return {?}
  29836. */
  29837. function () { return this.controls.length; },
  29838. enumerable: true,
  29839. configurable: true
  29840. });
  29841. /**
  29842. * Sets the value of the {@link FormArray}. It accepts an array that matches
  29843. * the structure of the control.
  29844. *
  29845. * This method performs strict checks, so it will throw an error if you try
  29846. * to set the value of a control that doesn't exist or if you exclude the
  29847. * value of a control.
  29848. *
  29849. * ### Example
  29850. *
  29851. * ```
  29852. * const arr = new FormArray([
  29853. * new FormControl(),
  29854. * new FormControl()
  29855. * ]);
  29856. * console.log(arr.value); // [null, null]
  29857. *
  29858. * arr.setValue(['Nancy', 'Drew']);
  29859. * console.log(arr.value); // ['Nancy', 'Drew']
  29860. * ```
  29861. */
  29862. /**
  29863. * Sets the value of the {\@link FormArray}. It accepts an array that matches
  29864. * the structure of the control.
  29865. *
  29866. * This method performs strict checks, so it will throw an error if you try
  29867. * to set the value of a control that doesn't exist or if you exclude the
  29868. * value of a control.
  29869. *
  29870. * ### Example
  29871. *
  29872. * ```
  29873. * const arr = new FormArray([
  29874. * new FormControl(),
  29875. * new FormControl()
  29876. * ]);
  29877. * console.log(arr.value); // [null, null]
  29878. *
  29879. * arr.setValue(['Nancy', 'Drew']);
  29880. * console.log(arr.value); // ['Nancy', 'Drew']
  29881. * ```
  29882. * @param {?} value
  29883. * @param {?=} options
  29884. * @return {?}
  29885. */
  29886. FormArray.prototype.setValue = /**
  29887. * Sets the value of the {\@link FormArray}. It accepts an array that matches
  29888. * the structure of the control.
  29889. *
  29890. * This method performs strict checks, so it will throw an error if you try
  29891. * to set the value of a control that doesn't exist or if you exclude the
  29892. * value of a control.
  29893. *
  29894. * ### Example
  29895. *
  29896. * ```
  29897. * const arr = new FormArray([
  29898. * new FormControl(),
  29899. * new FormControl()
  29900. * ]);
  29901. * console.log(arr.value); // [null, null]
  29902. *
  29903. * arr.setValue(['Nancy', 'Drew']);
  29904. * console.log(arr.value); // ['Nancy', 'Drew']
  29905. * ```
  29906. * @param {?} value
  29907. * @param {?=} options
  29908. * @return {?}
  29909. */
  29910. function (value, options) {
  29911. var _this = this;
  29912. if (options === void 0) { options = {}; }
  29913. this._checkAllValuesPresent(value);
  29914. value.forEach(function (newValue, index) {
  29915. _this._throwIfControlMissing(index);
  29916. _this.at(index).setValue(newValue, { onlySelf: true, emitEvent: options.emitEvent });
  29917. });
  29918. this.updateValueAndValidity(options);
  29919. };
  29920. /**
  29921. * Patches the value of the {@link FormArray}. It accepts an array that matches the
  29922. * structure of the control, and will do its best to match the values to the correct
  29923. * controls in the group.
  29924. *
  29925. * It accepts both super-sets and sub-sets of the array without throwing an error.
  29926. *
  29927. * ### Example
  29928. *
  29929. * ```
  29930. * const arr = new FormArray([
  29931. * new FormControl(),
  29932. * new FormControl()
  29933. * ]);
  29934. * console.log(arr.value); // [null, null]
  29935. *
  29936. * arr.patchValue(['Nancy']);
  29937. * console.log(arr.value); // ['Nancy', null]
  29938. * ```
  29939. */
  29940. /**
  29941. * Patches the value of the {\@link FormArray}. It accepts an array that matches the
  29942. * structure of the control, and will do its best to match the values to the correct
  29943. * controls in the group.
  29944. *
  29945. * It accepts both super-sets and sub-sets of the array without throwing an error.
  29946. *
  29947. * ### Example
  29948. *
  29949. * ```
  29950. * const arr = new FormArray([
  29951. * new FormControl(),
  29952. * new FormControl()
  29953. * ]);
  29954. * console.log(arr.value); // [null, null]
  29955. *
  29956. * arr.patchValue(['Nancy']);
  29957. * console.log(arr.value); // ['Nancy', null]
  29958. * ```
  29959. * @param {?} value
  29960. * @param {?=} options
  29961. * @return {?}
  29962. */
  29963. FormArray.prototype.patchValue = /**
  29964. * Patches the value of the {\@link FormArray}. It accepts an array that matches the
  29965. * structure of the control, and will do its best to match the values to the correct
  29966. * controls in the group.
  29967. *
  29968. * It accepts both super-sets and sub-sets of the array without throwing an error.
  29969. *
  29970. * ### Example
  29971. *
  29972. * ```
  29973. * const arr = new FormArray([
  29974. * new FormControl(),
  29975. * new FormControl()
  29976. * ]);
  29977. * console.log(arr.value); // [null, null]
  29978. *
  29979. * arr.patchValue(['Nancy']);
  29980. * console.log(arr.value); // ['Nancy', null]
  29981. * ```
  29982. * @param {?} value
  29983. * @param {?=} options
  29984. * @return {?}
  29985. */
  29986. function (value, options) {
  29987. var _this = this;
  29988. if (options === void 0) { options = {}; }
  29989. value.forEach(function (newValue, index) {
  29990. if (_this.at(index)) {
  29991. _this.at(index).patchValue(newValue, { onlySelf: true, emitEvent: options.emitEvent });
  29992. }
  29993. });
  29994. this.updateValueAndValidity(options);
  29995. };
  29996. /**
  29997. * Resets the {@link FormArray}. This means by default:
  29998. *
  29999. * * The array and all descendants are marked `pristine`
  30000. * * The array and all descendants are marked `untouched`
  30001. * * The value of all descendants will be null or null maps
  30002. *
  30003. * You can also reset to a specific form state by passing in an array of states
  30004. * that matches the structure of the control. The state can be a standalone value
  30005. * or a form state object with both a value and a disabled status.
  30006. *
  30007. * ### Example
  30008. *
  30009. * ```ts
  30010. * this.arr.reset(['name', 'last name']);
  30011. *
  30012. * console.log(this.arr.value); // ['name', 'last name']
  30013. * ```
  30014. *
  30015. * - OR -
  30016. *
  30017. * ```
  30018. * this.arr.reset([
  30019. * {value: 'name', disabled: true},
  30020. * 'last'
  30021. * ]);
  30022. *
  30023. * console.log(this.arr.value); // ['name', 'last name']
  30024. * console.log(this.arr.get(0).status); // 'DISABLED'
  30025. * ```
  30026. */
  30027. /**
  30028. * Resets the {\@link FormArray}. This means by default:
  30029. *
  30030. * * The array and all descendants are marked `pristine`
  30031. * * The array and all descendants are marked `untouched`
  30032. * * The value of all descendants will be null or null maps
  30033. *
  30034. * You can also reset to a specific form state by passing in an array of states
  30035. * that matches the structure of the control. The state can be a standalone value
  30036. * or a form state object with both a value and a disabled status.
  30037. *
  30038. * ### Example
  30039. *
  30040. * ```ts
  30041. * this.arr.reset(['name', 'last name']);
  30042. *
  30043. * console.log(this.arr.value); // ['name', 'last name']
  30044. * ```
  30045. *
  30046. * - OR -
  30047. *
  30048. * ```
  30049. * this.arr.reset([
  30050. * {value: 'name', disabled: true},
  30051. * 'last'
  30052. * ]);
  30053. *
  30054. * console.log(this.arr.value); // ['name', 'last name']
  30055. * console.log(this.arr.get(0).status); // 'DISABLED'
  30056. * ```
  30057. * @param {?=} value
  30058. * @param {?=} options
  30059. * @return {?}
  30060. */
  30061. FormArray.prototype.reset = /**
  30062. * Resets the {\@link FormArray}. This means by default:
  30063. *
  30064. * * The array and all descendants are marked `pristine`
  30065. * * The array and all descendants are marked `untouched`
  30066. * * The value of all descendants will be null or null maps
  30067. *
  30068. * You can also reset to a specific form state by passing in an array of states
  30069. * that matches the structure of the control. The state can be a standalone value
  30070. * or a form state object with both a value and a disabled status.
  30071. *
  30072. * ### Example
  30073. *
  30074. * ```ts
  30075. * this.arr.reset(['name', 'last name']);
  30076. *
  30077. * console.log(this.arr.value); // ['name', 'last name']
  30078. * ```
  30079. *
  30080. * - OR -
  30081. *
  30082. * ```
  30083. * this.arr.reset([
  30084. * {value: 'name', disabled: true},
  30085. * 'last'
  30086. * ]);
  30087. *
  30088. * console.log(this.arr.value); // ['name', 'last name']
  30089. * console.log(this.arr.get(0).status); // 'DISABLED'
  30090. * ```
  30091. * @param {?=} value
  30092. * @param {?=} options
  30093. * @return {?}
  30094. */
  30095. function (value, options) {
  30096. if (value === void 0) { value = []; }
  30097. if (options === void 0) { options = {}; }
  30098. this._forEachChild(function (control, index) {
  30099. control.reset(value[index], { onlySelf: true, emitEvent: options.emitEvent });
  30100. });
  30101. this.updateValueAndValidity(options);
  30102. this._updatePristine(options);
  30103. this._updateTouched(options);
  30104. };
  30105. /**
  30106. * The aggregate value of the array, including any disabled controls.
  30107. *
  30108. * If you'd like to include all values regardless of disabled status, use this method.
  30109. * Otherwise, the `value` property is the best way to get the value of the array.
  30110. */
  30111. /**
  30112. * The aggregate value of the array, including any disabled controls.
  30113. *
  30114. * If you'd like to include all values regardless of disabled status, use this method.
  30115. * Otherwise, the `value` property is the best way to get the value of the array.
  30116. * @return {?}
  30117. */
  30118. FormArray.prototype.getRawValue = /**
  30119. * The aggregate value of the array, including any disabled controls.
  30120. *
  30121. * If you'd like to include all values regardless of disabled status, use this method.
  30122. * Otherwise, the `value` property is the best way to get the value of the array.
  30123. * @return {?}
  30124. */
  30125. function () {
  30126. return this.controls.map(function (control) {
  30127. return control instanceof FormControl ? control.value : (/** @type {?} */ (control)).getRawValue();
  30128. });
  30129. };
  30130. /** @internal */
  30131. /**
  30132. * \@internal
  30133. * @return {?}
  30134. */
  30135. FormArray.prototype._syncPendingControls = /**
  30136. * \@internal
  30137. * @return {?}
  30138. */
  30139. function () {
  30140. var /** @type {?} */ subtreeUpdated = this.controls.reduce(function (updated, child) {
  30141. return child._syncPendingControls() ? true : updated;
  30142. }, false);
  30143. if (subtreeUpdated)
  30144. this.updateValueAndValidity({ onlySelf: true });
  30145. return subtreeUpdated;
  30146. };
  30147. /** @internal */
  30148. /**
  30149. * \@internal
  30150. * @param {?} index
  30151. * @return {?}
  30152. */
  30153. FormArray.prototype._throwIfControlMissing = /**
  30154. * \@internal
  30155. * @param {?} index
  30156. * @return {?}
  30157. */
  30158. function (index) {
  30159. if (!this.controls.length) {
  30160. throw new Error("\n There are no form controls registered with this array yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");
  30161. }
  30162. if (!this.at(index)) {
  30163. throw new Error("Cannot find form control at index " + index);
  30164. }
  30165. };
  30166. /** @internal */
  30167. /**
  30168. * \@internal
  30169. * @param {?} cb
  30170. * @return {?}
  30171. */
  30172. FormArray.prototype._forEachChild = /**
  30173. * \@internal
  30174. * @param {?} cb
  30175. * @return {?}
  30176. */
  30177. function (cb) {
  30178. this.controls.forEach(function (control, index) { cb(control, index); });
  30179. };
  30180. /** @internal */
  30181. /**
  30182. * \@internal
  30183. * @return {?}
  30184. */
  30185. FormArray.prototype._updateValue = /**
  30186. * \@internal
  30187. * @return {?}
  30188. */
  30189. function () {
  30190. var _this = this;
  30191. (/** @type {?} */ (this)).value =
  30192. this.controls.filter(function (control) { return control.enabled || _this.disabled; })
  30193. .map(function (control) { return control.value; });
  30194. };
  30195. /** @internal */
  30196. /**
  30197. * \@internal
  30198. * @param {?} condition
  30199. * @return {?}
  30200. */
  30201. FormArray.prototype._anyControls = /**
  30202. * \@internal
  30203. * @param {?} condition
  30204. * @return {?}
  30205. */
  30206. function (condition) {
  30207. return this.controls.some(function (control) { return control.enabled && condition(control); });
  30208. };
  30209. /** @internal */
  30210. /**
  30211. * \@internal
  30212. * @return {?}
  30213. */
  30214. FormArray.prototype._setUpControls = /**
  30215. * \@internal
  30216. * @return {?}
  30217. */
  30218. function () {
  30219. var _this = this;
  30220. this._forEachChild(function (control) { return _this._registerControl(control); });
  30221. };
  30222. /** @internal */
  30223. /**
  30224. * \@internal
  30225. * @param {?} value
  30226. * @return {?}
  30227. */
  30228. FormArray.prototype._checkAllValuesPresent = /**
  30229. * \@internal
  30230. * @param {?} value
  30231. * @return {?}
  30232. */
  30233. function (value) {
  30234. this._forEachChild(function (control, i) {
  30235. if (value[i] === undefined) {
  30236. throw new Error("Must supply a value for form control at index: " + i + ".");
  30237. }
  30238. });
  30239. };
  30240. /** @internal */
  30241. /**
  30242. * \@internal
  30243. * @return {?}
  30244. */
  30245. FormArray.prototype._allControlsDisabled = /**
  30246. * \@internal
  30247. * @return {?}
  30248. */
  30249. function () {
  30250. for (var _i = 0, _a = this.controls; _i < _a.length; _i++) {
  30251. var control = _a[_i];
  30252. if (control.enabled)
  30253. return false;
  30254. }
  30255. return this.controls.length > 0 || this.disabled;
  30256. };
  30257. /**
  30258. * @param {?} control
  30259. * @return {?}
  30260. */
  30261. FormArray.prototype._registerControl = /**
  30262. * @param {?} control
  30263. * @return {?}
  30264. */
  30265. function (control) {
  30266. control.setParent(this);
  30267. control._registerOnCollectionChange(this._onCollectionChange);
  30268. };
  30269. return FormArray;
  30270. }(AbstractControl));
  30271. /**
  30272. * @fileoverview added by tsickle
  30273. * @suppress {checkTypes} checked by tsc
  30274. */
  30275. /**
  30276. * @license
  30277. * Copyright Google Inc. All Rights Reserved.
  30278. *
  30279. * Use of this source code is governed by an MIT-style license that can be
  30280. * found in the LICENSE file at https://angular.io/license
  30281. */
  30282. var formDirectiveProvider = {
  30283. provide: ControlContainer,
  30284. useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_14" /* forwardRef */])(function () { return NgForm; })
  30285. };
  30286. var resolvedPromise = Promise.resolve(null);
  30287. /**
  30288. * \@whatItDoes Creates a top-level {\@link FormGroup} instance and binds it to a form
  30289. * to track aggregate form value and validation status.
  30290. *
  30291. * \@howToUse
  30292. *
  30293. * As soon as you import the `FormsModule`, this directive becomes active by default on
  30294. * all `<form>` tags. You don't need to add a special selector.
  30295. *
  30296. * You can export the directive into a local template variable using `ngForm` as the key
  30297. * (ex: `#myForm="ngForm"`). This is optional, but useful. Many properties from the underlying
  30298. * {\@link FormGroup} instance are duplicated on the directive itself, so a reference to it
  30299. * will give you access to the aggregate value and validity status of the form, as well as
  30300. * user interaction properties like `dirty` and `touched`.
  30301. *
  30302. * To register child controls with the form, you'll want to use {\@link NgModel} with a
  30303. * `name` attribute. You can also use {\@link NgModelGroup} if you'd like to create
  30304. * sub-groups within the form.
  30305. *
  30306. * You can listen to the directive's `ngSubmit` event to be notified when the user has
  30307. * triggered a form submission. The `ngSubmit` event will be emitted with the original form
  30308. * submission event.
  30309. *
  30310. * In template driven forms, all `<form>` tags are automatically tagged as `NgForm`.
  30311. * If you want to import the `FormsModule` but skip its usage in some forms,
  30312. * for example, to use native HTML5 validation, you can add `ngNoForm` and the `<form>`
  30313. * tags won't create an `NgForm` directive. In reactive forms, using `ngNoForm` is
  30314. * unnecessary because the `<form>` tags are inert. In that case, you would
  30315. * refrain from using the `formGroup` directive.
  30316. *
  30317. * {\@example forms/ts/simpleForm/simple_form_example.ts region='Component'}
  30318. *
  30319. * * **npm package**: `\@angular/forms`
  30320. *
  30321. * * **NgModule**: `FormsModule`
  30322. *
  30323. * \@stable
  30324. */
  30325. var NgForm = /** @class */ (function (_super) {
  30326. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(NgForm, _super);
  30327. function NgForm(validators, asyncValidators) {
  30328. var _this = _super.call(this) || this;
  30329. _this.submitted = false;
  30330. _this._directives = [];
  30331. _this.ngSubmit = new __WEBPACK_IMPORTED_MODULE_1__angular_core__["v" /* EventEmitter */]();
  30332. _this.form =
  30333. new FormGroup({}, composeValidators(validators), composeAsyncValidators(asyncValidators));
  30334. return _this;
  30335. }
  30336. /**
  30337. * @return {?}
  30338. */
  30339. NgForm.prototype.ngAfterViewInit = /**
  30340. * @return {?}
  30341. */
  30342. function () { this._setUpdateStrategy(); };
  30343. Object.defineProperty(NgForm.prototype, "formDirective", {
  30344. get: /**
  30345. * @return {?}
  30346. */
  30347. function () { return this; },
  30348. enumerable: true,
  30349. configurable: true
  30350. });
  30351. Object.defineProperty(NgForm.prototype, "control", {
  30352. get: /**
  30353. * @return {?}
  30354. */
  30355. function () { return this.form; },
  30356. enumerable: true,
  30357. configurable: true
  30358. });
  30359. Object.defineProperty(NgForm.prototype, "path", {
  30360. get: /**
  30361. * @return {?}
  30362. */
  30363. function () { return []; },
  30364. enumerable: true,
  30365. configurable: true
  30366. });
  30367. Object.defineProperty(NgForm.prototype, "controls", {
  30368. get: /**
  30369. * @return {?}
  30370. */
  30371. function () { return this.form.controls; },
  30372. enumerable: true,
  30373. configurable: true
  30374. });
  30375. /**
  30376. * @param {?} dir
  30377. * @return {?}
  30378. */
  30379. NgForm.prototype.addControl = /**
  30380. * @param {?} dir
  30381. * @return {?}
  30382. */
  30383. function (dir) {
  30384. var _this = this;
  30385. resolvedPromise.then(function () {
  30386. var /** @type {?} */ container = _this._findContainer(dir.path);
  30387. (/** @type {?} */ (dir)).control = /** @type {?} */ (container.registerControl(dir.name, dir.control));
  30388. setUpControl(dir.control, dir);
  30389. dir.control.updateValueAndValidity({ emitEvent: false });
  30390. _this._directives.push(dir);
  30391. });
  30392. };
  30393. /**
  30394. * @param {?} dir
  30395. * @return {?}
  30396. */
  30397. NgForm.prototype.getControl = /**
  30398. * @param {?} dir
  30399. * @return {?}
  30400. */
  30401. function (dir) { return /** @type {?} */ (this.form.get(dir.path)); };
  30402. /**
  30403. * @param {?} dir
  30404. * @return {?}
  30405. */
  30406. NgForm.prototype.removeControl = /**
  30407. * @param {?} dir
  30408. * @return {?}
  30409. */
  30410. function (dir) {
  30411. var _this = this;
  30412. resolvedPromise.then(function () {
  30413. var /** @type {?} */ container = _this._findContainer(dir.path);
  30414. if (container) {
  30415. container.removeControl(dir.name);
  30416. }
  30417. removeDir(_this._directives, dir);
  30418. });
  30419. };
  30420. /**
  30421. * @param {?} dir
  30422. * @return {?}
  30423. */
  30424. NgForm.prototype.addFormGroup = /**
  30425. * @param {?} dir
  30426. * @return {?}
  30427. */
  30428. function (dir) {
  30429. var _this = this;
  30430. resolvedPromise.then(function () {
  30431. var /** @type {?} */ container = _this._findContainer(dir.path);
  30432. var /** @type {?} */ group = new FormGroup({});
  30433. setUpFormContainer(group, dir);
  30434. container.registerControl(dir.name, group);
  30435. group.updateValueAndValidity({ emitEvent: false });
  30436. });
  30437. };
  30438. /**
  30439. * @param {?} dir
  30440. * @return {?}
  30441. */
  30442. NgForm.prototype.removeFormGroup = /**
  30443. * @param {?} dir
  30444. * @return {?}
  30445. */
  30446. function (dir) {
  30447. var _this = this;
  30448. resolvedPromise.then(function () {
  30449. var /** @type {?} */ container = _this._findContainer(dir.path);
  30450. if (container) {
  30451. container.removeControl(dir.name);
  30452. }
  30453. });
  30454. };
  30455. /**
  30456. * @param {?} dir
  30457. * @return {?}
  30458. */
  30459. NgForm.prototype.getFormGroup = /**
  30460. * @param {?} dir
  30461. * @return {?}
  30462. */
  30463. function (dir) { return /** @type {?} */ (this.form.get(dir.path)); };
  30464. /**
  30465. * @param {?} dir
  30466. * @param {?} value
  30467. * @return {?}
  30468. */
  30469. NgForm.prototype.updateModel = /**
  30470. * @param {?} dir
  30471. * @param {?} value
  30472. * @return {?}
  30473. */
  30474. function (dir, value) {
  30475. var _this = this;
  30476. resolvedPromise.then(function () {
  30477. var /** @type {?} */ ctrl = /** @type {?} */ (_this.form.get(/** @type {?} */ ((dir.path))));
  30478. ctrl.setValue(value);
  30479. });
  30480. };
  30481. /**
  30482. * @param {?} value
  30483. * @return {?}
  30484. */
  30485. NgForm.prototype.setValue = /**
  30486. * @param {?} value
  30487. * @return {?}
  30488. */
  30489. function (value) { this.control.setValue(value); };
  30490. /**
  30491. * @param {?} $event
  30492. * @return {?}
  30493. */
  30494. NgForm.prototype.onSubmit = /**
  30495. * @param {?} $event
  30496. * @return {?}
  30497. */
  30498. function ($event) {
  30499. (/** @type {?} */ (this)).submitted = true;
  30500. syncPendingControls(this.form, this._directives);
  30501. this.ngSubmit.emit($event);
  30502. return false;
  30503. };
  30504. /**
  30505. * @return {?}
  30506. */
  30507. NgForm.prototype.onReset = /**
  30508. * @return {?}
  30509. */
  30510. function () { this.resetForm(); };
  30511. /**
  30512. * @param {?=} value
  30513. * @return {?}
  30514. */
  30515. NgForm.prototype.resetForm = /**
  30516. * @param {?=} value
  30517. * @return {?}
  30518. */
  30519. function (value) {
  30520. if (value === void 0) { value = undefined; }
  30521. this.form.reset(value);
  30522. (/** @type {?} */ (this)).submitted = false;
  30523. };
  30524. /**
  30525. * @return {?}
  30526. */
  30527. NgForm.prototype._setUpdateStrategy = /**
  30528. * @return {?}
  30529. */
  30530. function () {
  30531. if (this.options && this.options.updateOn != null) {
  30532. this.form._updateOn = this.options.updateOn;
  30533. }
  30534. };
  30535. /** @internal */
  30536. /**
  30537. * \@internal
  30538. * @param {?} path
  30539. * @return {?}
  30540. */
  30541. NgForm.prototype._findContainer = /**
  30542. * \@internal
  30543. * @param {?} path
  30544. * @return {?}
  30545. */
  30546. function (path) {
  30547. path.pop();
  30548. return path.length ? /** @type {?} */ (this.form.get(path)) : this.form;
  30549. };
  30550. NgForm.decorators = [
  30551. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["s" /* Directive */], args: [{
  30552. selector: 'form:not([ngNoForm]):not([formGroup]),ngForm,[ngForm]',
  30553. providers: [formDirectiveProvider],
  30554. host: { '(submit)': 'onSubmit($event)', '(reset)': 'onReset()' },
  30555. outputs: ['ngSubmit'],
  30556. exportAs: 'ngForm'
  30557. },] },
  30558. ];
  30559. /** @nocollapse */
  30560. NgForm.ctorParameters = function () { return [
  30561. { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["N" /* Optional */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["_1" /* Self */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["z" /* Inject */], args: [NG_VALIDATORS,] },] },
  30562. { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["N" /* Optional */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["_1" /* Self */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["z" /* Inject */], args: [NG_ASYNC_VALIDATORS,] },] },
  30563. ]; };
  30564. NgForm.propDecorators = {
  30565. "options": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["D" /* Input */], args: ['ngFormOptions',] },],
  30566. };
  30567. return NgForm;
  30568. }(ControlContainer));
  30569. /**
  30570. * @fileoverview added by tsickle
  30571. * @suppress {checkTypes} checked by tsc
  30572. */
  30573. /**
  30574. * @license
  30575. * Copyright Google Inc. All Rights Reserved.
  30576. *
  30577. * Use of this source code is governed by an MIT-style license that can be
  30578. * found in the LICENSE file at https://angular.io/license
  30579. */
  30580. var FormErrorExamples = {
  30581. formControlName: "\n <div [formGroup]=\"myGroup\">\n <input formControlName=\"firstName\">\n </div>\n\n In your class:\n\n this.myGroup = new FormGroup({\n firstName: new FormControl()\n });",
  30582. formGroupName: "\n <div [formGroup]=\"myGroup\">\n <div formGroupName=\"person\">\n <input formControlName=\"firstName\">\n </div>\n </div>\n\n In your class:\n\n this.myGroup = new FormGroup({\n person: new FormGroup({ firstName: new FormControl() })\n });",
  30583. formArrayName: "\n <div [formGroup]=\"myGroup\">\n <div formArrayName=\"cities\">\n <div *ngFor=\"let city of cityArray.controls; index as i\">\n <input [formControlName]=\"i\">\n </div>\n </div>\n </div>\n\n In your class:\n\n this.cityArray = new FormArray([new FormControl('SF')]);\n this.myGroup = new FormGroup({\n cities: this.cityArray\n });",
  30584. ngModelGroup: "\n <form>\n <div ngModelGroup=\"person\">\n <input [(ngModel)]=\"person.name\" name=\"firstName\">\n </div>\n </form>",
  30585. ngModelWithFormGroup: "\n <div [formGroup]=\"myGroup\">\n <input formControlName=\"firstName\">\n <input [(ngModel)]=\"showMoreControls\" [ngModelOptions]=\"{standalone: true}\">\n </div>\n "
  30586. };
  30587. /**
  30588. * @fileoverview added by tsickle
  30589. * @suppress {checkTypes} checked by tsc
  30590. */
  30591. /**
  30592. * @license
  30593. * Copyright Google Inc. All Rights Reserved.
  30594. *
  30595. * Use of this source code is governed by an MIT-style license that can be
  30596. * found in the LICENSE file at https://angular.io/license
  30597. */
  30598. var TemplateDrivenErrors = /** @class */ (function () {
  30599. function TemplateDrivenErrors() {
  30600. }
  30601. /**
  30602. * @return {?}
  30603. */
  30604. TemplateDrivenErrors.modelParentException = /**
  30605. * @return {?}
  30606. */
  30607. function () {
  30608. throw new Error("\n ngModel cannot be used to register form controls with a parent formGroup directive. Try using\n formGroup's partner directive \"formControlName\" instead. Example:\n\n " + FormErrorExamples.formControlName + "\n\n Or, if you'd like to avoid registering this form control, indicate that it's standalone in ngModelOptions:\n\n Example:\n\n " + FormErrorExamples.ngModelWithFormGroup);
  30609. };
  30610. /**
  30611. * @return {?}
  30612. */
  30613. TemplateDrivenErrors.formGroupNameException = /**
  30614. * @return {?}
  30615. */
  30616. function () {
  30617. throw new Error("\n ngModel cannot be used to register form controls with a parent formGroupName or formArrayName directive.\n\n Option 1: Use formControlName instead of ngModel (reactive strategy):\n\n " + FormErrorExamples.formGroupName + "\n\n Option 2: Update ngModel's parent be ngModelGroup (template-driven strategy):\n\n " + FormErrorExamples.ngModelGroup);
  30618. };
  30619. /**
  30620. * @return {?}
  30621. */
  30622. TemplateDrivenErrors.missingNameException = /**
  30623. * @return {?}
  30624. */
  30625. function () {
  30626. throw new Error("If ngModel is used within a form tag, either the name attribute must be set or the form\n control must be defined as 'standalone' in ngModelOptions.\n\n Example 1: <input [(ngModel)]=\"person.firstName\" name=\"first\">\n Example 2: <input [(ngModel)]=\"person.firstName\" [ngModelOptions]=\"{standalone: true}\">");
  30627. };
  30628. /**
  30629. * @return {?}
  30630. */
  30631. TemplateDrivenErrors.modelGroupParentException = /**
  30632. * @return {?}
  30633. */
  30634. function () {
  30635. throw new Error("\n ngModelGroup cannot be used with a parent formGroup directive.\n\n Option 1: Use formGroupName instead of ngModelGroup (reactive strategy):\n\n " + FormErrorExamples.formGroupName + "\n\n Option 2: Use a regular form tag instead of the formGroup directive (template-driven strategy):\n\n " + FormErrorExamples.ngModelGroup);
  30636. };
  30637. return TemplateDrivenErrors;
  30638. }());
  30639. /**
  30640. * @fileoverview added by tsickle
  30641. * @suppress {checkTypes} checked by tsc
  30642. */
  30643. /**
  30644. * @license
  30645. * Copyright Google Inc. All Rights Reserved.
  30646. *
  30647. * Use of this source code is governed by an MIT-style license that can be
  30648. * found in the LICENSE file at https://angular.io/license
  30649. */
  30650. var modelGroupProvider = {
  30651. provide: ControlContainer,
  30652. useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_14" /* forwardRef */])(function () { return NgModelGroup; })
  30653. };
  30654. /**
  30655. * \@whatItDoes Creates and binds a {\@link FormGroup} instance to a DOM element.
  30656. *
  30657. * \@howToUse
  30658. *
  30659. * This directive can only be used as a child of {\@link NgForm} (or in other words,
  30660. * within `<form>` tags).
  30661. *
  30662. * Use this directive if you'd like to create a sub-group within a form. This can
  30663. * come in handy if you want to validate a sub-group of your form separately from
  30664. * the rest of your form, or if some values in your domain model make more sense to
  30665. * consume together in a nested object.
  30666. *
  30667. * Pass in the name you'd like this sub-group to have and it will become the key
  30668. * for the sub-group in the form's full value. You can also export the directive into
  30669. * a local template variable using `ngModelGroup` (ex: `#myGroup="ngModelGroup"`).
  30670. *
  30671. * {\@example forms/ts/ngModelGroup/ng_model_group_example.ts region='Component'}
  30672. *
  30673. * * **npm package**: `\@angular/forms`
  30674. *
  30675. * * **NgModule**: `FormsModule`
  30676. *
  30677. * \@stable
  30678. */
  30679. var NgModelGroup = /** @class */ (function (_super) {
  30680. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(NgModelGroup, _super);
  30681. function NgModelGroup(parent, validators, asyncValidators) {
  30682. var _this = _super.call(this) || this;
  30683. _this._parent = parent;
  30684. _this._validators = validators;
  30685. _this._asyncValidators = asyncValidators;
  30686. return _this;
  30687. }
  30688. /** @internal */
  30689. /**
  30690. * \@internal
  30691. * @return {?}
  30692. */
  30693. NgModelGroup.prototype._checkParentType = /**
  30694. * \@internal
  30695. * @return {?}
  30696. */
  30697. function () {
  30698. if (!(this._parent instanceof NgModelGroup) && !(this._parent instanceof NgForm)) {
  30699. TemplateDrivenErrors.modelGroupParentException();
  30700. }
  30701. };
  30702. NgModelGroup.decorators = [
  30703. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["s" /* Directive */], args: [{ selector: '[ngModelGroup]', providers: [modelGroupProvider], exportAs: 'ngModelGroup' },] },
  30704. ];
  30705. /** @nocollapse */
  30706. NgModelGroup.ctorParameters = function () { return [
  30707. { type: ControlContainer, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["w" /* Host */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["_2" /* SkipSelf */] },] },
  30708. { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["N" /* Optional */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["_1" /* Self */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["z" /* Inject */], args: [NG_VALIDATORS,] },] },
  30709. { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["N" /* Optional */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["_1" /* Self */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["z" /* Inject */], args: [NG_ASYNC_VALIDATORS,] },] },
  30710. ]; };
  30711. NgModelGroup.propDecorators = {
  30712. "name": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["D" /* Input */], args: ['ngModelGroup',] },],
  30713. };
  30714. return NgModelGroup;
  30715. }(AbstractFormGroupDirective));
  30716. /**
  30717. * @fileoverview added by tsickle
  30718. * @suppress {checkTypes} checked by tsc
  30719. */
  30720. /**
  30721. * @license
  30722. * Copyright Google Inc. All Rights Reserved.
  30723. *
  30724. * Use of this source code is governed by an MIT-style license that can be
  30725. * found in the LICENSE file at https://angular.io/license
  30726. */
  30727. var formControlBinding = {
  30728. provide: NgControl,
  30729. useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_14" /* forwardRef */])(function () { return NgModel; })
  30730. };
  30731. /**
  30732. * `ngModel` forces an additional change detection run when its inputs change:
  30733. * E.g.:
  30734. * ```
  30735. * <div>{{myModel.valid}}</div>
  30736. * <input [(ngModel)]="myValue" #myModel="ngModel">
  30737. * ```
  30738. * I.e. `ngModel` can export itself on the element and then be used in the template.
  30739. * Normally, this would result in expressions before the `input` that use the exported directive
  30740. * to have and old value as they have been
  30741. * dirty checked before. As this is a very common case for `ngModel`, we added this second change
  30742. * detection run.
  30743. *
  30744. * Notes:
  30745. * - this is just one extra run no matter how many `ngModel` have been changed.
  30746. * - this is a general problem when using `exportAs` for directives!
  30747. */
  30748. var resolvedPromise$1 = Promise.resolve(null);
  30749. /**
  30750. * \@whatItDoes Creates a {\@link FormControl} instance from a domain model and binds it
  30751. * to a form control element.
  30752. *
  30753. * The {\@link FormControl} instance will track the value, user interaction, and
  30754. * validation status of the control and keep the view synced with the model. If used
  30755. * within a parent form, the directive will also register itself with the form as a child
  30756. * control.
  30757. *
  30758. * \@howToUse
  30759. *
  30760. * This directive can be used by itself or as part of a larger form. All you need is the
  30761. * `ngModel` selector to activate it.
  30762. *
  30763. * It accepts a domain model as an optional {\@link Input}. If you have a one-way binding
  30764. * to `ngModel` with `[]` syntax, changing the value of the domain model in the component
  30765. * class will set the value in the view. If you have a two-way binding with `[()]` syntax
  30766. * (also known as 'banana-box syntax'), the value in the UI will always be synced back to
  30767. * the domain model in your class as well.
  30768. *
  30769. * If you wish to inspect the properties of the associated {\@link FormControl} (like
  30770. * validity state), you can also export the directive into a local template variable using
  30771. * `ngModel` as the key (ex: `#myVar="ngModel"`). You can then access the control using the
  30772. * directive's `control` property, but most properties you'll need (like `valid` and `dirty`)
  30773. * will fall through to the control anyway, so you can access them directly. You can see a
  30774. * full list of properties directly available in {\@link AbstractControlDirective}.
  30775. *
  30776. * The following is an example of a simple standalone control using `ngModel`:
  30777. *
  30778. * {\@example forms/ts/simpleNgModel/simple_ng_model_example.ts region='Component'}
  30779. *
  30780. * When using the `ngModel` within `<form>` tags, you'll also need to supply a `name` attribute
  30781. * so that the control can be registered with the parent form under that name.
  30782. *
  30783. * It's worth noting that in the context of a parent form, you often can skip one-way or
  30784. * two-way binding because the parent form will sync the value for you. You can access
  30785. * its properties by exporting it into a local template variable using `ngForm` (ex:
  30786. * `#f="ngForm"`). Then you can pass it where it needs to go on submit.
  30787. *
  30788. * If you do need to populate initial values into your form, using a one-way binding for
  30789. * `ngModel` tends to be sufficient as long as you use the exported form's value rather
  30790. * than the domain model's value on submit.
  30791. *
  30792. * Take a look at an example of using `ngModel` within a form:
  30793. *
  30794. * {\@example forms/ts/simpleForm/simple_form_example.ts region='Component'}
  30795. *
  30796. * To see `ngModel` examples with different form control types, see:
  30797. *
  30798. * * Radio buttons: {\@link RadioControlValueAccessor}
  30799. * * Selects: {\@link SelectControlValueAccessor}
  30800. *
  30801. * **npm package**: `\@angular/forms`
  30802. *
  30803. * **NgModule**: `FormsModule`
  30804. *
  30805. * \@stable
  30806. */
  30807. var NgModel = /** @class */ (function (_super) {
  30808. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(NgModel, _super);
  30809. function NgModel(parent, validators, asyncValidators, valueAccessors) {
  30810. var _this = _super.call(this) || this;
  30811. _this.control = new FormControl();
  30812. /**
  30813. * \@internal
  30814. */
  30815. _this._registered = false;
  30816. _this.update = new __WEBPACK_IMPORTED_MODULE_1__angular_core__["v" /* EventEmitter */]();
  30817. _this._parent = parent;
  30818. _this._rawValidators = validators || [];
  30819. _this._rawAsyncValidators = asyncValidators || [];
  30820. _this.valueAccessor = selectValueAccessor(_this, valueAccessors);
  30821. return _this;
  30822. }
  30823. /**
  30824. * @param {?} changes
  30825. * @return {?}
  30826. */
  30827. NgModel.prototype.ngOnChanges = /**
  30828. * @param {?} changes
  30829. * @return {?}
  30830. */
  30831. function (changes) {
  30832. this._checkForErrors();
  30833. if (!this._registered)
  30834. this._setUpControl();
  30835. if ('isDisabled' in changes) {
  30836. this._updateDisabled(changes);
  30837. }
  30838. if (isPropertyUpdated(changes, this.viewModel)) {
  30839. this._updateValue(this.model);
  30840. this.viewModel = this.model;
  30841. }
  30842. };
  30843. /**
  30844. * @return {?}
  30845. */
  30846. NgModel.prototype.ngOnDestroy = /**
  30847. * @return {?}
  30848. */
  30849. function () { this.formDirective && this.formDirective.removeControl(this); };
  30850. Object.defineProperty(NgModel.prototype, "path", {
  30851. get: /**
  30852. * @return {?}
  30853. */
  30854. function () {
  30855. return this._parent ? controlPath(this.name, this._parent) : [this.name];
  30856. },
  30857. enumerable: true,
  30858. configurable: true
  30859. });
  30860. Object.defineProperty(NgModel.prototype, "formDirective", {
  30861. get: /**
  30862. * @return {?}
  30863. */
  30864. function () { return this._parent ? this._parent.formDirective : null; },
  30865. enumerable: true,
  30866. configurable: true
  30867. });
  30868. Object.defineProperty(NgModel.prototype, "validator", {
  30869. get: /**
  30870. * @return {?}
  30871. */
  30872. function () { return composeValidators(this._rawValidators); },
  30873. enumerable: true,
  30874. configurable: true
  30875. });
  30876. Object.defineProperty(NgModel.prototype, "asyncValidator", {
  30877. get: /**
  30878. * @return {?}
  30879. */
  30880. function () {
  30881. return composeAsyncValidators(this._rawAsyncValidators);
  30882. },
  30883. enumerable: true,
  30884. configurable: true
  30885. });
  30886. /**
  30887. * @param {?} newValue
  30888. * @return {?}
  30889. */
  30890. NgModel.prototype.viewToModelUpdate = /**
  30891. * @param {?} newValue
  30892. * @return {?}
  30893. */
  30894. function (newValue) {
  30895. this.viewModel = newValue;
  30896. this.update.emit(newValue);
  30897. };
  30898. /**
  30899. * @return {?}
  30900. */
  30901. NgModel.prototype._setUpControl = /**
  30902. * @return {?}
  30903. */
  30904. function () {
  30905. this._setUpdateStrategy();
  30906. this._isStandalone() ? this._setUpStandalone() :
  30907. this.formDirective.addControl(this);
  30908. this._registered = true;
  30909. };
  30910. /**
  30911. * @return {?}
  30912. */
  30913. NgModel.prototype._setUpdateStrategy = /**
  30914. * @return {?}
  30915. */
  30916. function () {
  30917. if (this.options && this.options.updateOn != null) {
  30918. this.control._updateOn = this.options.updateOn;
  30919. }
  30920. };
  30921. /**
  30922. * @return {?}
  30923. */
  30924. NgModel.prototype._isStandalone = /**
  30925. * @return {?}
  30926. */
  30927. function () {
  30928. return !this._parent || !!(this.options && this.options.standalone);
  30929. };
  30930. /**
  30931. * @return {?}
  30932. */
  30933. NgModel.prototype._setUpStandalone = /**
  30934. * @return {?}
  30935. */
  30936. function () {
  30937. setUpControl(this.control, this);
  30938. this.control.updateValueAndValidity({ emitEvent: false });
  30939. };
  30940. /**
  30941. * @return {?}
  30942. */
  30943. NgModel.prototype._checkForErrors = /**
  30944. * @return {?}
  30945. */
  30946. function () {
  30947. if (!this._isStandalone()) {
  30948. this._checkParentType();
  30949. }
  30950. this._checkName();
  30951. };
  30952. /**
  30953. * @return {?}
  30954. */
  30955. NgModel.prototype._checkParentType = /**
  30956. * @return {?}
  30957. */
  30958. function () {
  30959. if (!(this._parent instanceof NgModelGroup) &&
  30960. this._parent instanceof AbstractFormGroupDirective) {
  30961. TemplateDrivenErrors.formGroupNameException();
  30962. }
  30963. else if (!(this._parent instanceof NgModelGroup) && !(this._parent instanceof NgForm)) {
  30964. TemplateDrivenErrors.modelParentException();
  30965. }
  30966. };
  30967. /**
  30968. * @return {?}
  30969. */
  30970. NgModel.prototype._checkName = /**
  30971. * @return {?}
  30972. */
  30973. function () {
  30974. if (this.options && this.options.name)
  30975. this.name = this.options.name;
  30976. if (!this._isStandalone() && !this.name) {
  30977. TemplateDrivenErrors.missingNameException();
  30978. }
  30979. };
  30980. /**
  30981. * @param {?} value
  30982. * @return {?}
  30983. */
  30984. NgModel.prototype._updateValue = /**
  30985. * @param {?} value
  30986. * @return {?}
  30987. */
  30988. function (value) {
  30989. var _this = this;
  30990. resolvedPromise$1.then(function () { _this.control.setValue(value, { emitViewToModelChange: false }); });
  30991. };
  30992. /**
  30993. * @param {?} changes
  30994. * @return {?}
  30995. */
  30996. NgModel.prototype._updateDisabled = /**
  30997. * @param {?} changes
  30998. * @return {?}
  30999. */
  31000. function (changes) {
  31001. var _this = this;
  31002. var /** @type {?} */ disabledValue = changes['isDisabled'].currentValue;
  31003. var /** @type {?} */ isDisabled = disabledValue === '' || (disabledValue && disabledValue !== 'false');
  31004. resolvedPromise$1.then(function () {
  31005. if (isDisabled && !_this.control.disabled) {
  31006. _this.control.disable();
  31007. }
  31008. else if (!isDisabled && _this.control.disabled) {
  31009. _this.control.enable();
  31010. }
  31011. });
  31012. };
  31013. NgModel.decorators = [
  31014. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["s" /* Directive */], args: [{
  31015. selector: '[ngModel]:not([formControlName]):not([formControl])',
  31016. providers: [formControlBinding],
  31017. exportAs: 'ngModel'
  31018. },] },
  31019. ];
  31020. /** @nocollapse */
  31021. NgModel.ctorParameters = function () { return [
  31022. { type: ControlContainer, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["N" /* Optional */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["w" /* Host */] },] },
  31023. { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["N" /* Optional */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["_1" /* Self */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["z" /* Inject */], args: [NG_VALIDATORS,] },] },
  31024. { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["N" /* Optional */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["_1" /* Self */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["z" /* Inject */], args: [NG_ASYNC_VALIDATORS,] },] },
  31025. { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["N" /* Optional */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["_1" /* Self */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["z" /* Inject */], args: [NG_VALUE_ACCESSOR,] },] },
  31026. ]; };
  31027. NgModel.propDecorators = {
  31028. "name": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["D" /* Input */] },],
  31029. "isDisabled": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["D" /* Input */], args: ['disabled',] },],
  31030. "model": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["D" /* Input */], args: ['ngModel',] },],
  31031. "options": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["D" /* Input */], args: ['ngModelOptions',] },],
  31032. "update": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["O" /* Output */], args: ['ngModelChange',] },],
  31033. };
  31034. return NgModel;
  31035. }(NgControl));
  31036. /**
  31037. * @fileoverview added by tsickle
  31038. * @suppress {checkTypes} checked by tsc
  31039. */
  31040. /**
  31041. * @license
  31042. * Copyright Google Inc. All Rights Reserved.
  31043. *
  31044. * Use of this source code is governed by an MIT-style license that can be
  31045. * found in the LICENSE file at https://angular.io/license
  31046. */
  31047. var ReactiveErrors = /** @class */ (function () {
  31048. function ReactiveErrors() {
  31049. }
  31050. /**
  31051. * @return {?}
  31052. */
  31053. ReactiveErrors.controlParentException = /**
  31054. * @return {?}
  31055. */
  31056. function () {
  31057. throw new Error("formControlName must be used with a parent formGroup directive. You'll want to add a formGroup\n directive and pass it an existing FormGroup instance (you can create one in your class).\n\n Example:\n\n " + FormErrorExamples.formControlName);
  31058. };
  31059. /**
  31060. * @return {?}
  31061. */
  31062. ReactiveErrors.ngModelGroupException = /**
  31063. * @return {?}
  31064. */
  31065. function () {
  31066. throw new Error("formControlName cannot be used with an ngModelGroup parent. It is only compatible with parents\n that also have a \"form\" prefix: formGroupName, formArrayName, or formGroup.\n\n Option 1: Update the parent to be formGroupName (reactive form strategy)\n\n " + FormErrorExamples.formGroupName + "\n\n Option 2: Use ngModel instead of formControlName (template-driven strategy)\n\n " + FormErrorExamples.ngModelGroup);
  31067. };
  31068. /**
  31069. * @return {?}
  31070. */
  31071. ReactiveErrors.missingFormException = /**
  31072. * @return {?}
  31073. */
  31074. function () {
  31075. throw new Error("formGroup expects a FormGroup instance. Please pass one in.\n\n Example:\n\n " + FormErrorExamples.formControlName);
  31076. };
  31077. /**
  31078. * @return {?}
  31079. */
  31080. ReactiveErrors.groupParentException = /**
  31081. * @return {?}
  31082. */
  31083. function () {
  31084. throw new Error("formGroupName must be used with a parent formGroup directive. You'll want to add a formGroup\n directive and pass it an existing FormGroup instance (you can create one in your class).\n\n Example:\n\n " + FormErrorExamples.formGroupName);
  31085. };
  31086. /**
  31087. * @return {?}
  31088. */
  31089. ReactiveErrors.arrayParentException = /**
  31090. * @return {?}
  31091. */
  31092. function () {
  31093. throw new Error("formArrayName must be used with a parent formGroup directive. You'll want to add a formGroup\n directive and pass it an existing FormGroup instance (you can create one in your class).\n\n Example:\n\n " + FormErrorExamples.formArrayName);
  31094. };
  31095. /**
  31096. * @return {?}
  31097. */
  31098. ReactiveErrors.disabledAttrWarning = /**
  31099. * @return {?}
  31100. */
  31101. function () {
  31102. console.warn("\n It looks like you're using the disabled attribute with a reactive form directive. If you set disabled to true\n when you set up this control in your component class, the disabled attribute will actually be set in the DOM for\n you. We recommend using this approach to avoid 'changed after checked' errors.\n \n Example: \n form = new FormGroup({\n first: new FormControl({value: 'Nancy', disabled: true}, Validators.required),\n last: new FormControl('Drew', Validators.required)\n });\n ");
  31103. };
  31104. return ReactiveErrors;
  31105. }());
  31106. /**
  31107. * @fileoverview added by tsickle
  31108. * @suppress {checkTypes} checked by tsc
  31109. */
  31110. /**
  31111. * @license
  31112. * Copyright Google Inc. All Rights Reserved.
  31113. *
  31114. * Use of this source code is governed by an MIT-style license that can be
  31115. * found in the LICENSE file at https://angular.io/license
  31116. */
  31117. var formControlBinding$1 = {
  31118. provide: NgControl,
  31119. useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_14" /* forwardRef */])(function () { return FormControlDirective; })
  31120. };
  31121. /**
  31122. * \@whatItDoes Syncs a standalone {\@link FormControl} instance to a form control element.
  31123. *
  31124. * In other words, this directive ensures that any values written to the {\@link FormControl}
  31125. * instance programmatically will be written to the DOM element (model -> view). Conversely,
  31126. * any values written to the DOM element through user input will be reflected in the
  31127. * {\@link FormControl} instance (view -> model).
  31128. *
  31129. * \@howToUse
  31130. *
  31131. * Use this directive if you'd like to create and manage a {\@link FormControl} instance directly.
  31132. * Simply create a {\@link FormControl}, save it to your component class, and pass it into the
  31133. * {\@link FormControlDirective}.
  31134. *
  31135. * This directive is designed to be used as a standalone control. Unlike {\@link FormControlName},
  31136. * it does not require that your {\@link FormControl} instance be part of any parent
  31137. * {\@link FormGroup}, and it won't be registered to any {\@link FormGroupDirective} that
  31138. * exists above it.
  31139. *
  31140. * **Get the value**: the `value` property is always synced and available on the
  31141. * {\@link FormControl} instance. See a full list of available properties in
  31142. * {\@link AbstractControl}.
  31143. *
  31144. * **Set the value**: You can pass in an initial value when instantiating the {\@link FormControl},
  31145. * or you can set it programmatically later using {\@link AbstractControl#setValue setValue} or
  31146. * {\@link AbstractControl#patchValue patchValue}.
  31147. *
  31148. * **Listen to value**: If you want to listen to changes in the value of the control, you can
  31149. * subscribe to the {\@link AbstractControl#valueChanges valueChanges} event. You can also listen to
  31150. * {\@link AbstractControl#statusChanges statusChanges} to be notified when the validation status is
  31151. * re-calculated.
  31152. *
  31153. * ### Example
  31154. *
  31155. * {\@example forms/ts/simpleFormControl/simple_form_control_example.ts region='Component'}
  31156. *
  31157. * * **npm package**: `\@angular/forms`
  31158. *
  31159. * * **NgModule**: `ReactiveFormsModule`
  31160. *
  31161. * \@stable
  31162. */
  31163. var FormControlDirective = /** @class */ (function (_super) {
  31164. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(FormControlDirective, _super);
  31165. function FormControlDirective(validators, asyncValidators, valueAccessors) {
  31166. var _this = _super.call(this) || this;
  31167. _this.update = new __WEBPACK_IMPORTED_MODULE_1__angular_core__["v" /* EventEmitter */]();
  31168. _this._rawValidators = validators || [];
  31169. _this._rawAsyncValidators = asyncValidators || [];
  31170. _this.valueAccessor = selectValueAccessor(_this, valueAccessors);
  31171. return _this;
  31172. }
  31173. Object.defineProperty(FormControlDirective.prototype, "isDisabled", {
  31174. set: /**
  31175. * @param {?} isDisabled
  31176. * @return {?}
  31177. */
  31178. function (isDisabled) { ReactiveErrors.disabledAttrWarning(); },
  31179. enumerable: true,
  31180. configurable: true
  31181. });
  31182. /**
  31183. * @param {?} changes
  31184. * @return {?}
  31185. */
  31186. FormControlDirective.prototype.ngOnChanges = /**
  31187. * @param {?} changes
  31188. * @return {?}
  31189. */
  31190. function (changes) {
  31191. if (this._isControlChanged(changes)) {
  31192. setUpControl(this.form, this);
  31193. if (this.control.disabled && /** @type {?} */ ((this.valueAccessor)).setDisabledState) {
  31194. /** @type {?} */ ((/** @type {?} */ ((this.valueAccessor)).setDisabledState))(true);
  31195. }
  31196. this.form.updateValueAndValidity({ emitEvent: false });
  31197. }
  31198. if (isPropertyUpdated(changes, this.viewModel)) {
  31199. this.form.setValue(this.model);
  31200. this.viewModel = this.model;
  31201. }
  31202. };
  31203. Object.defineProperty(FormControlDirective.prototype, "path", {
  31204. get: /**
  31205. * @return {?}
  31206. */
  31207. function () { return []; },
  31208. enumerable: true,
  31209. configurable: true
  31210. });
  31211. Object.defineProperty(FormControlDirective.prototype, "validator", {
  31212. get: /**
  31213. * @return {?}
  31214. */
  31215. function () { return composeValidators(this._rawValidators); },
  31216. enumerable: true,
  31217. configurable: true
  31218. });
  31219. Object.defineProperty(FormControlDirective.prototype, "asyncValidator", {
  31220. get: /**
  31221. * @return {?}
  31222. */
  31223. function () {
  31224. return composeAsyncValidators(this._rawAsyncValidators);
  31225. },
  31226. enumerable: true,
  31227. configurable: true
  31228. });
  31229. Object.defineProperty(FormControlDirective.prototype, "control", {
  31230. get: /**
  31231. * @return {?}
  31232. */
  31233. function () { return this.form; },
  31234. enumerable: true,
  31235. configurable: true
  31236. });
  31237. /**
  31238. * @param {?} newValue
  31239. * @return {?}
  31240. */
  31241. FormControlDirective.prototype.viewToModelUpdate = /**
  31242. * @param {?} newValue
  31243. * @return {?}
  31244. */
  31245. function (newValue) {
  31246. this.viewModel = newValue;
  31247. this.update.emit(newValue);
  31248. };
  31249. /**
  31250. * @param {?} changes
  31251. * @return {?}
  31252. */
  31253. FormControlDirective.prototype._isControlChanged = /**
  31254. * @param {?} changes
  31255. * @return {?}
  31256. */
  31257. function (changes) {
  31258. return changes.hasOwnProperty('form');
  31259. };
  31260. FormControlDirective.decorators = [
  31261. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["s" /* Directive */], args: [{ selector: '[formControl]', providers: [formControlBinding$1], exportAs: 'ngForm' },] },
  31262. ];
  31263. /** @nocollapse */
  31264. FormControlDirective.ctorParameters = function () { return [
  31265. { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["N" /* Optional */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["_1" /* Self */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["z" /* Inject */], args: [NG_VALIDATORS,] },] },
  31266. { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["N" /* Optional */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["_1" /* Self */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["z" /* Inject */], args: [NG_ASYNC_VALIDATORS,] },] },
  31267. { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["N" /* Optional */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["_1" /* Self */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["z" /* Inject */], args: [NG_VALUE_ACCESSOR,] },] },
  31268. ]; };
  31269. FormControlDirective.propDecorators = {
  31270. "form": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["D" /* Input */], args: ['formControl',] },],
  31271. "model": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["D" /* Input */], args: ['ngModel',] },],
  31272. "update": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["O" /* Output */], args: ['ngModelChange',] },],
  31273. "isDisabled": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["D" /* Input */], args: ['disabled',] },],
  31274. };
  31275. return FormControlDirective;
  31276. }(NgControl));
  31277. /**
  31278. * @fileoverview added by tsickle
  31279. * @suppress {checkTypes} checked by tsc
  31280. */
  31281. /**
  31282. * @license
  31283. * Copyright Google Inc. All Rights Reserved.
  31284. *
  31285. * Use of this source code is governed by an MIT-style license that can be
  31286. * found in the LICENSE file at https://angular.io/license
  31287. */
  31288. var formDirectiveProvider$1 = {
  31289. provide: ControlContainer,
  31290. useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_14" /* forwardRef */])(function () { return FormGroupDirective; })
  31291. };
  31292. /**
  31293. * \@whatItDoes Binds an existing {\@link FormGroup} to a DOM element.
  31294. *
  31295. * \@howToUse
  31296. *
  31297. * This directive accepts an existing {\@link FormGroup} instance. It will then use this
  31298. * {\@link FormGroup} instance to match any child {\@link FormControl}, {\@link FormGroup},
  31299. * and {\@link FormArray} instances to child {\@link FormControlName}, {\@link FormGroupName},
  31300. * and {\@link FormArrayName} directives.
  31301. *
  31302. * **Set value**: You can set the form's initial value when instantiating the
  31303. * {\@link FormGroup}, or you can set it programmatically later using the {\@link FormGroup}'s
  31304. * {\@link AbstractControl#setValue setValue} or {\@link AbstractControl#patchValue patchValue}
  31305. * methods.
  31306. *
  31307. * **Listen to value**: If you want to listen to changes in the value of the form, you can subscribe
  31308. * to the {\@link FormGroup}'s {\@link AbstractControl#valueChanges valueChanges} event. You can also
  31309. * listen to its {\@link AbstractControl#statusChanges statusChanges} event to be notified when the
  31310. * validation status is re-calculated.
  31311. *
  31312. * Furthermore, you can listen to the directive's `ngSubmit` event to be notified when the user has
  31313. * triggered a form submission. The `ngSubmit` event will be emitted with the original form
  31314. * submission event.
  31315. *
  31316. * ### Example
  31317. *
  31318. * In this example, we create form controls for first name and last name.
  31319. *
  31320. * {\@example forms/ts/simpleFormGroup/simple_form_group_example.ts region='Component'}
  31321. *
  31322. * **npm package**: `\@angular/forms`
  31323. *
  31324. * **NgModule**: {\@link ReactiveFormsModule}
  31325. *
  31326. * \@stable
  31327. */
  31328. var FormGroupDirective = /** @class */ (function (_super) {
  31329. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(FormGroupDirective, _super);
  31330. function FormGroupDirective(_validators, _asyncValidators) {
  31331. var _this = _super.call(this) || this;
  31332. _this._validators = _validators;
  31333. _this._asyncValidators = _asyncValidators;
  31334. _this.submitted = false;
  31335. _this.directives = [];
  31336. _this.form = /** @type {?} */ ((null));
  31337. _this.ngSubmit = new __WEBPACK_IMPORTED_MODULE_1__angular_core__["v" /* EventEmitter */]();
  31338. return _this;
  31339. }
  31340. /**
  31341. * @param {?} changes
  31342. * @return {?}
  31343. */
  31344. FormGroupDirective.prototype.ngOnChanges = /**
  31345. * @param {?} changes
  31346. * @return {?}
  31347. */
  31348. function (changes) {
  31349. this._checkFormPresent();
  31350. if (changes.hasOwnProperty('form')) {
  31351. this._updateValidators();
  31352. this._updateDomValue();
  31353. this._updateRegistrations();
  31354. }
  31355. };
  31356. Object.defineProperty(FormGroupDirective.prototype, "formDirective", {
  31357. get: /**
  31358. * @return {?}
  31359. */
  31360. function () { return this; },
  31361. enumerable: true,
  31362. configurable: true
  31363. });
  31364. Object.defineProperty(FormGroupDirective.prototype, "control", {
  31365. get: /**
  31366. * @return {?}
  31367. */
  31368. function () { return this.form; },
  31369. enumerable: true,
  31370. configurable: true
  31371. });
  31372. Object.defineProperty(FormGroupDirective.prototype, "path", {
  31373. get: /**
  31374. * @return {?}
  31375. */
  31376. function () { return []; },
  31377. enumerable: true,
  31378. configurable: true
  31379. });
  31380. /**
  31381. * @param {?} dir
  31382. * @return {?}
  31383. */
  31384. FormGroupDirective.prototype.addControl = /**
  31385. * @param {?} dir
  31386. * @return {?}
  31387. */
  31388. function (dir) {
  31389. var /** @type {?} */ ctrl = this.form.get(dir.path);
  31390. setUpControl(ctrl, dir);
  31391. ctrl.updateValueAndValidity({ emitEvent: false });
  31392. this.directives.push(dir);
  31393. return ctrl;
  31394. };
  31395. /**
  31396. * @param {?} dir
  31397. * @return {?}
  31398. */
  31399. FormGroupDirective.prototype.getControl = /**
  31400. * @param {?} dir
  31401. * @return {?}
  31402. */
  31403. function (dir) { return /** @type {?} */ (this.form.get(dir.path)); };
  31404. /**
  31405. * @param {?} dir
  31406. * @return {?}
  31407. */
  31408. FormGroupDirective.prototype.removeControl = /**
  31409. * @param {?} dir
  31410. * @return {?}
  31411. */
  31412. function (dir) { removeDir(this.directives, dir); };
  31413. /**
  31414. * @param {?} dir
  31415. * @return {?}
  31416. */
  31417. FormGroupDirective.prototype.addFormGroup = /**
  31418. * @param {?} dir
  31419. * @return {?}
  31420. */
  31421. function (dir) {
  31422. var /** @type {?} */ ctrl = this.form.get(dir.path);
  31423. setUpFormContainer(ctrl, dir);
  31424. ctrl.updateValueAndValidity({ emitEvent: false });
  31425. };
  31426. /**
  31427. * @param {?} dir
  31428. * @return {?}
  31429. */
  31430. FormGroupDirective.prototype.removeFormGroup = /**
  31431. * @param {?} dir
  31432. * @return {?}
  31433. */
  31434. function (dir) { };
  31435. /**
  31436. * @param {?} dir
  31437. * @return {?}
  31438. */
  31439. FormGroupDirective.prototype.getFormGroup = /**
  31440. * @param {?} dir
  31441. * @return {?}
  31442. */
  31443. function (dir) { return /** @type {?} */ (this.form.get(dir.path)); };
  31444. /**
  31445. * @param {?} dir
  31446. * @return {?}
  31447. */
  31448. FormGroupDirective.prototype.addFormArray = /**
  31449. * @param {?} dir
  31450. * @return {?}
  31451. */
  31452. function (dir) {
  31453. var /** @type {?} */ ctrl = this.form.get(dir.path);
  31454. setUpFormContainer(ctrl, dir);
  31455. ctrl.updateValueAndValidity({ emitEvent: false });
  31456. };
  31457. /**
  31458. * @param {?} dir
  31459. * @return {?}
  31460. */
  31461. FormGroupDirective.prototype.removeFormArray = /**
  31462. * @param {?} dir
  31463. * @return {?}
  31464. */
  31465. function (dir) { };
  31466. /**
  31467. * @param {?} dir
  31468. * @return {?}
  31469. */
  31470. FormGroupDirective.prototype.getFormArray = /**
  31471. * @param {?} dir
  31472. * @return {?}
  31473. */
  31474. function (dir) { return /** @type {?} */ (this.form.get(dir.path)); };
  31475. /**
  31476. * @param {?} dir
  31477. * @param {?} value
  31478. * @return {?}
  31479. */
  31480. FormGroupDirective.prototype.updateModel = /**
  31481. * @param {?} dir
  31482. * @param {?} value
  31483. * @return {?}
  31484. */
  31485. function (dir, value) {
  31486. var /** @type {?} */ ctrl = /** @type {?} */ (this.form.get(dir.path));
  31487. ctrl.setValue(value);
  31488. };
  31489. /**
  31490. * @param {?} $event
  31491. * @return {?}
  31492. */
  31493. FormGroupDirective.prototype.onSubmit = /**
  31494. * @param {?} $event
  31495. * @return {?}
  31496. */
  31497. function ($event) {
  31498. (/** @type {?} */ (this)).submitted = true;
  31499. syncPendingControls(this.form, this.directives);
  31500. this.ngSubmit.emit($event);
  31501. return false;
  31502. };
  31503. /**
  31504. * @return {?}
  31505. */
  31506. FormGroupDirective.prototype.onReset = /**
  31507. * @return {?}
  31508. */
  31509. function () { this.resetForm(); };
  31510. /**
  31511. * @param {?=} value
  31512. * @return {?}
  31513. */
  31514. FormGroupDirective.prototype.resetForm = /**
  31515. * @param {?=} value
  31516. * @return {?}
  31517. */
  31518. function (value) {
  31519. if (value === void 0) { value = undefined; }
  31520. this.form.reset(value);
  31521. (/** @type {?} */ (this)).submitted = false;
  31522. };
  31523. /** @internal */
  31524. /**
  31525. * \@internal
  31526. * @return {?}
  31527. */
  31528. FormGroupDirective.prototype._updateDomValue = /**
  31529. * \@internal
  31530. * @return {?}
  31531. */
  31532. function () {
  31533. var _this = this;
  31534. this.directives.forEach(function (dir) {
  31535. var /** @type {?} */ newCtrl = _this.form.get(dir.path);
  31536. if (dir.control !== newCtrl) {
  31537. cleanUpControl(dir.control, dir);
  31538. if (newCtrl)
  31539. setUpControl(newCtrl, dir);
  31540. (/** @type {?} */ (dir)).control = newCtrl;
  31541. }
  31542. });
  31543. this.form._updateTreeValidity({ emitEvent: false });
  31544. };
  31545. /**
  31546. * @return {?}
  31547. */
  31548. FormGroupDirective.prototype._updateRegistrations = /**
  31549. * @return {?}
  31550. */
  31551. function () {
  31552. var _this = this;
  31553. this.form._registerOnCollectionChange(function () { return _this._updateDomValue(); });
  31554. if (this._oldForm)
  31555. this._oldForm._registerOnCollectionChange(function () { });
  31556. this._oldForm = this.form;
  31557. };
  31558. /**
  31559. * @return {?}
  31560. */
  31561. FormGroupDirective.prototype._updateValidators = /**
  31562. * @return {?}
  31563. */
  31564. function () {
  31565. var /** @type {?} */ sync = composeValidators(this._validators);
  31566. this.form.validator = Validators.compose([/** @type {?} */ ((this.form.validator)), /** @type {?} */ ((sync))]);
  31567. var /** @type {?} */ async = composeAsyncValidators(this._asyncValidators);
  31568. this.form.asyncValidator = Validators.composeAsync([/** @type {?} */ ((this.form.asyncValidator)), /** @type {?} */ ((async))]);
  31569. };
  31570. /**
  31571. * @return {?}
  31572. */
  31573. FormGroupDirective.prototype._checkFormPresent = /**
  31574. * @return {?}
  31575. */
  31576. function () {
  31577. if (!this.form) {
  31578. ReactiveErrors.missingFormException();
  31579. }
  31580. };
  31581. FormGroupDirective.decorators = [
  31582. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["s" /* Directive */], args: [{
  31583. selector: '[formGroup]',
  31584. providers: [formDirectiveProvider$1],
  31585. host: { '(submit)': 'onSubmit($event)', '(reset)': 'onReset()' },
  31586. exportAs: 'ngForm'
  31587. },] },
  31588. ];
  31589. /** @nocollapse */
  31590. FormGroupDirective.ctorParameters = function () { return [
  31591. { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["N" /* Optional */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["_1" /* Self */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["z" /* Inject */], args: [NG_VALIDATORS,] },] },
  31592. { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["N" /* Optional */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["_1" /* Self */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["z" /* Inject */], args: [NG_ASYNC_VALIDATORS,] },] },
  31593. ]; };
  31594. FormGroupDirective.propDecorators = {
  31595. "form": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["D" /* Input */], args: ['formGroup',] },],
  31596. "ngSubmit": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["O" /* Output */] },],
  31597. };
  31598. return FormGroupDirective;
  31599. }(ControlContainer));
  31600. /**
  31601. * @fileoverview added by tsickle
  31602. * @suppress {checkTypes} checked by tsc
  31603. */
  31604. /**
  31605. * @license
  31606. * Copyright Google Inc. All Rights Reserved.
  31607. *
  31608. * Use of this source code is governed by an MIT-style license that can be
  31609. * found in the LICENSE file at https://angular.io/license
  31610. */
  31611. var formGroupNameProvider = {
  31612. provide: ControlContainer,
  31613. useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_14" /* forwardRef */])(function () { return FormGroupName; })
  31614. };
  31615. /**
  31616. * \@whatItDoes Syncs a nested {\@link FormGroup} to a DOM element.
  31617. *
  31618. * \@howToUse
  31619. *
  31620. * This directive can only be used with a parent {\@link FormGroupDirective} (selector:
  31621. * `[formGroup]`).
  31622. *
  31623. * It accepts the string name of the nested {\@link FormGroup} you want to link, and
  31624. * will look for a {\@link FormGroup} registered with that name in the parent
  31625. * {\@link FormGroup} instance you passed into {\@link FormGroupDirective}.
  31626. *
  31627. * Nested form groups can come in handy when you want to validate a sub-group of a
  31628. * form separately from the rest or when you'd like to group the values of certain
  31629. * controls into their own nested object.
  31630. *
  31631. * **Access the group**: You can access the associated {\@link FormGroup} using the
  31632. * {\@link AbstractControl#get get} method. Ex: `this.form.get('name')`.
  31633. *
  31634. * You can also access individual controls within the group using dot syntax.
  31635. * Ex: `this.form.get('name.first')`
  31636. *
  31637. * **Get the value**: the `value` property is always synced and available on the
  31638. * {\@link FormGroup}. See a full list of available properties in {\@link AbstractControl}.
  31639. *
  31640. * **Set the value**: You can set an initial value for each child control when instantiating
  31641. * the {\@link FormGroup}, or you can set it programmatically later using
  31642. * {\@link AbstractControl#setValue setValue} or {\@link AbstractControl#patchValue patchValue}.
  31643. *
  31644. * **Listen to value**: If you want to listen to changes in the value of the group, you can
  31645. * subscribe to the {\@link AbstractControl#valueChanges valueChanges} event. You can also listen to
  31646. * {\@link AbstractControl#statusChanges statusChanges} to be notified when the validation status is
  31647. * re-calculated.
  31648. *
  31649. * ### Example
  31650. *
  31651. * {\@example forms/ts/nestedFormGroup/nested_form_group_example.ts region='Component'}
  31652. *
  31653. * * **npm package**: `\@angular/forms`
  31654. *
  31655. * * **NgModule**: `ReactiveFormsModule`
  31656. *
  31657. * \@stable
  31658. */
  31659. var FormGroupName = /** @class */ (function (_super) {
  31660. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(FormGroupName, _super);
  31661. function FormGroupName(parent, validators, asyncValidators) {
  31662. var _this = _super.call(this) || this;
  31663. _this._parent = parent;
  31664. _this._validators = validators;
  31665. _this._asyncValidators = asyncValidators;
  31666. return _this;
  31667. }
  31668. /** @internal */
  31669. /**
  31670. * \@internal
  31671. * @return {?}
  31672. */
  31673. FormGroupName.prototype._checkParentType = /**
  31674. * \@internal
  31675. * @return {?}
  31676. */
  31677. function () {
  31678. if (_hasInvalidParent(this._parent)) {
  31679. ReactiveErrors.groupParentException();
  31680. }
  31681. };
  31682. FormGroupName.decorators = [
  31683. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["s" /* Directive */], args: [{ selector: '[formGroupName]', providers: [formGroupNameProvider] },] },
  31684. ];
  31685. /** @nocollapse */
  31686. FormGroupName.ctorParameters = function () { return [
  31687. { type: ControlContainer, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["N" /* Optional */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["w" /* Host */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["_2" /* SkipSelf */] },] },
  31688. { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["N" /* Optional */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["_1" /* Self */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["z" /* Inject */], args: [NG_VALIDATORS,] },] },
  31689. { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["N" /* Optional */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["_1" /* Self */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["z" /* Inject */], args: [NG_ASYNC_VALIDATORS,] },] },
  31690. ]; };
  31691. FormGroupName.propDecorators = {
  31692. "name": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["D" /* Input */], args: ['formGroupName',] },],
  31693. };
  31694. return FormGroupName;
  31695. }(AbstractFormGroupDirective));
  31696. var formArrayNameProvider = {
  31697. provide: ControlContainer,
  31698. useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_14" /* forwardRef */])(function () { return FormArrayName; })
  31699. };
  31700. /**
  31701. * \@whatItDoes Syncs a nested {\@link FormArray} to a DOM element.
  31702. *
  31703. * \@howToUse
  31704. *
  31705. * This directive is designed to be used with a parent {\@link FormGroupDirective} (selector:
  31706. * `[formGroup]`).
  31707. *
  31708. * It accepts the string name of the nested {\@link FormArray} you want to link, and
  31709. * will look for a {\@link FormArray} registered with that name in the parent
  31710. * {\@link FormGroup} instance you passed into {\@link FormGroupDirective}.
  31711. *
  31712. * Nested form arrays can come in handy when you have a group of form controls but
  31713. * you're not sure how many there will be. Form arrays allow you to create new
  31714. * form controls dynamically.
  31715. *
  31716. * **Access the array**: You can access the associated {\@link FormArray} using the
  31717. * {\@link AbstractControl#get get} method on the parent {\@link FormGroup}.
  31718. * Ex: `this.form.get('cities')`.
  31719. *
  31720. * **Get the value**: the `value` property is always synced and available on the
  31721. * {\@link FormArray}. See a full list of available properties in {\@link AbstractControl}.
  31722. *
  31723. * **Set the value**: You can set an initial value for each child control when instantiating
  31724. * the {\@link FormArray}, or you can set the value programmatically later using the
  31725. * {\@link FormArray}'s {\@link AbstractControl#setValue setValue} or
  31726. * {\@link AbstractControl#patchValue patchValue} methods.
  31727. *
  31728. * **Listen to value**: If you want to listen to changes in the value of the array, you can
  31729. * subscribe to the {\@link FormArray}'s {\@link AbstractControl#valueChanges valueChanges} event.
  31730. * You can also listen to its {\@link AbstractControl#statusChanges statusChanges} event to be
  31731. * notified when the validation status is re-calculated.
  31732. *
  31733. * **Add new controls**: You can add new controls to the {\@link FormArray} dynamically by calling
  31734. * its {\@link FormArray#push push} method.
  31735. * Ex: `this.form.get('cities').push(new FormControl());`
  31736. *
  31737. * ### Example
  31738. *
  31739. * {\@example forms/ts/nestedFormArray/nested_form_array_example.ts region='Component'}
  31740. *
  31741. * * **npm package**: `\@angular/forms`
  31742. *
  31743. * * **NgModule**: `ReactiveFormsModule`
  31744. *
  31745. * \@stable
  31746. */
  31747. var FormArrayName = /** @class */ (function (_super) {
  31748. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(FormArrayName, _super);
  31749. function FormArrayName(parent, validators, asyncValidators) {
  31750. var _this = _super.call(this) || this;
  31751. _this._parent = parent;
  31752. _this._validators = validators;
  31753. _this._asyncValidators = asyncValidators;
  31754. return _this;
  31755. }
  31756. /**
  31757. * @return {?}
  31758. */
  31759. FormArrayName.prototype.ngOnInit = /**
  31760. * @return {?}
  31761. */
  31762. function () {
  31763. this._checkParentType(); /** @type {?} */
  31764. ((this.formDirective)).addFormArray(this);
  31765. };
  31766. /**
  31767. * @return {?}
  31768. */
  31769. FormArrayName.prototype.ngOnDestroy = /**
  31770. * @return {?}
  31771. */
  31772. function () {
  31773. if (this.formDirective) {
  31774. this.formDirective.removeFormArray(this);
  31775. }
  31776. };
  31777. Object.defineProperty(FormArrayName.prototype, "control", {
  31778. get: /**
  31779. * @return {?}
  31780. */
  31781. function () { return /** @type {?} */ ((this.formDirective)).getFormArray(this); },
  31782. enumerable: true,
  31783. configurable: true
  31784. });
  31785. Object.defineProperty(FormArrayName.prototype, "formDirective", {
  31786. get: /**
  31787. * @return {?}
  31788. */
  31789. function () {
  31790. return this._parent ? /** @type {?} */ (this._parent.formDirective) : null;
  31791. },
  31792. enumerable: true,
  31793. configurable: true
  31794. });
  31795. Object.defineProperty(FormArrayName.prototype, "path", {
  31796. get: /**
  31797. * @return {?}
  31798. */
  31799. function () { return controlPath(this.name, this._parent); },
  31800. enumerable: true,
  31801. configurable: true
  31802. });
  31803. Object.defineProperty(FormArrayName.prototype, "validator", {
  31804. get: /**
  31805. * @return {?}
  31806. */
  31807. function () { return composeValidators(this._validators); },
  31808. enumerable: true,
  31809. configurable: true
  31810. });
  31811. Object.defineProperty(FormArrayName.prototype, "asyncValidator", {
  31812. get: /**
  31813. * @return {?}
  31814. */
  31815. function () {
  31816. return composeAsyncValidators(this._asyncValidators);
  31817. },
  31818. enumerable: true,
  31819. configurable: true
  31820. });
  31821. /**
  31822. * @return {?}
  31823. */
  31824. FormArrayName.prototype._checkParentType = /**
  31825. * @return {?}
  31826. */
  31827. function () {
  31828. if (_hasInvalidParent(this._parent)) {
  31829. ReactiveErrors.arrayParentException();
  31830. }
  31831. };
  31832. FormArrayName.decorators = [
  31833. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["s" /* Directive */], args: [{ selector: '[formArrayName]', providers: [formArrayNameProvider] },] },
  31834. ];
  31835. /** @nocollapse */
  31836. FormArrayName.ctorParameters = function () { return [
  31837. { type: ControlContainer, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["N" /* Optional */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["w" /* Host */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["_2" /* SkipSelf */] },] },
  31838. { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["N" /* Optional */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["_1" /* Self */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["z" /* Inject */], args: [NG_VALIDATORS,] },] },
  31839. { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["N" /* Optional */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["_1" /* Self */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["z" /* Inject */], args: [NG_ASYNC_VALIDATORS,] },] },
  31840. ]; };
  31841. FormArrayName.propDecorators = {
  31842. "name": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["D" /* Input */], args: ['formArrayName',] },],
  31843. };
  31844. return FormArrayName;
  31845. }(ControlContainer));
  31846. /**
  31847. * @param {?} parent
  31848. * @return {?}
  31849. */
  31850. function _hasInvalidParent(parent) {
  31851. return !(parent instanceof FormGroupName) && !(parent instanceof FormGroupDirective) &&
  31852. !(parent instanceof FormArrayName);
  31853. }
  31854. /**
  31855. * @fileoverview added by tsickle
  31856. * @suppress {checkTypes} checked by tsc
  31857. */
  31858. /**
  31859. * @license
  31860. * Copyright Google Inc. All Rights Reserved.
  31861. *
  31862. * Use of this source code is governed by an MIT-style license that can be
  31863. * found in the LICENSE file at https://angular.io/license
  31864. */
  31865. var controlNameBinding = {
  31866. provide: NgControl,
  31867. useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_14" /* forwardRef */])(function () { return FormControlName; })
  31868. };
  31869. /**
  31870. * \@whatItDoes Syncs a {\@link FormControl} in an existing {\@link FormGroup} to a form control
  31871. * element by name.
  31872. *
  31873. * In other words, this directive ensures that any values written to the {\@link FormControl}
  31874. * instance programmatically will be written to the DOM element (model -> view). Conversely,
  31875. * any values written to the DOM element through user input will be reflected in the
  31876. * {\@link FormControl} instance (view -> model).
  31877. *
  31878. * \@howToUse
  31879. *
  31880. * This directive is designed to be used with a parent {\@link FormGroupDirective} (selector:
  31881. * `[formGroup]`).
  31882. *
  31883. * It accepts the string name of the {\@link FormControl} instance you want to
  31884. * link, and will look for a {\@link FormControl} registered with that name in the
  31885. * closest {\@link FormGroup} or {\@link FormArray} above it.
  31886. *
  31887. * **Access the control**: You can access the {\@link FormControl} associated with
  31888. * this directive by using the {\@link AbstractControl#get get} method.
  31889. * Ex: `this.form.get('first');`
  31890. *
  31891. * **Get value**: the `value` property is always synced and available on the {\@link FormControl}.
  31892. * See a full list of available properties in {\@link AbstractControl}.
  31893. *
  31894. * **Set value**: You can set an initial value for the control when instantiating the
  31895. * {\@link FormControl}, or you can set it programmatically later using
  31896. * {\@link AbstractControl#setValue setValue} or {\@link AbstractControl#patchValue patchValue}.
  31897. *
  31898. * **Listen to value**: If you want to listen to changes in the value of the control, you can
  31899. * subscribe to the {\@link AbstractControl#valueChanges valueChanges} event. You can also listen to
  31900. * {\@link AbstractControl#statusChanges statusChanges} to be notified when the validation status is
  31901. * re-calculated.
  31902. *
  31903. * ### Example
  31904. *
  31905. * In this example, we create form controls for first name and last name.
  31906. *
  31907. * {\@example forms/ts/simpleFormGroup/simple_form_group_example.ts region='Component'}
  31908. *
  31909. * To see `formControlName` examples with different form control types, see:
  31910. *
  31911. * * Radio buttons: {\@link RadioControlValueAccessor}
  31912. * * Selects: {\@link SelectControlValueAccessor}
  31913. *
  31914. * **npm package**: `\@angular/forms`
  31915. *
  31916. * **NgModule**: {\@link ReactiveFormsModule}
  31917. *
  31918. * \@stable
  31919. */
  31920. var FormControlName = /** @class */ (function (_super) {
  31921. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(FormControlName, _super);
  31922. function FormControlName(parent, validators, asyncValidators, valueAccessors) {
  31923. var _this = _super.call(this) || this;
  31924. _this._added = false;
  31925. _this.update = new __WEBPACK_IMPORTED_MODULE_1__angular_core__["v" /* EventEmitter */]();
  31926. _this._parent = parent;
  31927. _this._rawValidators = validators || [];
  31928. _this._rawAsyncValidators = asyncValidators || [];
  31929. _this.valueAccessor = selectValueAccessor(_this, valueAccessors);
  31930. return _this;
  31931. }
  31932. Object.defineProperty(FormControlName.prototype, "isDisabled", {
  31933. set: /**
  31934. * @param {?} isDisabled
  31935. * @return {?}
  31936. */
  31937. function (isDisabled) { ReactiveErrors.disabledAttrWarning(); },
  31938. enumerable: true,
  31939. configurable: true
  31940. });
  31941. /**
  31942. * @param {?} changes
  31943. * @return {?}
  31944. */
  31945. FormControlName.prototype.ngOnChanges = /**
  31946. * @param {?} changes
  31947. * @return {?}
  31948. */
  31949. function (changes) {
  31950. if (!this._added)
  31951. this._setUpControl();
  31952. if (isPropertyUpdated(changes, this.viewModel)) {
  31953. this.viewModel = this.model;
  31954. this.formDirective.updateModel(this, this.model);
  31955. }
  31956. };
  31957. /**
  31958. * @return {?}
  31959. */
  31960. FormControlName.prototype.ngOnDestroy = /**
  31961. * @return {?}
  31962. */
  31963. function () {
  31964. if (this.formDirective) {
  31965. this.formDirective.removeControl(this);
  31966. }
  31967. };
  31968. /**
  31969. * @param {?} newValue
  31970. * @return {?}
  31971. */
  31972. FormControlName.prototype.viewToModelUpdate = /**
  31973. * @param {?} newValue
  31974. * @return {?}
  31975. */
  31976. function (newValue) {
  31977. this.viewModel = newValue;
  31978. this.update.emit(newValue);
  31979. };
  31980. Object.defineProperty(FormControlName.prototype, "path", {
  31981. get: /**
  31982. * @return {?}
  31983. */
  31984. function () { return controlPath(this.name, /** @type {?} */ ((this._parent))); },
  31985. enumerable: true,
  31986. configurable: true
  31987. });
  31988. Object.defineProperty(FormControlName.prototype, "formDirective", {
  31989. get: /**
  31990. * @return {?}
  31991. */
  31992. function () { return this._parent ? this._parent.formDirective : null; },
  31993. enumerable: true,
  31994. configurable: true
  31995. });
  31996. Object.defineProperty(FormControlName.prototype, "validator", {
  31997. get: /**
  31998. * @return {?}
  31999. */
  32000. function () { return composeValidators(this._rawValidators); },
  32001. enumerable: true,
  32002. configurable: true
  32003. });
  32004. Object.defineProperty(FormControlName.prototype, "asyncValidator", {
  32005. get: /**
  32006. * @return {?}
  32007. */
  32008. function () {
  32009. return /** @type {?} */ ((composeAsyncValidators(this._rawAsyncValidators)));
  32010. },
  32011. enumerable: true,
  32012. configurable: true
  32013. });
  32014. /**
  32015. * @return {?}
  32016. */
  32017. FormControlName.prototype._checkParentType = /**
  32018. * @return {?}
  32019. */
  32020. function () {
  32021. if (!(this._parent instanceof FormGroupName) &&
  32022. this._parent instanceof AbstractFormGroupDirective) {
  32023. ReactiveErrors.ngModelGroupException();
  32024. }
  32025. else if (!(this._parent instanceof FormGroupName) && !(this._parent instanceof FormGroupDirective) &&
  32026. !(this._parent instanceof FormArrayName)) {
  32027. ReactiveErrors.controlParentException();
  32028. }
  32029. };
  32030. /**
  32031. * @return {?}
  32032. */
  32033. FormControlName.prototype._setUpControl = /**
  32034. * @return {?}
  32035. */
  32036. function () {
  32037. this._checkParentType();
  32038. (/** @type {?} */ (this)).control = this.formDirective.addControl(this);
  32039. if (this.control.disabled && /** @type {?} */ ((this.valueAccessor)).setDisabledState) {
  32040. /** @type {?} */ ((/** @type {?} */ ((this.valueAccessor)).setDisabledState))(true);
  32041. }
  32042. this._added = true;
  32043. };
  32044. FormControlName.decorators = [
  32045. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["s" /* Directive */], args: [{ selector: '[formControlName]', providers: [controlNameBinding] },] },
  32046. ];
  32047. /** @nocollapse */
  32048. FormControlName.ctorParameters = function () { return [
  32049. { type: ControlContainer, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["N" /* Optional */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["w" /* Host */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["_2" /* SkipSelf */] },] },
  32050. { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["N" /* Optional */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["_1" /* Self */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["z" /* Inject */], args: [NG_VALIDATORS,] },] },
  32051. { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["N" /* Optional */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["_1" /* Self */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["z" /* Inject */], args: [NG_ASYNC_VALIDATORS,] },] },
  32052. { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["N" /* Optional */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["_1" /* Self */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["z" /* Inject */], args: [NG_VALUE_ACCESSOR,] },] },
  32053. ]; };
  32054. FormControlName.propDecorators = {
  32055. "name": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["D" /* Input */], args: ['formControlName',] },],
  32056. "model": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["D" /* Input */], args: ['ngModel',] },],
  32057. "update": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["O" /* Output */], args: ['ngModelChange',] },],
  32058. "isDisabled": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["D" /* Input */], args: ['disabled',] },],
  32059. };
  32060. return FormControlName;
  32061. }(NgControl));
  32062. /**
  32063. * @fileoverview added by tsickle
  32064. * @suppress {checkTypes} checked by tsc
  32065. */
  32066. /**
  32067. * @license
  32068. * Copyright Google Inc. All Rights Reserved.
  32069. *
  32070. * Use of this source code is governed by an MIT-style license that can be
  32071. * found in the LICENSE file at https://angular.io/license
  32072. */
  32073. /**
  32074. * An interface that can be implemented by classes that can act as validators.
  32075. *
  32076. * ## Usage
  32077. *
  32078. * ```typescript
  32079. * \@Directive({
  32080. * selector: '[custom-validator]',
  32081. * providers: [{provide: NG_VALIDATORS, useExisting: CustomValidatorDirective, multi: true}]
  32082. * })
  32083. * class CustomValidatorDirective implements Validator {
  32084. * validate(c: Control): {[key: string]: any} {
  32085. * return {"custom": true};
  32086. * }
  32087. * }
  32088. * ```
  32089. *
  32090. * \@stable
  32091. * @record
  32092. */
  32093. /**
  32094. * \@experimental
  32095. * @record
  32096. */
  32097. var REQUIRED_VALIDATOR = {
  32098. provide: NG_VALIDATORS,
  32099. useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_14" /* forwardRef */])(function () { return RequiredValidator; }),
  32100. multi: true
  32101. };
  32102. var CHECKBOX_REQUIRED_VALIDATOR = {
  32103. provide: NG_VALIDATORS,
  32104. useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_14" /* forwardRef */])(function () { return CheckboxRequiredValidator; }),
  32105. multi: true
  32106. };
  32107. /**
  32108. * A Directive that adds the `required` validator to any controls marked with the
  32109. * `required` attribute, via the {\@link NG_VALIDATORS} binding.
  32110. *
  32111. * ### Example
  32112. *
  32113. * ```
  32114. * <input name="fullName" ngModel required>
  32115. * ```
  32116. *
  32117. * \@stable
  32118. */
  32119. var RequiredValidator = /** @class */ (function () {
  32120. function RequiredValidator() {
  32121. }
  32122. Object.defineProperty(RequiredValidator.prototype, "required", {
  32123. get: /**
  32124. * @return {?}
  32125. */
  32126. function () { return this._required; },
  32127. set: /**
  32128. * @param {?} value
  32129. * @return {?}
  32130. */
  32131. function (value) {
  32132. this._required = value != null && value !== false && "" + value !== 'false';
  32133. if (this._onChange)
  32134. this._onChange();
  32135. },
  32136. enumerable: true,
  32137. configurable: true
  32138. });
  32139. /**
  32140. * @param {?} c
  32141. * @return {?}
  32142. */
  32143. RequiredValidator.prototype.validate = /**
  32144. * @param {?} c
  32145. * @return {?}
  32146. */
  32147. function (c) {
  32148. return this.required ? Validators.required(c) : null;
  32149. };
  32150. /**
  32151. * @param {?} fn
  32152. * @return {?}
  32153. */
  32154. RequiredValidator.prototype.registerOnValidatorChange = /**
  32155. * @param {?} fn
  32156. * @return {?}
  32157. */
  32158. function (fn) { this._onChange = fn; };
  32159. RequiredValidator.decorators = [
  32160. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["s" /* Directive */], args: [{
  32161. selector: ':not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]',
  32162. providers: [REQUIRED_VALIDATOR],
  32163. host: { '[attr.required]': 'required ? "" : null' }
  32164. },] },
  32165. ];
  32166. /** @nocollapse */
  32167. RequiredValidator.ctorParameters = function () { return []; };
  32168. RequiredValidator.propDecorators = {
  32169. "required": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["D" /* Input */] },],
  32170. };
  32171. return RequiredValidator;
  32172. }());
  32173. /**
  32174. * A Directive that adds the `required` validator to checkbox controls marked with the
  32175. * `required` attribute, via the {\@link NG_VALIDATORS} binding.
  32176. *
  32177. * ### Example
  32178. *
  32179. * ```
  32180. * <input type="checkbox" name="active" ngModel required>
  32181. * ```
  32182. *
  32183. * \@experimental
  32184. */
  32185. var CheckboxRequiredValidator = /** @class */ (function (_super) {
  32186. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(CheckboxRequiredValidator, _super);
  32187. function CheckboxRequiredValidator() {
  32188. return _super !== null && _super.apply(this, arguments) || this;
  32189. }
  32190. /**
  32191. * @param {?} c
  32192. * @return {?}
  32193. */
  32194. CheckboxRequiredValidator.prototype.validate = /**
  32195. * @param {?} c
  32196. * @return {?}
  32197. */
  32198. function (c) {
  32199. return this.required ? Validators.requiredTrue(c) : null;
  32200. };
  32201. CheckboxRequiredValidator.decorators = [
  32202. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["s" /* Directive */], args: [{
  32203. selector: 'input[type=checkbox][required][formControlName],input[type=checkbox][required][formControl],input[type=checkbox][required][ngModel]',
  32204. providers: [CHECKBOX_REQUIRED_VALIDATOR],
  32205. host: { '[attr.required]': 'required ? "" : null' }
  32206. },] },
  32207. ];
  32208. /** @nocollapse */
  32209. CheckboxRequiredValidator.ctorParameters = function () { return []; };
  32210. return CheckboxRequiredValidator;
  32211. }(RequiredValidator));
  32212. /**
  32213. * Provider which adds {\@link EmailValidator} to {\@link NG_VALIDATORS}.
  32214. */
  32215. var EMAIL_VALIDATOR = {
  32216. provide: NG_VALIDATORS,
  32217. useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_14" /* forwardRef */])(function () { return EmailValidator; }),
  32218. multi: true
  32219. };
  32220. /**
  32221. * A Directive that adds the `email` validator to controls marked with the
  32222. * `email` attribute, via the {\@link NG_VALIDATORS} binding.
  32223. *
  32224. * ### Example
  32225. *
  32226. * ```
  32227. * <input type="email" name="email" ngModel email>
  32228. * <input type="email" name="email" ngModel email="true">
  32229. * <input type="email" name="email" ngModel [email]="true">
  32230. * ```
  32231. *
  32232. * \@experimental
  32233. */
  32234. var EmailValidator = /** @class */ (function () {
  32235. function EmailValidator() {
  32236. }
  32237. Object.defineProperty(EmailValidator.prototype, "email", {
  32238. set: /**
  32239. * @param {?} value
  32240. * @return {?}
  32241. */
  32242. function (value) {
  32243. this._enabled = value === '' || value === true || value === 'true';
  32244. if (this._onChange)
  32245. this._onChange();
  32246. },
  32247. enumerable: true,
  32248. configurable: true
  32249. });
  32250. /**
  32251. * @param {?} c
  32252. * @return {?}
  32253. */
  32254. EmailValidator.prototype.validate = /**
  32255. * @param {?} c
  32256. * @return {?}
  32257. */
  32258. function (c) {
  32259. return this._enabled ? Validators.email(c) : null;
  32260. };
  32261. /**
  32262. * @param {?} fn
  32263. * @return {?}
  32264. */
  32265. EmailValidator.prototype.registerOnValidatorChange = /**
  32266. * @param {?} fn
  32267. * @return {?}
  32268. */
  32269. function (fn) { this._onChange = fn; };
  32270. EmailValidator.decorators = [
  32271. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["s" /* Directive */], args: [{
  32272. selector: '[email][formControlName],[email][formControl],[email][ngModel]',
  32273. providers: [EMAIL_VALIDATOR]
  32274. },] },
  32275. ];
  32276. /** @nocollapse */
  32277. EmailValidator.ctorParameters = function () { return []; };
  32278. EmailValidator.propDecorators = {
  32279. "email": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["D" /* Input */] },],
  32280. };
  32281. return EmailValidator;
  32282. }());
  32283. /**
  32284. * \@stable
  32285. * @record
  32286. */
  32287. /**
  32288. * \@stable
  32289. * @record
  32290. */
  32291. /**
  32292. * Provider which adds {\@link MinLengthValidator} to {\@link NG_VALIDATORS}.
  32293. *
  32294. * ## Example:
  32295. *
  32296. * {\@example common/forms/ts/validators/validators.ts region='min'}
  32297. */
  32298. var MIN_LENGTH_VALIDATOR = {
  32299. provide: NG_VALIDATORS,
  32300. useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_14" /* forwardRef */])(function () { return MinLengthValidator; }),
  32301. multi: true
  32302. };
  32303. /**
  32304. * A directive which installs the {\@link MinLengthValidator} for any `formControlName`,
  32305. * `formControl`, or control with `ngModel` that also has a `minlength` attribute.
  32306. *
  32307. * \@stable
  32308. */
  32309. var MinLengthValidator = /** @class */ (function () {
  32310. function MinLengthValidator() {
  32311. }
  32312. /**
  32313. * @param {?} changes
  32314. * @return {?}
  32315. */
  32316. MinLengthValidator.prototype.ngOnChanges = /**
  32317. * @param {?} changes
  32318. * @return {?}
  32319. */
  32320. function (changes) {
  32321. if ('minlength' in changes) {
  32322. this._createValidator();
  32323. if (this._onChange)
  32324. this._onChange();
  32325. }
  32326. };
  32327. /**
  32328. * @param {?} c
  32329. * @return {?}
  32330. */
  32331. MinLengthValidator.prototype.validate = /**
  32332. * @param {?} c
  32333. * @return {?}
  32334. */
  32335. function (c) {
  32336. return this.minlength == null ? null : this._validator(c);
  32337. };
  32338. /**
  32339. * @param {?} fn
  32340. * @return {?}
  32341. */
  32342. MinLengthValidator.prototype.registerOnValidatorChange = /**
  32343. * @param {?} fn
  32344. * @return {?}
  32345. */
  32346. function (fn) { this._onChange = fn; };
  32347. /**
  32348. * @return {?}
  32349. */
  32350. MinLengthValidator.prototype._createValidator = /**
  32351. * @return {?}
  32352. */
  32353. function () {
  32354. this._validator = Validators.minLength(parseInt(this.minlength, 10));
  32355. };
  32356. MinLengthValidator.decorators = [
  32357. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["s" /* Directive */], args: [{
  32358. selector: '[minlength][formControlName],[minlength][formControl],[minlength][ngModel]',
  32359. providers: [MIN_LENGTH_VALIDATOR],
  32360. host: { '[attr.minlength]': 'minlength ? minlength : null' }
  32361. },] },
  32362. ];
  32363. /** @nocollapse */
  32364. MinLengthValidator.ctorParameters = function () { return []; };
  32365. MinLengthValidator.propDecorators = {
  32366. "minlength": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["D" /* Input */] },],
  32367. };
  32368. return MinLengthValidator;
  32369. }());
  32370. /**
  32371. * Provider which adds {\@link MaxLengthValidator} to {\@link NG_VALIDATORS}.
  32372. *
  32373. * ## Example:
  32374. *
  32375. * {\@example common/forms/ts/validators/validators.ts region='max'}
  32376. */
  32377. var MAX_LENGTH_VALIDATOR = {
  32378. provide: NG_VALIDATORS,
  32379. useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_14" /* forwardRef */])(function () { return MaxLengthValidator; }),
  32380. multi: true
  32381. };
  32382. /**
  32383. * A directive which installs the {\@link MaxLengthValidator} for any `formControlName,
  32384. * `formControl`,
  32385. * or control with `ngModel` that also has a `maxlength` attribute.
  32386. *
  32387. * \@stable
  32388. */
  32389. var MaxLengthValidator = /** @class */ (function () {
  32390. function MaxLengthValidator() {
  32391. }
  32392. /**
  32393. * @param {?} changes
  32394. * @return {?}
  32395. */
  32396. MaxLengthValidator.prototype.ngOnChanges = /**
  32397. * @param {?} changes
  32398. * @return {?}
  32399. */
  32400. function (changes) {
  32401. if ('maxlength' in changes) {
  32402. this._createValidator();
  32403. if (this._onChange)
  32404. this._onChange();
  32405. }
  32406. };
  32407. /**
  32408. * @param {?} c
  32409. * @return {?}
  32410. */
  32411. MaxLengthValidator.prototype.validate = /**
  32412. * @param {?} c
  32413. * @return {?}
  32414. */
  32415. function (c) {
  32416. return this.maxlength != null ? this._validator(c) : null;
  32417. };
  32418. /**
  32419. * @param {?} fn
  32420. * @return {?}
  32421. */
  32422. MaxLengthValidator.prototype.registerOnValidatorChange = /**
  32423. * @param {?} fn
  32424. * @return {?}
  32425. */
  32426. function (fn) { this._onChange = fn; };
  32427. /**
  32428. * @return {?}
  32429. */
  32430. MaxLengthValidator.prototype._createValidator = /**
  32431. * @return {?}
  32432. */
  32433. function () {
  32434. this._validator = Validators.maxLength(parseInt(this.maxlength, 10));
  32435. };
  32436. MaxLengthValidator.decorators = [
  32437. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["s" /* Directive */], args: [{
  32438. selector: '[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]',
  32439. providers: [MAX_LENGTH_VALIDATOR],
  32440. host: { '[attr.maxlength]': 'maxlength ? maxlength : null' }
  32441. },] },
  32442. ];
  32443. /** @nocollapse */
  32444. MaxLengthValidator.ctorParameters = function () { return []; };
  32445. MaxLengthValidator.propDecorators = {
  32446. "maxlength": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["D" /* Input */] },],
  32447. };
  32448. return MaxLengthValidator;
  32449. }());
  32450. var PATTERN_VALIDATOR = {
  32451. provide: NG_VALIDATORS,
  32452. useExisting: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_14" /* forwardRef */])(function () { return PatternValidator; }),
  32453. multi: true
  32454. };
  32455. /**
  32456. * A Directive that adds the `pattern` validator to any controls marked with the
  32457. * `pattern` attribute, via the {\@link NG_VALIDATORS} binding. Uses attribute value
  32458. * as the regex to validate Control value against. Follows pattern attribute
  32459. * semantics; i.e. regex must match entire Control value.
  32460. *
  32461. * ### Example
  32462. *
  32463. * ```
  32464. * <input [name]="fullName" pattern="[a-zA-Z ]*" ngModel>
  32465. * ```
  32466. * \@stable
  32467. */
  32468. var PatternValidator = /** @class */ (function () {
  32469. function PatternValidator() {
  32470. }
  32471. /**
  32472. * @param {?} changes
  32473. * @return {?}
  32474. */
  32475. PatternValidator.prototype.ngOnChanges = /**
  32476. * @param {?} changes
  32477. * @return {?}
  32478. */
  32479. function (changes) {
  32480. if ('pattern' in changes) {
  32481. this._createValidator();
  32482. if (this._onChange)
  32483. this._onChange();
  32484. }
  32485. };
  32486. /**
  32487. * @param {?} c
  32488. * @return {?}
  32489. */
  32490. PatternValidator.prototype.validate = /**
  32491. * @param {?} c
  32492. * @return {?}
  32493. */
  32494. function (c) { return this._validator(c); };
  32495. /**
  32496. * @param {?} fn
  32497. * @return {?}
  32498. */
  32499. PatternValidator.prototype.registerOnValidatorChange = /**
  32500. * @param {?} fn
  32501. * @return {?}
  32502. */
  32503. function (fn) { this._onChange = fn; };
  32504. /**
  32505. * @return {?}
  32506. */
  32507. PatternValidator.prototype._createValidator = /**
  32508. * @return {?}
  32509. */
  32510. function () { this._validator = Validators.pattern(this.pattern); };
  32511. PatternValidator.decorators = [
  32512. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["s" /* Directive */], args: [{
  32513. selector: '[pattern][formControlName],[pattern][formControl],[pattern][ngModel]',
  32514. providers: [PATTERN_VALIDATOR],
  32515. host: { '[attr.pattern]': 'pattern ? pattern : null' }
  32516. },] },
  32517. ];
  32518. /** @nocollapse */
  32519. PatternValidator.ctorParameters = function () { return []; };
  32520. PatternValidator.propDecorators = {
  32521. "pattern": [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["D" /* Input */] },],
  32522. };
  32523. return PatternValidator;
  32524. }());
  32525. /**
  32526. * @fileoverview added by tsickle
  32527. * @suppress {checkTypes} checked by tsc
  32528. */
  32529. /**
  32530. * @license
  32531. * Copyright Google Inc. All Rights Reserved.
  32532. *
  32533. * Use of this source code is governed by an MIT-style license that can be
  32534. * found in the LICENSE file at https://angular.io/license
  32535. */
  32536. /**
  32537. * \@whatItDoes Creates an {\@link AbstractControl} from a user-specified configuration.
  32538. *
  32539. * It is essentially syntactic sugar that shortens the `new FormGroup()`,
  32540. * `new FormControl()`, and `new FormArray()` boilerplate that can build up in larger
  32541. * forms.
  32542. *
  32543. * \@howToUse
  32544. *
  32545. * To use, inject `FormBuilder` into your component class. You can then call its methods
  32546. * directly.
  32547. *
  32548. * {\@example forms/ts/formBuilder/form_builder_example.ts region='Component'}
  32549. *
  32550. * * **npm package**: `\@angular/forms`
  32551. *
  32552. * * **NgModule**: {\@link ReactiveFormsModule}
  32553. *
  32554. * \@stable
  32555. */
  32556. var FormBuilder = /** @class */ (function () {
  32557. function FormBuilder() {
  32558. }
  32559. /**
  32560. * Construct a new {@link FormGroup} with the given map of configuration.
  32561. * Valid keys for the `extra` parameter map are `validator` and `asyncValidator`.
  32562. *
  32563. * See the {@link FormGroup} constructor for more details.
  32564. */
  32565. /**
  32566. * Construct a new {\@link FormGroup} with the given map of configuration.
  32567. * Valid keys for the `extra` parameter map are `validator` and `asyncValidator`.
  32568. *
  32569. * See the {\@link FormGroup} constructor for more details.
  32570. * @param {?} controlsConfig
  32571. * @param {?=} extra
  32572. * @return {?}
  32573. */
  32574. FormBuilder.prototype.group = /**
  32575. * Construct a new {\@link FormGroup} with the given map of configuration.
  32576. * Valid keys for the `extra` parameter map are `validator` and `asyncValidator`.
  32577. *
  32578. * See the {\@link FormGroup} constructor for more details.
  32579. * @param {?} controlsConfig
  32580. * @param {?=} extra
  32581. * @return {?}
  32582. */
  32583. function (controlsConfig, extra) {
  32584. if (extra === void 0) { extra = null; }
  32585. var /** @type {?} */ controls = this._reduceControls(controlsConfig);
  32586. var /** @type {?} */ validator = extra != null ? extra['validator'] : null;
  32587. var /** @type {?} */ asyncValidator = extra != null ? extra['asyncValidator'] : null;
  32588. return new FormGroup(controls, validator, asyncValidator);
  32589. };
  32590. /**
  32591. * Construct a new {@link FormControl} with the given `formState`,`validator`, and
  32592. * `asyncValidator`.
  32593. *
  32594. * `formState` can either be a standalone value for the form control or an object
  32595. * that contains both a value and a disabled status.
  32596. *
  32597. */
  32598. /**
  32599. * Construct a new {\@link FormControl} with the given `formState`,`validator`, and
  32600. * `asyncValidator`.
  32601. *
  32602. * `formState` can either be a standalone value for the form control or an object
  32603. * that contains both a value and a disabled status.
  32604. *
  32605. * @param {?} formState
  32606. * @param {?=} validator
  32607. * @param {?=} asyncValidator
  32608. * @return {?}
  32609. */
  32610. FormBuilder.prototype.control = /**
  32611. * Construct a new {\@link FormControl} with the given `formState`,`validator`, and
  32612. * `asyncValidator`.
  32613. *
  32614. * `formState` can either be a standalone value for the form control or an object
  32615. * that contains both a value and a disabled status.
  32616. *
  32617. * @param {?} formState
  32618. * @param {?=} validator
  32619. * @param {?=} asyncValidator
  32620. * @return {?}
  32621. */
  32622. function (formState, validator, asyncValidator) {
  32623. return new FormControl(formState, validator, asyncValidator);
  32624. };
  32625. /**
  32626. * Construct a {@link FormArray} from the given `controlsConfig` array of
  32627. * configuration, with the given optional `validator` and `asyncValidator`.
  32628. */
  32629. /**
  32630. * Construct a {\@link FormArray} from the given `controlsConfig` array of
  32631. * configuration, with the given optional `validator` and `asyncValidator`.
  32632. * @param {?} controlsConfig
  32633. * @param {?=} validator
  32634. * @param {?=} asyncValidator
  32635. * @return {?}
  32636. */
  32637. FormBuilder.prototype.array = /**
  32638. * Construct a {\@link FormArray} from the given `controlsConfig` array of
  32639. * configuration, with the given optional `validator` and `asyncValidator`.
  32640. * @param {?} controlsConfig
  32641. * @param {?=} validator
  32642. * @param {?=} asyncValidator
  32643. * @return {?}
  32644. */
  32645. function (controlsConfig, validator, asyncValidator) {
  32646. var _this = this;
  32647. var /** @type {?} */ controls = controlsConfig.map(function (c) { return _this._createControl(c); });
  32648. return new FormArray(controls, validator, asyncValidator);
  32649. };
  32650. /** @internal */
  32651. /**
  32652. * \@internal
  32653. * @param {?} controlsConfig
  32654. * @return {?}
  32655. */
  32656. FormBuilder.prototype._reduceControls = /**
  32657. * \@internal
  32658. * @param {?} controlsConfig
  32659. * @return {?}
  32660. */
  32661. function (controlsConfig) {
  32662. var _this = this;
  32663. var /** @type {?} */ controls = {};
  32664. Object.keys(controlsConfig).forEach(function (controlName) {
  32665. controls[controlName] = _this._createControl(controlsConfig[controlName]);
  32666. });
  32667. return controls;
  32668. };
  32669. /** @internal */
  32670. /**
  32671. * \@internal
  32672. * @param {?} controlConfig
  32673. * @return {?}
  32674. */
  32675. FormBuilder.prototype._createControl = /**
  32676. * \@internal
  32677. * @param {?} controlConfig
  32678. * @return {?}
  32679. */
  32680. function (controlConfig) {
  32681. if (controlConfig instanceof FormControl || controlConfig instanceof FormGroup ||
  32682. controlConfig instanceof FormArray) {
  32683. return controlConfig;
  32684. }
  32685. else if (Array.isArray(controlConfig)) {
  32686. var /** @type {?} */ value = controlConfig[0];
  32687. var /** @type {?} */ validator = controlConfig.length > 1 ? controlConfig[1] : null;
  32688. var /** @type {?} */ asyncValidator = controlConfig.length > 2 ? controlConfig[2] : null;
  32689. return this.control(value, validator, asyncValidator);
  32690. }
  32691. else {
  32692. return this.control(controlConfig);
  32693. }
  32694. };
  32695. FormBuilder.decorators = [
  32696. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["A" /* Injectable */] },
  32697. ];
  32698. /** @nocollapse */
  32699. FormBuilder.ctorParameters = function () { return []; };
  32700. return FormBuilder;
  32701. }());
  32702. /**
  32703. * @fileoverview added by tsickle
  32704. * @suppress {checkTypes} checked by tsc
  32705. */
  32706. /**
  32707. * @license
  32708. * Copyright Google Inc. All Rights Reserved.
  32709. *
  32710. * Use of this source code is governed by an MIT-style license that can be
  32711. * found in the LICENSE file at https://angular.io/license
  32712. */
  32713. /**
  32714. * \@stable
  32715. */
  32716. var VERSION = new __WEBPACK_IMPORTED_MODULE_1__angular_core__["_7" /* Version */]('5.2.11');
  32717. /**
  32718. * @fileoverview added by tsickle
  32719. * @suppress {checkTypes} checked by tsc
  32720. */
  32721. /**
  32722. * @license
  32723. * Copyright Google Inc. All Rights Reserved.
  32724. *
  32725. * Use of this source code is governed by an MIT-style license that can be
  32726. * found in the LICENSE file at https://angular.io/license
  32727. */
  32728. /**
  32729. * \@whatItDoes Adds `novalidate` attribute to all forms by default.
  32730. *
  32731. * `novalidate` is used to disable browser's native form validation.
  32732. *
  32733. * If you want to use native validation with Angular forms, just add `ngNativeValidate` attribute:
  32734. *
  32735. * ```
  32736. * <form ngNativeValidate></form>
  32737. * ```
  32738. *
  32739. * \@experimental
  32740. */
  32741. var NgNoValidate = /** @class */ (function () {
  32742. function NgNoValidate() {
  32743. }
  32744. NgNoValidate.decorators = [
  32745. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["s" /* Directive */], args: [{
  32746. selector: 'form:not([ngNoForm]):not([ngNativeValidate])',
  32747. host: { 'novalidate': '' },
  32748. },] },
  32749. ];
  32750. /** @nocollapse */
  32751. NgNoValidate.ctorParameters = function () { return []; };
  32752. return NgNoValidate;
  32753. }());
  32754. /**
  32755. * @fileoverview added by tsickle
  32756. * @suppress {checkTypes} checked by tsc
  32757. */
  32758. /**
  32759. * @license
  32760. * Copyright Google Inc. All Rights Reserved.
  32761. *
  32762. * Use of this source code is governed by an MIT-style license that can be
  32763. * found in the LICENSE file at https://angular.io/license
  32764. */
  32765. var SHARED_FORM_DIRECTIVES = [
  32766. NgNoValidate,
  32767. NgSelectOption,
  32768. NgSelectMultipleOption,
  32769. DefaultValueAccessor,
  32770. NumberValueAccessor,
  32771. RangeValueAccessor,
  32772. CheckboxControlValueAccessor,
  32773. SelectControlValueAccessor,
  32774. SelectMultipleControlValueAccessor,
  32775. RadioControlValueAccessor,
  32776. NgControlStatus,
  32777. NgControlStatusGroup,
  32778. RequiredValidator,
  32779. MinLengthValidator,
  32780. MaxLengthValidator,
  32781. PatternValidator,
  32782. CheckboxRequiredValidator,
  32783. EmailValidator,
  32784. ];
  32785. var TEMPLATE_DRIVEN_DIRECTIVES = [NgModel, NgModelGroup, NgForm];
  32786. var REACTIVE_DRIVEN_DIRECTIVES = [FormControlDirective, FormGroupDirective, FormControlName, FormGroupName, FormArrayName];
  32787. /**
  32788. * Internal module used for sharing directives between FormsModule and ReactiveFormsModule
  32789. */
  32790. var InternalFormsSharedModule = /** @class */ (function () {
  32791. function InternalFormsSharedModule() {
  32792. }
  32793. InternalFormsSharedModule.decorators = [
  32794. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["I" /* NgModule */], args: [{
  32795. declarations: SHARED_FORM_DIRECTIVES,
  32796. exports: SHARED_FORM_DIRECTIVES,
  32797. },] },
  32798. ];
  32799. /** @nocollapse */
  32800. InternalFormsSharedModule.ctorParameters = function () { return []; };
  32801. return InternalFormsSharedModule;
  32802. }());
  32803. /**
  32804. * @fileoverview added by tsickle
  32805. * @suppress {checkTypes} checked by tsc
  32806. */
  32807. /**
  32808. * @license
  32809. * Copyright Google Inc. All Rights Reserved.
  32810. *
  32811. * Use of this source code is governed by an MIT-style license that can be
  32812. * found in the LICENSE file at https://angular.io/license
  32813. */
  32814. /**
  32815. * The ng module for forms.
  32816. * \@stable
  32817. */
  32818. var FormsModule = /** @class */ (function () {
  32819. function FormsModule() {
  32820. }
  32821. FormsModule.decorators = [
  32822. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["I" /* NgModule */], args: [{
  32823. declarations: TEMPLATE_DRIVEN_DIRECTIVES,
  32824. providers: [RadioControlRegistry],
  32825. exports: [InternalFormsSharedModule, TEMPLATE_DRIVEN_DIRECTIVES]
  32826. },] },
  32827. ];
  32828. /** @nocollapse */
  32829. FormsModule.ctorParameters = function () { return []; };
  32830. return FormsModule;
  32831. }());
  32832. /**
  32833. * The ng module for reactive forms.
  32834. * \@stable
  32835. */
  32836. var ReactiveFormsModule = /** @class */ (function () {
  32837. function ReactiveFormsModule() {
  32838. }
  32839. ReactiveFormsModule.decorators = [
  32840. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["I" /* NgModule */], args: [{
  32841. declarations: [REACTIVE_DRIVEN_DIRECTIVES],
  32842. providers: [FormBuilder, RadioControlRegistry],
  32843. exports: [InternalFormsSharedModule, REACTIVE_DRIVEN_DIRECTIVES]
  32844. },] },
  32845. ];
  32846. /** @nocollapse */
  32847. ReactiveFormsModule.ctorParameters = function () { return []; };
  32848. return ReactiveFormsModule;
  32849. }());
  32850. /**
  32851. * @fileoverview added by tsickle
  32852. * @suppress {checkTypes} checked by tsc
  32853. */
  32854. /**
  32855. * @license
  32856. * Copyright Google Inc. All Rights Reserved.
  32857. *
  32858. * Use of this source code is governed by an MIT-style license that can be
  32859. * found in the LICENSE file at https://angular.io/license
  32860. */
  32861. /**
  32862. * @fileoverview added by tsickle
  32863. * @suppress {checkTypes} checked by tsc
  32864. */
  32865. /**
  32866. * @license
  32867. * Copyright Google Inc. All Rights Reserved.
  32868. *
  32869. * Use of this source code is governed by an MIT-style license that can be
  32870. * found in the LICENSE file at https://angular.io/license
  32871. */
  32872. /**
  32873. * @module
  32874. * @description
  32875. * Entry point for all public APIs of this package.
  32876. */
  32877. // This file only reexports content of the `src` folder. Keep it that way.
  32878. /**
  32879. * @fileoverview added by tsickle
  32880. * @suppress {checkTypes} checked by tsc
  32881. */
  32882. /**
  32883. * Generated bundle index. Do not edit.
  32884. */
  32885. //# sourceMappingURL=forms.js.map
  32886. /***/ }),
  32887. /* 16 */
  32888. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  32889. "use strict";
  32890. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Form; });
  32891. /* unused harmony export IonicTapInput */
  32892. /* unused harmony export IonicFormInput */
  32893. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  32894. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util__ = __webpack_require__(2);
  32895. /**
  32896. * @hidden
  32897. */
  32898. var Form = (function () {
  32899. function Form() {
  32900. this._focused = null;
  32901. this._ids = -1;
  32902. this._inputs = [];
  32903. }
  32904. Form.prototype.register = function (input) {
  32905. this._inputs.push(input);
  32906. };
  32907. Form.prototype.deregister = function (input) {
  32908. Object(__WEBPACK_IMPORTED_MODULE_1__util__["q" /* removeArrayItem */])(this._inputs, input);
  32909. this.unsetAsFocused(input);
  32910. };
  32911. Form.prototype.setAsFocused = function (input) {
  32912. this._focused = input;
  32913. };
  32914. Form.prototype.unsetAsFocused = function (input) {
  32915. if (input === this._focused) {
  32916. this._focused = null;
  32917. }
  32918. };
  32919. /**
  32920. * Focuses the next input element, if it exists.
  32921. */
  32922. Form.prototype.tabFocus = function (currentInput) {
  32923. var inputs = this._inputs;
  32924. var index = inputs.indexOf(currentInput) + 1;
  32925. if (index > 0 && index < inputs.length) {
  32926. var nextInput = inputs[index];
  32927. if (nextInput !== this._focused) {
  32928. (void 0) /* console.debug */;
  32929. return nextInput.initFocus();
  32930. }
  32931. }
  32932. index = inputs.indexOf(this._focused);
  32933. if (index > 0) {
  32934. var previousInput = inputs[index - 1];
  32935. if (previousInput) {
  32936. (void 0) /* console.debug */;
  32937. previousInput.initFocus();
  32938. }
  32939. }
  32940. };
  32941. Form.prototype.nextId = function () {
  32942. return ++this._ids;
  32943. };
  32944. Form.decorators = [
  32945. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */] },
  32946. ];
  32947. /** @nocollapse */
  32948. Form.ctorParameters = function () { return []; };
  32949. return Form;
  32950. }());
  32951. /**
  32952. * @hidden
  32953. */
  32954. var IonicTapInput = (function () {
  32955. function IonicTapInput() {
  32956. }
  32957. return IonicTapInput;
  32958. }());
  32959. /**
  32960. * @hidden
  32961. */
  32962. var IonicFormInput = (function () {
  32963. function IonicFormInput() {
  32964. }
  32965. return IonicFormInput;
  32966. }());
  32967. //# sourceMappingURL=form.js.map
  32968. /***/ }),
  32969. /* 17 */
  32970. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  32971. "use strict";
  32972. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Item; });
  32973. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  32974. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__button_button__ = __webpack_require__(36);
  32975. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__config_config__ = __webpack_require__(1);
  32976. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_form__ = __webpack_require__(16);
  32977. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__icon_icon__ = __webpack_require__(62);
  32978. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__ion__ = __webpack_require__(4);
  32979. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__label_label__ = __webpack_require__(63);
  32980. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__item_reorder__ = __webpack_require__(64);
  32981. var __extends = (this && this.__extends) || (function () {
  32982. var extendStatics = Object.setPrototypeOf ||
  32983. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  32984. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  32985. return function (d, b) {
  32986. extendStatics(d, b);
  32987. function __() { this.constructor = d; }
  32988. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  32989. };
  32990. })();
  32991. /**
  32992. * @name Item
  32993. * @description
  32994. * An item can contain text, images, and anything else. Generally it is placed in a list with other
  32995. * items. It can easily be swiped, deleted, reordered, edited, and more. An item is only required to
  32996. * be in a [List](../../list/List) if manipulating the item via gestures is required. It requires an
  32997. * [ItemSliding](../ItemSliding) wrapper element in order to be swiped.
  32998. *
  32999. *
  33000. * ## Common Usage
  33001. * There are a few elements that are considered items, but not all of them are styled to look the same.
  33002. * The basic item can be written as an `<ion-item>` element or it can be added to any element by adding
  33003. * `ion-item` as an attribute. List headers and item dividers, although styled differently, are also items
  33004. * and can be written as `<ion-list-header>` and `<ion-item-divider>`, respectively.
  33005. *
  33006. * ### As an Element
  33007. * A basic item should be written as a `<ion-item>` element when it is not clickable.
  33008. *
  33009. * ```html
  33010. * <ion-item>
  33011. * Item
  33012. * </ion-item>
  33013. * ```
  33014. *
  33015. * A list header should be written as `<ion-list-header>`.
  33016. *
  33017. * ```html
  33018. * <ion-list-header>
  33019. * List Header
  33020. * </ion-list-header>
  33021. * ```
  33022. *
  33023. * An item divider should be written as `<ion-item-divider>`.
  33024. *
  33025. * ```html
  33026. * <ion-item-divider>
  33027. * Item Divider
  33028. * </ion-item-divider>
  33029. * ```
  33030. *
  33031. * ### As an Attribute
  33032. * The attribute `ion-item` should be added to a `<button>` when the item can be clicked or tapped. It
  33033. * should be added to an `<a>` element when the item needs to contain a `href`. It can be added as an
  33034. * attribute to any element to take on the item styling.
  33035. *
  33036. * ```html
  33037. * <button ion-item (click)="buttonClick()">
  33038. * Button Item
  33039. * </button>
  33040. *
  33041. * <a ion-item href="https://www.ionicframework.com">
  33042. * Anchor Item
  33043. * </a>
  33044. * ```
  33045. *
  33046. * Note: do not add `ion-item` as an attribute to an `<ion-list-header>` or `<ion-item-divider>` element
  33047. * as they are already items and their styling will be changed to look like a basic item.
  33048. *
  33049. * ## Detail Arrows
  33050. * By default, `<button>` and `<a>` elements with the `ion-item` attribute will display a right arrow icon
  33051. * on `ios` mode. To hide the right arrow icon on either of these elements, add the `detail-none` attribute
  33052. * to the item. To show the right arrow icon on an element that doesn't display it naturally, add the
  33053. * `detail-push` attribute to the item.
  33054. *
  33055. * ```html
  33056. * <ion-item detail-push>
  33057. * Item with Detail Arrow
  33058. * </ion-item>
  33059. *
  33060. * <button ion-item (click)="buttonClick()">
  33061. * Button Item with Detail Arrow
  33062. * </button>
  33063. *
  33064. * <a ion-item detail-none href="https://www.ionicframework.com">
  33065. * Anchor Item with no Detail Arrow
  33066. * </a>
  33067. * ```
  33068. *
  33069. * This feature is not enabled by default for `md` and `wp` modes, but it can be enabled by setting the
  33070. * Sass variables `$item-md-detail-push-show` and `$item-wp-detail-push-show`, respectively, to `true`.
  33071. * It can also be disabled for ios by setting `$item-ios-detail-push-show` to `false`. See the
  33072. * [theming documentation](http://ionicframework.com/docs/theming/overriding-ionic-variables/) for
  33073. * more information on overriding Sass variables.
  33074. *
  33075. *
  33076. * ## Item Placement
  33077. * Items rely heavily on content projection to position content. The item grabs content based on the
  33078. * element or attribute and positions it that way. This logic makes it possible to write a complex
  33079. * item with simple, understandable markup without having to worry about styling and positioning
  33080. * the elements.
  33081. *
  33082. * The below chart details the attributes item looks for and where it will place the element with
  33083. * that attribute inside of the item:
  33084. *
  33085. * | Attribute | Description |
  33086. * |----------------|----------------------------------------------------------------------------------------------------- |
  33087. * | `item-start` | Placed to the left of all other elements, outside of the inner item. |
  33088. * | `item-end` | Placed to the right of all other elements, inside of the inner item, outside of the input wrapper. |
  33089. * | `item-content` | Placed to the right of any `ion-label`, inside of the input wrapper. |
  33090. *
  33091. * ### Checkboxes, Radios and Toggles
  33092. * [Checkboxes](../../checkbox/Checkbox) are positioned in the same place as the `item-start` attribute.
  33093. * [Radios](../../radio/RadioButton) and [Toggles](../../toggle/Toggle) are positioned in the same place
  33094. * as the `item-end` attribute. All of these components can be positioned differently by adding the
  33095. * `item-start` or `item-end` attribute.
  33096. *
  33097. * ### Content and Inputs
  33098. * A [Label](../../label/Label) is placed inside of the item to the left of all content and inputs. The
  33099. * following components are all placed in the same position as the `item-content` attribute: [Select](../../select/Select),
  33100. * [Input](../../input/Input), [TextArea](../../input/TextArea), [DateTime](../../datetime/DateTime), and
  33101. * [Range](../../range/Range).
  33102. *
  33103. * Any element directly placed inside of an `<ion-item>` that does not have one of the previously mentioned
  33104. * attributes and isn't one of the above elements will be placed inside of a [Label](../../label/Label).
  33105. *
  33106. * ### Text Alignment
  33107. * By default, Items will align text to the left and add an ellipsis when the text is wider than the item.
  33108. * See the [Utility Attributes Documentation](../../../../theming/css-utilities/) for attributes that can
  33109. * be added to `ion-item` to transform the text.
  33110. *
  33111. * @usage
  33112. *
  33113. * ```html
  33114. * <ion-list>
  33115. *
  33116. * <ion-list-header>
  33117. * Header
  33118. * </ion-list-header>
  33119. *
  33120. * <ion-item>
  33121. * Item
  33122. * </ion-item>
  33123. *
  33124. * <ion-item detail-push>
  33125. * Item with Detail Arrow
  33126. * </ion-item>
  33127. *
  33128. * <button ion-item (click)="buttonClick()">
  33129. * Button Item
  33130. * </button>
  33131. *
  33132. * <ion-item-divider>
  33133. * Item Divider
  33134. * </ion-item-divider>
  33135. *
  33136. * <button ion-item detail-none (click)="buttonClick()">
  33137. * Button Item with no Detail Arrow
  33138. * </button>
  33139. *
  33140. * <a ion-item href="https://www.ionicframework.com">
  33141. * Anchor Item
  33142. * </a>
  33143. *
  33144. * <ion-item no-lines>
  33145. * Item with no border
  33146. * </ion-item>
  33147. *
  33148. * <ion-item text-wrap>
  33149. * Multiline text that should wrap when it is too long
  33150. * to fit on one line in the item.
  33151. * </ion-item>
  33152. *
  33153. * </ion-list>
  33154. * ```
  33155. *
  33156. *
  33157. * @advanced
  33158. *
  33159. * ```html
  33160. * <ion-list>
  33161. *
  33162. * <!-- List header with buttons on each side -->
  33163. * <ion-list-header>
  33164. * <button ion-button item-start (click)="buttonClick()">Button</button>
  33165. * List Header
  33166. * <button ion-button outline item-end (click)="buttonClick()">Outline</button>
  33167. * </ion-list-header>
  33168. *
  33169. * <!-- Loops through and creates multiple items -->
  33170. * <ion-item *ngFor="let item of items">
  33171. * Item {% raw %}{{item}}{% endraw %}
  33172. * </ion-item>
  33173. *
  33174. * <!-- Button item with an icon on the left -->
  33175. * <button ion-item>
  33176. * <ion-icon name="star" item-start></ion-icon>
  33177. * Button Item
  33178. * </button>
  33179. *
  33180. * <!-- Item with a label and content -->
  33181. * <ion-item>
  33182. * <ion-label>
  33183. * Item Label
  33184. * </ion-label>
  33185. * <div item-content>
  33186. * Item Content next to the label
  33187. * </div>
  33188. * </ion-item>
  33189. *
  33190. * <!-- Item with left and right buttons -->
  33191. * <ion-item>
  33192. * <button ion-button item-start (click)="buttonClick()">Button</button>
  33193. * Item
  33194. * <button ion-button outline item-end (click)="buttonClick()">Outline</button>
  33195. * </ion-item>
  33196. *
  33197. * <!-- Item divider with a right button -->
  33198. * <ion-item-divider>
  33199. * Item Divider
  33200. * <button ion-button item-end>Button</button>
  33201. * </ion-item-divider>
  33202. *
  33203. * <!-- Disabled button item with left and right buttons -->
  33204. * <button ion-item disabled>
  33205. * <button ion-button item-start (click)="buttonClick()">
  33206. * <ion-icon name="home"></ion-icon>
  33207. * Left Icon
  33208. * </button>
  33209. * Disabled Button Item
  33210. * <button ion-button outline item-end (click)="buttonClick()">
  33211. * <ion-icon name="star"></ion-icon>
  33212. * Left Icon
  33213. * </button>
  33214. * </button>
  33215. *
  33216. * <!-- Item with an avatar on the left and button on the right -->
  33217. * <ion-item>
  33218. * <ion-avatar item-start>
  33219. * <img src="img/my-avatar.png">
  33220. * </ion-avatar>
  33221. * Avatar Item
  33222. * <button ion-button outline item-end>View</button>
  33223. * </ion-item>
  33224. *
  33225. * <!-- Item with a thumbnail on the right -->
  33226. * <ion-item>
  33227. * <h2>Item</h2>
  33228. * <p>Item Paragraph</p>
  33229. * <ion-thumbnail item-end>
  33230. * <img src="img/my-thumbnail.png">
  33231. * </ion-thumbnail>
  33232. * </ion-item>
  33233. *
  33234. * <!-- Sliding item -->
  33235. * <ion-item-sliding>
  33236. * <ion-item>
  33237. * Item
  33238. * </ion-item>
  33239. * <ion-item-options>
  33240. * <button ion-button color="primary" (click)="archive()">Archive</button>
  33241. * </ion-item-options>
  33242. * </ion-item-sliding>
  33243. *
  33244. * </ion-list>
  33245. * ```
  33246. *
  33247. *
  33248. * @demo /docs/demos/src/item/
  33249. * @see {@link /docs/components#lists List Component Docs}
  33250. * @see {@link ../../list/List List API Docs}
  33251. * @see {@link ../ItemSliding ItemSliding API Docs}
  33252. */
  33253. var Item = (function (_super) {
  33254. __extends(Item, _super);
  33255. function Item(form, config, elementRef, renderer, reorder) {
  33256. var _this = _super.call(this, config, elementRef, renderer, 'item') || this;
  33257. _this._ids = -1;
  33258. _this._inputs = [];
  33259. _this._viewLabel = true;
  33260. _this._name = 'item';
  33261. /**
  33262. * @hidden
  33263. */
  33264. _this.labelId = null;
  33265. _this._setName(elementRef);
  33266. _this._hasReorder = !!reorder;
  33267. _this.id = form.nextId().toString();
  33268. _this.labelId = 'lbl-' + _this.id;
  33269. // auto add "tappable" attribute to ion-item components that have a click listener
  33270. if (!renderer.orgListen) {
  33271. renderer.orgListen = renderer.listen;
  33272. renderer.listen = function (renderElement, name, callback) {
  33273. if (name === 'click' && renderElement.setAttribute) {
  33274. renderElement.setAttribute('tappable', '');
  33275. }
  33276. return renderer.orgListen(renderElement, name, callback);
  33277. };
  33278. }
  33279. return _this;
  33280. }
  33281. /**
  33282. * @hidden
  33283. */
  33284. Item.prototype.registerInput = function (type) {
  33285. this._inputs.push(type);
  33286. return this.id + '-' + (++this._ids);
  33287. };
  33288. /**
  33289. * @hidden
  33290. */
  33291. Item.prototype.ngAfterContentInit = function () {
  33292. if (this._viewLabel && this._inputs.length) {
  33293. var labelText = this.getLabelText().trim();
  33294. this._viewLabel = (labelText.length > 0);
  33295. }
  33296. if (this._inputs.length > 1) {
  33297. this.setElementClass('item-multiple-inputs', true);
  33298. }
  33299. };
  33300. /**
  33301. * @hidden
  33302. */
  33303. Item.prototype._updateColor = function (newColor, componentName) {
  33304. componentName = componentName || 'item'; // item-radio
  33305. this._setColor(newColor, componentName);
  33306. };
  33307. /**
  33308. * @hidden
  33309. */
  33310. Item.prototype._setName = function (elementRef) {
  33311. var nodeName = elementRef.nativeElement.nodeName.replace('ION-', '');
  33312. if (nodeName === 'LIST-HEADER' || nodeName === 'ITEM-DIVIDER') {
  33313. this._name = nodeName;
  33314. }
  33315. };
  33316. /**
  33317. * @hidden
  33318. */
  33319. Item.prototype.getLabelText = function () {
  33320. return this._label ? this._label.text : '';
  33321. };
  33322. Object.defineProperty(Item.prototype, "contentLabel", {
  33323. /**
  33324. * @hidden
  33325. */
  33326. set: function (label) {
  33327. if (label) {
  33328. this._label = label;
  33329. label.id = this.labelId;
  33330. if (label.type) {
  33331. this.setElementClass('item-label-' + label.type, true);
  33332. }
  33333. this._viewLabel = false;
  33334. }
  33335. },
  33336. enumerable: true,
  33337. configurable: true
  33338. });
  33339. Object.defineProperty(Item.prototype, "viewLabel", {
  33340. /**
  33341. * @hidden
  33342. */
  33343. set: function (label) {
  33344. if (!this._label) {
  33345. this._label = label;
  33346. }
  33347. },
  33348. enumerable: true,
  33349. configurable: true
  33350. });
  33351. Object.defineProperty(Item.prototype, "_buttons", {
  33352. /**
  33353. * @hidden
  33354. */
  33355. set: function (buttons) {
  33356. buttons.forEach(function (button) {
  33357. if (!button._size) {
  33358. button.setElementClass('item-button', true);
  33359. }
  33360. });
  33361. },
  33362. enumerable: true,
  33363. configurable: true
  33364. });
  33365. Object.defineProperty(Item.prototype, "_icons", {
  33366. /**
  33367. * @hidden
  33368. */
  33369. set: function (icons) {
  33370. icons.forEach(function (icon) {
  33371. icon.setElementClass('item-icon', true);
  33372. });
  33373. },
  33374. enumerable: true,
  33375. configurable: true
  33376. });
  33377. Item.decorators = [
  33378. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  33379. selector: 'ion-list-header,ion-item,[ion-item],ion-item-divider',
  33380. template: '<ng-content select="[item-start],[item-left],ion-checkbox:not([item-end]):not([item-right])"></ng-content>' +
  33381. '<div class="item-inner">' +
  33382. '<div class="input-wrapper">' +
  33383. '<ng-content select="ion-label"></ng-content>' +
  33384. '<ion-label *ngIf="_viewLabel">' +
  33385. '<ng-content></ng-content>' +
  33386. '</ion-label>' +
  33387. '<ng-content select="ion-select,ion-input,ion-textarea,ion-datetime,ion-range,[item-content]"></ng-content>' +
  33388. '</div>' +
  33389. '<ng-content select="[item-end],[item-right],ion-radio,ion-toggle"></ng-content>' +
  33390. '<ion-reorder *ngIf="_hasReorder"></ion-reorder>' +
  33391. '</div>' +
  33392. '<div class="button-effect"></div>',
  33393. host: {
  33394. 'class': 'item'
  33395. },
  33396. changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["i" /* ChangeDetectionStrategy */].OnPush,
  33397. encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_11" /* ViewEncapsulation */].None,
  33398. },] },
  33399. ];
  33400. /** @nocollapse */
  33401. Item.ctorParameters = function () { return [
  33402. { type: __WEBPACK_IMPORTED_MODULE_3__util_form__["a" /* Form */], },
  33403. { type: __WEBPACK_IMPORTED_MODULE_2__config_config__["a" /* Config */], },
  33404. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  33405. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  33406. { type: __WEBPACK_IMPORTED_MODULE_7__item_reorder__["a" /* ItemReorder */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  33407. ]; };
  33408. Item.propDecorators = {
  33409. 'contentLabel': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["q" /* ContentChild */], args: [__WEBPACK_IMPORTED_MODULE_6__label_label__["a" /* Label */],] },],
  33410. 'viewLabel': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_8" /* ViewChild */], args: [__WEBPACK_IMPORTED_MODULE_6__label_label__["a" /* Label */],] },],
  33411. '_buttons': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["r" /* ContentChildren */], args: [__WEBPACK_IMPORTED_MODULE_1__button_button__["a" /* Button */],] },],
  33412. '_icons': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["r" /* ContentChildren */], args: [__WEBPACK_IMPORTED_MODULE_4__icon_icon__["a" /* Icon */],] },],
  33413. };
  33414. return Item;
  33415. }(__WEBPACK_IMPORTED_MODULE_5__ion__["a" /* Ion */]));
  33416. //# sourceMappingURL=item.js.map
  33417. /***/ }),
  33418. /* 18 */
  33419. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  33420. "use strict";
  33421. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return KEY_LEFT; });
  33422. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return KEY_UP; });
  33423. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return KEY_RIGHT; });
  33424. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return KEY_DOWN; });
  33425. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return KEY_ENTER; });
  33426. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return KEY_ESCAPE; });
  33427. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return KEY_SPACE; });
  33428. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return KEY_TAB; });
  33429. var KEY_LEFT = 37;
  33430. var KEY_UP = 38;
  33431. var KEY_RIGHT = 39;
  33432. var KEY_DOWN = 40;
  33433. var KEY_ENTER = 13;
  33434. var KEY_ESCAPE = 27;
  33435. var KEY_SPACE = 32;
  33436. var KEY_TAB = 9;
  33437. //# sourceMappingURL=key.js.map
  33438. /***/ }),
  33439. /* 19 */
  33440. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  33441. "use strict";
  33442. /* unused harmony export EventEmitterProxy */
  33443. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Content; });
  33444. /* unused harmony export updateImgs */
  33445. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  33446. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__app_app__ = __webpack_require__(6);
  33447. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__config_config__ = __webpack_require__(1);
  33448. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__platform_dom_controller__ = __webpack_require__(8);
  33449. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__ion__ = __webpack_require__(4);
  33450. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__navigation_nav_util__ = __webpack_require__(21);
  33451. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__util_util__ = __webpack_require__(2);
  33452. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__platform_keyboard__ = __webpack_require__(37);
  33453. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__navigation_nav_controller__ = __webpack_require__(22);
  33454. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__platform_platform__ = __webpack_require__(3);
  33455. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__util_scroll_view__ = __webpack_require__(129);
  33456. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__navigation_view_controller__ = __webpack_require__(5);
  33457. var __extends = (this && this.__extends) || (function () {
  33458. var extendStatics = Object.setPrototypeOf ||
  33459. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  33460. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  33461. return function (d, b) {
  33462. extendStatics(d, b);
  33463. function __() { this.constructor = d; }
  33464. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  33465. };
  33466. })();
  33467. var EventEmitterProxy = (function (_super) {
  33468. __extends(EventEmitterProxy, _super);
  33469. function EventEmitterProxy() {
  33470. return _super !== null && _super.apply(this, arguments) || this;
  33471. }
  33472. EventEmitterProxy.prototype.subscribe = function (generatorOrNext, error, complete) {
  33473. this.onSubscribe();
  33474. return _super.prototype.subscribe.call(this, generatorOrNext, error, complete);
  33475. };
  33476. return EventEmitterProxy;
  33477. }(__WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]));
  33478. /**
  33479. * @name Content
  33480. * @description
  33481. * The Content component provides an easy to use content area with
  33482. * some useful methods to control the scrollable area. There should
  33483. * only be one content in a single view component. If additional scrollable
  33484. * elements are needed, use [ionScroll](../../scroll/Scroll).
  33485. *
  33486. *
  33487. * The content area can also implement pull-to-refresh with the
  33488. * [Refresher](../../refresher/Refresher) component.
  33489. *
  33490. * @usage
  33491. * ```html
  33492. * <ion-content>
  33493. * Add your content here!
  33494. * </ion-content>
  33495. * ```
  33496. *
  33497. * To get a reference to the content component from a Page's logic,
  33498. * you can use Angular's `@ViewChild` annotation:
  33499. *
  33500. * ```ts
  33501. * import { Component, ViewChild } from '@angular/core';
  33502. * import { Content } from 'ionic-angular';
  33503. *
  33504. * @Component({...})
  33505. * export class MyPage{
  33506. * @ViewChild(Content) content: Content;
  33507. *
  33508. * scrollToTop() {
  33509. * this.content.scrollToTop();
  33510. * }
  33511. * }
  33512. * ```
  33513. *
  33514. * @advanced
  33515. *
  33516. * ### Scroll Events
  33517. *
  33518. * Scroll events happen outside of Angular's Zones. This is for performance reasons. So
  33519. * if you're trying to bind a value to any scroll event, it will need to be wrapped in
  33520. * a `zone.run()`
  33521. *
  33522. * ```ts
  33523. * import { Component, NgZone } from '@angular/core';
  33524. * @Component({
  33525. * template: `
  33526. * <ion-header>
  33527. * <ion-navbar>
  33528. * <ion-title>{{scrollAmount}}</ion-title>
  33529. * </ion-navbar>
  33530. * </ion-header>
  33531. * <ion-content (ionScroll)="scrollHandler($event)">
  33532. * <p> Some realllllllly long content </p>
  33533. * </ion-content>
  33534. * `})
  33535. * class E2EPage {
  33536. * public scrollAmount = 0;
  33537. * constructor( public zone: NgZone){}
  33538. * scrollHandler(event) {
  33539. * console.log(`ScrollEvent: ${event}`)
  33540. * this.zone.run(()=>{
  33541. * // since scrollAmount is data-binded,
  33542. * // the update needs to happen in zone
  33543. * this.scrollAmount++
  33544. * })
  33545. * }
  33546. * }
  33547. * ```
  33548. *
  33549. * This goes for any scroll event, not just `ionScroll`.
  33550. *
  33551. * ### Resizing the content
  33552. *
  33553. * If the height of `ion-header`, `ion-footer` or `ion-tabbar`
  33554. * changes dynamically, `content.resize()` has to be called in order to update the
  33555. * layout of `Content`.
  33556. *
  33557. *
  33558. * ```ts
  33559. * @Component({
  33560. * template: `
  33561. * <ion-header>
  33562. * <ion-navbar>
  33563. * <ion-title>Main Navbar</ion-title>
  33564. * </ion-navbar>
  33565. * <ion-toolbar *ngIf="showToolbar">
  33566. * <ion-title>Dynamic Toolbar</ion-title>
  33567. * </ion-toolbar>
  33568. * </ion-header>
  33569. * <ion-content>
  33570. * <button ion-button (click)="toggleToolbar()">Toggle Toolbar</button>
  33571. * </ion-content>
  33572. * `})
  33573. *
  33574. * class E2EPage {
  33575. * @ViewChild(Content) content: Content;
  33576. * showToolbar: boolean = false;
  33577. *
  33578. * toggleToolbar() {
  33579. * this.showToolbar = !this.showToolbar;
  33580. * this.content.resize();
  33581. * }
  33582. * }
  33583. * ```
  33584. *
  33585. *
  33586. * Scroll to a specific position
  33587. *
  33588. * ```ts
  33589. * import { Component, ViewChild } from '@angular/core';
  33590. * import { Content } from 'ionic-angular';
  33591. *
  33592. * @Component({
  33593. * template: `<ion-content>
  33594. * <button ion-button (click)="scrollTo()">Down 500px</button>
  33595. * </ion-content>`
  33596. * )}
  33597. * export class MyPage{
  33598. * @ViewChild(Content) content: Content;
  33599. *
  33600. * scrollTo() {
  33601. * // set the scrollLeft to 0px, and scrollTop to 500px
  33602. * // the scroll duration should take 200ms
  33603. * this.content.scrollTo(0, 500, 200);
  33604. * }
  33605. * }
  33606. * ```
  33607. *
  33608. */
  33609. var Content = (function (_super) {
  33610. __extends(Content, _super);
  33611. function Content(config, _plt, _dom, elementRef, renderer, _app, _keyboard, _zone, viewCtrl, navCtrl) {
  33612. var _this = _super.call(this, config, elementRef, renderer, 'content') || this;
  33613. _this._plt = _plt;
  33614. _this._dom = _dom;
  33615. _this._app = _app;
  33616. _this._keyboard = _keyboard;
  33617. _this._zone = _zone;
  33618. /** @internal */
  33619. _this._scrollPadding = 0;
  33620. /** @internal */
  33621. _this._inputPolling = false;
  33622. /** @internal */
  33623. _this._hasRefresher = false;
  33624. /** @internal */
  33625. _this._imgs = [];
  33626. /** @internal */
  33627. _this._scrollDownOnLoad = false;
  33628. /**
  33629. * @output {ScrollEvent} Emitted when the scrolling first starts.
  33630. */
  33631. _this.ionScrollStart = new EventEmitterProxy();
  33632. /**
  33633. * @output {ScrollEvent} Emitted on every scroll event.
  33634. */
  33635. _this.ionScroll = new EventEmitterProxy();
  33636. /**
  33637. * @output {ScrollEvent} Emitted when scrolling ends.
  33638. */
  33639. _this.ionScrollEnd = new EventEmitterProxy();
  33640. var enableScrollListener = function () { return _this._scroll.enableEvents(); };
  33641. _this.ionScroll.onSubscribe = enableScrollListener;
  33642. _this.ionScrollStart.onSubscribe = enableScrollListener;
  33643. _this.ionScrollEnd.onSubscribe = enableScrollListener;
  33644. _this.statusbarPadding = config.getBoolean('statusbarPadding', false);
  33645. _this._imgReqBfr = config.getNumber('imgRequestBuffer', 1400);
  33646. _this._imgRndBfr = config.getNumber('imgRenderBuffer', 400);
  33647. _this._imgVelMax = config.getNumber('imgVelocityMax', 3);
  33648. _this._scroll = new __WEBPACK_IMPORTED_MODULE_10__util_scroll_view__["a" /* ScrollView */](_app, _plt, _dom);
  33649. while (navCtrl) {
  33650. if (Object(__WEBPACK_IMPORTED_MODULE_5__navigation_nav_util__["m" /* isTabs */])(navCtrl)) {
  33651. _this._tabs = navCtrl;
  33652. break;
  33653. }
  33654. navCtrl = navCtrl.parent;
  33655. }
  33656. if (viewCtrl) {
  33657. _this._viewCtrl = viewCtrl;
  33658. // content has a view controller
  33659. viewCtrl._setIONContent(_this);
  33660. viewCtrl._setIONContentRef(elementRef);
  33661. _this._viewCtrlReadSub = viewCtrl.readReady.subscribe(function () {
  33662. _this._viewCtrlReadSub.unsubscribe();
  33663. _this._readDimensions();
  33664. });
  33665. _this._viewCtrlWriteSub = viewCtrl.writeReady.subscribe(function () {
  33666. _this._viewCtrlWriteSub.unsubscribe();
  33667. _this._writeDimensions();
  33668. });
  33669. }
  33670. else {
  33671. // content does not have a view controller
  33672. _dom.read(_this._readDimensions.bind(_this));
  33673. _dom.write(_this._writeDimensions.bind(_this));
  33674. }
  33675. return _this;
  33676. }
  33677. Object.defineProperty(Content.prototype, "contentHeight", {
  33678. /**
  33679. * Content height of the viewable area. This does not include content
  33680. * which is outside the overflow area, or content area which is under
  33681. * headers and footers. Read-only.
  33682. *
  33683. * @return {number}
  33684. */
  33685. get: function () {
  33686. return this._scroll.ev.contentHeight;
  33687. },
  33688. enumerable: true,
  33689. configurable: true
  33690. });
  33691. Object.defineProperty(Content.prototype, "contentWidth", {
  33692. /**
  33693. * Content width including content which is not visible on the screen
  33694. * due to overflow. Read-only.
  33695. *
  33696. * @return {number}
  33697. */
  33698. get: function () {
  33699. return this._scroll.ev.contentWidth;
  33700. },
  33701. enumerable: true,
  33702. configurable: true
  33703. });
  33704. Object.defineProperty(Content.prototype, "scrollHeight", {
  33705. /**
  33706. * Content height including content which is not visible on the screen
  33707. * due to overflow. Read-only.
  33708. *
  33709. * @return {number}
  33710. */
  33711. get: function () {
  33712. return this._scroll.ev.scrollHeight;
  33713. },
  33714. enumerable: true,
  33715. configurable: true
  33716. });
  33717. Object.defineProperty(Content.prototype, "scrollWidth", {
  33718. /**
  33719. * Content width including content which is not visible due to
  33720. * overflow. Read-only.
  33721. *
  33722. * @return {number}
  33723. */
  33724. get: function () {
  33725. return this._scroll.ev.scrollWidth;
  33726. },
  33727. enumerable: true,
  33728. configurable: true
  33729. });
  33730. Object.defineProperty(Content.prototype, "scrollTop", {
  33731. /**
  33732. * The distance of the content's top to its topmost visible content.
  33733. *
  33734. * @return {number}
  33735. */
  33736. get: function () {
  33737. return this._scroll.ev.scrollTop;
  33738. },
  33739. /**
  33740. * @param {number} top
  33741. */
  33742. set: function (top) {
  33743. this._scroll.setTop(top);
  33744. },
  33745. enumerable: true,
  33746. configurable: true
  33747. });
  33748. Object.defineProperty(Content.prototype, "scrollLeft", {
  33749. /**
  33750. * The distance of the content's left to its leftmost visible content.
  33751. *
  33752. * @return {number}
  33753. */
  33754. get: function () {
  33755. return this._scroll.ev.scrollLeft;
  33756. },
  33757. /**
  33758. * @param {number} top
  33759. */
  33760. set: function (top) {
  33761. this._scroll.setLeft(top);
  33762. },
  33763. enumerable: true,
  33764. configurable: true
  33765. });
  33766. Object.defineProperty(Content.prototype, "isScrolling", {
  33767. /**
  33768. * If the content is actively scrolling or not.
  33769. *
  33770. * @return {boolean}
  33771. */
  33772. get: function () {
  33773. return this._scroll.isScrolling;
  33774. },
  33775. enumerable: true,
  33776. configurable: true
  33777. });
  33778. Object.defineProperty(Content.prototype, "directionY", {
  33779. /**
  33780. * The current, or last known, vertical scroll direction. Possible
  33781. * string values include `down` and `up`.
  33782. *
  33783. * @return {string}
  33784. */
  33785. get: function () {
  33786. return this._scroll.ev.directionY;
  33787. },
  33788. enumerable: true,
  33789. configurable: true
  33790. });
  33791. Object.defineProperty(Content.prototype, "directionX", {
  33792. /**
  33793. * The current, or last known, horizontal scroll direction. Possible
  33794. * string values include `right` and `left`.
  33795. *
  33796. * @return {string}
  33797. */
  33798. get: function () {
  33799. return this._scroll.ev.directionX;
  33800. },
  33801. enumerable: true,
  33802. configurable: true
  33803. });
  33804. /**
  33805. * @hidden
  33806. */
  33807. Content.prototype.ngAfterViewInit = function () {
  33808. var _this = this;
  33809. (void 0) /* assert */;
  33810. (void 0) /* assert */;
  33811. var scroll = this._scroll;
  33812. scroll.ev.fixedElement = this.getFixedElement();
  33813. scroll.ev.scrollElement = this.getScrollElement();
  33814. // subscribe to the scroll start
  33815. scroll.onScrollStart = function (ev) {
  33816. _this.ionScrollStart.emit(ev);
  33817. };
  33818. // subscribe to every scroll move
  33819. scroll.onScroll = function (ev) {
  33820. // emit to all of our other friends things be scrolling
  33821. _this.ionScroll.emit(ev);
  33822. _this.imgsUpdate();
  33823. };
  33824. // subscribe to the scroll end
  33825. scroll.onScrollEnd = function (ev) {
  33826. _this.ionScrollEnd.emit(ev);
  33827. _this.imgsUpdate();
  33828. };
  33829. };
  33830. /**
  33831. * @hidden
  33832. */
  33833. Content.prototype.enableJsScroll = function () {
  33834. this._scroll.enableJsScroll(this._cTop, this._cBottom);
  33835. };
  33836. /**
  33837. * @hidden
  33838. */
  33839. Content.prototype.ngOnDestroy = function () {
  33840. this._scLsn && this._scLsn();
  33841. this._viewCtrlReadSub && this._viewCtrlReadSub.unsubscribe();
  33842. this._viewCtrlWriteSub && this._viewCtrlWriteSub.unsubscribe();
  33843. this._viewCtrlReadSub = this._viewCtrlWriteSub = null;
  33844. this._scroll && this._scroll.destroy();
  33845. this._footerEle = this._scLsn = this._scroll = null;
  33846. };
  33847. /**
  33848. * @hidden
  33849. */
  33850. Content.prototype.getScrollElement = function () {
  33851. return this._scrollContent.nativeElement;
  33852. };
  33853. /**
  33854. * @private
  33855. */
  33856. Content.prototype.getFixedElement = function () {
  33857. return this._fixedContent.nativeElement;
  33858. };
  33859. /**
  33860. * @hidden
  33861. */
  33862. Content.prototype.onScrollElementTransitionEnd = function (callback) {
  33863. this._plt.transitionEnd(this.getScrollElement(), callback);
  33864. };
  33865. /**
  33866. * Scroll to the specified position.
  33867. *
  33868. * @param {number} x The x-value to scroll to.
  33869. * @param {number} y The y-value to scroll to.
  33870. * @param {number} [duration] Duration of the scroll animation in milliseconds. Defaults to `300`.
  33871. * @returns {Promise} Returns a promise which is resolved when the scroll has completed.
  33872. */
  33873. Content.prototype.scrollTo = function (x, y, duration, done) {
  33874. if (duration === void 0) { duration = 300; }
  33875. (void 0) /* console.debug */;
  33876. return this._scroll.scrollTo(x, y, duration, done);
  33877. };
  33878. /**
  33879. * Scroll to the top of the content component.
  33880. *
  33881. * @param {number} [duration] Duration of the scroll animation in milliseconds. Defaults to `300`.
  33882. * @returns {Promise} Returns a promise which is resolved when the scroll has completed.
  33883. */
  33884. Content.prototype.scrollToTop = function (duration) {
  33885. if (duration === void 0) { duration = 300; }
  33886. (void 0) /* console.debug */;
  33887. return this._scroll.scrollToTop(duration);
  33888. };
  33889. /**
  33890. * Scroll to the bottom of the content component.
  33891. *
  33892. * @param {number} [duration] Duration of the scroll animation in milliseconds. Defaults to `300`.
  33893. * @returns {Promise} Returns a promise which is resolved when the scroll has completed.
  33894. */
  33895. Content.prototype.scrollToBottom = function (duration) {
  33896. if (duration === void 0) { duration = 300; }
  33897. (void 0) /* console.debug */;
  33898. return this._scroll.scrollToBottom(duration);
  33899. };
  33900. Object.defineProperty(Content.prototype, "fullscreen", {
  33901. /**
  33902. * @input {boolean} If true, the content will scroll behind the headers
  33903. * and footers. This effect can easily be seen by setting the toolbar
  33904. * to transparent.
  33905. */
  33906. get: function () {
  33907. return this._fullscreen;
  33908. },
  33909. set: function (val) {
  33910. this._fullscreen = Object(__WEBPACK_IMPORTED_MODULE_6__util_util__["o" /* isTrueProperty */])(val);
  33911. },
  33912. enumerable: true,
  33913. configurable: true
  33914. });
  33915. Object.defineProperty(Content.prototype, "scrollDownOnLoad", {
  33916. /**
  33917. * @input {boolean} If true, the content will scroll down on load.
  33918. */
  33919. get: function () {
  33920. return this._scrollDownOnLoad;
  33921. },
  33922. set: function (val) {
  33923. this._scrollDownOnLoad = Object(__WEBPACK_IMPORTED_MODULE_6__util_util__["o" /* isTrueProperty */])(val);
  33924. },
  33925. enumerable: true,
  33926. configurable: true
  33927. });
  33928. /**
  33929. * @private
  33930. */
  33931. Content.prototype.addImg = function (img) {
  33932. this._imgs.push(img);
  33933. };
  33934. /**
  33935. * @hidden
  33936. */
  33937. Content.prototype.removeImg = function (img) {
  33938. Object(__WEBPACK_IMPORTED_MODULE_6__util_util__["q" /* removeArrayItem */])(this._imgs, img);
  33939. };
  33940. /**
  33941. * @hidden
  33942. * DOM WRITE
  33943. */
  33944. Content.prototype.setScrollElementStyle = function (prop, val) {
  33945. var scrollEle = this.getScrollElement();
  33946. if (scrollEle) {
  33947. this._dom.write(function () {
  33948. scrollEle.style[prop] = val;
  33949. });
  33950. }
  33951. };
  33952. /**
  33953. * Returns the content and scroll elements' dimensions.
  33954. * @returns {object} dimensions The content and scroll elements' dimensions
  33955. * {number} dimensions.contentHeight content offsetHeight
  33956. * {number} dimensions.contentTop content offsetTop
  33957. * {number} dimensions.contentBottom content offsetTop+offsetHeight
  33958. * {number} dimensions.contentWidth content offsetWidth
  33959. * {number} dimensions.contentLeft content offsetLeft
  33960. * {number} dimensions.contentRight content offsetLeft + offsetWidth
  33961. * {number} dimensions.scrollHeight scroll scrollHeight
  33962. * {number} dimensions.scrollTop scroll scrollTop
  33963. * {number} dimensions.scrollBottom scroll scrollTop + scrollHeight
  33964. * {number} dimensions.scrollWidth scroll scrollWidth
  33965. * {number} dimensions.scrollLeft scroll scrollLeft
  33966. * {number} dimensions.scrollRight scroll scrollLeft + scrollWidth
  33967. */
  33968. Content.prototype.getContentDimensions = function () {
  33969. var scrollEle = this.getScrollElement();
  33970. var parentElement = scrollEle.parentElement;
  33971. return {
  33972. contentHeight: parentElement.offsetHeight - this._cTop - this._cBottom,
  33973. contentTop: this._cTop,
  33974. contentBottom: this._cBottom,
  33975. contentWidth: parentElement.offsetWidth,
  33976. contentLeft: parentElement.offsetLeft,
  33977. scrollHeight: scrollEle.scrollHeight,
  33978. scrollTop: scrollEle.scrollTop,
  33979. scrollWidth: scrollEle.scrollWidth,
  33980. scrollLeft: scrollEle.scrollLeft,
  33981. };
  33982. };
  33983. /**
  33984. * @hidden
  33985. * DOM WRITE
  33986. * Adds padding to the bottom of the scroll element when the keyboard is open
  33987. * so content below the keyboard can be scrolled into view.
  33988. */
  33989. Content.prototype.addScrollPadding = function (newPadding) {
  33990. (void 0) /* assert */;
  33991. if (newPadding === 0) {
  33992. this._inputPolling = false;
  33993. this._scrollPadding = -1;
  33994. }
  33995. if (newPadding > this._scrollPadding) {
  33996. (void 0) /* console.debug */;
  33997. this._scrollPadding = newPadding;
  33998. var scrollEle = this.getScrollElement();
  33999. if (scrollEle) {
  34000. this._dom.write(function () {
  34001. scrollEle.style.paddingBottom = (newPadding > 0) ? newPadding + 'px' : '';
  34002. });
  34003. }
  34004. }
  34005. };
  34006. /**
  34007. * @hidden
  34008. * DOM WRITE
  34009. */
  34010. Content.prototype.clearScrollPaddingFocusOut = function () {
  34011. var _this = this;
  34012. if (!this._inputPolling) {
  34013. (void 0) /* console.debug */;
  34014. this._inputPolling = true;
  34015. this._keyboard.onClose(function () {
  34016. (void 0) /* console.debug */;
  34017. _this.addScrollPadding(0);
  34018. }, 200, 3000);
  34019. }
  34020. };
  34021. /**
  34022. * Tell the content to recalculate its dimensions. This should be called
  34023. * after dynamically adding/removing headers, footers, or tabs.
  34024. */
  34025. Content.prototype.resize = function () {
  34026. this._dom.read(this._readDimensions.bind(this));
  34027. this._dom.write(this._writeDimensions.bind(this));
  34028. };
  34029. /**
  34030. * @hidden
  34031. * DOM READ
  34032. */
  34033. Content.prototype._readDimensions = function () {
  34034. var cachePaddingTop = this._pTop;
  34035. var cachePaddingRight = this._pRight;
  34036. var cachePaddingBottom = this._pBottom;
  34037. var cachePaddingLeft = this._pLeft;
  34038. var cacheHeaderHeight = this._hdrHeight;
  34039. var cacheFooterHeight = this._ftrHeight;
  34040. var cacheTabsPlacement = this._tabsPlacement;
  34041. var tabsTop = 0;
  34042. var scrollEvent;
  34043. this._pTop = 0;
  34044. this._pRight = 0;
  34045. this._pBottom = 0;
  34046. this._pLeft = 0;
  34047. this._hdrHeight = 0;
  34048. this._ftrHeight = 0;
  34049. this._tabsPlacement = null;
  34050. this._tTop = 0;
  34051. this._fTop = 0;
  34052. this._fBottom = 0;
  34053. // In certain cases this._scroll is undefined
  34054. // if that is the case then we should just return
  34055. if (!this._scroll) {
  34056. return;
  34057. }
  34058. scrollEvent = this._scroll.ev;
  34059. var ele = this.getNativeElement();
  34060. if (!ele) {
  34061. (void 0) /* assert */;
  34062. return;
  34063. }
  34064. var computedStyle;
  34065. var tagName;
  34066. var parentEle = ele.parentElement;
  34067. var children = parentEle.children;
  34068. for (var i = children.length - 1; i >= 0; i--) {
  34069. ele = children[i];
  34070. tagName = ele.tagName;
  34071. if (tagName === 'ION-CONTENT') {
  34072. scrollEvent.contentElement = ele;
  34073. if (this._fullscreen) {
  34074. // ******** DOM READ ****************
  34075. computedStyle = getComputedStyle(ele);
  34076. this._pTop = parsePxUnit(computedStyle.paddingTop);
  34077. this._pBottom = parsePxUnit(computedStyle.paddingBottom);
  34078. this._pRight = parsePxUnit(computedStyle.paddingRight);
  34079. this._pLeft = parsePxUnit(computedStyle.paddingLeft);
  34080. }
  34081. }
  34082. else if (tagName === 'ION-HEADER') {
  34083. scrollEvent.headerElement = ele;
  34084. // ******** DOM READ ****************
  34085. this._hdrHeight = ele.clientHeight;
  34086. }
  34087. else if (tagName === 'ION-FOOTER') {
  34088. scrollEvent.footerElement = ele;
  34089. // ******** DOM READ ****************
  34090. this._ftrHeight = ele.clientHeight;
  34091. this._footerEle = ele;
  34092. }
  34093. }
  34094. ele = parentEle;
  34095. var tabbarEle;
  34096. while (ele && ele.tagName !== 'ION-MODAL' && !ele.classList.contains('tab-subpage')) {
  34097. if (ele.tagName === 'ION-TABS') {
  34098. tabbarEle = ele.firstElementChild;
  34099. // ******** DOM READ ****************
  34100. this._tabbarHeight = tabbarEle.clientHeight;
  34101. if (this._tabsPlacement === null) {
  34102. // this is the first tabbar found, remember it's position
  34103. this._tabsPlacement = ele.getAttribute('tabsplacement');
  34104. }
  34105. }
  34106. ele = ele.parentElement;
  34107. }
  34108. // Tabs top
  34109. if (this._tabs && this._tabsPlacement === 'top') {
  34110. this._tTop = this._hdrHeight;
  34111. tabsTop = this._tabs._top;
  34112. }
  34113. // Toolbar height
  34114. this._cTop = this._hdrHeight;
  34115. this._cBottom = this._ftrHeight;
  34116. // Tabs height
  34117. if (this._tabsPlacement === 'top') {
  34118. this._cTop += this._tabbarHeight;
  34119. }
  34120. else if (this._tabsPlacement === 'bottom') {
  34121. this._cBottom += this._tabbarHeight;
  34122. }
  34123. // Refresher uses a border which should be hidden unless pulled
  34124. if (this._hasRefresher) {
  34125. this._cTop -= 1;
  34126. }
  34127. // Fixed content shouldn't include content padding
  34128. this._fTop = this._cTop;
  34129. this._fBottom = this._cBottom;
  34130. // Handle fullscreen viewport (padding vs margin)
  34131. if (this._fullscreen) {
  34132. this._cTop += this._pTop;
  34133. this._cBottom += this._pBottom;
  34134. }
  34135. // ******** DOM READ ****************
  34136. var contentDimensions = this.getContentDimensions();
  34137. scrollEvent.scrollHeight = contentDimensions.scrollHeight;
  34138. scrollEvent.scrollWidth = contentDimensions.scrollWidth;
  34139. scrollEvent.contentHeight = contentDimensions.contentHeight;
  34140. scrollEvent.contentWidth = contentDimensions.contentWidth;
  34141. scrollEvent.contentTop = contentDimensions.contentTop;
  34142. scrollEvent.contentBottom = contentDimensions.contentBottom;
  34143. this._dirty = (cachePaddingTop !== this._pTop ||
  34144. cachePaddingBottom !== this._pBottom ||
  34145. cachePaddingLeft !== this._pLeft ||
  34146. cachePaddingRight !== this._pRight ||
  34147. cacheHeaderHeight !== this._hdrHeight ||
  34148. cacheFooterHeight !== this._ftrHeight ||
  34149. cacheTabsPlacement !== this._tabsPlacement ||
  34150. tabsTop !== this._tTop ||
  34151. this._cTop !== this.contentTop ||
  34152. this._cBottom !== this.contentBottom);
  34153. this._scroll.init(this.getScrollElement(), this._cTop, this._cBottom);
  34154. // initial imgs refresh
  34155. this.imgsUpdate();
  34156. };
  34157. /**
  34158. * @hidden
  34159. * DOM WRITE
  34160. */
  34161. Content.prototype._writeDimensions = function () {
  34162. if (!this._dirty) {
  34163. (void 0) /* console.debug */;
  34164. return;
  34165. }
  34166. var scrollEle = this.getScrollElement();
  34167. if (!scrollEle) {
  34168. (void 0) /* assert */;
  34169. return;
  34170. }
  34171. var fixedEle = this.getFixedElement();
  34172. if (!fixedEle) {
  34173. (void 0) /* assert */;
  34174. return;
  34175. }
  34176. // Tabs height
  34177. if (this._tabsPlacement === 'bottom' && this._cBottom > 0 && this._footerEle) {
  34178. var footerPos = this._cBottom - this._ftrHeight;
  34179. (void 0) /* assert */;
  34180. // ******** DOM WRITE ****************
  34181. this._footerEle.style.bottom = cssFormat(footerPos);
  34182. }
  34183. // Handle fullscreen viewport (padding vs margin)
  34184. var topProperty = 'marginTop';
  34185. var bottomProperty = 'marginBottom';
  34186. var fixedTop = this._fTop;
  34187. var fixedBottom = this._fBottom;
  34188. if (this._fullscreen) {
  34189. (void 0) /* assert */;
  34190. (void 0) /* assert */;
  34191. // adjust the content with padding, allowing content to scroll under headers/footers
  34192. // however, on iOS you cannot control the margins of the scrollbar (last tested iOS9.2)
  34193. // only add inline padding styles if the computed padding value, which would
  34194. // have come from the app's css, is different than the new padding value
  34195. topProperty = 'paddingTop';
  34196. bottomProperty = 'paddingBottom';
  34197. }
  34198. // Only update top margin if value changed
  34199. if (this._cTop !== this.contentTop) {
  34200. (void 0) /* assert */;
  34201. (void 0) /* assert */;
  34202. // ******** DOM WRITE ****************
  34203. scrollEle.style[topProperty] = cssFormat(this._cTop);
  34204. // ******** DOM WRITE ****************
  34205. fixedEle.style.marginTop = cssFormat(fixedTop);
  34206. this.contentTop = this._cTop;
  34207. }
  34208. // Only update bottom margin if value changed
  34209. if (this._cBottom !== this.contentBottom) {
  34210. (void 0) /* assert */;
  34211. (void 0) /* assert */;
  34212. // ******** DOM WRITE ****************
  34213. scrollEle.style[bottomProperty] = cssFormat(this._cBottom);
  34214. // ******** DOM WRITE ****************
  34215. fixedEle.style.marginBottom = cssFormat(fixedBottom);
  34216. this.contentBottom = this._cBottom;
  34217. }
  34218. if (this._tabsPlacement !== null && this._tabs) {
  34219. // set the position of the tabbar
  34220. if (this._tabsPlacement === 'top') {
  34221. // ******** DOM WRITE ****************
  34222. this._tabs.setTabbarPosition(this._tTop, -1);
  34223. }
  34224. else {
  34225. (void 0) /* assert */;
  34226. // ******** DOM WRITE ****************
  34227. this._tabs.setTabbarPosition(-1, 0);
  34228. }
  34229. }
  34230. // Scroll the page all the way down after setting dimensions
  34231. if (this._scrollDownOnLoad) {
  34232. this.scrollToBottom(0);
  34233. this._scrollDownOnLoad = false;
  34234. }
  34235. };
  34236. /**
  34237. * @hidden
  34238. */
  34239. Content.prototype.imgsUpdate = function () {
  34240. if (this._scroll.initialized && this._imgs.length && this.isImgsUpdatable()) {
  34241. updateImgs(this._imgs, this.scrollTop, this.contentHeight, this.directionY, this._imgReqBfr, this._imgRndBfr);
  34242. }
  34243. };
  34244. /**
  34245. * @hidden
  34246. */
  34247. Content.prototype.isImgsUpdatable = function () {
  34248. // an image is only "updatable" if the content isn't scrolling too fast
  34249. // if scroll speed is above the maximum velocity, then let current
  34250. // requests finish, but do not start new requets or render anything
  34251. // if scroll speed is below the maximum velocity, then it's ok
  34252. // to start new requests and render images
  34253. return Math.abs(this._scroll.ev.velocityY) < this._imgVelMax;
  34254. };
  34255. Content.decorators = [
  34256. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  34257. selector: 'ion-content',
  34258. template: '<div class="fixed-content" #fixedContent>' +
  34259. '<ng-content select="[ion-fixed],ion-fab"></ng-content>' +
  34260. '</div>' +
  34261. '<div class="scroll-content" #scrollContent>' +
  34262. '<ng-content></ng-content>' +
  34263. '</div>' +
  34264. '<ng-content select="ion-refresher"></ng-content>',
  34265. host: {
  34266. '[class.statusbar-padding]': 'statusbarPadding',
  34267. '[class.has-refresher]': '_hasRefresher'
  34268. },
  34269. changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["i" /* ChangeDetectionStrategy */].OnPush,
  34270. encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_11" /* ViewEncapsulation */].None
  34271. },] },
  34272. ];
  34273. /** @nocollapse */
  34274. Content.ctorParameters = function () { return [
  34275. { type: __WEBPACK_IMPORTED_MODULE_2__config_config__["a" /* Config */], },
  34276. { type: __WEBPACK_IMPORTED_MODULE_9__platform_platform__["a" /* Platform */], },
  34277. { type: __WEBPACK_IMPORTED_MODULE_3__platform_dom_controller__["a" /* DomController */], },
  34278. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  34279. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  34280. { type: __WEBPACK_IMPORTED_MODULE_1__app_app__["a" /* App */], },
  34281. { type: __WEBPACK_IMPORTED_MODULE_7__platform_keyboard__["a" /* Keyboard */], },
  34282. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["M" /* NgZone */], },
  34283. { type: __WEBPACK_IMPORTED_MODULE_11__navigation_view_controller__["a" /* ViewController */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  34284. { type: __WEBPACK_IMPORTED_MODULE_8__navigation_nav_controller__["a" /* NavController */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  34285. ]; };
  34286. Content.propDecorators = {
  34287. '_fixedContent': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_8" /* ViewChild */], args: ['fixedContent', { read: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */] },] },],
  34288. '_scrollContent': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_8" /* ViewChild */], args: ['scrollContent', { read: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */] },] },],
  34289. 'ionScrollStart': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  34290. 'ionScroll': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  34291. 'ionScrollEnd': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  34292. 'fullscreen': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  34293. 'scrollDownOnLoad': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  34294. };
  34295. return Content;
  34296. }(__WEBPACK_IMPORTED_MODULE_4__ion__["a" /* Ion */]));
  34297. function updateImgs(imgs, viewableTop, contentHeight, scrollDirectionY, requestableBuffer, renderableBuffer) {
  34298. // ok, so it's time to see which images, if any, should be requested and rendered
  34299. // ultimately, if we're scrolling fast then don't bother requesting or rendering
  34300. // when scrolling is done, then it needs to do a check to see which images are
  34301. // important to request and render, and which image requests should be aborted.
  34302. // Additionally, images which are not near the viewable area should not be
  34303. // rendered at all in order to save browser resources.
  34304. var viewableBottom = (viewableTop + contentHeight);
  34305. var priority1 = [];
  34306. var priority2 = [];
  34307. var img;
  34308. // all images should be paused
  34309. for (var i = 0, ilen = imgs.length; i < ilen; i++) {
  34310. img = imgs[i];
  34311. if (scrollDirectionY === 'up') {
  34312. // scrolling up
  34313. if (img.top < viewableBottom && img.bottom > viewableTop - renderableBuffer) {
  34314. // scrolling up, img is within viewable area
  34315. // or about to be viewable area
  34316. img.canRequest = img.canRender = true;
  34317. priority1.push(img);
  34318. continue;
  34319. }
  34320. if (img.bottom <= viewableTop && img.bottom > viewableTop - requestableBuffer) {
  34321. // scrolling up, img is within requestable area
  34322. img.canRequest = true;
  34323. img.canRender = false;
  34324. priority2.push(img);
  34325. continue;
  34326. }
  34327. if (img.top >= viewableBottom && img.top < viewableBottom + renderableBuffer) {
  34328. // scrolling up, img below viewable area
  34329. // but it's still within renderable area
  34330. // don't allow a reset
  34331. img.canRequest = img.canRender = false;
  34332. continue;
  34333. }
  34334. }
  34335. else {
  34336. // scrolling down
  34337. if (img.bottom > viewableTop && img.top < viewableBottom + renderableBuffer) {
  34338. // scrolling down, img is within viewable area
  34339. // or about to be viewable area
  34340. img.canRequest = img.canRender = true;
  34341. priority1.push(img);
  34342. continue;
  34343. }
  34344. if (img.top >= viewableBottom && img.top < viewableBottom + requestableBuffer) {
  34345. // scrolling down, img is within requestable area
  34346. img.canRequest = true;
  34347. img.canRender = false;
  34348. priority2.push(img);
  34349. continue;
  34350. }
  34351. if (img.bottom <= viewableTop && img.bottom > viewableTop - renderableBuffer) {
  34352. // scrolling down, img above viewable area
  34353. // but it's still within renderable area
  34354. // don't allow a reset
  34355. img.canRequest = img.canRender = false;
  34356. continue;
  34357. }
  34358. }
  34359. img.canRequest = img.canRender = false;
  34360. img.reset();
  34361. }
  34362. // update all imgs which are viewable
  34363. priority1.sort(sortTopToBottom).forEach(function (i) { return i.update(); });
  34364. if (scrollDirectionY === 'up') {
  34365. // scrolling up
  34366. priority2.sort(sortTopToBottom).reverse().forEach(function (i) { return i.update(); });
  34367. }
  34368. else {
  34369. // scrolling down
  34370. priority2.sort(sortTopToBottom).forEach(function (i) { return i.update(); });
  34371. }
  34372. }
  34373. function sortTopToBottom(a, b) {
  34374. if (a.top < b.top) {
  34375. return -1;
  34376. }
  34377. if (a.top > b.top) {
  34378. return 1;
  34379. }
  34380. return 0;
  34381. }
  34382. function parsePxUnit(val) {
  34383. return (val.indexOf('px') > 0) ? parseInt(val, 10) : 0;
  34384. }
  34385. function cssFormat(val) {
  34386. return (val > 0 ? val + 'px' : '');
  34387. }
  34388. //# sourceMappingURL=content.js.map
  34389. /***/ }),
  34390. /* 20 */
  34391. /***/ (function(module, exports, __webpack_require__) {
  34392. "use strict";
  34393. var __extends = (this && this.__extends) || function (d, b) {
  34394. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  34395. function __() { this.constructor = d; }
  34396. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  34397. };
  34398. var isFunction_1 = __webpack_require__(50);
  34399. var Subscription_1 = __webpack_require__(30);
  34400. var Observer_1 = __webpack_require__(107);
  34401. var rxSubscriber_1 = __webpack_require__(52);
  34402. /**
  34403. * Implements the {@link Observer} interface and extends the
  34404. * {@link Subscription} class. While the {@link Observer} is the public API for
  34405. * consuming the values of an {@link Observable}, all Observers get converted to
  34406. * a Subscriber, in order to provide Subscription-like capabilities such as
  34407. * `unsubscribe`. Subscriber is a common type in RxJS, and crucial for
  34408. * implementing operators, but it is rarely used as a public API.
  34409. *
  34410. * @class Subscriber<T>
  34411. */
  34412. var Subscriber = (function (_super) {
  34413. __extends(Subscriber, _super);
  34414. /**
  34415. * @param {Observer|function(value: T): void} [destinationOrNext] A partially
  34416. * defined Observer or a `next` callback function.
  34417. * @param {function(e: ?any): void} [error] The `error` callback of an
  34418. * Observer.
  34419. * @param {function(): void} [complete] The `complete` callback of an
  34420. * Observer.
  34421. */
  34422. function Subscriber(destinationOrNext, error, complete) {
  34423. _super.call(this);
  34424. this.syncErrorValue = null;
  34425. this.syncErrorThrown = false;
  34426. this.syncErrorThrowable = false;
  34427. this.isStopped = false;
  34428. switch (arguments.length) {
  34429. case 0:
  34430. this.destination = Observer_1.empty;
  34431. break;
  34432. case 1:
  34433. if (!destinationOrNext) {
  34434. this.destination = Observer_1.empty;
  34435. break;
  34436. }
  34437. if (typeof destinationOrNext === 'object') {
  34438. // HACK(benlesh): To resolve an issue where Node users may have multiple
  34439. // copies of rxjs in their node_modules directory.
  34440. if (isTrustedSubscriber(destinationOrNext)) {
  34441. var trustedSubscriber = destinationOrNext[rxSubscriber_1.rxSubscriber]();
  34442. this.syncErrorThrowable = trustedSubscriber.syncErrorThrowable;
  34443. this.destination = trustedSubscriber;
  34444. trustedSubscriber.add(this);
  34445. }
  34446. else {
  34447. this.syncErrorThrowable = true;
  34448. this.destination = new SafeSubscriber(this, destinationOrNext);
  34449. }
  34450. break;
  34451. }
  34452. default:
  34453. this.syncErrorThrowable = true;
  34454. this.destination = new SafeSubscriber(this, destinationOrNext, error, complete);
  34455. break;
  34456. }
  34457. }
  34458. Subscriber.prototype[rxSubscriber_1.rxSubscriber] = function () { return this; };
  34459. /**
  34460. * A static factory for a Subscriber, given a (potentially partial) definition
  34461. * of an Observer.
  34462. * @param {function(x: ?T): void} [next] The `next` callback of an Observer.
  34463. * @param {function(e: ?any): void} [error] The `error` callback of an
  34464. * Observer.
  34465. * @param {function(): void} [complete] The `complete` callback of an
  34466. * Observer.
  34467. * @return {Subscriber<T>} A Subscriber wrapping the (partially defined)
  34468. * Observer represented by the given arguments.
  34469. */
  34470. Subscriber.create = function (next, error, complete) {
  34471. var subscriber = new Subscriber(next, error, complete);
  34472. subscriber.syncErrorThrowable = false;
  34473. return subscriber;
  34474. };
  34475. /**
  34476. * The {@link Observer} callback to receive notifications of type `next` from
  34477. * the Observable, with a value. The Observable may call this method 0 or more
  34478. * times.
  34479. * @param {T} [value] The `next` value.
  34480. * @return {void}
  34481. */
  34482. Subscriber.prototype.next = function (value) {
  34483. if (!this.isStopped) {
  34484. this._next(value);
  34485. }
  34486. };
  34487. /**
  34488. * The {@link Observer} callback to receive notifications of type `error` from
  34489. * the Observable, with an attached {@link Error}. Notifies the Observer that
  34490. * the Observable has experienced an error condition.
  34491. * @param {any} [err] The `error` exception.
  34492. * @return {void}
  34493. */
  34494. Subscriber.prototype.error = function (err) {
  34495. if (!this.isStopped) {
  34496. this.isStopped = true;
  34497. this._error(err);
  34498. }
  34499. };
  34500. /**
  34501. * The {@link Observer} callback to receive a valueless notification of type
  34502. * `complete` from the Observable. Notifies the Observer that the Observable
  34503. * has finished sending push-based notifications.
  34504. * @return {void}
  34505. */
  34506. Subscriber.prototype.complete = function () {
  34507. if (!this.isStopped) {
  34508. this.isStopped = true;
  34509. this._complete();
  34510. }
  34511. };
  34512. Subscriber.prototype.unsubscribe = function () {
  34513. if (this.closed) {
  34514. return;
  34515. }
  34516. this.isStopped = true;
  34517. _super.prototype.unsubscribe.call(this);
  34518. };
  34519. Subscriber.prototype._next = function (value) {
  34520. this.destination.next(value);
  34521. };
  34522. Subscriber.prototype._error = function (err) {
  34523. this.destination.error(err);
  34524. this.unsubscribe();
  34525. };
  34526. Subscriber.prototype._complete = function () {
  34527. this.destination.complete();
  34528. this.unsubscribe();
  34529. };
  34530. /** @deprecated internal use only */ Subscriber.prototype._unsubscribeAndRecycle = function () {
  34531. var _a = this, _parent = _a._parent, _parents = _a._parents;
  34532. this._parent = null;
  34533. this._parents = null;
  34534. this.unsubscribe();
  34535. this.closed = false;
  34536. this.isStopped = false;
  34537. this._parent = _parent;
  34538. this._parents = _parents;
  34539. return this;
  34540. };
  34541. return Subscriber;
  34542. }(Subscription_1.Subscription));
  34543. exports.Subscriber = Subscriber;
  34544. /**
  34545. * We need this JSDoc comment for affecting ESDoc.
  34546. * @ignore
  34547. * @extends {Ignored}
  34548. */
  34549. var SafeSubscriber = (function (_super) {
  34550. __extends(SafeSubscriber, _super);
  34551. function SafeSubscriber(_parentSubscriber, observerOrNext, error, complete) {
  34552. _super.call(this);
  34553. this._parentSubscriber = _parentSubscriber;
  34554. var next;
  34555. var context = this;
  34556. if (isFunction_1.isFunction(observerOrNext)) {
  34557. next = observerOrNext;
  34558. }
  34559. else if (observerOrNext) {
  34560. next = observerOrNext.next;
  34561. error = observerOrNext.error;
  34562. complete = observerOrNext.complete;
  34563. if (observerOrNext !== Observer_1.empty) {
  34564. context = Object.create(observerOrNext);
  34565. if (isFunction_1.isFunction(context.unsubscribe)) {
  34566. this.add(context.unsubscribe.bind(context));
  34567. }
  34568. context.unsubscribe = this.unsubscribe.bind(this);
  34569. }
  34570. }
  34571. this._context = context;
  34572. this._next = next;
  34573. this._error = error;
  34574. this._complete = complete;
  34575. }
  34576. SafeSubscriber.prototype.next = function (value) {
  34577. if (!this.isStopped && this._next) {
  34578. var _parentSubscriber = this._parentSubscriber;
  34579. if (!_parentSubscriber.syncErrorThrowable) {
  34580. this.__tryOrUnsub(this._next, value);
  34581. }
  34582. else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) {
  34583. this.unsubscribe();
  34584. }
  34585. }
  34586. };
  34587. SafeSubscriber.prototype.error = function (err) {
  34588. if (!this.isStopped) {
  34589. var _parentSubscriber = this._parentSubscriber;
  34590. if (this._error) {
  34591. if (!_parentSubscriber.syncErrorThrowable) {
  34592. this.__tryOrUnsub(this._error, err);
  34593. this.unsubscribe();
  34594. }
  34595. else {
  34596. this.__tryOrSetError(_parentSubscriber, this._error, err);
  34597. this.unsubscribe();
  34598. }
  34599. }
  34600. else if (!_parentSubscriber.syncErrorThrowable) {
  34601. this.unsubscribe();
  34602. throw err;
  34603. }
  34604. else {
  34605. _parentSubscriber.syncErrorValue = err;
  34606. _parentSubscriber.syncErrorThrown = true;
  34607. this.unsubscribe();
  34608. }
  34609. }
  34610. };
  34611. SafeSubscriber.prototype.complete = function () {
  34612. var _this = this;
  34613. if (!this.isStopped) {
  34614. var _parentSubscriber = this._parentSubscriber;
  34615. if (this._complete) {
  34616. var wrappedComplete = function () { return _this._complete.call(_this._context); };
  34617. if (!_parentSubscriber.syncErrorThrowable) {
  34618. this.__tryOrUnsub(wrappedComplete);
  34619. this.unsubscribe();
  34620. }
  34621. else {
  34622. this.__tryOrSetError(_parentSubscriber, wrappedComplete);
  34623. this.unsubscribe();
  34624. }
  34625. }
  34626. else {
  34627. this.unsubscribe();
  34628. }
  34629. }
  34630. };
  34631. SafeSubscriber.prototype.__tryOrUnsub = function (fn, value) {
  34632. try {
  34633. fn.call(this._context, value);
  34634. }
  34635. catch (err) {
  34636. this.unsubscribe();
  34637. throw err;
  34638. }
  34639. };
  34640. SafeSubscriber.prototype.__tryOrSetError = function (parent, fn, value) {
  34641. try {
  34642. fn.call(this._context, value);
  34643. }
  34644. catch (err) {
  34645. parent.syncErrorValue = err;
  34646. parent.syncErrorThrown = true;
  34647. return true;
  34648. }
  34649. return false;
  34650. };
  34651. /** @deprecated internal use only */ SafeSubscriber.prototype._unsubscribe = function () {
  34652. var _parentSubscriber = this._parentSubscriber;
  34653. this._context = null;
  34654. this._parentSubscriber = null;
  34655. _parentSubscriber.unsubscribe();
  34656. };
  34657. return SafeSubscriber;
  34658. }(Subscriber));
  34659. function isTrustedSubscriber(obj) {
  34660. return obj instanceof Subscriber || ('syncErrorThrowable' in obj && obj[rxSubscriber_1.rxSubscriber]);
  34661. }
  34662. //# sourceMappingURL=Subscriber.js.map
  34663. /***/ }),
  34664. /* 21 */
  34665. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  34666. "use strict";
  34667. /* harmony export (immutable) */ __webpack_exports__["j"] = getComponent;
  34668. /* unused harmony export convertToView */
  34669. /* harmony export (immutable) */ __webpack_exports__["i"] = convertToViews;
  34670. /* harmony export (immutable) */ __webpack_exports__["n"] = setZIndex;
  34671. /* harmony export (immutable) */ __webpack_exports__["m"] = isTabs;
  34672. /* harmony export (immutable) */ __webpack_exports__["l"] = isTab;
  34673. /* harmony export (immutable) */ __webpack_exports__["k"] = isNav;
  34674. /* unused harmony export linkToSegment */
  34675. /* unused harmony export DeepLinkMetadata */
  34676. /* unused harmony export DeepLinkMetadataFactory */
  34677. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return STATE_NEW; });
  34678. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return STATE_INITIALIZED; });
  34679. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return STATE_ATTACHED; });
  34680. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return STATE_DESTROYED; });
  34681. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return INIT_ZINDEX; });
  34682. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DIRECTION_BACK; });
  34683. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return DIRECTION_FORWARD; });
  34684. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return DIRECTION_SWITCH; });
  34685. /* unused harmony export NAV */
  34686. /* unused harmony export TABS */
  34687. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_util__ = __webpack_require__(2);
  34688. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__view_controller__ = __webpack_require__(5);
  34689. function getComponent(linker, nameOrPageOrView, params) {
  34690. if (typeof nameOrPageOrView === 'function') {
  34691. return Promise.resolve(new __WEBPACK_IMPORTED_MODULE_1__view_controller__["a" /* ViewController */](nameOrPageOrView, params));
  34692. }
  34693. if (typeof nameOrPageOrView === 'string') {
  34694. return linker.getComponentFromName(nameOrPageOrView).then(function (component) {
  34695. var vc = new __WEBPACK_IMPORTED_MODULE_1__view_controller__["a" /* ViewController */](component, params);
  34696. vc.id = nameOrPageOrView;
  34697. return vc;
  34698. });
  34699. }
  34700. return Promise.resolve(null);
  34701. }
  34702. function convertToView(linker, nameOrPageOrView, params) {
  34703. if (nameOrPageOrView) {
  34704. if (Object(__WEBPACK_IMPORTED_MODULE_1__view_controller__["b" /* isViewController */])(nameOrPageOrView)) {
  34705. // is already a ViewController
  34706. return Promise.resolve(nameOrPageOrView);
  34707. }
  34708. return getComponent(linker, nameOrPageOrView, params);
  34709. }
  34710. return Promise.resolve(null);
  34711. }
  34712. function convertToViews(linker, pages) {
  34713. var views = [];
  34714. if (Object(__WEBPACK_IMPORTED_MODULE_0__util_util__["e" /* isArray */])(pages)) {
  34715. for (var i = 0; i < pages.length; i++) {
  34716. var page = pages[i];
  34717. if (page) {
  34718. if (Object(__WEBPACK_IMPORTED_MODULE_1__view_controller__["b" /* isViewController */])(page)) {
  34719. views.push(page);
  34720. }
  34721. else if (page.page) {
  34722. views.push(convertToView(linker, page.page, page.params));
  34723. }
  34724. else {
  34725. views.push(convertToView(linker, page, null));
  34726. }
  34727. }
  34728. }
  34729. }
  34730. return Promise.all(views);
  34731. }
  34732. var portalZindex = 9999;
  34733. function setZIndex(nav, enteringView, leavingView, direction, renderer) {
  34734. if (enteringView) {
  34735. if (nav._isPortal) {
  34736. if (direction === DIRECTION_FORWARD) {
  34737. enteringView._setZIndex(nav._zIndexOffset + portalZindex, renderer);
  34738. }
  34739. portalZindex++;
  34740. return;
  34741. }
  34742. leavingView = leavingView || nav.getPrevious(enteringView);
  34743. if (leavingView && Object(__WEBPACK_IMPORTED_MODULE_0__util_util__["l" /* isPresent */])(leavingView._zIndex)) {
  34744. if (direction === DIRECTION_BACK) {
  34745. enteringView._setZIndex(leavingView._zIndex - 1, renderer);
  34746. }
  34747. else {
  34748. enteringView._setZIndex(leavingView._zIndex + 1, renderer);
  34749. }
  34750. }
  34751. else {
  34752. enteringView._setZIndex(INIT_ZINDEX + nav._zIndexOffset, renderer);
  34753. }
  34754. }
  34755. }
  34756. function isTabs(nav) {
  34757. // Tabs (ion-tabs)
  34758. return !!nav && !!nav.getSelected;
  34759. }
  34760. function isTab(nav) {
  34761. // Tab (ion-tab)
  34762. return !!nav && Object(__WEBPACK_IMPORTED_MODULE_0__util_util__["l" /* isPresent */])(nav._tabId);
  34763. }
  34764. function isNav(nav) {
  34765. // Nav (ion-nav), Tab (ion-tab), Portal (ion-portal)
  34766. return !!nav && !!nav.push && nav.getType() === 'nav';
  34767. }
  34768. function linkToSegment(navId, type, secondaryId, link) {
  34769. var segment = Object.assign({}, link);
  34770. segment.navId = navId;
  34771. segment.type = type;
  34772. segment.secondaryId = secondaryId;
  34773. return segment;
  34774. }
  34775. /**
  34776. * @hidden
  34777. */
  34778. var DeepLinkMetadata = (function () {
  34779. function DeepLinkMetadata() {
  34780. }
  34781. return DeepLinkMetadata;
  34782. }());
  34783. /**
  34784. * @hidden
  34785. */
  34786. var DeepLinkMetadataFactory;
  34787. var STATE_NEW = 1;
  34788. var STATE_INITIALIZED = 2;
  34789. var STATE_ATTACHED = 3;
  34790. var STATE_DESTROYED = 4;
  34791. var INIT_ZINDEX = 100;
  34792. var DIRECTION_BACK = 'back';
  34793. var DIRECTION_FORWARD = 'forward';
  34794. var DIRECTION_SWITCH = 'switch';
  34795. var NAV = 'nav';
  34796. var TABS = 'tabs';
  34797. //# sourceMappingURL=nav-util.js.map
  34798. /***/ }),
  34799. /* 22 */
  34800. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  34801. "use strict";
  34802. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return NavController; });
  34803. /**
  34804. * @name NavController
  34805. * @description
  34806. *
  34807. * NavController is the base class for navigation controller components like
  34808. * [`Nav`](../../components/nav/Nav/) and [`Tab`](../../components/tabs/Tab/). You use navigation controllers
  34809. * to navigate to [pages](#view-creation) in your app. At a basic level, a
  34810. * navigation controller is an array of pages representing a particular history
  34811. * (of a Tab for example). This array can be manipulated to navigate throughout
  34812. * an app by pushing and popping pages or inserting and removing them at
  34813. * arbitrary locations in history.
  34814. *
  34815. * The current page is the last one in the array, or the top of the stack if we
  34816. * think of it that way. [Pushing](#push) a new page onto the top of the
  34817. * navigation stack causes the new page to be animated in, while [popping](#pop)
  34818. * the current page will navigate to the previous page in the stack.
  34819. *
  34820. * Unless you are using a directive like [NavPush](../../components/nav/NavPush/), or need a
  34821. * specific NavController, most times you will inject and use a reference to the
  34822. * nearest NavController to manipulate the navigation stack.
  34823. *
  34824. * ## Basic usage
  34825. * The simplest way to navigate through an app is to create and initialize a new
  34826. * nav controller using the `<ion-nav>` component. `ion-nav` extends the `NavController`
  34827. * class.
  34828. *
  34829. * ```typescript
  34830. * import { Component } from `@angular/core`;
  34831. * import { StartPage } from './start-page';
  34832. *
  34833. * @Component(
  34834. * template: `<ion-nav [root]="rootPage"></ion-nav>`
  34835. * })
  34836. * class MyApp {
  34837. * // set the rootPage to the first page we want displayed
  34838. * public rootPage: any = StartPage;
  34839. *
  34840. * constructor(){
  34841. * }
  34842. * }
  34843. *
  34844. * ```
  34845. *
  34846. * ### Injecting NavController
  34847. * Injecting NavController will always get you an instance of the nearest
  34848. * NavController, regardless of whether it is a Tab or a Nav.
  34849. *
  34850. * Behind the scenes, when Ionic instantiates a new NavController, it creates an
  34851. * injector with NavController bound to that instance (usually either a Nav or
  34852. * Tab) and adds the injector to its own providers. For more information on
  34853. * providers and dependency injection, see [Dependency Injection](https://angular.io/docs/ts/latest/guide/dependency-injection.html).
  34854. *
  34855. * Instead, you can inject NavController and know that it is the correct
  34856. * navigation controller for most situations (for more advanced situations, see
  34857. * [Menu](../../menu/Menu/) and [Tab](../../tab/Tab/)).
  34858. *
  34859. * ```ts
  34860. * import { NavController } from 'ionic-angular';
  34861. *
  34862. * class MyComponent {
  34863. * constructor(public navCtrl: NavController) {
  34864. *
  34865. * }
  34866. * }
  34867. * ```
  34868. *
  34869. * ### Navigating from the Root component
  34870. * What if you want to control navigation from your root app component?
  34871. * You can't inject `NavController` because any components that are navigation
  34872. * controllers are _children_ of the root component so they aren't available
  34873. * to be injected.
  34874. *
  34875. * By adding a reference variable to the `ion-nav`, you can use `@ViewChild` to
  34876. * get an instance of the `Nav` component, which is a navigation controller
  34877. * (it extends `NavController`):
  34878. *
  34879. * ```typescript
  34880. *
  34881. * import { Component, ViewChild } from '@angular/core';
  34882. * import { NavController } from 'ionic-angular';
  34883. *
  34884. * @Component({
  34885. * template: '<ion-nav #myNav [root]="rootPage"></ion-nav>'
  34886. * })
  34887. * export class MyApp {
  34888. * @ViewChild('myNav') nav: NavController
  34889. * public rootPage: any = TabsPage;
  34890. *
  34891. * // Wait for the components in MyApp's template to be initialized
  34892. * // In this case, we are waiting for the Nav with reference variable of "#myNav"
  34893. * ngOnInit() {
  34894. * // Let's navigate from TabsPage to Page1
  34895. * this.nav.push(Page1);
  34896. * }
  34897. * }
  34898. * ```
  34899. *
  34900. * ### Navigating from an Overlay Component
  34901. * What if you wanted to navigate from an overlay component (popover, modal, alert, etc)?
  34902. * In this example, we've displayed a popover in our app. From the popover, we'll get a
  34903. * reference of the root `NavController` in our app, using the `getRootNav()` method.
  34904. *
  34905. *
  34906. * ```typescript
  34907. * import { Component } from '@angular/core';
  34908. * import { App, ViewController } from 'ionic-angular';
  34909. *
  34910. * @Component({
  34911. * template: `
  34912. * <ion-content>
  34913. * <h1>My PopoverPage</h1>
  34914. * <button ion-button (click)="pushPage()">Call pushPage</button>
  34915. * </ion-content>
  34916. * `
  34917. * })
  34918. * class PopoverPage {
  34919. * constructor(
  34920. * public viewCtrl: ViewController
  34921. * public appCtrl: App
  34922. * ) {}
  34923. *
  34924. * pushPage() {
  34925. * this.viewCtrl.dismiss();
  34926. * this.appCtrl.getRootNav().push(SecondPage);
  34927. * }
  34928. * }
  34929. *```
  34930. *
  34931. *
  34932. * ## View creation
  34933. * Views are created when they are added to the navigation stack. For methods
  34934. * like [push()](#push), the NavController takes any component class that is
  34935. * decorated with `@Component` as its first argument. The NavController then
  34936. * compiles that component, adds it to the app and animates it into view.
  34937. *
  34938. * By default, pages are cached and left in the DOM if they are navigated away
  34939. * from but still in the navigation stack (the exiting page on a `push()` for
  34940. * example). They are destroyed when removed from the navigation stack (on
  34941. * [pop()](#pop) or [setRoot()](#setRoot)).
  34942. *
  34943. * ## Pushing a View
  34944. * To push a new view onto the navigation stack, use the `push` method.
  34945. * If the page has an [`<ion-navbar>`](../../navbar/Navbar/),
  34946. * a back button will automatically be added to the pushed view.
  34947. *
  34948. * Data can also be passed to a view by passing an object to the `push` method.
  34949. * The pushed view can then receive the data by accessing it via the `NavParams`
  34950. * class.
  34951. *
  34952. * ```typescript
  34953. * import { Component } from '@angular/core';
  34954. * import { NavController } from 'ionic-angular';
  34955. * import { OtherPage } from './other-page';
  34956. * @Component({
  34957. * template: `
  34958. * <ion-header>
  34959. * <ion-navbar>
  34960. * <ion-title>Login</ion-title>
  34961. * </ion-navbar>
  34962. * </ion-header>
  34963. *
  34964. * <ion-content>
  34965. * <button ion-button (click)="pushPage()">
  34966. * Go to OtherPage
  34967. * </button>
  34968. * </ion-content>
  34969. * `
  34970. * })
  34971. * export class StartPage {
  34972. * constructor(public navCtrl: NavController) {
  34973. * }
  34974. *
  34975. * pushPage(){
  34976. * // push another page onto the navigation stack
  34977. * // causing the nav controller to transition to the new page
  34978. * // optional data can also be passed to the pushed page.
  34979. * this.navCtrl.push(OtherPage, {
  34980. * id: "123",
  34981. * name: "Carl"
  34982. * });
  34983. * }
  34984. * }
  34985. *
  34986. * import { NavParams } from 'ionic-angular';
  34987. *
  34988. * @Component({
  34989. * template: `
  34990. * <ion-header>
  34991. * <ion-navbar>
  34992. * <ion-title>Other Page</ion-title>
  34993. * </ion-navbar>
  34994. * </ion-header>
  34995. * <ion-content>I'm the other page!</ion-content>`
  34996. * })
  34997. * class OtherPage {
  34998. * constructor(private navParams: NavParams) {
  34999. * let id = navParams.get('id');
  35000. * let name = navParams.get('name');
  35001. * }
  35002. * }
  35003. * ```
  35004. *
  35005. * ## Removing a view
  35006. * To remove a view from the stack, use the `pop` method.
  35007. * Popping a view will transition to the previous view.
  35008. *
  35009. * ```ts
  35010. * import { Component } from '@angular/core';
  35011. * import { NavController } from 'ionic-angular';
  35012. *
  35013. * @Component({
  35014. * template: `
  35015. * <ion-header>
  35016. * <ion-navbar>
  35017. * <ion-title>Other Page</ion-title>
  35018. * </ion-navbar>
  35019. * </ion-header>
  35020. * <ion-content>I'm the other page!</ion-content>`
  35021. * })
  35022. * class OtherPage {
  35023. * constructor(public navCtrl: NavController ){
  35024. * }
  35025. *
  35026. * popView(){
  35027. * this.navCtrl.pop();
  35028. * }
  35029. * }
  35030. * ```
  35031. *
  35032. * ## Lifecycle events
  35033. * Lifecycle events are fired during various stages of navigation. They can be
  35034. * defined in any component type which is pushed/popped from a `NavController`.
  35035. *
  35036. * ```ts
  35037. * import { Component } from '@angular/core';
  35038. *
  35039. * @Component({
  35040. * template: 'Hello World'
  35041. * })
  35042. * class HelloWorld {
  35043. * ionViewDidLoad() {
  35044. * console.log("I'm alive!");
  35045. * }
  35046. * ionViewWillLeave() {
  35047. * console.log("Looks like I'm about to leave :(");
  35048. * }
  35049. * }
  35050. * ```
  35051. *
  35052. * | Page Event | Returns | Description |
  35053. * |---------------------|-----------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  35054. * | `ionViewDidLoad` | void | Runs when the page has loaded. This event only happens once per page being created. If a page leaves but is cached, then this event will not fire again on a subsequent viewing. The `ionViewDidLoad` event is good place to put your setup code for the page. |
  35055. * | `ionViewWillEnter` | void | Runs when the page is about to enter and become the active page. |
  35056. * | `ionViewDidEnter` | void | Runs when the page has fully entered and is now the active page. This event will fire, whether it was the first load or a cached page. |
  35057. * | `ionViewWillLeave` | void | Runs when the page is about to leave and no longer be the active page. |
  35058. * | `ionViewDidLeave` | void | Runs when the page has finished leaving and is no longer the active page. |
  35059. * | `ionViewWillUnload` | void | Runs when the page is about to be destroyed and have its elements removed. |
  35060. * | `ionViewCanEnter` | boolean/Promise&lt;void&gt; | Runs before the view can enter. This can be used as a sort of "guard" in authenticated views where you need to check permissions before the view can enter |
  35061. * | `ionViewCanLeave` | boolean/Promise&lt;void&gt; | Runs before the view can leave. This can be used as a sort of "guard" in authenticated views where you need to check permissions before the view can leave |
  35062. *
  35063. *
  35064. * ## Nav Guards
  35065. *
  35066. * In some cases, a developer should be able to control views leaving and entering. To allow for this, NavController has the `ionViewCanEnter` and `ionViewCanLeave` methods.
  35067. * Similar to Angular route guards, but are more integrated with NavController. For example, if you wanted to prevent a user from leaving a view:
  35068. *
  35069. * ```ts
  35070. * export class MyClass{
  35071. * constructor(
  35072. * public navCtrl: NavController
  35073. * ){}
  35074. *
  35075. * pushPage(){
  35076. * this.navCtrl.push(DetailPage);
  35077. * }
  35078. *
  35079. * ionViewCanLeave(): boolean{
  35080. * // here we can either return true or false
  35081. * // depending on if we want to leave this view
  35082. * if(isValid(randomValue)){
  35083. * return true;
  35084. * } else {
  35085. * return false;
  35086. * }
  35087. * }
  35088. * }
  35089. * ```
  35090. *
  35091. * We need to make sure that our `navCtrl.push` has a catch in order to catch the and handle the error.
  35092. * If you need to prevent a view from entering, you can do the same thing
  35093. *
  35094. * ```ts
  35095. * export class MyClass{
  35096. * constructor(
  35097. * public navCtrl: NavController
  35098. * ){}
  35099. *
  35100. * pushPage(){
  35101. * this.navCtrl.push(DetailPage);
  35102. * }
  35103. *
  35104. * }
  35105. *
  35106. * export class DetailPage(){
  35107. * constructor(
  35108. * public navCtrl: NavController
  35109. * ){}
  35110. * ionViewCanEnter(): boolean{
  35111. * // here we can either return true or false
  35112. * // depending on if we want to enter this view
  35113. * if(isValid(randomValue)){
  35114. * return true;
  35115. * } else {
  35116. * return false;
  35117. * }
  35118. * }
  35119. * }
  35120. * ```
  35121. *
  35122. * Similar to `ionViewCanLeave` we still need a catch on the original `navCtrl.push` in order to handle it properly.
  35123. * When handling the back button in the `ion-navbar`, the catch is already taken care of for you by the framework.
  35124. *
  35125. * ## NavOptions
  35126. *
  35127. * Some methods on `NavController` allow for customizing the current transition.
  35128. * To do this, we can pass an object with the modified properites.
  35129. *
  35130. *
  35131. * | Property | Value | Description |
  35132. * |-----------|-----------|------------------------------------------------------------------------------------------------------------|
  35133. * | animate | `boolean` | Whether or not the transition should animate. |
  35134. * | animation | `string` | What kind of animation should be used. |
  35135. * | direction | `string` | The conceptual direction the user is navigating. For example, is the user navigating `forward`, or `back`? |
  35136. * | duration | `number` | The length in milliseconds the animation should take. |
  35137. * | easing | `string` | The easing for the animation. |
  35138. *
  35139. * The property 'animation' understands the following values: `md-transition`, `ios-transition` and `wp-transition`.
  35140. *
  35141. * @see {@link /docs/components#navigation Navigation Component Docs}
  35142. */
  35143. var NavController = (function () {
  35144. function NavController() {
  35145. }
  35146. return NavController;
  35147. }());
  35148. //# sourceMappingURL=nav-controller.js.map
  35149. /***/ }),
  35150. /* 23 */
  35151. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  35152. "use strict";
  35153. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return UIEventManager; });
  35154. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__pointer_events__ = __webpack_require__(117);
  35155. /**
  35156. * @hidden
  35157. */
  35158. var UIEventManager = (function () {
  35159. function UIEventManager(plt) {
  35160. this.plt = plt;
  35161. this.evts = [];
  35162. }
  35163. UIEventManager.prototype.pointerEvents = function (config) {
  35164. if (!config.element || !config.pointerDown) {
  35165. console.error('PointerEvents config is invalid');
  35166. return;
  35167. }
  35168. var eventListnerOpts = {
  35169. capture: config.capture,
  35170. passive: config.passive,
  35171. zone: config.zone
  35172. };
  35173. var pointerEvents = new __WEBPACK_IMPORTED_MODULE_0__pointer_events__["b" /* PointerEvents */](this.plt, config.element, config.pointerDown, config.pointerMove, config.pointerUp, eventListnerOpts);
  35174. var removeFunc = function () { return pointerEvents.destroy(); };
  35175. this.evts.push(removeFunc);
  35176. return pointerEvents;
  35177. };
  35178. UIEventManager.prototype.listen = function (ele, eventName, callback, opts) {
  35179. if (ele) {
  35180. var removeFunc = this.plt.registerListener(ele, eventName, callback, opts);
  35181. this.evts.push(removeFunc);
  35182. return removeFunc;
  35183. }
  35184. };
  35185. UIEventManager.prototype.unlistenAll = function () {
  35186. this.evts.forEach(function (unRegEvent) {
  35187. unRegEvent();
  35188. });
  35189. this.evts.length = 0;
  35190. };
  35191. UIEventManager.prototype.destroy = function () {
  35192. this.unlistenAll();
  35193. this.evts = null;
  35194. };
  35195. return UIEventManager;
  35196. }());
  35197. //# sourceMappingURL=ui-event-manager.js.map
  35198. /***/ }),
  35199. /* 24 */
  35200. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  35201. "use strict";
  35202. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return BaseInput; });
  35203. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  35204. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util__ = __webpack_require__(2);
  35205. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__components_ion__ = __webpack_require__(4);
  35206. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__debouncer__ = __webpack_require__(128);
  35207. var __extends = (this && this.__extends) || (function () {
  35208. var extendStatics = Object.setPrototypeOf ||
  35209. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  35210. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  35211. return function (d, b) {
  35212. extendStatics(d, b);
  35213. function __() { this.constructor = d; }
  35214. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  35215. };
  35216. })();
  35217. var BaseInput = (function (_super) {
  35218. __extends(BaseInput, _super);
  35219. function BaseInput(config, elementRef, renderer, name, _defaultValue, _form, _item, _ngControl) {
  35220. var _this = _super.call(this, config, elementRef, renderer, name) || this;
  35221. _this._defaultValue = _defaultValue;
  35222. _this._form = _form;
  35223. _this._item = _item;
  35224. _this._ngControl = _ngControl;
  35225. _this._isFocus = false;
  35226. _this._disabled = false;
  35227. _this._debouncer = new __WEBPACK_IMPORTED_MODULE_3__debouncer__["a" /* TimeoutDebouncer */](0);
  35228. _this._init = false;
  35229. _this._initModel = false;
  35230. /**
  35231. * @output {Range} Emitted when the range selector drag starts.
  35232. */
  35233. _this.ionFocus = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  35234. /**
  35235. * @output {Range} Emitted when the range value changes.
  35236. */
  35237. _this.ionChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  35238. /**
  35239. * @output {Range} Emitted when the range selector drag ends.
  35240. */
  35241. _this.ionBlur = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  35242. _form && _form.register(_this);
  35243. _this._value = Object(__WEBPACK_IMPORTED_MODULE_1__util__["b" /* deepCopy */])(_this._defaultValue);
  35244. if (_item) {
  35245. (void 0) /* assert */;
  35246. _this.id = name + '-' + _item.registerInput(name);
  35247. _this._labelId = _item.labelId;
  35248. _this._item.setElementClass('item-' + name, true);
  35249. }
  35250. // If the user passed a ngControl we need to set the valueAccessor
  35251. if (_ngControl) {
  35252. _ngControl.valueAccessor = _this;
  35253. }
  35254. return _this;
  35255. }
  35256. Object.defineProperty(BaseInput.prototype, "disabled", {
  35257. /**
  35258. * @input {boolean} If true, the user cannot interact with this element.
  35259. */
  35260. get: function () {
  35261. return this._disabled;
  35262. },
  35263. set: function (val) {
  35264. this.setDisabledState(val);
  35265. },
  35266. enumerable: true,
  35267. configurable: true
  35268. });
  35269. Object.defineProperty(BaseInput.prototype, "value", {
  35270. get: function () {
  35271. return this._value;
  35272. },
  35273. set: function (val) {
  35274. if (this._writeValue(val)) {
  35275. this.onChange();
  35276. this._fireIonChange();
  35277. }
  35278. },
  35279. enumerable: true,
  35280. configurable: true
  35281. });
  35282. // 1. Updates the value
  35283. // 2. Calls _inputUpdated()
  35284. // 3. Dispatch onChange events
  35285. BaseInput.prototype.setValue = function (val) {
  35286. this.value = val;
  35287. };
  35288. /**
  35289. * @hidden
  35290. */
  35291. BaseInput.prototype.setDisabledState = function (isDisabled) {
  35292. this._disabled = isDisabled = Object(__WEBPACK_IMPORTED_MODULE_1__util__["o" /* isTrueProperty */])(isDisabled);
  35293. this._item && this._item.setElementClass("item-" + this._componentName + "-disabled", isDisabled);
  35294. };
  35295. /**
  35296. * @hidden
  35297. */
  35298. BaseInput.prototype.writeValue = function (val) {
  35299. if (this._writeValue(val)) {
  35300. if (this._initModel) {
  35301. this._fireIonChange();
  35302. }
  35303. else if (this._init) {
  35304. // ngModel fires the first time too late, we need to skip the first ngModel update
  35305. this._initModel = true;
  35306. }
  35307. }
  35308. };
  35309. /**
  35310. * @hidden
  35311. */
  35312. BaseInput.prototype._writeValue = function (val) {
  35313. (void 0) /* assert */;
  35314. if (Object(__WEBPACK_IMPORTED_MODULE_1__util__["p" /* isUndefined */])(val)) {
  35315. return false;
  35316. }
  35317. var normalized = (val === null)
  35318. ? Object(__WEBPACK_IMPORTED_MODULE_1__util__["b" /* deepCopy */])(this._defaultValue)
  35319. : this._inputNormalize(val);
  35320. var notUpdate = Object(__WEBPACK_IMPORTED_MODULE_1__util__["p" /* isUndefined */])(normalized) || !this._inputShouldChange(normalized);
  35321. if (notUpdate) {
  35322. return false;
  35323. }
  35324. (void 0) /* console.debug */;
  35325. this._value = normalized;
  35326. if (this._init) {
  35327. this._inputUpdated();
  35328. }
  35329. return true;
  35330. };
  35331. /**
  35332. * @hidden
  35333. */
  35334. BaseInput.prototype._fireIonChange = function () {
  35335. var _this = this;
  35336. if (this._init) {
  35337. this._debouncer.debounce(function () {
  35338. (void 0) /* assert */;
  35339. _this.ionChange.emit(_this._inputChangeEvent());
  35340. _this._initModel = true;
  35341. });
  35342. }
  35343. };
  35344. /**
  35345. * @hidden
  35346. */
  35347. BaseInput.prototype.registerOnChange = function (fn) {
  35348. this._onChanged = fn;
  35349. };
  35350. /**
  35351. * @hidden
  35352. */
  35353. BaseInput.prototype.registerOnTouched = function (fn) {
  35354. this._onTouched = fn;
  35355. };
  35356. /**
  35357. * @hidden
  35358. */
  35359. BaseInput.prototype._initialize = function () {
  35360. if (this._init) {
  35361. (void 0) /* assert */;
  35362. return;
  35363. }
  35364. this._init = true;
  35365. if (Object(__WEBPACK_IMPORTED_MODULE_1__util__["l" /* isPresent */])(this._value)) {
  35366. this._inputUpdated();
  35367. }
  35368. };
  35369. /**
  35370. * @hidden
  35371. */
  35372. BaseInput.prototype._fireFocus = function () {
  35373. if (this._isFocus) {
  35374. return;
  35375. }
  35376. (void 0) /* console.debug */;
  35377. this._form && this._form.setAsFocused(this);
  35378. this._setFocus(true);
  35379. this.ionFocus.emit(this);
  35380. };
  35381. /**
  35382. * @hidden
  35383. */
  35384. BaseInput.prototype._fireBlur = function () {
  35385. if (!this._isFocus) {
  35386. return;
  35387. }
  35388. (void 0) /* console.debug */;
  35389. this._form && this._form.unsetAsFocused(this);
  35390. this._setFocus(false);
  35391. this._fireTouched();
  35392. this.ionBlur.emit(this);
  35393. };
  35394. /**
  35395. * @hidden
  35396. */
  35397. BaseInput.prototype._fireTouched = function () {
  35398. this._onTouched && this._onTouched();
  35399. };
  35400. /**
  35401. * @hidden
  35402. */
  35403. BaseInput.prototype._setFocus = function (isFocused) {
  35404. (void 0) /* assert */;
  35405. (void 0) /* assert */;
  35406. (void 0) /* assert */;
  35407. this._isFocus = isFocused;
  35408. var item = this._item;
  35409. if (item) {
  35410. item.setElementClass('input-has-focus', isFocused);
  35411. item.setElementClass('item-input-has-focus', isFocused);
  35412. }
  35413. this._inputUpdated();
  35414. };
  35415. /**
  35416. * @hidden
  35417. */
  35418. BaseInput.prototype.onChange = function () {
  35419. this._onChanged && this._onChanged(this._inputNgModelEvent());
  35420. };
  35421. /**
  35422. * @hidden
  35423. */
  35424. BaseInput.prototype.isFocus = function () {
  35425. return this._isFocus;
  35426. };
  35427. /**
  35428. * @hidden
  35429. */
  35430. BaseInput.prototype.hasValue = function () {
  35431. var val = this._value;
  35432. if (!Object(__WEBPACK_IMPORTED_MODULE_1__util__["l" /* isPresent */])(val)) {
  35433. return false;
  35434. }
  35435. if (Object(__WEBPACK_IMPORTED_MODULE_1__util__["e" /* isArray */])(val) || Object(__WEBPACK_IMPORTED_MODULE_1__util__["n" /* isString */])(val)) {
  35436. return val.length > 0;
  35437. }
  35438. return true;
  35439. };
  35440. /**
  35441. * @hidden
  35442. */
  35443. BaseInput.prototype.focusNext = function () {
  35444. this._form && this._form.tabFocus(this);
  35445. };
  35446. /**
  35447. * @hidden
  35448. */
  35449. BaseInput.prototype.ngOnDestroy = function () {
  35450. (void 0) /* assert */;
  35451. var form = this._form;
  35452. form && form.deregister(this);
  35453. this._init = false;
  35454. };
  35455. /**
  35456. * @hidden
  35457. */
  35458. BaseInput.prototype.ngAfterContentInit = function () {
  35459. this._initialize();
  35460. };
  35461. /**
  35462. * @hidden
  35463. */
  35464. BaseInput.prototype.initFocus = function () {
  35465. var ele = this._elementRef.nativeElement.querySelector('button');
  35466. ele && ele.focus();
  35467. };
  35468. /**
  35469. * @hidden
  35470. */
  35471. BaseInput.prototype._inputNormalize = function (val) {
  35472. return val;
  35473. };
  35474. /**
  35475. * @hidden
  35476. */
  35477. BaseInput.prototype._inputShouldChange = function (val) {
  35478. return this._value !== val;
  35479. };
  35480. /**
  35481. * @hidden
  35482. */
  35483. BaseInput.prototype._inputChangeEvent = function () {
  35484. return this;
  35485. };
  35486. /**
  35487. * @hidden
  35488. */
  35489. BaseInput.prototype._inputNgModelEvent = function () {
  35490. return this._value;
  35491. };
  35492. /**
  35493. * @hidden
  35494. */
  35495. BaseInput.prototype._inputUpdated = function () {
  35496. (void 0) /* assert */;
  35497. var item = this._item;
  35498. if (item) {
  35499. setControlCss(item, this._ngControl);
  35500. // TODO remove all uses of input-has-value in v4
  35501. var hasValue = this.hasValue();
  35502. item.setElementClass('input-has-value', hasValue);
  35503. item.setElementClass('item-input-has-value', hasValue);
  35504. }
  35505. };
  35506. BaseInput.propDecorators = {
  35507. 'ionFocus': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  35508. 'ionChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  35509. 'ionBlur': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  35510. 'disabled': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  35511. };
  35512. return BaseInput;
  35513. }(__WEBPACK_IMPORTED_MODULE_2__components_ion__["a" /* Ion */]));
  35514. function setControlCss(element, control) {
  35515. if (!control) {
  35516. return;
  35517. }
  35518. element.setElementClass('ng-untouched', control.untouched);
  35519. element.setElementClass('ng-touched', control.touched);
  35520. element.setElementClass('ng-pristine', control.pristine);
  35521. element.setElementClass('ng-dirty', control.dirty);
  35522. element.setElementClass('ng-valid', control.valid);
  35523. element.setElementClass('ng-invalid', !control.valid);
  35524. }
  35525. //# sourceMappingURL=base-input.js.map
  35526. /***/ }),
  35527. /* 25 */
  35528. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  35529. "use strict";
  35530. /* harmony export (immutable) */ __webpack_exports__["b"] = __extends;
  35531. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __assign; });
  35532. /* unused harmony export __rest */
  35533. /* unused harmony export __decorate */
  35534. /* unused harmony export __param */
  35535. /* unused harmony export __metadata */
  35536. /* unused harmony export __awaiter */
  35537. /* unused harmony export __generator */
  35538. /* unused harmony export __exportStar */
  35539. /* unused harmony export __values */
  35540. /* unused harmony export __read */
  35541. /* unused harmony export __spread */
  35542. /* unused harmony export __await */
  35543. /* unused harmony export __asyncGenerator */
  35544. /* unused harmony export __asyncDelegator */
  35545. /* unused harmony export __asyncValues */
  35546. /* unused harmony export __makeTemplateObject */
  35547. /* unused harmony export __importStar */
  35548. /* unused harmony export __importDefault */
  35549. /*! *****************************************************************************
  35550. Copyright (c) Microsoft Corporation. All rights reserved.
  35551. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  35552. this file except in compliance with the License. You may obtain a copy of the
  35553. License at http://www.apache.org/licenses/LICENSE-2.0
  35554. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  35555. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  35556. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  35557. MERCHANTABLITY OR NON-INFRINGEMENT.
  35558. See the Apache Version 2.0 License for specific language governing permissions
  35559. and limitations under the License.
  35560. ***************************************************************************** */
  35561. /* global Reflect, Promise */
  35562. var extendStatics = function(d, b) {
  35563. extendStatics = Object.setPrototypeOf ||
  35564. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  35565. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  35566. return extendStatics(d, b);
  35567. };
  35568. function __extends(d, b) {
  35569. extendStatics(d, b);
  35570. function __() { this.constructor = d; }
  35571. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  35572. }
  35573. var __assign = function() {
  35574. __assign = Object.assign || function __assign(t) {
  35575. for (var s, i = 1, n = arguments.length; i < n; i++) {
  35576. s = arguments[i];
  35577. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  35578. }
  35579. return t;
  35580. }
  35581. return __assign.apply(this, arguments);
  35582. }
  35583. function __rest(s, e) {
  35584. var t = {};
  35585. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  35586. t[p] = s[p];
  35587. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  35588. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  35589. t[p[i]] = s[p[i]];
  35590. return t;
  35591. }
  35592. function __decorate(decorators, target, key, desc) {
  35593. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  35594. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  35595. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  35596. return c > 3 && r && Object.defineProperty(target, key, r), r;
  35597. }
  35598. function __param(paramIndex, decorator) {
  35599. return function (target, key) { decorator(target, key, paramIndex); }
  35600. }
  35601. function __metadata(metadataKey, metadataValue) {
  35602. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  35603. }
  35604. function __awaiter(thisArg, _arguments, P, generator) {
  35605. return new (P || (P = Promise))(function (resolve, reject) {
  35606. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  35607. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  35608. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  35609. step((generator = generator.apply(thisArg, _arguments || [])).next());
  35610. });
  35611. }
  35612. function __generator(thisArg, body) {
  35613. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  35614. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  35615. function verb(n) { return function (v) { return step([n, v]); }; }
  35616. function step(op) {
  35617. if (f) throw new TypeError("Generator is already executing.");
  35618. while (_) try {
  35619. if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
  35620. if (y = 0, t) op = [op[0] & 2, t.value];
  35621. switch (op[0]) {
  35622. case 0: case 1: t = op; break;
  35623. case 4: _.label++; return { value: op[1], done: false };
  35624. case 5: _.label++; y = op[1]; op = [0]; continue;
  35625. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  35626. default:
  35627. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  35628. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  35629. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  35630. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  35631. if (t[2]) _.ops.pop();
  35632. _.trys.pop(); continue;
  35633. }
  35634. op = body.call(thisArg, _);
  35635. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  35636. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  35637. }
  35638. }
  35639. function __exportStar(m, exports) {
  35640. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  35641. }
  35642. function __values(o) {
  35643. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  35644. if (m) return m.call(o);
  35645. return {
  35646. next: function () {
  35647. if (o && i >= o.length) o = void 0;
  35648. return { value: o && o[i++], done: !o };
  35649. }
  35650. };
  35651. }
  35652. function __read(o, n) {
  35653. var m = typeof Symbol === "function" && o[Symbol.iterator];
  35654. if (!m) return o;
  35655. var i = m.call(o), r, ar = [], e;
  35656. try {
  35657. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  35658. }
  35659. catch (error) { e = { error: error }; }
  35660. finally {
  35661. try {
  35662. if (r && !r.done && (m = i["return"])) m.call(i);
  35663. }
  35664. finally { if (e) throw e.error; }
  35665. }
  35666. return ar;
  35667. }
  35668. function __spread() {
  35669. for (var ar = [], i = 0; i < arguments.length; i++)
  35670. ar = ar.concat(__read(arguments[i]));
  35671. return ar;
  35672. }
  35673. function __await(v) {
  35674. return this instanceof __await ? (this.v = v, this) : new __await(v);
  35675. }
  35676. function __asyncGenerator(thisArg, _arguments, generator) {
  35677. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  35678. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  35679. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  35680. function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
  35681. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  35682. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  35683. function fulfill(value) { resume("next", value); }
  35684. function reject(value) { resume("throw", value); }
  35685. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  35686. }
  35687. function __asyncDelegator(o) {
  35688. var i, p;
  35689. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  35690. function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
  35691. }
  35692. function __asyncValues(o) {
  35693. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  35694. var m = o[Symbol.asyncIterator], i;
  35695. return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
  35696. function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
  35697. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  35698. }
  35699. function __makeTemplateObject(cooked, raw) {
  35700. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  35701. return cooked;
  35702. };
  35703. function __importStar(mod) {
  35704. if (mod && mod.__esModule) return mod;
  35705. var result = {};
  35706. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  35707. result.default = mod;
  35708. return result;
  35709. }
  35710. function __importDefault(mod) {
  35711. return (mod && mod.__esModule) ? mod : { default: mod };
  35712. }
  35713. /***/ }),
  35714. /* 26 */
  35715. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  35716. "use strict";
  35717. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MenuController; });
  35718. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_util__ = __webpack_require__(2);
  35719. /**
  35720. * @name MenuController
  35721. * @description
  35722. * The MenuController is a provider which makes it easy to control a [Menu](../../Menu/Menu/).
  35723. * Its methods can be used to display the menu, enable the menu, toggle the menu, and more.
  35724. * The controller will grab a reference to the menu by the `side`, `id`, or, if neither
  35725. * of these are passed to it, it will grab the first menu it finds.
  35726. *
  35727. *
  35728. * @usage
  35729. *
  35730. * Add a basic menu component to start with. See the [Menu](../../Menu/Menu/) API docs
  35731. * for more information on adding menu components.
  35732. *
  35733. * ```html
  35734. * <ion-menu [content]="mycontent">
  35735. * <ion-content>
  35736. * <ion-list>
  35737. * ...
  35738. * </ion-list>
  35739. * </ion-content>
  35740. * </ion-menu>
  35741. *
  35742. * <ion-nav #mycontent [root]="rootPage"></ion-nav>
  35743. * ```
  35744. *
  35745. * To call the controller methods, inject the `MenuController` provider
  35746. * into the page. Then, create some methods for opening, closing, and
  35747. * toggling the menu.
  35748. *
  35749. * ```ts
  35750. * import { Component } from '@angular/core';
  35751. * import { MenuController } from 'ionic-angular';
  35752. *
  35753. * @Component({...})
  35754. * export class MyPage {
  35755. *
  35756. * constructor(public menuCtrl: MenuController) {
  35757. *
  35758. * }
  35759. *
  35760. * openMenu() {
  35761. * this.menuCtrl.open();
  35762. * }
  35763. *
  35764. * closeMenu() {
  35765. * this.menuCtrl.close();
  35766. * }
  35767. *
  35768. * toggleMenu() {
  35769. * this.menuCtrl.toggle();
  35770. * }
  35771. *
  35772. * }
  35773. * ```
  35774. *
  35775. * Since only one menu exists, the `MenuController` will grab the
  35776. * correct menu and call the correct method for each.
  35777. *
  35778. *
  35779. * ### Multiple Menus on Different Sides
  35780. *
  35781. * For applications with both a left and right menu, the desired menu can be
  35782. * grabbed by passing the `side` of the menu. If nothing is passed, it will
  35783. * default to the `"left"` menu.
  35784. *
  35785. * ```html
  35786. * <ion-menu side="left" [content]="mycontent">...</ion-menu>
  35787. * <ion-menu side="right" [content]="mycontent">...</ion-menu>
  35788. * <ion-nav #mycontent [root]="rootPage"></ion-nav>
  35789. * ```
  35790. *
  35791. * ```ts
  35792. * toggleLeftMenu() {
  35793. * this.menuCtrl.toggle();
  35794. * }
  35795. *
  35796. * toggleRightMenu() {
  35797. * this.menuCtrl.toggle('right');
  35798. * }
  35799. * ```
  35800. *
  35801. *
  35802. * ### Multiple Menus on the Same Side
  35803. *
  35804. * An application can have multiple menus on the same side. In order to determine
  35805. * the menu to control, an `id` should be passed. In the example below, the menu
  35806. * with the `authenticated` id will be enabled, and the menu with the `unauthenticated`
  35807. * id will be disabled.
  35808. *
  35809. * ```html
  35810. * <ion-menu id="authenticated" side="left" [content]="mycontent">...</ion-menu>
  35811. * <ion-menu id="unauthenticated" side="left" [content]="mycontent">...</ion-menu>
  35812. * <ion-nav #mycontent [root]="rootPage"></ion-nav>
  35813. * ```
  35814. *
  35815. * ```ts
  35816. * enableAuthenticatedMenu() {
  35817. * this.menuCtrl.enable(true, 'authenticated');
  35818. * this.menuCtrl.enable(false, 'unauthenticated');
  35819. * }
  35820. * ```
  35821. *
  35822. * Note: if an app only has one menu, there is no reason to pass an `id`.
  35823. *
  35824. *
  35825. * @demo /docs/demos/src/menu/
  35826. *
  35827. * @see {@link /docs/components#menus Menu Component Docs}
  35828. * @see {@link ../Menu Menu API Docs}
  35829. *
  35830. */
  35831. var MenuController = (function () {
  35832. function MenuController() {
  35833. this._menus = [];
  35834. }
  35835. /**
  35836. * Programatically open the Menu.
  35837. * @param {string} [menuId] Optionally get the menu by its id, or side.
  35838. * @return {Promise} returns a promise when the menu is fully opened
  35839. */
  35840. MenuController.prototype.open = function (menuId) {
  35841. var menu = this.get(menuId);
  35842. if (menu && !this.isAnimating()) {
  35843. var openedMenu = this.getOpen();
  35844. if (openedMenu && menu !== openedMenu) {
  35845. openedMenu.setOpen(false, false);
  35846. }
  35847. return menu.open();
  35848. }
  35849. return Promise.resolve(false);
  35850. };
  35851. /**
  35852. * Programatically close the Menu. If no `menuId` is given as the first
  35853. * argument then it'll close any menu which is open. If a `menuId`
  35854. * is given then it'll close that exact menu.
  35855. * @param {string} [menuId] Optionally get the menu by its id, or side.
  35856. * @return {Promise} returns a promise when the menu is fully closed
  35857. */
  35858. MenuController.prototype.close = function (menuId) {
  35859. var menu;
  35860. if (menuId) {
  35861. // find the menu by its id
  35862. menu = this.get(menuId);
  35863. }
  35864. else {
  35865. // find the menu that is open
  35866. menu = this.getOpen();
  35867. }
  35868. if (menu) {
  35869. // close the menu
  35870. return menu.close();
  35871. }
  35872. return Promise.resolve(false);
  35873. };
  35874. /**
  35875. * Toggle the menu. If it's closed, it will open, and if opened, it
  35876. * will close.
  35877. * @param {string} [menuId] Optionally get the menu by its id, or side.
  35878. * @return {Promise} returns a promise when the menu has been toggled
  35879. */
  35880. MenuController.prototype.toggle = function (menuId) {
  35881. var menu = this.get(menuId);
  35882. if (menu && !this.isAnimating()) {
  35883. var openedMenu = this.getOpen();
  35884. if (openedMenu && menu !== openedMenu) {
  35885. openedMenu.setOpen(false, false);
  35886. }
  35887. return menu.toggle();
  35888. }
  35889. return Promise.resolve(false);
  35890. };
  35891. /**
  35892. * Used to enable or disable a menu. For example, there could be multiple
  35893. * left menus, but only one of them should be able to be opened at the same
  35894. * time. If there are multiple menus on the same side, then enabling one menu
  35895. * will also automatically disable all the others that are on the same side.
  35896. * @param {string} [menuId] Optionally get the menu by its id, or side.
  35897. * @return {Menu} Returns the instance of the menu, which is useful for chaining.
  35898. */
  35899. MenuController.prototype.enable = function (shouldEnable, menuId) {
  35900. var menu = this.get(menuId);
  35901. if (menu) {
  35902. return menu.enable(shouldEnable);
  35903. }
  35904. };
  35905. /**
  35906. * Used to enable or disable the ability to swipe open the menu.
  35907. * @param {boolean} shouldEnable True if it should be swipe-able, false if not.
  35908. * @param {string} [menuId] Optionally get the menu by its id, or side.
  35909. * @return {Menu} Returns the instance of the menu, which is useful for chaining.
  35910. */
  35911. MenuController.prototype.swipeEnable = function (shouldEnable, menuId) {
  35912. var menu = this.get(menuId);
  35913. if (menu) {
  35914. return menu.swipeEnable(shouldEnable);
  35915. }
  35916. };
  35917. /**
  35918. * @param {string} [menuId] Optionally get the menu by its id, or side.
  35919. * @return {boolean} Returns true if the specified menu is currently open, otherwise false.
  35920. * If the menuId is not specified, it returns true if ANY menu is currenly open.
  35921. */
  35922. MenuController.prototype.isOpen = function (menuId) {
  35923. if (menuId) {
  35924. var menu = this.get(menuId);
  35925. return menu && menu.isOpen || false;
  35926. }
  35927. else {
  35928. return !!this.getOpen();
  35929. }
  35930. };
  35931. /**
  35932. * @param {string} [menuId] Optionally get the menu by its id, or side.
  35933. * @return {boolean} Returns true if the menu is currently enabled, otherwise false.
  35934. */
  35935. MenuController.prototype.isEnabled = function (menuId) {
  35936. var menu = this.get(menuId);
  35937. return menu && menu.enabled || false;
  35938. };
  35939. /**
  35940. * Used to get a menu instance. If a `menuId` is not provided then it'll
  35941. * return the first menu found. If a `menuId` is `left` or `right`, then
  35942. * it'll return the enabled menu on that side. Otherwise, if a `menuId` is
  35943. * provided, then it'll try to find the menu using the menu's `id`
  35944. * property. If a menu is not found then it'll return `null`.
  35945. * @param {string} [menuId] Optionally get the menu by its id, or side.
  35946. * @return {Menu} Returns the instance of the menu if found, otherwise `null`.
  35947. */
  35948. MenuController.prototype.get = function (menuId) {
  35949. var menu;
  35950. if (menuId === 'left' || menuId === 'right') {
  35951. // there could be more than one menu on the same side
  35952. // so first try to get the enabled one
  35953. menu = this._menus.find(function (m) { return m.side === menuId && m.enabled; });
  35954. if (menu) {
  35955. return menu;
  35956. }
  35957. // didn't find a menu side that is enabled
  35958. // so try to get the first menu side found
  35959. return this._menus.find(function (m) { return m.side === menuId; }) || null;
  35960. }
  35961. else if (menuId) {
  35962. // the menuId was not left or right
  35963. // so try to get the menu by its "id"
  35964. return this._menus.find(function (m) { return m.id === menuId; }) || null;
  35965. }
  35966. // return the first enabled menu
  35967. menu = this._menus.find(function (m) { return m.enabled; });
  35968. if (menu) {
  35969. return menu;
  35970. }
  35971. // get the first menu in the array, if one exists
  35972. return (this._menus.length ? this._menus[0] : null);
  35973. };
  35974. /**
  35975. * @return {Menu} Returns the instance of the menu already opened, otherwise `null`.
  35976. */
  35977. MenuController.prototype.getOpen = function () {
  35978. return this._menus.find(function (m) { return m.isOpen; });
  35979. };
  35980. /**
  35981. * @return {Array<Menu>} Returns an array of all menu instances.
  35982. */
  35983. MenuController.prototype.getMenus = function () {
  35984. return this._menus;
  35985. };
  35986. /**
  35987. * @hidden
  35988. * @return {boolean} if any menu is currently animating
  35989. */
  35990. MenuController.prototype.isAnimating = function () {
  35991. return this._menus.some(function (menu) { return menu.isAnimating(); });
  35992. };
  35993. /**
  35994. * @hidden
  35995. */
  35996. MenuController.prototype._register = function (menu) {
  35997. (void 0) /* assert */;
  35998. this._menus.push(menu);
  35999. };
  36000. /**
  36001. * @hidden
  36002. */
  36003. MenuController.prototype._unregister = function (menu) {
  36004. (void 0) /* assert */;
  36005. Object(__WEBPACK_IMPORTED_MODULE_0__util_util__["q" /* removeArrayItem */])(this._menus, menu);
  36006. };
  36007. /**
  36008. * @hidden
  36009. */
  36010. MenuController.prototype._setActiveMenu = function (menu) {
  36011. (void 0) /* assert */;
  36012. (void 0) /* assert */;
  36013. // if this menu should be enabled
  36014. // then find all the other menus on this same side
  36015. // and automatically disable other same side menus
  36016. var side = menu.side;
  36017. this._menus
  36018. .filter(function (m) { return m.side === side && m !== menu; })
  36019. .map(function (m) { return m.enable(false); });
  36020. };
  36021. /**
  36022. * @hidden
  36023. */
  36024. MenuController.registerType = function (name, cls) {
  36025. menuTypes[name] = cls;
  36026. };
  36027. /**
  36028. * @hidden
  36029. */
  36030. MenuController.create = function (type, menuCmp, plt) {
  36031. return new menuTypes[type](menuCmp, plt);
  36032. };
  36033. return MenuController;
  36034. }());
  36035. var menuTypes = {};
  36036. //# sourceMappingURL=menu-controller.js.map
  36037. /***/ }),
  36038. /* 27 */
  36039. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  36040. "use strict";
  36041. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Transition; });
  36042. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__animations_animation__ = __webpack_require__(11);
  36043. var __extends = (this && this.__extends) || (function () {
  36044. var extendStatics = Object.setPrototypeOf ||
  36045. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  36046. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  36047. return function (d, b) {
  36048. extendStatics(d, b);
  36049. function __() { this.constructor = d; }
  36050. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  36051. };
  36052. })();
  36053. /**
  36054. * @hidden
  36055. *
  36056. * - play
  36057. * - Add before classes - DOM WRITE
  36058. * - Remove before classes - DOM WRITE
  36059. * - Add before inline styles - DOM WRITE
  36060. * - set inline FROM styles - DOM WRITE
  36061. * - RAF
  36062. * - read toolbar dimensions - DOM READ
  36063. * - write content top/bottom padding - DOM WRITE
  36064. * - set css transition duration/easing - DOM WRITE
  36065. * - RAF
  36066. * - set inline TO styles - DOM WRITE
  36067. */
  36068. var Transition = (function (_super) {
  36069. __extends(Transition, _super);
  36070. function Transition(plt, enteringView, leavingView, opts) {
  36071. var _this = _super.call(this, plt, null, opts) || this;
  36072. _this.enteringView = enteringView;
  36073. _this.leavingView = leavingView;
  36074. return _this;
  36075. }
  36076. Transition.prototype.init = function () { };
  36077. Transition.prototype.registerStart = function (trnsStart) {
  36078. this._trnsStart = trnsStart;
  36079. };
  36080. Transition.prototype.start = function () {
  36081. this._trnsStart && this._trnsStart();
  36082. this._trnsStart = null;
  36083. // bubble up start
  36084. this.parent && this.parent.start();
  36085. };
  36086. Transition.prototype.destroy = function () {
  36087. _super.prototype.destroy.call(this);
  36088. this.parent = this.enteringView = this.leavingView = this._trnsStart = null;
  36089. };
  36090. return Transition;
  36091. }(__WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */]));
  36092. //# sourceMappingURL=transition.js.map
  36093. /***/ }),
  36094. /* 28 */
  36095. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  36096. "use strict";
  36097. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_app_app_root__ = __webpack_require__(55);
  36098. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__components_app_app_root__["b"]; });
  36099. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__components_app_menu_controller__ = __webpack_require__(26);
  36100. /* unused harmony reexport MenuController */
  36101. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__components_action_sheet_action_sheet__ = __webpack_require__(57);
  36102. /* unused harmony reexport ActionSheet */
  36103. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__components_action_sheet_action_sheet_controller__ = __webpack_require__(118);
  36104. /* unused harmony reexport ActionSheetController */
  36105. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__components_action_sheet_action_sheet_component__ = __webpack_require__(58);
  36106. /* unused harmony reexport ActionSheetCmp */
  36107. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__components_alert_alert__ = __webpack_require__(59);
  36108. /* unused harmony reexport Alert */
  36109. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__components_alert_alert_controller__ = __webpack_require__(119);
  36110. /* unused harmony reexport AlertController */
  36111. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__components_alert_alert_component__ = __webpack_require__(60);
  36112. /* unused harmony reexport AlertCmp */
  36113. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__components_app_app__ = __webpack_require__(6);
  36114. /* unused harmony reexport App */
  36115. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__components_avatar_avatar__ = __webpack_require__(120);
  36116. /* unused harmony reexport Avatar */
  36117. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__components_backdrop_backdrop__ = __webpack_require__(61);
  36118. /* unused harmony reexport Backdrop */
  36119. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__components_badge_badge__ = __webpack_require__(121);
  36120. /* unused harmony reexport Badge */
  36121. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__components_button_button__ = __webpack_require__(36);
  36122. /* unused harmony reexport Button */
  36123. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__components_card_card__ = __webpack_require__(122);
  36124. /* unused harmony reexport Card */
  36125. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__components_card_card_content__ = __webpack_require__(123);
  36126. /* unused harmony reexport CardContent */
  36127. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__components_card_card_header__ = __webpack_require__(124);
  36128. /* unused harmony reexport CardHeader */
  36129. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__components_card_card_title__ = __webpack_require__(125);
  36130. /* unused harmony reexport CardTitle */
  36131. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__components_checkbox_checkbox__ = __webpack_require__(126);
  36132. /* unused harmony reexport Checkbox */
  36133. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__components_chip_chip__ = __webpack_require__(131);
  36134. /* unused harmony reexport Chip */
  36135. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__components_content_content__ = __webpack_require__(19);
  36136. /* unused harmony reexport Content */
  36137. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__components_datetime_datetime__ = __webpack_require__(132);
  36138. /* unused harmony reexport DateTime */
  36139. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__components_fab_fab__ = __webpack_require__(45);
  36140. /* unused harmony reexport FabButton */
  36141. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__components_fab_fab_container__ = __webpack_require__(134);
  36142. /* unused harmony reexport FabContainer */
  36143. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__components_fab_fab_list__ = __webpack_require__(68);
  36144. /* unused harmony reexport FabList */
  36145. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__components_grid_col__ = __webpack_require__(135);
  36146. /* unused harmony reexport Col */
  36147. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__components_grid_grid__ = __webpack_require__(136);
  36148. /* unused harmony reexport Grid */
  36149. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__components_grid_row__ = __webpack_require__(137);
  36150. /* unused harmony reexport Row */
  36151. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__components_ion__ = __webpack_require__(4);
  36152. /* unused harmony reexport Ion */
  36153. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__components_icon_icon__ = __webpack_require__(62);
  36154. /* unused harmony reexport Icon */
  36155. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__components_img_img__ = __webpack_require__(138);
  36156. /* unused harmony reexport Img */
  36157. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__components_infinite_scroll_infinite_scroll__ = __webpack_require__(69);
  36158. /* unused harmony reexport InfiniteScroll */
  36159. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_31__components_infinite_scroll_infinite_scroll_content__ = __webpack_require__(139);
  36160. /* unused harmony reexport InfiniteScrollContent */
  36161. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_32__components_input_input__ = __webpack_require__(140);
  36162. /* unused harmony reexport TextInput */
  36163. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_33__components_item_item__ = __webpack_require__(17);
  36164. /* unused harmony reexport Item */
  36165. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_34__components_item_item_content__ = __webpack_require__(142);
  36166. /* unused harmony reexport ItemContent */
  36167. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_35__components_item_item_divider__ = __webpack_require__(143);
  36168. /* unused harmony reexport ItemDivider */
  36169. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_36__components_item_item_group__ = __webpack_require__(144);
  36170. /* unused harmony reexport ItemGroup */
  36171. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_37__components_item_item_options__ = __webpack_require__(70);
  36172. /* unused harmony reexport ItemOptions */
  36173. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_38__components_item_item_reorder__ = __webpack_require__(64);
  36174. /* unused harmony reexport ItemReorder */
  36175. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_39__components_item_item_sliding__ = __webpack_require__(145);
  36176. /* unused harmony reexport ItemSliding */
  36177. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_40__components_item_reorder__ = __webpack_require__(146);
  36178. /* unused harmony reexport Reorder */
  36179. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_41__components_label_label__ = __webpack_require__(63);
  36180. /* unused harmony reexport Label */
  36181. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_42__components_list_list__ = __webpack_require__(71);
  36182. /* unused harmony reexport List */
  36183. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_43__components_list_list_header__ = __webpack_require__(72);
  36184. /* unused harmony reexport ListHeader */
  36185. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_44__components_loading_loading__ = __webpack_require__(147);
  36186. /* unused harmony reexport Loading */
  36187. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_45__components_loading_loading_controller__ = __webpack_require__(148);
  36188. /* unused harmony reexport LoadingController */
  36189. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_46__components_loading_loading_component__ = __webpack_require__(73);
  36190. /* unused harmony reexport LoadingCmp */
  36191. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_47__components_menu_menu__ = __webpack_require__(149);
  36192. /* unused harmony reexport Menu */
  36193. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_48__components_menu_menu_close__ = __webpack_require__(150);
  36194. /* unused harmony reexport MenuClose */
  36195. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_49__components_menu_menu_toggle__ = __webpack_require__(151);
  36196. /* unused harmony reexport MenuToggle */
  36197. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_50__components_menu_menu_types__ = __webpack_require__(247);
  36198. /* unused harmony reexport MenuType */
  36199. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_51__components_modal_modal__ = __webpack_require__(153);
  36200. /* unused harmony reexport Modal */
  36201. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_52__components_modal_modal_component__ = __webpack_require__(75);
  36202. /* unused harmony reexport ModalCmp */
  36203. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_53__components_modal_modal_controller__ = __webpack_require__(160);
  36204. /* unused harmony reexport ModalController */
  36205. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_54__components_nav_nav__ = __webpack_require__(74);
  36206. /* unused harmony reexport Nav */
  36207. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_55__components_nav_nav_pop__ = __webpack_require__(77);
  36208. /* unused harmony reexport NavPop */
  36209. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_56__components_nav_nav_pop_anchor__ = __webpack_require__(161);
  36210. /* unused harmony reexport NavPopAnchor */
  36211. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_57__components_nav_nav_push__ = __webpack_require__(78);
  36212. /* unused harmony reexport NavPush */
  36213. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_58__components_nav_nav_push_anchor__ = __webpack_require__(162);
  36214. /* unused harmony reexport NavPushAnchor */
  36215. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_59__components_note_note__ = __webpack_require__(163);
  36216. /* unused harmony reexport Note */
  36217. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_60__components_option_option__ = __webpack_require__(79);
  36218. /* unused harmony reexport Option */
  36219. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_61__components_picker_picker__ = __webpack_require__(133);
  36220. /* unused harmony reexport Picker */
  36221. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_62__components_picker_picker_component__ = __webpack_require__(66);
  36222. /* unused harmony reexport PickerCmp */
  36223. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_63__components_picker_picker_column__ = __webpack_require__(67);
  36224. /* unused harmony reexport PickerColumnCmp */
  36225. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_64__components_picker_picker_controller__ = __webpack_require__(65);
  36226. /* unused harmony reexport PickerController */
  36227. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_65__components_popover_popover__ = __webpack_require__(80);
  36228. /* unused harmony reexport Popover */
  36229. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_66__components_popover_popover_component__ = __webpack_require__(81);
  36230. /* unused harmony reexport PopoverCmp */
  36231. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_67__components_popover_popover_controller__ = __webpack_require__(164);
  36232. /* unused harmony reexport PopoverController */
  36233. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_68__components_radio_radio_button__ = __webpack_require__(165);
  36234. /* unused harmony reexport RadioButton */
  36235. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_69__components_radio_radio_group__ = __webpack_require__(82);
  36236. /* unused harmony reexport RadioGroup */
  36237. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_70__components_range_range__ = __webpack_require__(166);
  36238. /* unused harmony reexport Range */
  36239. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_71__components_range_range_knob__ = __webpack_require__(167);
  36240. /* unused harmony reexport RangeKnob */
  36241. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_72__components_refresher_refresher__ = __webpack_require__(83);
  36242. /* unused harmony reexport Refresher */
  36243. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_73__components_refresher_refresher_content__ = __webpack_require__(168);
  36244. /* unused harmony reexport RefresherContent */
  36245. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_74__components_scroll_scroll__ = __webpack_require__(169);
  36246. /* unused harmony reexport Scroll */
  36247. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_75__components_searchbar_searchbar__ = __webpack_require__(170);
  36248. /* unused harmony reexport Searchbar */
  36249. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_76__components_segment_segment__ = __webpack_require__(171);
  36250. /* unused harmony reexport Segment */
  36251. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_77__components_segment_segment_button__ = __webpack_require__(84);
  36252. /* unused harmony reexport SegmentButton */
  36253. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_78__components_select_select__ = __webpack_require__(172);
  36254. /* unused harmony reexport Select */
  36255. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_79__components_select_select_popover_component__ = __webpack_require__(85);
  36256. /* unused harmony reexport SelectPopover */
  36257. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_80__components_show_hide_when_show_when__ = __webpack_require__(173);
  36258. /* unused harmony reexport ShowWhen */
  36259. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_81__components_show_hide_when_display_when__ = __webpack_require__(86);
  36260. /* unused harmony reexport DisplayWhen */
  36261. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_82__components_show_hide_when_hide_when__ = __webpack_require__(174);
  36262. /* unused harmony reexport HideWhen */
  36263. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_83__components_slides_slide__ = __webpack_require__(175);
  36264. /* unused harmony reexport Slide */
  36265. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_84__components_slides_slides__ = __webpack_require__(87);
  36266. /* unused harmony reexport Slides */
  36267. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_85__components_spinner_spinner__ = __webpack_require__(179);
  36268. /* unused harmony reexport Spinner */
  36269. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_86__components_split_pane_split_pane__ = __webpack_require__(39);
  36270. /* unused harmony reexport SplitPane */
  36271. /* unused harmony reexport RootNode */
  36272. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_87__components_tabs_tab__ = __webpack_require__(180);
  36273. /* unused harmony reexport Tab */
  36274. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_88__components_tabs_tab_button__ = __webpack_require__(181);
  36275. /* unused harmony reexport TabButton */
  36276. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_89__components_tabs_tab_highlight__ = __webpack_require__(93);
  36277. /* unused harmony reexport TabHighlight */
  36278. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_90__components_tabs_tabs__ = __webpack_require__(92);
  36279. /* unused harmony reexport Tabs */
  36280. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_91__components_toast_toast__ = __webpack_require__(182);
  36281. /* unused harmony reexport Toast */
  36282. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_92__components_toast_toast_component__ = __webpack_require__(94);
  36283. /* unused harmony reexport ToastCmp */
  36284. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_93__components_toast_toast_controller__ = __webpack_require__(183);
  36285. /* unused harmony reexport ToastController */
  36286. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_94__components_toggle_toggle__ = __webpack_require__(184);
  36287. /* unused harmony reexport Toggle */
  36288. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_95__components_toolbar_toolbar_footer__ = __webpack_require__(185);
  36289. /* unused harmony reexport Footer */
  36290. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_96__components_toolbar_toolbar_header__ = __webpack_require__(186);
  36291. /* unused harmony reexport Header */
  36292. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_97__components_toolbar_toolbar__ = __webpack_require__(49);
  36293. /* unused harmony reexport Toolbar */
  36294. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_98__components_toolbar_toolbar_item__ = __webpack_require__(187);
  36295. /* unused harmony reexport ToolbarItem */
  36296. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_99__components_toolbar_toolbar_title__ = __webpack_require__(188);
  36297. /* unused harmony reexport ToolbarTitle */
  36298. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_100__components_toolbar_navbar__ = __webpack_require__(40);
  36299. /* unused harmony reexport Navbar */
  36300. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_101__components_thumbnail_thumbnail__ = __webpack_require__(189);
  36301. /* unused harmony reexport Thumbnail */
  36302. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_102__components_typography_typography__ = __webpack_require__(190);
  36303. /* unused harmony reexport Typography */
  36304. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_103__components_virtual_scroll_virtual_footer__ = __webpack_require__(95);
  36305. /* unused harmony reexport VirtualFooter */
  36306. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_104__components_virtual_scroll_virtual_header__ = __webpack_require__(96);
  36307. /* unused harmony reexport VirtualHeader */
  36308. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_105__components_virtual_scroll_virtual_item__ = __webpack_require__(97);
  36309. /* unused harmony reexport VirtualItem */
  36310. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_106__components_virtual_scroll_virtual_scroll__ = __webpack_require__(191);
  36311. /* unused harmony reexport VirtualScroll */
  36312. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_107__config_config__ = __webpack_require__(1);
  36313. /* unused harmony reexport Config */
  36314. /* unused harmony reexport setupConfig */
  36315. /* unused harmony reexport ConfigToken */
  36316. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_108__platform_dom_controller__ = __webpack_require__(8);
  36317. /* unused harmony reexport DomController */
  36318. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_109__platform_platform__ = __webpack_require__(3);
  36319. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return __WEBPACK_IMPORTED_MODULE_109__platform_platform__["a"]; });
  36320. /* unused harmony reexport setupPlatform */
  36321. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_110__tap_click_haptic__ = __webpack_require__(38);
  36322. /* unused harmony reexport Haptic */
  36323. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_111__navigation_deep_linker__ = __webpack_require__(14);
  36324. /* unused harmony reexport DeepLinker */
  36325. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_112__navigation_ionic_page__ = __webpack_require__(264);
  36326. /* unused harmony reexport IonicPage */
  36327. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_113__navigation_nav_controller__ = __webpack_require__(22);
  36328. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return __WEBPACK_IMPORTED_MODULE_113__navigation_nav_controller__["a"]; });
  36329. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_114__navigation_nav_controller_base__ = __webpack_require__(42);
  36330. /* unused harmony reexport NavControllerBase */
  36331. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_115__navigation_nav_params__ = __webpack_require__(13);
  36332. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return __WEBPACK_IMPORTED_MODULE_115__navigation_nav_params__["a"]; });
  36333. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_116__navigation_nav_util__ = __webpack_require__(21);
  36334. /* unused harmony reexport DeepLinkMetadata */
  36335. /* unused harmony reexport DeepLinkMetadataFactory */
  36336. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_117__tap_click_tap_click__ = __webpack_require__(192);
  36337. /* unused harmony reexport TapClick */
  36338. /* unused harmony reexport setupTapClick */
  36339. /* unused harmony reexport isActivatable */
  36340. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_118__navigation_url_serializer__ = __webpack_require__(41);
  36341. /* unused harmony reexport UrlSerializer */
  36342. /* unused harmony reexport DeepLinkConfigToken */
  36343. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_119__navigation_view_controller__ = __webpack_require__(5);
  36344. /* unused harmony reexport ViewController */
  36345. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_120__gestures_pan_gesture__ = __webpack_require__(43);
  36346. /* unused harmony reexport PanGesture */
  36347. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_121__gestures_gesture__ = __webpack_require__(266);
  36348. /* unused harmony reexport Gesture */
  36349. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_122__gestures_slide_edge_gesture__ = __webpack_require__(56);
  36350. /* unused harmony reexport SlideEdgeGesture */
  36351. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_123__gestures_slide_gesture__ = __webpack_require__(116);
  36352. /* unused harmony reexport SlideGesture */
  36353. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_124__gestures_gesture_controller__ = __webpack_require__(7);
  36354. /* unused harmony reexport BLOCK_ALL */
  36355. /* unused harmony reexport GESTURE_GO_BACK_SWIPE */
  36356. /* unused harmony reexport GESTURE_MENU_SWIPE */
  36357. /* unused harmony reexport GESTURE_ITEM_SWIPE */
  36358. /* unused harmony reexport GESTURE_REFRESHER */
  36359. /* unused harmony reexport GESTURE_TOGGLE */
  36360. /* unused harmony reexport GestureController */
  36361. /* unused harmony reexport GestureDelegate */
  36362. /* unused harmony reexport BlockerDelegate */
  36363. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_125__util_events__ = __webpack_require__(195);
  36364. /* unused harmony reexport Events */
  36365. /* unused harmony reexport setupEvents */
  36366. /* unused harmony reexport setupProvideEvents */
  36367. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_126__util_ionic_error_handler__ = __webpack_require__(268);
  36368. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_126__util_ionic_error_handler__["a"]; });
  36369. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_127__platform_keyboard__ = __webpack_require__(37);
  36370. /* unused harmony reexport Keyboard */
  36371. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_128__util_form__ = __webpack_require__(16);
  36372. /* unused harmony reexport Form */
  36373. /* unused harmony reexport IonicFormInput */
  36374. /* unused harmony reexport IonicTapInput */
  36375. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_129__util_util__ = __webpack_require__(2);
  36376. /* unused harmony reexport reorderArray */
  36377. /* unused harmony reexport normalizeURL */
  36378. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_130__animations_animation__ = __webpack_require__(11);
  36379. /* unused harmony reexport Animation */
  36380. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_131__transitions_page_transition__ = __webpack_require__(32);
  36381. /* unused harmony reexport PageTransition */
  36382. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_132__transitions_transition__ = __webpack_require__(27);
  36383. /* unused harmony reexport Transition */
  36384. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_133__platform_platform_registry__ = __webpack_require__(196);
  36385. /* unused harmony reexport PlatformConfigToken */
  36386. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_134__config_mode_registry__ = __webpack_require__(197);
  36387. /* unused harmony reexport registerModeConfigs */
  36388. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_135__gestures_gesture_config__ = __webpack_require__(198);
  36389. /* unused harmony reexport IonicGestureConfig */
  36390. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_136__module__ = __webpack_require__(269);
  36391. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_136__module__["a"]; });
  36392. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_136__module__["b"]; });
  36393. /* unused harmony reexport provideLocationStrategy */
  36394. /**
  36395. * Global Providers
  36396. */
  36397. /**
  36398. * Export Utils
  36399. */
  36400. //# sourceMappingURL=index.js.map
  36401. /***/ }),
  36402. /* 29 */
  36403. /***/ (function(module, exports, __webpack_require__) {
  36404. "use strict";
  36405. /* WEBPACK VAR INJECTION */(function(global) {
  36406. // CommonJS / Node have global context exposed as "global" variable.
  36407. // We don't want to include the whole node.d.ts this this compilation unit so we'll just fake
  36408. // the global "global" var for now.
  36409. var __window = typeof window !== 'undefined' && window;
  36410. var __self = typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' &&
  36411. self instanceof WorkerGlobalScope && self;
  36412. var __global = typeof global !== 'undefined' && global;
  36413. var _root = __window || __global || __self;
  36414. exports.root = _root;
  36415. // Workaround Closure Compiler restriction: The body of a goog.module cannot use throw.
  36416. // This is needed when used with angular/tsickle which inserts a goog.module statement.
  36417. // Wrap in IIFE
  36418. (function () {
  36419. if (!_root) {
  36420. throw new Error('RxJS could not find any global context (window, self, global)');
  36421. }
  36422. })();
  36423. //# sourceMappingURL=root.js.map
  36424. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(103)))
  36425. /***/ }),
  36426. /* 30 */
  36427. /***/ (function(module, exports, __webpack_require__) {
  36428. "use strict";
  36429. var isArray_1 = __webpack_require__(104);
  36430. var isObject_1 = __webpack_require__(105);
  36431. var isFunction_1 = __webpack_require__(50);
  36432. var tryCatch_1 = __webpack_require__(106);
  36433. var errorObject_1 = __webpack_require__(51);
  36434. var UnsubscriptionError_1 = __webpack_require__(207);
  36435. /**
  36436. * Represents a disposable resource, such as the execution of an Observable. A
  36437. * Subscription has one important method, `unsubscribe`, that takes no argument
  36438. * and just disposes the resource held by the subscription.
  36439. *
  36440. * Additionally, subscriptions may be grouped together through the `add()`
  36441. * method, which will attach a child Subscription to the current Subscription.
  36442. * When a Subscription is unsubscribed, all its children (and its grandchildren)
  36443. * will be unsubscribed as well.
  36444. *
  36445. * @class Subscription
  36446. */
  36447. var Subscription = (function () {
  36448. /**
  36449. * @param {function(): void} [unsubscribe] A function describing how to
  36450. * perform the disposal of resources when the `unsubscribe` method is called.
  36451. */
  36452. function Subscription(unsubscribe) {
  36453. /**
  36454. * A flag to indicate whether this Subscription has already been unsubscribed.
  36455. * @type {boolean}
  36456. */
  36457. this.closed = false;
  36458. this._parent = null;
  36459. this._parents = null;
  36460. this._subscriptions = null;
  36461. if (unsubscribe) {
  36462. this._unsubscribe = unsubscribe;
  36463. }
  36464. }
  36465. /**
  36466. * Disposes the resources held by the subscription. May, for instance, cancel
  36467. * an ongoing Observable execution or cancel any other type of work that
  36468. * started when the Subscription was created.
  36469. * @return {void}
  36470. */
  36471. Subscription.prototype.unsubscribe = function () {
  36472. var hasErrors = false;
  36473. var errors;
  36474. if (this.closed) {
  36475. return;
  36476. }
  36477. var _a = this, _parent = _a._parent, _parents = _a._parents, _unsubscribe = _a._unsubscribe, _subscriptions = _a._subscriptions;
  36478. this.closed = true;
  36479. this._parent = null;
  36480. this._parents = null;
  36481. // null out _subscriptions first so any child subscriptions that attempt
  36482. // to remove themselves from this subscription will noop
  36483. this._subscriptions = null;
  36484. var index = -1;
  36485. var len = _parents ? _parents.length : 0;
  36486. // if this._parent is null, then so is this._parents, and we
  36487. // don't have to remove ourselves from any parent subscriptions.
  36488. while (_parent) {
  36489. _parent.remove(this);
  36490. // if this._parents is null or index >= len,
  36491. // then _parent is set to null, and the loop exits
  36492. _parent = ++index < len && _parents[index] || null;
  36493. }
  36494. if (isFunction_1.isFunction(_unsubscribe)) {
  36495. var trial = tryCatch_1.tryCatch(_unsubscribe).call(this);
  36496. if (trial === errorObject_1.errorObject) {
  36497. hasErrors = true;
  36498. errors = errors || (errorObject_1.errorObject.e instanceof UnsubscriptionError_1.UnsubscriptionError ?
  36499. flattenUnsubscriptionErrors(errorObject_1.errorObject.e.errors) : [errorObject_1.errorObject.e]);
  36500. }
  36501. }
  36502. if (isArray_1.isArray(_subscriptions)) {
  36503. index = -1;
  36504. len = _subscriptions.length;
  36505. while (++index < len) {
  36506. var sub = _subscriptions[index];
  36507. if (isObject_1.isObject(sub)) {
  36508. var trial = tryCatch_1.tryCatch(sub.unsubscribe).call(sub);
  36509. if (trial === errorObject_1.errorObject) {
  36510. hasErrors = true;
  36511. errors = errors || [];
  36512. var err = errorObject_1.errorObject.e;
  36513. if (err instanceof UnsubscriptionError_1.UnsubscriptionError) {
  36514. errors = errors.concat(flattenUnsubscriptionErrors(err.errors));
  36515. }
  36516. else {
  36517. errors.push(err);
  36518. }
  36519. }
  36520. }
  36521. }
  36522. }
  36523. if (hasErrors) {
  36524. throw new UnsubscriptionError_1.UnsubscriptionError(errors);
  36525. }
  36526. };
  36527. /**
  36528. * Adds a tear down to be called during the unsubscribe() of this
  36529. * Subscription.
  36530. *
  36531. * If the tear down being added is a subscription that is already
  36532. * unsubscribed, is the same reference `add` is being called on, or is
  36533. * `Subscription.EMPTY`, it will not be added.
  36534. *
  36535. * If this subscription is already in an `closed` state, the passed
  36536. * tear down logic will be executed immediately.
  36537. *
  36538. * @param {TeardownLogic} teardown The additional logic to execute on
  36539. * teardown.
  36540. * @return {Subscription} Returns the Subscription used or created to be
  36541. * added to the inner subscriptions list. This Subscription can be used with
  36542. * `remove()` to remove the passed teardown logic from the inner subscriptions
  36543. * list.
  36544. */
  36545. Subscription.prototype.add = function (teardown) {
  36546. if (!teardown || (teardown === Subscription.EMPTY)) {
  36547. return Subscription.EMPTY;
  36548. }
  36549. if (teardown === this) {
  36550. return this;
  36551. }
  36552. var subscription = teardown;
  36553. switch (typeof teardown) {
  36554. case 'function':
  36555. subscription = new Subscription(teardown);
  36556. case 'object':
  36557. if (subscription.closed || typeof subscription.unsubscribe !== 'function') {
  36558. return subscription;
  36559. }
  36560. else if (this.closed) {
  36561. subscription.unsubscribe();
  36562. return subscription;
  36563. }
  36564. else if (typeof subscription._addParent !== 'function' /* quack quack */) {
  36565. var tmp = subscription;
  36566. subscription = new Subscription();
  36567. subscription._subscriptions = [tmp];
  36568. }
  36569. break;
  36570. default:
  36571. throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.');
  36572. }
  36573. var subscriptions = this._subscriptions || (this._subscriptions = []);
  36574. subscriptions.push(subscription);
  36575. subscription._addParent(this);
  36576. return subscription;
  36577. };
  36578. /**
  36579. * Removes a Subscription from the internal list of subscriptions that will
  36580. * unsubscribe during the unsubscribe process of this Subscription.
  36581. * @param {Subscription} subscription The subscription to remove.
  36582. * @return {void}
  36583. */
  36584. Subscription.prototype.remove = function (subscription) {
  36585. var subscriptions = this._subscriptions;
  36586. if (subscriptions) {
  36587. var subscriptionIndex = subscriptions.indexOf(subscription);
  36588. if (subscriptionIndex !== -1) {
  36589. subscriptions.splice(subscriptionIndex, 1);
  36590. }
  36591. }
  36592. };
  36593. Subscription.prototype._addParent = function (parent) {
  36594. var _a = this, _parent = _a._parent, _parents = _a._parents;
  36595. if (!_parent || _parent === parent) {
  36596. // If we don't have a parent, or the new parent is the same as the
  36597. // current parent, then set this._parent to the new parent.
  36598. this._parent = parent;
  36599. }
  36600. else if (!_parents) {
  36601. // If there's already one parent, but not multiple, allocate an Array to
  36602. // store the rest of the parent Subscriptions.
  36603. this._parents = [parent];
  36604. }
  36605. else if (_parents.indexOf(parent) === -1) {
  36606. // Only add the new parent to the _parents list if it's not already there.
  36607. _parents.push(parent);
  36608. }
  36609. };
  36610. Subscription.EMPTY = (function (empty) {
  36611. empty.closed = true;
  36612. return empty;
  36613. }(new Subscription()));
  36614. return Subscription;
  36615. }());
  36616. exports.Subscription = Subscription;
  36617. function flattenUnsubscriptionErrors(errors) {
  36618. return errors.reduce(function (errs, err) { return errs.concat((err instanceof UnsubscriptionError_1.UnsubscriptionError) ? err.errors : err); }, []);
  36619. }
  36620. //# sourceMappingURL=Subscription.js.map
  36621. /***/ }),
  36622. /* 31 */
  36623. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  36624. "use strict";
  36625. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return BrowserModule; });
  36626. /* unused harmony export platformBrowser */
  36627. /* unused harmony export Meta */
  36628. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return Title; });
  36629. /* unused harmony export disableDebugTools */
  36630. /* unused harmony export enableDebugTools */
  36631. /* unused harmony export BrowserTransferStateModule */
  36632. /* unused harmony export TransferState */
  36633. /* unused harmony export makeStateKey */
  36634. /* unused harmony export By */
  36635. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return DOCUMENT$1; });
  36636. /* unused harmony export EVENT_MANAGER_PLUGINS */
  36637. /* unused harmony export EventManager */
  36638. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return HAMMER_GESTURE_CONFIG; });
  36639. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return HammerGestureConfig; });
  36640. /* unused harmony export DomSanitizer */
  36641. /* unused harmony export VERSION */
  36642. /* unused harmony export ɵBROWSER_SANITIZATION_PROVIDERS */
  36643. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return INTERNAL_BROWSER_PLATFORM_PROVIDERS; });
  36644. /* unused harmony export ɵinitDomAdapter */
  36645. /* unused harmony export ɵBrowserDomAdapter */
  36646. /* unused harmony export ɵBrowserPlatformLocation */
  36647. /* unused harmony export ɵTRANSITION_ID */
  36648. /* unused harmony export ɵBrowserGetTestability */
  36649. /* unused harmony export ɵescapeHtml */
  36650. /* unused harmony export ɵELEMENT_PROBE_PROVIDERS */
  36651. /* unused harmony export ɵDomAdapter */
  36652. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return getDOM; });
  36653. /* unused harmony export ɵsetRootDomAdapter */
  36654. /* unused harmony export ɵDomRendererFactory2 */
  36655. /* unused harmony export ɵNAMESPACE_URIS */
  36656. /* unused harmony export ɵflattenStyles */
  36657. /* unused harmony export ɵshimContentAttribute */
  36658. /* unused harmony export ɵshimHostAttribute */
  36659. /* unused harmony export ɵDomEventsPlugin */
  36660. /* unused harmony export ɵHammerGesturesPlugin */
  36661. /* unused harmony export ɵKeyEventsPlugin */
  36662. /* unused harmony export ɵDomSharedStylesHost */
  36663. /* unused harmony export ɵSharedStylesHost */
  36664. /* unused harmony export ɵb */
  36665. /* unused harmony export ɵa */
  36666. /* unused harmony export ɵi */
  36667. /* unused harmony export ɵg */
  36668. /* unused harmony export ɵf */
  36669. /* unused harmony export ɵc */
  36670. /* unused harmony export ɵh */
  36671. /* unused harmony export ɵd */
  36672. /* unused harmony export ɵe */
  36673. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_common__ = __webpack_require__(34);
  36674. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
  36675. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_tslib__ = __webpack_require__(25);
  36676. /**
  36677. * @license Angular v5.2.11
  36678. * (c) 2010-2018 Google, Inc. https://angular.io/
  36679. * License: MIT
  36680. */
  36681. /**
  36682. * @fileoverview added by tsickle
  36683. * @suppress {checkTypes} checked by tsc
  36684. */
  36685. /**
  36686. * @license
  36687. * Copyright Google Inc. All Rights Reserved.
  36688. *
  36689. * Use of this source code is governed by an MIT-style license that can be
  36690. * found in the LICENSE file at https://angular.io/license
  36691. */
  36692. var _DOM = /** @type {?} */ ((null));
  36693. /**
  36694. * @return {?}
  36695. */
  36696. function getDOM() {
  36697. return _DOM;
  36698. }
  36699. /**
  36700. * @param {?} adapter
  36701. * @return {?}
  36702. */
  36703. /**
  36704. * @param {?} adapter
  36705. * @return {?}
  36706. */
  36707. function setRootDomAdapter(adapter) {
  36708. if (!_DOM) {
  36709. _DOM = adapter;
  36710. }
  36711. }
  36712. /**
  36713. * Provides DOM operations in an environment-agnostic way.
  36714. *
  36715. * \@security Tread carefully! Interacting with the DOM directly is dangerous and
  36716. * can introduce XSS risks.
  36717. * @abstract
  36718. */
  36719. var DomAdapter = /** @class */ (function () {
  36720. function DomAdapter() {
  36721. this.resourceLoaderType = /** @type {?} */ ((null));
  36722. }
  36723. Object.defineProperty(DomAdapter.prototype, "attrToPropMap", {
  36724. /**
  36725. * Maps attribute names to their corresponding property names for cases
  36726. * where attribute name doesn't match property name.
  36727. */
  36728. get: /**
  36729. * Maps attribute names to their corresponding property names for cases
  36730. * where attribute name doesn't match property name.
  36731. * @return {?}
  36732. */
  36733. function () { return this._attrToPropMap; },
  36734. set: /**
  36735. * @param {?} value
  36736. * @return {?}
  36737. */
  36738. function (value) { this._attrToPropMap = value; },
  36739. enumerable: true,
  36740. configurable: true
  36741. });
  36742. return DomAdapter;
  36743. }());
  36744. /**
  36745. * @fileoverview added by tsickle
  36746. * @suppress {checkTypes} checked by tsc
  36747. */
  36748. /**
  36749. * @license
  36750. * Copyright Google Inc. All Rights Reserved.
  36751. *
  36752. * Use of this source code is governed by an MIT-style license that can be
  36753. * found in the LICENSE file at https://angular.io/license
  36754. */
  36755. /**
  36756. * Provides DOM operations in any browser environment.
  36757. *
  36758. * \@security Tread carefully! Interacting with the DOM directly is dangerous and
  36759. * can introduce XSS risks.
  36760. * @abstract
  36761. */
  36762. var GenericBrowserDomAdapter = /** @class */ (function (_super) {
  36763. Object(__WEBPACK_IMPORTED_MODULE_2_tslib__["b" /* __extends */])(GenericBrowserDomAdapter, _super);
  36764. function GenericBrowserDomAdapter() {
  36765. var _this = _super.call(this) || this;
  36766. _this._animationPrefix = null;
  36767. _this._transitionEnd = null;
  36768. try {
  36769. var /** @type {?} */ element_1 = _this.createElement('div', document);
  36770. if (_this.getStyle(element_1, 'animationName') != null) {
  36771. _this._animationPrefix = '';
  36772. }
  36773. else {
  36774. var /** @type {?} */ domPrefixes = ['Webkit', 'Moz', 'O', 'ms'];
  36775. for (var /** @type {?} */ i = 0; i < domPrefixes.length; i++) {
  36776. if (_this.getStyle(element_1, domPrefixes[i] + 'AnimationName') != null) {
  36777. _this._animationPrefix = '-' + domPrefixes[i].toLowerCase() + '-';
  36778. break;
  36779. }
  36780. }
  36781. }
  36782. var /** @type {?} */ transEndEventNames_1 = {
  36783. WebkitTransition: 'webkitTransitionEnd',
  36784. MozTransition: 'transitionend',
  36785. OTransition: 'oTransitionEnd otransitionend',
  36786. transition: 'transitionend'
  36787. };
  36788. Object.keys(transEndEventNames_1).forEach(function (key) {
  36789. if (_this.getStyle(element_1, key) != null) {
  36790. _this._transitionEnd = transEndEventNames_1[key];
  36791. }
  36792. });
  36793. }
  36794. catch (/** @type {?} */ e) {
  36795. _this._animationPrefix = null;
  36796. _this._transitionEnd = null;
  36797. }
  36798. return _this;
  36799. }
  36800. /**
  36801. * @param {?} el
  36802. * @return {?}
  36803. */
  36804. GenericBrowserDomAdapter.prototype.getDistributedNodes = /**
  36805. * @param {?} el
  36806. * @return {?}
  36807. */
  36808. function (el) { return (/** @type {?} */ (el)).getDistributedNodes(); };
  36809. /**
  36810. * @param {?} el
  36811. * @param {?} baseUrl
  36812. * @param {?} href
  36813. * @return {?}
  36814. */
  36815. GenericBrowserDomAdapter.prototype.resolveAndSetHref = /**
  36816. * @param {?} el
  36817. * @param {?} baseUrl
  36818. * @param {?} href
  36819. * @return {?}
  36820. */
  36821. function (el, baseUrl, href) {
  36822. el.href = href == null ? baseUrl : baseUrl + '/../' + href;
  36823. };
  36824. /**
  36825. * @return {?}
  36826. */
  36827. GenericBrowserDomAdapter.prototype.supportsDOMEvents = /**
  36828. * @return {?}
  36829. */
  36830. function () { return true; };
  36831. /**
  36832. * @return {?}
  36833. */
  36834. GenericBrowserDomAdapter.prototype.supportsNativeShadowDOM = /**
  36835. * @return {?}
  36836. */
  36837. function () {
  36838. return typeof (/** @type {?} */ (document.body)).createShadowRoot === 'function';
  36839. };
  36840. /**
  36841. * @return {?}
  36842. */
  36843. GenericBrowserDomAdapter.prototype.getAnimationPrefix = /**
  36844. * @return {?}
  36845. */
  36846. function () { return this._animationPrefix ? this._animationPrefix : ''; };
  36847. /**
  36848. * @return {?}
  36849. */
  36850. GenericBrowserDomAdapter.prototype.getTransitionEnd = /**
  36851. * @return {?}
  36852. */
  36853. function () { return this._transitionEnd ? this._transitionEnd : ''; };
  36854. /**
  36855. * @return {?}
  36856. */
  36857. GenericBrowserDomAdapter.prototype.supportsAnimation = /**
  36858. * @return {?}
  36859. */
  36860. function () {
  36861. return this._animationPrefix != null && this._transitionEnd != null;
  36862. };
  36863. return GenericBrowserDomAdapter;
  36864. }(DomAdapter));
  36865. /**
  36866. * @fileoverview added by tsickle
  36867. * @suppress {checkTypes} checked by tsc
  36868. */
  36869. /**
  36870. * @license
  36871. * Copyright Google Inc. All Rights Reserved.
  36872. *
  36873. * Use of this source code is governed by an MIT-style license that can be
  36874. * found in the LICENSE file at https://angular.io/license
  36875. */
  36876. var _attrToPropMap = {
  36877. 'class': 'className',
  36878. 'innerHtml': 'innerHTML',
  36879. 'readonly': 'readOnly',
  36880. 'tabindex': 'tabIndex',
  36881. };
  36882. var DOM_KEY_LOCATION_NUMPAD = 3;
  36883. // Map to convert some key or keyIdentifier values to what will be returned by getEventKey
  36884. var _keyMap = {
  36885. // The following values are here for cross-browser compatibility and to match the W3C standard
  36886. // cf http://www.w3.org/TR/DOM-Level-3-Events-key/
  36887. '\b': 'Backspace',
  36888. '\t': 'Tab',
  36889. '\x7F': 'Delete',
  36890. '\x1B': 'Escape',
  36891. 'Del': 'Delete',
  36892. 'Esc': 'Escape',
  36893. 'Left': 'ArrowLeft',
  36894. 'Right': 'ArrowRight',
  36895. 'Up': 'ArrowUp',
  36896. 'Down': 'ArrowDown',
  36897. 'Menu': 'ContextMenu',
  36898. 'Scroll': 'ScrollLock',
  36899. 'Win': 'OS'
  36900. };
  36901. // There is a bug in Chrome for numeric keypad keys:
  36902. // https://code.google.com/p/chromium/issues/detail?id=155654
  36903. // 1, 2, 3 ... are reported as A, B, C ...
  36904. var _chromeNumKeyPadMap = {
  36905. 'A': '1',
  36906. 'B': '2',
  36907. 'C': '3',
  36908. 'D': '4',
  36909. 'E': '5',
  36910. 'F': '6',
  36911. 'G': '7',
  36912. 'H': '8',
  36913. 'I': '9',
  36914. 'J': '*',
  36915. 'K': '+',
  36916. 'M': '-',
  36917. 'N': '.',
  36918. 'O': '/',
  36919. '\x60': '0',
  36920. '\x90': 'NumLock'
  36921. };
  36922. var nodeContains;
  36923. if (__WEBPACK_IMPORTED_MODULE_1__angular_core__["_30" /* ɵglobal */]['Node']) {
  36924. nodeContains = __WEBPACK_IMPORTED_MODULE_1__angular_core__["_30" /* ɵglobal */]['Node'].prototype.contains || function (node) {
  36925. return !!(this.compareDocumentPosition(node) & 16);
  36926. };
  36927. }
  36928. /**
  36929. * A `DomAdapter` powered by full browser DOM APIs.
  36930. *
  36931. * \@security Tread carefully! Interacting with the DOM directly is dangerous and
  36932. * can introduce XSS risks.
  36933. */
  36934. var BrowserDomAdapter = /** @class */ (function (_super) {
  36935. Object(__WEBPACK_IMPORTED_MODULE_2_tslib__["b" /* __extends */])(BrowserDomAdapter, _super);
  36936. function BrowserDomAdapter() {
  36937. return _super !== null && _super.apply(this, arguments) || this;
  36938. }
  36939. /**
  36940. * @param {?} templateHtml
  36941. * @return {?}
  36942. */
  36943. BrowserDomAdapter.prototype.parse = /**
  36944. * @param {?} templateHtml
  36945. * @return {?}
  36946. */
  36947. function (templateHtml) { throw new Error('parse not implemented'); };
  36948. /**
  36949. * @return {?}
  36950. */
  36951. BrowserDomAdapter.makeCurrent = /**
  36952. * @return {?}
  36953. */
  36954. function () { setRootDomAdapter(new BrowserDomAdapter()); };
  36955. /**
  36956. * @param {?} element
  36957. * @param {?} name
  36958. * @return {?}
  36959. */
  36960. BrowserDomAdapter.prototype.hasProperty = /**
  36961. * @param {?} element
  36962. * @param {?} name
  36963. * @return {?}
  36964. */
  36965. function (element, name) { return name in element; };
  36966. /**
  36967. * @param {?} el
  36968. * @param {?} name
  36969. * @param {?} value
  36970. * @return {?}
  36971. */
  36972. BrowserDomAdapter.prototype.setProperty = /**
  36973. * @param {?} el
  36974. * @param {?} name
  36975. * @param {?} value
  36976. * @return {?}
  36977. */
  36978. function (el, name, value) { (/** @type {?} */ (el))[name] = value; };
  36979. /**
  36980. * @param {?} el
  36981. * @param {?} name
  36982. * @return {?}
  36983. */
  36984. BrowserDomAdapter.prototype.getProperty = /**
  36985. * @param {?} el
  36986. * @param {?} name
  36987. * @return {?}
  36988. */
  36989. function (el, name) { return (/** @type {?} */ (el))[name]; };
  36990. /**
  36991. * @param {?} el
  36992. * @param {?} methodName
  36993. * @param {?} args
  36994. * @return {?}
  36995. */
  36996. BrowserDomAdapter.prototype.invoke = /**
  36997. * @param {?} el
  36998. * @param {?} methodName
  36999. * @param {?} args
  37000. * @return {?}
  37001. */
  37002. function (el, methodName, args) {
  37003. (_a = (/** @type {?} */ (el)))[methodName].apply(_a, args);
  37004. var _a;
  37005. };
  37006. // TODO(tbosch): move this into a separate environment class once we have it
  37007. /**
  37008. * @param {?} error
  37009. * @return {?}
  37010. */
  37011. BrowserDomAdapter.prototype.logError = /**
  37012. * @param {?} error
  37013. * @return {?}
  37014. */
  37015. function (error) {
  37016. if (window.console) {
  37017. if (console.error) {
  37018. console.error(error);
  37019. }
  37020. else {
  37021. console.log(error);
  37022. }
  37023. }
  37024. };
  37025. /**
  37026. * @param {?} error
  37027. * @return {?}
  37028. */
  37029. BrowserDomAdapter.prototype.log = /**
  37030. * @param {?} error
  37031. * @return {?}
  37032. */
  37033. function (error) {
  37034. if (window.console) {
  37035. window.console.log && window.console.log(error);
  37036. }
  37037. };
  37038. /**
  37039. * @param {?} error
  37040. * @return {?}
  37041. */
  37042. BrowserDomAdapter.prototype.logGroup = /**
  37043. * @param {?} error
  37044. * @return {?}
  37045. */
  37046. function (error) {
  37047. if (window.console) {
  37048. window.console.group && window.console.group(error);
  37049. }
  37050. };
  37051. /**
  37052. * @return {?}
  37053. */
  37054. BrowserDomAdapter.prototype.logGroupEnd = /**
  37055. * @return {?}
  37056. */
  37057. function () {
  37058. if (window.console) {
  37059. window.console.groupEnd && window.console.groupEnd();
  37060. }
  37061. };
  37062. Object.defineProperty(BrowserDomAdapter.prototype, "attrToPropMap", {
  37063. get: /**
  37064. * @return {?}
  37065. */
  37066. function () { return _attrToPropMap; },
  37067. enumerable: true,
  37068. configurable: true
  37069. });
  37070. /**
  37071. * @param {?} nodeA
  37072. * @param {?} nodeB
  37073. * @return {?}
  37074. */
  37075. BrowserDomAdapter.prototype.contains = /**
  37076. * @param {?} nodeA
  37077. * @param {?} nodeB
  37078. * @return {?}
  37079. */
  37080. function (nodeA, nodeB) { return nodeContains.call(nodeA, nodeB); };
  37081. /**
  37082. * @param {?} el
  37083. * @param {?} selector
  37084. * @return {?}
  37085. */
  37086. BrowserDomAdapter.prototype.querySelector = /**
  37087. * @param {?} el
  37088. * @param {?} selector
  37089. * @return {?}
  37090. */
  37091. function (el, selector) { return el.querySelector(selector); };
  37092. /**
  37093. * @param {?} el
  37094. * @param {?} selector
  37095. * @return {?}
  37096. */
  37097. BrowserDomAdapter.prototype.querySelectorAll = /**
  37098. * @param {?} el
  37099. * @param {?} selector
  37100. * @return {?}
  37101. */
  37102. function (el, selector) { return el.querySelectorAll(selector); };
  37103. /**
  37104. * @param {?} el
  37105. * @param {?} evt
  37106. * @param {?} listener
  37107. * @return {?}
  37108. */
  37109. BrowserDomAdapter.prototype.on = /**
  37110. * @param {?} el
  37111. * @param {?} evt
  37112. * @param {?} listener
  37113. * @return {?}
  37114. */
  37115. function (el, evt, listener) { el.addEventListener(evt, listener, false); };
  37116. /**
  37117. * @param {?} el
  37118. * @param {?} evt
  37119. * @param {?} listener
  37120. * @return {?}
  37121. */
  37122. BrowserDomAdapter.prototype.onAndCancel = /**
  37123. * @param {?} el
  37124. * @param {?} evt
  37125. * @param {?} listener
  37126. * @return {?}
  37127. */
  37128. function (el, evt, listener) {
  37129. el.addEventListener(evt, listener, false);
  37130. // Needed to follow Dart's subscription semantic, until fix of
  37131. // https://code.google.com/p/dart/issues/detail?id=17406
  37132. return function () { el.removeEventListener(evt, listener, false); };
  37133. };
  37134. /**
  37135. * @param {?} el
  37136. * @param {?} evt
  37137. * @return {?}
  37138. */
  37139. BrowserDomAdapter.prototype.dispatchEvent = /**
  37140. * @param {?} el
  37141. * @param {?} evt
  37142. * @return {?}
  37143. */
  37144. function (el, evt) { el.dispatchEvent(evt); };
  37145. /**
  37146. * @param {?} eventType
  37147. * @return {?}
  37148. */
  37149. BrowserDomAdapter.prototype.createMouseEvent = /**
  37150. * @param {?} eventType
  37151. * @return {?}
  37152. */
  37153. function (eventType) {
  37154. var /** @type {?} */ evt = this.getDefaultDocument().createEvent('MouseEvent');
  37155. evt.initEvent(eventType, true, true);
  37156. return evt;
  37157. };
  37158. /**
  37159. * @param {?} eventType
  37160. * @return {?}
  37161. */
  37162. BrowserDomAdapter.prototype.createEvent = /**
  37163. * @param {?} eventType
  37164. * @return {?}
  37165. */
  37166. function (eventType) {
  37167. var /** @type {?} */ evt = this.getDefaultDocument().createEvent('Event');
  37168. evt.initEvent(eventType, true, true);
  37169. return evt;
  37170. };
  37171. /**
  37172. * @param {?} evt
  37173. * @return {?}
  37174. */
  37175. BrowserDomAdapter.prototype.preventDefault = /**
  37176. * @param {?} evt
  37177. * @return {?}
  37178. */
  37179. function (evt) {
  37180. evt.preventDefault();
  37181. evt.returnValue = false;
  37182. };
  37183. /**
  37184. * @param {?} evt
  37185. * @return {?}
  37186. */
  37187. BrowserDomAdapter.prototype.isPrevented = /**
  37188. * @param {?} evt
  37189. * @return {?}
  37190. */
  37191. function (evt) {
  37192. return evt.defaultPrevented || evt.returnValue != null && !evt.returnValue;
  37193. };
  37194. /**
  37195. * @param {?} el
  37196. * @return {?}
  37197. */
  37198. BrowserDomAdapter.prototype.getInnerHTML = /**
  37199. * @param {?} el
  37200. * @return {?}
  37201. */
  37202. function (el) { return el.innerHTML; };
  37203. /**
  37204. * @param {?} el
  37205. * @return {?}
  37206. */
  37207. BrowserDomAdapter.prototype.getTemplateContent = /**
  37208. * @param {?} el
  37209. * @return {?}
  37210. */
  37211. function (el) {
  37212. return 'content' in el && this.isTemplateElement(el) ? (/** @type {?} */ (el)).content : null;
  37213. };
  37214. /**
  37215. * @param {?} el
  37216. * @return {?}
  37217. */
  37218. BrowserDomAdapter.prototype.getOuterHTML = /**
  37219. * @param {?} el
  37220. * @return {?}
  37221. */
  37222. function (el) { return el.outerHTML; };
  37223. /**
  37224. * @param {?} node
  37225. * @return {?}
  37226. */
  37227. BrowserDomAdapter.prototype.nodeName = /**
  37228. * @param {?} node
  37229. * @return {?}
  37230. */
  37231. function (node) { return node.nodeName; };
  37232. /**
  37233. * @param {?} node
  37234. * @return {?}
  37235. */
  37236. BrowserDomAdapter.prototype.nodeValue = /**
  37237. * @param {?} node
  37238. * @return {?}
  37239. */
  37240. function (node) { return node.nodeValue; };
  37241. /**
  37242. * @param {?} node
  37243. * @return {?}
  37244. */
  37245. BrowserDomAdapter.prototype.type = /**
  37246. * @param {?} node
  37247. * @return {?}
  37248. */
  37249. function (node) { return node.type; };
  37250. /**
  37251. * @param {?} node
  37252. * @return {?}
  37253. */
  37254. BrowserDomAdapter.prototype.content = /**
  37255. * @param {?} node
  37256. * @return {?}
  37257. */
  37258. function (node) {
  37259. if (this.hasProperty(node, 'content')) {
  37260. return (/** @type {?} */ (node)).content;
  37261. }
  37262. else {
  37263. return node;
  37264. }
  37265. };
  37266. /**
  37267. * @param {?} el
  37268. * @return {?}
  37269. */
  37270. BrowserDomAdapter.prototype.firstChild = /**
  37271. * @param {?} el
  37272. * @return {?}
  37273. */
  37274. function (el) { return el.firstChild; };
  37275. /**
  37276. * @param {?} el
  37277. * @return {?}
  37278. */
  37279. BrowserDomAdapter.prototype.nextSibling = /**
  37280. * @param {?} el
  37281. * @return {?}
  37282. */
  37283. function (el) { return el.nextSibling; };
  37284. /**
  37285. * @param {?} el
  37286. * @return {?}
  37287. */
  37288. BrowserDomAdapter.prototype.parentElement = /**
  37289. * @param {?} el
  37290. * @return {?}
  37291. */
  37292. function (el) { return el.parentNode; };
  37293. /**
  37294. * @param {?} el
  37295. * @return {?}
  37296. */
  37297. BrowserDomAdapter.prototype.childNodes = /**
  37298. * @param {?} el
  37299. * @return {?}
  37300. */
  37301. function (el) { return el.childNodes; };
  37302. /**
  37303. * @param {?} el
  37304. * @return {?}
  37305. */
  37306. BrowserDomAdapter.prototype.childNodesAsList = /**
  37307. * @param {?} el
  37308. * @return {?}
  37309. */
  37310. function (el) {
  37311. var /** @type {?} */ childNodes = el.childNodes;
  37312. var /** @type {?} */ res = new Array(childNodes.length);
  37313. for (var /** @type {?} */ i = 0; i < childNodes.length; i++) {
  37314. res[i] = childNodes[i];
  37315. }
  37316. return res;
  37317. };
  37318. /**
  37319. * @param {?} el
  37320. * @return {?}
  37321. */
  37322. BrowserDomAdapter.prototype.clearNodes = /**
  37323. * @param {?} el
  37324. * @return {?}
  37325. */
  37326. function (el) {
  37327. while (el.firstChild) {
  37328. el.removeChild(el.firstChild);
  37329. }
  37330. };
  37331. /**
  37332. * @param {?} el
  37333. * @param {?} node
  37334. * @return {?}
  37335. */
  37336. BrowserDomAdapter.prototype.appendChild = /**
  37337. * @param {?} el
  37338. * @param {?} node
  37339. * @return {?}
  37340. */
  37341. function (el, node) { el.appendChild(node); };
  37342. /**
  37343. * @param {?} el
  37344. * @param {?} node
  37345. * @return {?}
  37346. */
  37347. BrowserDomAdapter.prototype.removeChild = /**
  37348. * @param {?} el
  37349. * @param {?} node
  37350. * @return {?}
  37351. */
  37352. function (el, node) { el.removeChild(node); };
  37353. /**
  37354. * @param {?} el
  37355. * @param {?} newChild
  37356. * @param {?} oldChild
  37357. * @return {?}
  37358. */
  37359. BrowserDomAdapter.prototype.replaceChild = /**
  37360. * @param {?} el
  37361. * @param {?} newChild
  37362. * @param {?} oldChild
  37363. * @return {?}
  37364. */
  37365. function (el, newChild, oldChild) { el.replaceChild(newChild, oldChild); };
  37366. /**
  37367. * @param {?} node
  37368. * @return {?}
  37369. */
  37370. BrowserDomAdapter.prototype.remove = /**
  37371. * @param {?} node
  37372. * @return {?}
  37373. */
  37374. function (node) {
  37375. if (node.parentNode) {
  37376. node.parentNode.removeChild(node);
  37377. }
  37378. return node;
  37379. };
  37380. /**
  37381. * @param {?} parent
  37382. * @param {?} ref
  37383. * @param {?} node
  37384. * @return {?}
  37385. */
  37386. BrowserDomAdapter.prototype.insertBefore = /**
  37387. * @param {?} parent
  37388. * @param {?} ref
  37389. * @param {?} node
  37390. * @return {?}
  37391. */
  37392. function (parent, ref, node) { parent.insertBefore(node, ref); };
  37393. /**
  37394. * @param {?} parent
  37395. * @param {?} ref
  37396. * @param {?} nodes
  37397. * @return {?}
  37398. */
  37399. BrowserDomAdapter.prototype.insertAllBefore = /**
  37400. * @param {?} parent
  37401. * @param {?} ref
  37402. * @param {?} nodes
  37403. * @return {?}
  37404. */
  37405. function (parent, ref, nodes) {
  37406. nodes.forEach(function (n) { return parent.insertBefore(n, ref); });
  37407. };
  37408. /**
  37409. * @param {?} parent
  37410. * @param {?} ref
  37411. * @param {?} node
  37412. * @return {?}
  37413. */
  37414. BrowserDomAdapter.prototype.insertAfter = /**
  37415. * @param {?} parent
  37416. * @param {?} ref
  37417. * @param {?} node
  37418. * @return {?}
  37419. */
  37420. function (parent, ref, node) { parent.insertBefore(node, ref.nextSibling); };
  37421. /**
  37422. * @param {?} el
  37423. * @param {?} value
  37424. * @return {?}
  37425. */
  37426. BrowserDomAdapter.prototype.setInnerHTML = /**
  37427. * @param {?} el
  37428. * @param {?} value
  37429. * @return {?}
  37430. */
  37431. function (el, value) { el.innerHTML = value; };
  37432. /**
  37433. * @param {?} el
  37434. * @return {?}
  37435. */
  37436. BrowserDomAdapter.prototype.getText = /**
  37437. * @param {?} el
  37438. * @return {?}
  37439. */
  37440. function (el) { return el.textContent; };
  37441. /**
  37442. * @param {?} el
  37443. * @param {?} value
  37444. * @return {?}
  37445. */
  37446. BrowserDomAdapter.prototype.setText = /**
  37447. * @param {?} el
  37448. * @param {?} value
  37449. * @return {?}
  37450. */
  37451. function (el, value) { el.textContent = value; };
  37452. /**
  37453. * @param {?} el
  37454. * @return {?}
  37455. */
  37456. BrowserDomAdapter.prototype.getValue = /**
  37457. * @param {?} el
  37458. * @return {?}
  37459. */
  37460. function (el) { return el.value; };
  37461. /**
  37462. * @param {?} el
  37463. * @param {?} value
  37464. * @return {?}
  37465. */
  37466. BrowserDomAdapter.prototype.setValue = /**
  37467. * @param {?} el
  37468. * @param {?} value
  37469. * @return {?}
  37470. */
  37471. function (el, value) { el.value = value; };
  37472. /**
  37473. * @param {?} el
  37474. * @return {?}
  37475. */
  37476. BrowserDomAdapter.prototype.getChecked = /**
  37477. * @param {?} el
  37478. * @return {?}
  37479. */
  37480. function (el) { return el.checked; };
  37481. /**
  37482. * @param {?} el
  37483. * @param {?} value
  37484. * @return {?}
  37485. */
  37486. BrowserDomAdapter.prototype.setChecked = /**
  37487. * @param {?} el
  37488. * @param {?} value
  37489. * @return {?}
  37490. */
  37491. function (el, value) { el.checked = value; };
  37492. /**
  37493. * @param {?} text
  37494. * @return {?}
  37495. */
  37496. BrowserDomAdapter.prototype.createComment = /**
  37497. * @param {?} text
  37498. * @return {?}
  37499. */
  37500. function (text) { return this.getDefaultDocument().createComment(text); };
  37501. /**
  37502. * @param {?} html
  37503. * @return {?}
  37504. */
  37505. BrowserDomAdapter.prototype.createTemplate = /**
  37506. * @param {?} html
  37507. * @return {?}
  37508. */
  37509. function (html) {
  37510. var /** @type {?} */ t = this.getDefaultDocument().createElement('template');
  37511. t.innerHTML = html;
  37512. return t;
  37513. };
  37514. /**
  37515. * @param {?} tagName
  37516. * @param {?=} doc
  37517. * @return {?}
  37518. */
  37519. BrowserDomAdapter.prototype.createElement = /**
  37520. * @param {?} tagName
  37521. * @param {?=} doc
  37522. * @return {?}
  37523. */
  37524. function (tagName, doc) {
  37525. doc = doc || this.getDefaultDocument();
  37526. return doc.createElement(tagName);
  37527. };
  37528. /**
  37529. * @param {?} ns
  37530. * @param {?} tagName
  37531. * @param {?=} doc
  37532. * @return {?}
  37533. */
  37534. BrowserDomAdapter.prototype.createElementNS = /**
  37535. * @param {?} ns
  37536. * @param {?} tagName
  37537. * @param {?=} doc
  37538. * @return {?}
  37539. */
  37540. function (ns, tagName, doc) {
  37541. doc = doc || this.getDefaultDocument();
  37542. return doc.createElementNS(ns, tagName);
  37543. };
  37544. /**
  37545. * @param {?} text
  37546. * @param {?=} doc
  37547. * @return {?}
  37548. */
  37549. BrowserDomAdapter.prototype.createTextNode = /**
  37550. * @param {?} text
  37551. * @param {?=} doc
  37552. * @return {?}
  37553. */
  37554. function (text, doc) {
  37555. doc = doc || this.getDefaultDocument();
  37556. return doc.createTextNode(text);
  37557. };
  37558. /**
  37559. * @param {?} attrName
  37560. * @param {?} attrValue
  37561. * @param {?=} doc
  37562. * @return {?}
  37563. */
  37564. BrowserDomAdapter.prototype.createScriptTag = /**
  37565. * @param {?} attrName
  37566. * @param {?} attrValue
  37567. * @param {?=} doc
  37568. * @return {?}
  37569. */
  37570. function (attrName, attrValue, doc) {
  37571. doc = doc || this.getDefaultDocument();
  37572. var /** @type {?} */ el = /** @type {?} */ (doc.createElement('SCRIPT'));
  37573. el.setAttribute(attrName, attrValue);
  37574. return el;
  37575. };
  37576. /**
  37577. * @param {?} css
  37578. * @param {?=} doc
  37579. * @return {?}
  37580. */
  37581. BrowserDomAdapter.prototype.createStyleElement = /**
  37582. * @param {?} css
  37583. * @param {?=} doc
  37584. * @return {?}
  37585. */
  37586. function (css, doc) {
  37587. doc = doc || this.getDefaultDocument();
  37588. var /** @type {?} */ style = /** @type {?} */ (doc.createElement('style'));
  37589. this.appendChild(style, this.createTextNode(css, doc));
  37590. return style;
  37591. };
  37592. /**
  37593. * @param {?} el
  37594. * @return {?}
  37595. */
  37596. BrowserDomAdapter.prototype.createShadowRoot = /**
  37597. * @param {?} el
  37598. * @return {?}
  37599. */
  37600. function (el) { return (/** @type {?} */ (el)).createShadowRoot(); };
  37601. /**
  37602. * @param {?} el
  37603. * @return {?}
  37604. */
  37605. BrowserDomAdapter.prototype.getShadowRoot = /**
  37606. * @param {?} el
  37607. * @return {?}
  37608. */
  37609. function (el) { return (/** @type {?} */ (el)).shadowRoot; };
  37610. /**
  37611. * @param {?} el
  37612. * @return {?}
  37613. */
  37614. BrowserDomAdapter.prototype.getHost = /**
  37615. * @param {?} el
  37616. * @return {?}
  37617. */
  37618. function (el) { return (/** @type {?} */ (el)).host; };
  37619. /**
  37620. * @param {?} node
  37621. * @return {?}
  37622. */
  37623. BrowserDomAdapter.prototype.clone = /**
  37624. * @param {?} node
  37625. * @return {?}
  37626. */
  37627. function (node) { return node.cloneNode(true); };
  37628. /**
  37629. * @param {?} element
  37630. * @param {?} name
  37631. * @return {?}
  37632. */
  37633. BrowserDomAdapter.prototype.getElementsByClassName = /**
  37634. * @param {?} element
  37635. * @param {?} name
  37636. * @return {?}
  37637. */
  37638. function (element, name) {
  37639. return element.getElementsByClassName(name);
  37640. };
  37641. /**
  37642. * @param {?} element
  37643. * @param {?} name
  37644. * @return {?}
  37645. */
  37646. BrowserDomAdapter.prototype.getElementsByTagName = /**
  37647. * @param {?} element
  37648. * @param {?} name
  37649. * @return {?}
  37650. */
  37651. function (element, name) {
  37652. return element.getElementsByTagName(name);
  37653. };
  37654. /**
  37655. * @param {?} element
  37656. * @return {?}
  37657. */
  37658. BrowserDomAdapter.prototype.classList = /**
  37659. * @param {?} element
  37660. * @return {?}
  37661. */
  37662. function (element) { return Array.prototype.slice.call(element.classList, 0); };
  37663. /**
  37664. * @param {?} element
  37665. * @param {?} className
  37666. * @return {?}
  37667. */
  37668. BrowserDomAdapter.prototype.addClass = /**
  37669. * @param {?} element
  37670. * @param {?} className
  37671. * @return {?}
  37672. */
  37673. function (element, className) { element.classList.add(className); };
  37674. /**
  37675. * @param {?} element
  37676. * @param {?} className
  37677. * @return {?}
  37678. */
  37679. BrowserDomAdapter.prototype.removeClass = /**
  37680. * @param {?} element
  37681. * @param {?} className
  37682. * @return {?}
  37683. */
  37684. function (element, className) { element.classList.remove(className); };
  37685. /**
  37686. * @param {?} element
  37687. * @param {?} className
  37688. * @return {?}
  37689. */
  37690. BrowserDomAdapter.prototype.hasClass = /**
  37691. * @param {?} element
  37692. * @param {?} className
  37693. * @return {?}
  37694. */
  37695. function (element, className) {
  37696. return element.classList.contains(className);
  37697. };
  37698. /**
  37699. * @param {?} element
  37700. * @param {?} styleName
  37701. * @param {?} styleValue
  37702. * @return {?}
  37703. */
  37704. BrowserDomAdapter.prototype.setStyle = /**
  37705. * @param {?} element
  37706. * @param {?} styleName
  37707. * @param {?} styleValue
  37708. * @return {?}
  37709. */
  37710. function (element, styleName, styleValue) {
  37711. element.style[styleName] = styleValue;
  37712. };
  37713. /**
  37714. * @param {?} element
  37715. * @param {?} stylename
  37716. * @return {?}
  37717. */
  37718. BrowserDomAdapter.prototype.removeStyle = /**
  37719. * @param {?} element
  37720. * @param {?} stylename
  37721. * @return {?}
  37722. */
  37723. function (element, stylename) {
  37724. // IE requires '' instead of null
  37725. // see https://github.com/angular/angular/issues/7916
  37726. element.style[stylename] = '';
  37727. };
  37728. /**
  37729. * @param {?} element
  37730. * @param {?} stylename
  37731. * @return {?}
  37732. */
  37733. BrowserDomAdapter.prototype.getStyle = /**
  37734. * @param {?} element
  37735. * @param {?} stylename
  37736. * @return {?}
  37737. */
  37738. function (element, stylename) { return element.style[stylename]; };
  37739. /**
  37740. * @param {?} element
  37741. * @param {?} styleName
  37742. * @param {?=} styleValue
  37743. * @return {?}
  37744. */
  37745. BrowserDomAdapter.prototype.hasStyle = /**
  37746. * @param {?} element
  37747. * @param {?} styleName
  37748. * @param {?=} styleValue
  37749. * @return {?}
  37750. */
  37751. function (element, styleName, styleValue) {
  37752. var /** @type {?} */ value = this.getStyle(element, styleName) || '';
  37753. return styleValue ? value == styleValue : value.length > 0;
  37754. };
  37755. /**
  37756. * @param {?} element
  37757. * @return {?}
  37758. */
  37759. BrowserDomAdapter.prototype.tagName = /**
  37760. * @param {?} element
  37761. * @return {?}
  37762. */
  37763. function (element) { return element.tagName; };
  37764. /**
  37765. * @param {?} element
  37766. * @return {?}
  37767. */
  37768. BrowserDomAdapter.prototype.attributeMap = /**
  37769. * @param {?} element
  37770. * @return {?}
  37771. */
  37772. function (element) {
  37773. var /** @type {?} */ res = new Map();
  37774. var /** @type {?} */ elAttrs = element.attributes;
  37775. for (var /** @type {?} */ i = 0; i < elAttrs.length; i++) {
  37776. var /** @type {?} */ attrib = elAttrs.item(i);
  37777. res.set(attrib.name, attrib.value);
  37778. }
  37779. return res;
  37780. };
  37781. /**
  37782. * @param {?} element
  37783. * @param {?} attribute
  37784. * @return {?}
  37785. */
  37786. BrowserDomAdapter.prototype.hasAttribute = /**
  37787. * @param {?} element
  37788. * @param {?} attribute
  37789. * @return {?}
  37790. */
  37791. function (element, attribute) {
  37792. return element.hasAttribute(attribute);
  37793. };
  37794. /**
  37795. * @param {?} element
  37796. * @param {?} ns
  37797. * @param {?} attribute
  37798. * @return {?}
  37799. */
  37800. BrowserDomAdapter.prototype.hasAttributeNS = /**
  37801. * @param {?} element
  37802. * @param {?} ns
  37803. * @param {?} attribute
  37804. * @return {?}
  37805. */
  37806. function (element, ns, attribute) {
  37807. return element.hasAttributeNS(ns, attribute);
  37808. };
  37809. /**
  37810. * @param {?} element
  37811. * @param {?} attribute
  37812. * @return {?}
  37813. */
  37814. BrowserDomAdapter.prototype.getAttribute = /**
  37815. * @param {?} element
  37816. * @param {?} attribute
  37817. * @return {?}
  37818. */
  37819. function (element, attribute) {
  37820. return element.getAttribute(attribute);
  37821. };
  37822. /**
  37823. * @param {?} element
  37824. * @param {?} ns
  37825. * @param {?} name
  37826. * @return {?}
  37827. */
  37828. BrowserDomAdapter.prototype.getAttributeNS = /**
  37829. * @param {?} element
  37830. * @param {?} ns
  37831. * @param {?} name
  37832. * @return {?}
  37833. */
  37834. function (element, ns, name) {
  37835. return element.getAttributeNS(ns, name);
  37836. };
  37837. /**
  37838. * @param {?} element
  37839. * @param {?} name
  37840. * @param {?} value
  37841. * @return {?}
  37842. */
  37843. BrowserDomAdapter.prototype.setAttribute = /**
  37844. * @param {?} element
  37845. * @param {?} name
  37846. * @param {?} value
  37847. * @return {?}
  37848. */
  37849. function (element, name, value) { element.setAttribute(name, value); };
  37850. /**
  37851. * @param {?} element
  37852. * @param {?} ns
  37853. * @param {?} name
  37854. * @param {?} value
  37855. * @return {?}
  37856. */
  37857. BrowserDomAdapter.prototype.setAttributeNS = /**
  37858. * @param {?} element
  37859. * @param {?} ns
  37860. * @param {?} name
  37861. * @param {?} value
  37862. * @return {?}
  37863. */
  37864. function (element, ns, name, value) {
  37865. element.setAttributeNS(ns, name, value);
  37866. };
  37867. /**
  37868. * @param {?} element
  37869. * @param {?} attribute
  37870. * @return {?}
  37871. */
  37872. BrowserDomAdapter.prototype.removeAttribute = /**
  37873. * @param {?} element
  37874. * @param {?} attribute
  37875. * @return {?}
  37876. */
  37877. function (element, attribute) { element.removeAttribute(attribute); };
  37878. /**
  37879. * @param {?} element
  37880. * @param {?} ns
  37881. * @param {?} name
  37882. * @return {?}
  37883. */
  37884. BrowserDomAdapter.prototype.removeAttributeNS = /**
  37885. * @param {?} element
  37886. * @param {?} ns
  37887. * @param {?} name
  37888. * @return {?}
  37889. */
  37890. function (element, ns, name) {
  37891. element.removeAttributeNS(ns, name);
  37892. };
  37893. /**
  37894. * @param {?} el
  37895. * @return {?}
  37896. */
  37897. BrowserDomAdapter.prototype.templateAwareRoot = /**
  37898. * @param {?} el
  37899. * @return {?}
  37900. */
  37901. function (el) { return this.isTemplateElement(el) ? this.content(el) : el; };
  37902. /**
  37903. * @return {?}
  37904. */
  37905. BrowserDomAdapter.prototype.createHtmlDocument = /**
  37906. * @return {?}
  37907. */
  37908. function () {
  37909. return document.implementation.createHTMLDocument('fakeTitle');
  37910. };
  37911. /**
  37912. * @return {?}
  37913. */
  37914. BrowserDomAdapter.prototype.getDefaultDocument = /**
  37915. * @return {?}
  37916. */
  37917. function () { return document; };
  37918. /**
  37919. * @param {?} el
  37920. * @return {?}
  37921. */
  37922. BrowserDomAdapter.prototype.getBoundingClientRect = /**
  37923. * @param {?} el
  37924. * @return {?}
  37925. */
  37926. function (el) {
  37927. try {
  37928. return el.getBoundingClientRect();
  37929. }
  37930. catch (/** @type {?} */ e) {
  37931. return { top: 0, bottom: 0, left: 0, right: 0, width: 0, height: 0 };
  37932. }
  37933. };
  37934. /**
  37935. * @param {?} doc
  37936. * @return {?}
  37937. */
  37938. BrowserDomAdapter.prototype.getTitle = /**
  37939. * @param {?} doc
  37940. * @return {?}
  37941. */
  37942. function (doc) { return doc.title; };
  37943. /**
  37944. * @param {?} doc
  37945. * @param {?} newTitle
  37946. * @return {?}
  37947. */
  37948. BrowserDomAdapter.prototype.setTitle = /**
  37949. * @param {?} doc
  37950. * @param {?} newTitle
  37951. * @return {?}
  37952. */
  37953. function (doc, newTitle) { doc.title = newTitle || ''; };
  37954. /**
  37955. * @param {?} n
  37956. * @param {?} selector
  37957. * @return {?}
  37958. */
  37959. BrowserDomAdapter.prototype.elementMatches = /**
  37960. * @param {?} n
  37961. * @param {?} selector
  37962. * @return {?}
  37963. */
  37964. function (n, selector) {
  37965. if (this.isElementNode(n)) {
  37966. return n.matches && n.matches(selector) ||
  37967. n.msMatchesSelector && n.msMatchesSelector(selector) ||
  37968. n.webkitMatchesSelector && n.webkitMatchesSelector(selector);
  37969. }
  37970. return false;
  37971. };
  37972. /**
  37973. * @param {?} el
  37974. * @return {?}
  37975. */
  37976. BrowserDomAdapter.prototype.isTemplateElement = /**
  37977. * @param {?} el
  37978. * @return {?}
  37979. */
  37980. function (el) {
  37981. return this.isElementNode(el) && el.nodeName === 'TEMPLATE';
  37982. };
  37983. /**
  37984. * @param {?} node
  37985. * @return {?}
  37986. */
  37987. BrowserDomAdapter.prototype.isTextNode = /**
  37988. * @param {?} node
  37989. * @return {?}
  37990. */
  37991. function (node) { return node.nodeType === Node.TEXT_NODE; };
  37992. /**
  37993. * @param {?} node
  37994. * @return {?}
  37995. */
  37996. BrowserDomAdapter.prototype.isCommentNode = /**
  37997. * @param {?} node
  37998. * @return {?}
  37999. */
  38000. function (node) { return node.nodeType === Node.COMMENT_NODE; };
  38001. /**
  38002. * @param {?} node
  38003. * @return {?}
  38004. */
  38005. BrowserDomAdapter.prototype.isElementNode = /**
  38006. * @param {?} node
  38007. * @return {?}
  38008. */
  38009. function (node) { return node.nodeType === Node.ELEMENT_NODE; };
  38010. /**
  38011. * @param {?} node
  38012. * @return {?}
  38013. */
  38014. BrowserDomAdapter.prototype.hasShadowRoot = /**
  38015. * @param {?} node
  38016. * @return {?}
  38017. */
  38018. function (node) {
  38019. return node.shadowRoot != null && node instanceof HTMLElement;
  38020. };
  38021. /**
  38022. * @param {?} node
  38023. * @return {?}
  38024. */
  38025. BrowserDomAdapter.prototype.isShadowRoot = /**
  38026. * @param {?} node
  38027. * @return {?}
  38028. */
  38029. function (node) { return node instanceof DocumentFragment; };
  38030. /**
  38031. * @param {?} node
  38032. * @return {?}
  38033. */
  38034. BrowserDomAdapter.prototype.importIntoDoc = /**
  38035. * @param {?} node
  38036. * @return {?}
  38037. */
  38038. function (node) { return document.importNode(this.templateAwareRoot(node), true); };
  38039. /**
  38040. * @param {?} node
  38041. * @return {?}
  38042. */
  38043. BrowserDomAdapter.prototype.adoptNode = /**
  38044. * @param {?} node
  38045. * @return {?}
  38046. */
  38047. function (node) { return document.adoptNode(node); };
  38048. /**
  38049. * @param {?} el
  38050. * @return {?}
  38051. */
  38052. BrowserDomAdapter.prototype.getHref = /**
  38053. * @param {?} el
  38054. * @return {?}
  38055. */
  38056. function (el) { return /** @type {?} */ ((el.getAttribute('href'))); };
  38057. /**
  38058. * @param {?} event
  38059. * @return {?}
  38060. */
  38061. BrowserDomAdapter.prototype.getEventKey = /**
  38062. * @param {?} event
  38063. * @return {?}
  38064. */
  38065. function (event) {
  38066. var /** @type {?} */ key = event.key;
  38067. if (key == null) {
  38068. key = event.keyIdentifier;
  38069. // keyIdentifier is defined in the old draft of DOM Level 3 Events implemented by Chrome and
  38070. // Safari cf
  38071. // http://www.w3.org/TR/2007/WD-DOM-Level-3-Events-20071221/events.html#Events-KeyboardEvents-Interfaces
  38072. if (key == null) {
  38073. return 'Unidentified';
  38074. }
  38075. if (key.startsWith('U+')) {
  38076. key = String.fromCharCode(parseInt(key.substring(2), 16));
  38077. if (event.location === DOM_KEY_LOCATION_NUMPAD && _chromeNumKeyPadMap.hasOwnProperty(key)) {
  38078. // There is a bug in Chrome for numeric keypad keys:
  38079. // https://code.google.com/p/chromium/issues/detail?id=155654
  38080. // 1, 2, 3 ... are reported as A, B, C ...
  38081. key = (/** @type {?} */ (_chromeNumKeyPadMap))[key];
  38082. }
  38083. }
  38084. }
  38085. return _keyMap[key] || key;
  38086. };
  38087. /**
  38088. * @param {?} doc
  38089. * @param {?} target
  38090. * @return {?}
  38091. */
  38092. BrowserDomAdapter.prototype.getGlobalEventTarget = /**
  38093. * @param {?} doc
  38094. * @param {?} target
  38095. * @return {?}
  38096. */
  38097. function (doc, target) {
  38098. if (target === 'window') {
  38099. return window;
  38100. }
  38101. if (target === 'document') {
  38102. return doc;
  38103. }
  38104. if (target === 'body') {
  38105. return doc.body;
  38106. }
  38107. return null;
  38108. };
  38109. /**
  38110. * @return {?}
  38111. */
  38112. BrowserDomAdapter.prototype.getHistory = /**
  38113. * @return {?}
  38114. */
  38115. function () { return window.history; };
  38116. /**
  38117. * @return {?}
  38118. */
  38119. BrowserDomAdapter.prototype.getLocation = /**
  38120. * @return {?}
  38121. */
  38122. function () { return window.location; };
  38123. /**
  38124. * @param {?} doc
  38125. * @return {?}
  38126. */
  38127. BrowserDomAdapter.prototype.getBaseHref = /**
  38128. * @param {?} doc
  38129. * @return {?}
  38130. */
  38131. function (doc) {
  38132. var /** @type {?} */ href = getBaseElementHref();
  38133. return href == null ? null : relativePath(href);
  38134. };
  38135. /**
  38136. * @return {?}
  38137. */
  38138. BrowserDomAdapter.prototype.resetBaseElement = /**
  38139. * @return {?}
  38140. */
  38141. function () { baseElement = null; };
  38142. /**
  38143. * @return {?}
  38144. */
  38145. BrowserDomAdapter.prototype.getUserAgent = /**
  38146. * @return {?}
  38147. */
  38148. function () { return window.navigator.userAgent; };
  38149. /**
  38150. * @param {?} element
  38151. * @param {?} name
  38152. * @param {?} value
  38153. * @return {?}
  38154. */
  38155. BrowserDomAdapter.prototype.setData = /**
  38156. * @param {?} element
  38157. * @param {?} name
  38158. * @param {?} value
  38159. * @return {?}
  38160. */
  38161. function (element, name, value) {
  38162. this.setAttribute(element, 'data-' + name, value);
  38163. };
  38164. /**
  38165. * @param {?} element
  38166. * @param {?} name
  38167. * @return {?}
  38168. */
  38169. BrowserDomAdapter.prototype.getData = /**
  38170. * @param {?} element
  38171. * @param {?} name
  38172. * @return {?}
  38173. */
  38174. function (element, name) {
  38175. return this.getAttribute(element, 'data-' + name);
  38176. };
  38177. /**
  38178. * @param {?} element
  38179. * @return {?}
  38180. */
  38181. BrowserDomAdapter.prototype.getComputedStyle = /**
  38182. * @param {?} element
  38183. * @return {?}
  38184. */
  38185. function (element) { return getComputedStyle(element); };
  38186. // TODO(tbosch): move this into a separate environment class once we have it
  38187. /**
  38188. * @return {?}
  38189. */
  38190. BrowserDomAdapter.prototype.supportsWebAnimation = /**
  38191. * @return {?}
  38192. */
  38193. function () {
  38194. return typeof (/** @type {?} */ (Element)).prototype['animate'] === 'function';
  38195. };
  38196. /**
  38197. * @return {?}
  38198. */
  38199. BrowserDomAdapter.prototype.performanceNow = /**
  38200. * @return {?}
  38201. */
  38202. function () {
  38203. // performance.now() is not available in all browsers, see
  38204. // http://caniuse.com/#search=performance.now
  38205. return window.performance && window.performance.now ? window.performance.now() :
  38206. new Date().getTime();
  38207. };
  38208. /**
  38209. * @return {?}
  38210. */
  38211. BrowserDomAdapter.prototype.supportsCookies = /**
  38212. * @return {?}
  38213. */
  38214. function () { return true; };
  38215. /**
  38216. * @param {?} name
  38217. * @return {?}
  38218. */
  38219. BrowserDomAdapter.prototype.getCookie = /**
  38220. * @param {?} name
  38221. * @return {?}
  38222. */
  38223. function (name) { return Object(__WEBPACK_IMPORTED_MODULE_0__angular_common__["j" /* ɵparseCookieValue */])(document.cookie, name); };
  38224. /**
  38225. * @param {?} name
  38226. * @param {?} value
  38227. * @return {?}
  38228. */
  38229. BrowserDomAdapter.prototype.setCookie = /**
  38230. * @param {?} name
  38231. * @param {?} value
  38232. * @return {?}
  38233. */
  38234. function (name, value) {
  38235. // document.cookie is magical, assigning into it assigns/overrides one cookie value, but does
  38236. // not clear other cookies.
  38237. document.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value);
  38238. };
  38239. return BrowserDomAdapter;
  38240. }(GenericBrowserDomAdapter));
  38241. var baseElement = null;
  38242. /**
  38243. * @return {?}
  38244. */
  38245. function getBaseElementHref() {
  38246. if (!baseElement) {
  38247. baseElement = /** @type {?} */ ((document.querySelector('base')));
  38248. if (!baseElement) {
  38249. return null;
  38250. }
  38251. }
  38252. return baseElement.getAttribute('href');
  38253. }
  38254. // based on urlUtils.js in AngularJS 1
  38255. var urlParsingNode;
  38256. /**
  38257. * @param {?} url
  38258. * @return {?}
  38259. */
  38260. function relativePath(url) {
  38261. if (!urlParsingNode) {
  38262. urlParsingNode = document.createElement('a');
  38263. }
  38264. urlParsingNode.setAttribute('href', url);
  38265. return (urlParsingNode.pathname.charAt(0) === '/') ? urlParsingNode.pathname :
  38266. '/' + urlParsingNode.pathname;
  38267. }
  38268. /**
  38269. * @fileoverview added by tsickle
  38270. * @suppress {checkTypes} checked by tsc
  38271. */
  38272. /**
  38273. * @license
  38274. * Copyright Google Inc. All Rights Reserved.
  38275. *
  38276. * Use of this source code is governed by an MIT-style license that can be
  38277. * found in the LICENSE file at https://angular.io/license
  38278. */
  38279. /**
  38280. * A DI Token representing the main rendering context. In a browser this is the DOM Document.
  38281. *
  38282. * Note: Document might not be available in the Application Context when Application and Rendering
  38283. * Contexts are not the same (e.g. when running the application into a Web Worker).
  38284. *
  38285. * @deprecated import from `\@angular/common` instead.
  38286. */
  38287. var DOCUMENT$1 = __WEBPACK_IMPORTED_MODULE_0__angular_common__["c" /* DOCUMENT */];
  38288. /**
  38289. * @fileoverview added by tsickle
  38290. * @suppress {checkTypes} checked by tsc
  38291. */
  38292. /**
  38293. * @license
  38294. * Copyright Google Inc. All Rights Reserved.
  38295. *
  38296. * Use of this source code is governed by an MIT-style license that can be
  38297. * found in the LICENSE file at https://angular.io/license
  38298. */
  38299. /**
  38300. * @return {?}
  38301. */
  38302. function supportsState() {
  38303. return !!window.history.pushState;
  38304. }
  38305. /**
  38306. * @fileoverview added by tsickle
  38307. * @suppress {checkTypes} checked by tsc
  38308. */
  38309. /**
  38310. * @license
  38311. * Copyright Google Inc. All Rights Reserved.
  38312. *
  38313. * Use of this source code is governed by an MIT-style license that can be
  38314. * found in the LICENSE file at https://angular.io/license
  38315. */
  38316. /**
  38317. * `PlatformLocation` encapsulates all of the direct calls to platform APIs.
  38318. * This class should not be used directly by an application developer. Instead, use
  38319. * {\@link Location}.
  38320. */
  38321. var BrowserPlatformLocation = /** @class */ (function (_super) {
  38322. Object(__WEBPACK_IMPORTED_MODULE_2_tslib__["b" /* __extends */])(BrowserPlatformLocation, _super);
  38323. function BrowserPlatformLocation(_doc) {
  38324. var _this = _super.call(this) || this;
  38325. _this._doc = _doc;
  38326. _this._init();
  38327. return _this;
  38328. }
  38329. // This is moved to its own method so that `MockPlatformLocationStrategy` can overwrite it
  38330. /** @internal */
  38331. /**
  38332. * \@internal
  38333. * @return {?}
  38334. */
  38335. BrowserPlatformLocation.prototype._init = /**
  38336. * \@internal
  38337. * @return {?}
  38338. */
  38339. function () {
  38340. (/** @type {?} */ (this)).location = getDOM().getLocation();
  38341. this._history = getDOM().getHistory();
  38342. };
  38343. /**
  38344. * @return {?}
  38345. */
  38346. BrowserPlatformLocation.prototype.getBaseHrefFromDOM = /**
  38347. * @return {?}
  38348. */
  38349. function () { return /** @type {?} */ ((getDOM().getBaseHref(this._doc))); };
  38350. /**
  38351. * @param {?} fn
  38352. * @return {?}
  38353. */
  38354. BrowserPlatformLocation.prototype.onPopState = /**
  38355. * @param {?} fn
  38356. * @return {?}
  38357. */
  38358. function (fn) {
  38359. getDOM().getGlobalEventTarget(this._doc, 'window').addEventListener('popstate', fn, false);
  38360. };
  38361. /**
  38362. * @param {?} fn
  38363. * @return {?}
  38364. */
  38365. BrowserPlatformLocation.prototype.onHashChange = /**
  38366. * @param {?} fn
  38367. * @return {?}
  38368. */
  38369. function (fn) {
  38370. getDOM().getGlobalEventTarget(this._doc, 'window').addEventListener('hashchange', fn, false);
  38371. };
  38372. Object.defineProperty(BrowserPlatformLocation.prototype, "pathname", {
  38373. get: /**
  38374. * @return {?}
  38375. */
  38376. function () { return this.location.pathname; },
  38377. set: /**
  38378. * @param {?} newPath
  38379. * @return {?}
  38380. */
  38381. function (newPath) { this.location.pathname = newPath; },
  38382. enumerable: true,
  38383. configurable: true
  38384. });
  38385. Object.defineProperty(BrowserPlatformLocation.prototype, "search", {
  38386. get: /**
  38387. * @return {?}
  38388. */
  38389. function () { return this.location.search; },
  38390. enumerable: true,
  38391. configurable: true
  38392. });
  38393. Object.defineProperty(BrowserPlatformLocation.prototype, "hash", {
  38394. get: /**
  38395. * @return {?}
  38396. */
  38397. function () { return this.location.hash; },
  38398. enumerable: true,
  38399. configurable: true
  38400. });
  38401. /**
  38402. * @param {?} state
  38403. * @param {?} title
  38404. * @param {?} url
  38405. * @return {?}
  38406. */
  38407. BrowserPlatformLocation.prototype.pushState = /**
  38408. * @param {?} state
  38409. * @param {?} title
  38410. * @param {?} url
  38411. * @return {?}
  38412. */
  38413. function (state, title, url) {
  38414. if (supportsState()) {
  38415. this._history.pushState(state, title, url);
  38416. }
  38417. else {
  38418. this.location.hash = url;
  38419. }
  38420. };
  38421. /**
  38422. * @param {?} state
  38423. * @param {?} title
  38424. * @param {?} url
  38425. * @return {?}
  38426. */
  38427. BrowserPlatformLocation.prototype.replaceState = /**
  38428. * @param {?} state
  38429. * @param {?} title
  38430. * @param {?} url
  38431. * @return {?}
  38432. */
  38433. function (state, title, url) {
  38434. if (supportsState()) {
  38435. this._history.replaceState(state, title, url);
  38436. }
  38437. else {
  38438. this.location.hash = url;
  38439. }
  38440. };
  38441. /**
  38442. * @return {?}
  38443. */
  38444. BrowserPlatformLocation.prototype.forward = /**
  38445. * @return {?}
  38446. */
  38447. function () { this._history.forward(); };
  38448. /**
  38449. * @return {?}
  38450. */
  38451. BrowserPlatformLocation.prototype.back = /**
  38452. * @return {?}
  38453. */
  38454. function () { this._history.back(); };
  38455. BrowserPlatformLocation.decorators = [
  38456. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["A" /* Injectable */] },
  38457. ];
  38458. /** @nocollapse */
  38459. BrowserPlatformLocation.ctorParameters = function () { return [
  38460. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["z" /* Inject */], args: [DOCUMENT$1,] },] },
  38461. ]; };
  38462. return BrowserPlatformLocation;
  38463. }(__WEBPACK_IMPORTED_MODULE_0__angular_common__["h" /* PlatformLocation */]));
  38464. /**
  38465. * @fileoverview added by tsickle
  38466. * @suppress {checkTypes} checked by tsc
  38467. */
  38468. /**
  38469. * @license
  38470. * Copyright Google Inc. All Rights Reserved.
  38471. *
  38472. * Use of this source code is governed by an MIT-style license that can be
  38473. * found in the LICENSE file at https://angular.io/license
  38474. */
  38475. /**
  38476. * A service that can be used to get and add meta tags.
  38477. *
  38478. * \@experimental
  38479. */
  38480. var Meta = /** @class */ (function () {
  38481. function Meta(_doc) {
  38482. this._doc = _doc;
  38483. this._dom = getDOM();
  38484. }
  38485. /**
  38486. * @param {?} tag
  38487. * @param {?=} forceCreation
  38488. * @return {?}
  38489. */
  38490. Meta.prototype.addTag = /**
  38491. * @param {?} tag
  38492. * @param {?=} forceCreation
  38493. * @return {?}
  38494. */
  38495. function (tag, forceCreation) {
  38496. if (forceCreation === void 0) { forceCreation = false; }
  38497. if (!tag)
  38498. return null;
  38499. return this._getOrCreateElement(tag, forceCreation);
  38500. };
  38501. /**
  38502. * @param {?} tags
  38503. * @param {?=} forceCreation
  38504. * @return {?}
  38505. */
  38506. Meta.prototype.addTags = /**
  38507. * @param {?} tags
  38508. * @param {?=} forceCreation
  38509. * @return {?}
  38510. */
  38511. function (tags, forceCreation) {
  38512. var _this = this;
  38513. if (forceCreation === void 0) { forceCreation = false; }
  38514. if (!tags)
  38515. return [];
  38516. return tags.reduce(function (result, tag) {
  38517. if (tag) {
  38518. result.push(_this._getOrCreateElement(tag, forceCreation));
  38519. }
  38520. return result;
  38521. }, []);
  38522. };
  38523. /**
  38524. * @param {?} attrSelector
  38525. * @return {?}
  38526. */
  38527. Meta.prototype.getTag = /**
  38528. * @param {?} attrSelector
  38529. * @return {?}
  38530. */
  38531. function (attrSelector) {
  38532. if (!attrSelector)
  38533. return null;
  38534. return this._dom.querySelector(this._doc, "meta[" + attrSelector + "]") || null;
  38535. };
  38536. /**
  38537. * @param {?} attrSelector
  38538. * @return {?}
  38539. */
  38540. Meta.prototype.getTags = /**
  38541. * @param {?} attrSelector
  38542. * @return {?}
  38543. */
  38544. function (attrSelector) {
  38545. if (!attrSelector)
  38546. return [];
  38547. var /** @type {?} */ list = this._dom.querySelectorAll(this._doc, "meta[" + attrSelector + "]");
  38548. return list ? [].slice.call(list) : [];
  38549. };
  38550. /**
  38551. * @param {?} tag
  38552. * @param {?=} selector
  38553. * @return {?}
  38554. */
  38555. Meta.prototype.updateTag = /**
  38556. * @param {?} tag
  38557. * @param {?=} selector
  38558. * @return {?}
  38559. */
  38560. function (tag, selector) {
  38561. if (!tag)
  38562. return null;
  38563. selector = selector || this._parseSelector(tag);
  38564. var /** @type {?} */ meta = /** @type {?} */ ((this.getTag(selector)));
  38565. if (meta) {
  38566. return this._setMetaElementAttributes(tag, meta);
  38567. }
  38568. return this._getOrCreateElement(tag, true);
  38569. };
  38570. /**
  38571. * @param {?} attrSelector
  38572. * @return {?}
  38573. */
  38574. Meta.prototype.removeTag = /**
  38575. * @param {?} attrSelector
  38576. * @return {?}
  38577. */
  38578. function (attrSelector) { this.removeTagElement(/** @type {?} */ ((this.getTag(attrSelector)))); };
  38579. /**
  38580. * @param {?} meta
  38581. * @return {?}
  38582. */
  38583. Meta.prototype.removeTagElement = /**
  38584. * @param {?} meta
  38585. * @return {?}
  38586. */
  38587. function (meta) {
  38588. if (meta) {
  38589. this._dom.remove(meta);
  38590. }
  38591. };
  38592. /**
  38593. * @param {?} meta
  38594. * @param {?=} forceCreation
  38595. * @return {?}
  38596. */
  38597. Meta.prototype._getOrCreateElement = /**
  38598. * @param {?} meta
  38599. * @param {?=} forceCreation
  38600. * @return {?}
  38601. */
  38602. function (meta, forceCreation) {
  38603. if (forceCreation === void 0) { forceCreation = false; }
  38604. if (!forceCreation) {
  38605. var /** @type {?} */ selector = this._parseSelector(meta);
  38606. var /** @type {?} */ elem = /** @type {?} */ ((this.getTag(selector)));
  38607. // It's allowed to have multiple elements with the same name so it's not enough to
  38608. // just check that element with the same name already present on the page. We also need to
  38609. // check if element has tag attributes
  38610. if (elem && this._containsAttributes(meta, elem))
  38611. return elem;
  38612. }
  38613. var /** @type {?} */ element = /** @type {?} */ (this._dom.createElement('meta'));
  38614. this._setMetaElementAttributes(meta, element);
  38615. var /** @type {?} */ head = this._dom.getElementsByTagName(this._doc, 'head')[0];
  38616. this._dom.appendChild(head, element);
  38617. return element;
  38618. };
  38619. /**
  38620. * @param {?} tag
  38621. * @param {?} el
  38622. * @return {?}
  38623. */
  38624. Meta.prototype._setMetaElementAttributes = /**
  38625. * @param {?} tag
  38626. * @param {?} el
  38627. * @return {?}
  38628. */
  38629. function (tag, el) {
  38630. var _this = this;
  38631. Object.keys(tag).forEach(function (prop) { return _this._dom.setAttribute(el, prop, tag[prop]); });
  38632. return el;
  38633. };
  38634. /**
  38635. * @param {?} tag
  38636. * @return {?}
  38637. */
  38638. Meta.prototype._parseSelector = /**
  38639. * @param {?} tag
  38640. * @return {?}
  38641. */
  38642. function (tag) {
  38643. var /** @type {?} */ attr = tag.name ? 'name' : 'property';
  38644. return attr + "=\"" + tag[attr] + "\"";
  38645. };
  38646. /**
  38647. * @param {?} tag
  38648. * @param {?} elem
  38649. * @return {?}
  38650. */
  38651. Meta.prototype._containsAttributes = /**
  38652. * @param {?} tag
  38653. * @param {?} elem
  38654. * @return {?}
  38655. */
  38656. function (tag, elem) {
  38657. var _this = this;
  38658. return Object.keys(tag).every(function (key) { return _this._dom.getAttribute(elem, key) === tag[key]; });
  38659. };
  38660. Meta.decorators = [
  38661. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["A" /* Injectable */] },
  38662. ];
  38663. /** @nocollapse */
  38664. Meta.ctorParameters = function () { return [
  38665. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["z" /* Inject */], args: [DOCUMENT$1,] },] },
  38666. ]; };
  38667. return Meta;
  38668. }());
  38669. /**
  38670. * @fileoverview added by tsickle
  38671. * @suppress {checkTypes} checked by tsc
  38672. */
  38673. /**
  38674. * @license
  38675. * Copyright Google Inc. All Rights Reserved.
  38676. *
  38677. * Use of this source code is governed by an MIT-style license that can be
  38678. * found in the LICENSE file at https://angular.io/license
  38679. */
  38680. /**
  38681. * An id that identifies a particular application being bootstrapped, that should
  38682. * match across the client/server boundary.
  38683. */
  38684. var TRANSITION_ID = new __WEBPACK_IMPORTED_MODULE_1__angular_core__["B" /* InjectionToken */]('TRANSITION_ID');
  38685. /**
  38686. * @param {?} transitionId
  38687. * @param {?} document
  38688. * @param {?} injector
  38689. * @return {?}
  38690. */
  38691. function appInitializerFactory(transitionId, document, injector) {
  38692. return function () {
  38693. // Wait for all application initializers to be completed before removing the styles set by
  38694. // the server.
  38695. injector.get(__WEBPACK_IMPORTED_MODULE_1__angular_core__["d" /* ApplicationInitStatus */]).donePromise.then(function () {
  38696. var /** @type {?} */ dom = getDOM();
  38697. var /** @type {?} */ styles = Array.prototype.slice.apply(dom.querySelectorAll(document, "style[ng-transition]"));
  38698. styles.filter(function (el) { return dom.getAttribute(el, 'ng-transition') === transitionId; })
  38699. .forEach(function (el) { return dom.remove(el); });
  38700. });
  38701. };
  38702. }
  38703. var SERVER_TRANSITION_PROVIDERS = [
  38704. {
  38705. provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__["c" /* APP_INITIALIZER */],
  38706. useFactory: appInitializerFactory,
  38707. deps: [TRANSITION_ID, DOCUMENT$1, __WEBPACK_IMPORTED_MODULE_1__angular_core__["C" /* Injector */]],
  38708. multi: true
  38709. },
  38710. ];
  38711. /**
  38712. * @fileoverview added by tsickle
  38713. * @suppress {checkTypes} checked by tsc
  38714. */
  38715. /**
  38716. * @license
  38717. * Copyright Google Inc. All Rights Reserved.
  38718. *
  38719. * Use of this source code is governed by an MIT-style license that can be
  38720. * found in the LICENSE file at https://angular.io/license
  38721. */
  38722. var BrowserGetTestability = /** @class */ (function () {
  38723. function BrowserGetTestability() {
  38724. }
  38725. /**
  38726. * @return {?}
  38727. */
  38728. BrowserGetTestability.init = /**
  38729. * @return {?}
  38730. */
  38731. function () { Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_18" /* setTestabilityGetter */])(new BrowserGetTestability()); };
  38732. /**
  38733. * @param {?} registry
  38734. * @return {?}
  38735. */
  38736. BrowserGetTestability.prototype.addToWindow = /**
  38737. * @param {?} registry
  38738. * @return {?}
  38739. */
  38740. function (registry) {
  38741. __WEBPACK_IMPORTED_MODULE_1__angular_core__["_30" /* ɵglobal */]['getAngularTestability'] = function (elem, findInAncestors) {
  38742. if (findInAncestors === void 0) { findInAncestors = true; }
  38743. var /** @type {?} */ testability = registry.findTestabilityInTree(elem, findInAncestors);
  38744. if (testability == null) {
  38745. throw new Error('Could not find testability for element.');
  38746. }
  38747. return testability;
  38748. };
  38749. __WEBPACK_IMPORTED_MODULE_1__angular_core__["_30" /* ɵglobal */]['getAllAngularTestabilities'] = function () { return registry.getAllTestabilities(); };
  38750. __WEBPACK_IMPORTED_MODULE_1__angular_core__["_30" /* ɵglobal */]['getAllAngularRootElements'] = function () { return registry.getAllRootElements(); };
  38751. var /** @type {?} */ whenAllStable = function (callback /** TODO #9100 */) {
  38752. var /** @type {?} */ testabilities = __WEBPACK_IMPORTED_MODULE_1__angular_core__["_30" /* ɵglobal */]['getAllAngularTestabilities']();
  38753. var /** @type {?} */ count = testabilities.length;
  38754. var /** @type {?} */ didWork = false;
  38755. var /** @type {?} */ decrement = function (didWork_ /** TODO #9100 */) {
  38756. didWork = didWork || didWork_;
  38757. count--;
  38758. if (count == 0) {
  38759. callback(didWork);
  38760. }
  38761. };
  38762. testabilities.forEach(function (testability /** TODO #9100 */) {
  38763. testability.whenStable(decrement);
  38764. });
  38765. };
  38766. if (!__WEBPACK_IMPORTED_MODULE_1__angular_core__["_30" /* ɵglobal */]['frameworkStabilizers']) {
  38767. __WEBPACK_IMPORTED_MODULE_1__angular_core__["_30" /* ɵglobal */]['frameworkStabilizers'] = [];
  38768. }
  38769. __WEBPACK_IMPORTED_MODULE_1__angular_core__["_30" /* ɵglobal */]['frameworkStabilizers'].push(whenAllStable);
  38770. };
  38771. /**
  38772. * @param {?} registry
  38773. * @param {?} elem
  38774. * @param {?} findInAncestors
  38775. * @return {?}
  38776. */
  38777. BrowserGetTestability.prototype.findTestabilityInTree = /**
  38778. * @param {?} registry
  38779. * @param {?} elem
  38780. * @param {?} findInAncestors
  38781. * @return {?}
  38782. */
  38783. function (registry, elem, findInAncestors) {
  38784. if (elem == null) {
  38785. return null;
  38786. }
  38787. var /** @type {?} */ t = registry.getTestability(elem);
  38788. if (t != null) {
  38789. return t;
  38790. }
  38791. else if (!findInAncestors) {
  38792. return null;
  38793. }
  38794. if (getDOM().isShadowRoot(elem)) {
  38795. return this.findTestabilityInTree(registry, getDOM().getHost(elem), true);
  38796. }
  38797. return this.findTestabilityInTree(registry, getDOM().parentElement(elem), true);
  38798. };
  38799. return BrowserGetTestability;
  38800. }());
  38801. /**
  38802. * @fileoverview added by tsickle
  38803. * @suppress {checkTypes} checked by tsc
  38804. */
  38805. /**
  38806. * @license
  38807. * Copyright Google Inc. All Rights Reserved.
  38808. *
  38809. * Use of this source code is governed by an MIT-style license that can be
  38810. * found in the LICENSE file at https://angular.io/license
  38811. */
  38812. /**
  38813. * A service that can be used to get and set the title of a current HTML document.
  38814. *
  38815. * Since an Angular application can't be bootstrapped on the entire HTML document (`<html>` tag)
  38816. * it is not possible to bind to the `text` property of the `HTMLTitleElement` elements
  38817. * (representing the `<title>` tag). Instead, this service can be used to set and get the current
  38818. * title value.
  38819. *
  38820. * \@experimental
  38821. */
  38822. var Title = /** @class */ (function () {
  38823. function Title(_doc) {
  38824. this._doc = _doc;
  38825. }
  38826. /**
  38827. * Get the title of the current HTML document.
  38828. */
  38829. /**
  38830. * Get the title of the current HTML document.
  38831. * @return {?}
  38832. */
  38833. Title.prototype.getTitle = /**
  38834. * Get the title of the current HTML document.
  38835. * @return {?}
  38836. */
  38837. function () { return getDOM().getTitle(this._doc); };
  38838. /**
  38839. * Set the title of the current HTML document.
  38840. * @param newTitle
  38841. */
  38842. /**
  38843. * Set the title of the current HTML document.
  38844. * @param {?} newTitle
  38845. * @return {?}
  38846. */
  38847. Title.prototype.setTitle = /**
  38848. * Set the title of the current HTML document.
  38849. * @param {?} newTitle
  38850. * @return {?}
  38851. */
  38852. function (newTitle) { getDOM().setTitle(this._doc, newTitle); };
  38853. Title.decorators = [
  38854. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["A" /* Injectable */] },
  38855. ];
  38856. /** @nocollapse */
  38857. Title.ctorParameters = function () { return [
  38858. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["z" /* Inject */], args: [DOCUMENT$1,] },] },
  38859. ]; };
  38860. return Title;
  38861. }());
  38862. /**
  38863. * @fileoverview added by tsickle
  38864. * @suppress {checkTypes} checked by tsc
  38865. */
  38866. /**
  38867. * @license
  38868. * Copyright Google Inc. All Rights Reserved.
  38869. *
  38870. * Use of this source code is governed by an MIT-style license that can be
  38871. * found in the LICENSE file at https://angular.io/license
  38872. */
  38873. /**
  38874. * @param {?} input
  38875. * @return {?}
  38876. */
  38877. /**
  38878. * @param {?} input
  38879. * @return {?}
  38880. */
  38881. /**
  38882. * Exports the value under a given `name` in the global property `ng`. For example `ng.probe` if
  38883. * `name` is `'probe'`.
  38884. * @param {?} name Name under which it will be exported. Keep in mind this will be a property of the
  38885. * global `ng` object.
  38886. * @param {?} value The value to export.
  38887. * @return {?}
  38888. */
  38889. function exportNgVar(name, value) {
  38890. if (typeof COMPILED === 'undefined' || !COMPILED) {
  38891. // Note: we can't export `ng` when using closure enhanced optimization as:
  38892. // - closure declares globals itself for minified names, which sometimes clobber our `ng` global
  38893. // - we can't declare a closure extern as the namespace `ng` is already used within Google
  38894. // for typings for angularJS (via `goog.provide('ng....')`).
  38895. var /** @type {?} */ ng = __WEBPACK_IMPORTED_MODULE_1__angular_core__["_30" /* ɵglobal */]['ng'] = (/** @type {?} */ (__WEBPACK_IMPORTED_MODULE_1__angular_core__["_30" /* ɵglobal */]['ng'])) || {};
  38896. ng[name] = value;
  38897. }
  38898. }
  38899. /**
  38900. * @fileoverview added by tsickle
  38901. * @suppress {checkTypes} checked by tsc
  38902. */
  38903. /**
  38904. * @license
  38905. * Copyright Google Inc. All Rights Reserved.
  38906. *
  38907. * Use of this source code is governed by an MIT-style license that can be
  38908. * found in the LICENSE file at https://angular.io/license
  38909. */
  38910. var CORE_TOKENS = {
  38911. 'ApplicationRef': __WEBPACK_IMPORTED_MODULE_1__angular_core__["f" /* ApplicationRef */],
  38912. 'NgZone': __WEBPACK_IMPORTED_MODULE_1__angular_core__["M" /* NgZone */],
  38913. };
  38914. var INSPECT_GLOBAL_NAME = 'probe';
  38915. var CORE_TOKENS_GLOBAL_NAME = 'coreTokens';
  38916. /**
  38917. * Returns a {\@link DebugElement} for the given native DOM element, or
  38918. * null if the given native element does not have an Angular view associated
  38919. * with it.
  38920. * @param {?} element
  38921. * @return {?}
  38922. */
  38923. function inspectNativeElement(element) {
  38924. return Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_15" /* getDebugNode */])(element);
  38925. }
  38926. /**
  38927. * @param {?} coreTokens
  38928. * @return {?}
  38929. */
  38930. function _createNgProbe(coreTokens) {
  38931. exportNgVar(INSPECT_GLOBAL_NAME, inspectNativeElement);
  38932. exportNgVar(CORE_TOKENS_GLOBAL_NAME, Object(__WEBPACK_IMPORTED_MODULE_2_tslib__["a" /* __assign */])({}, CORE_TOKENS, _ngProbeTokensToMap(coreTokens || [])));
  38933. return function () { return inspectNativeElement; };
  38934. }
  38935. /**
  38936. * @param {?} tokens
  38937. * @return {?}
  38938. */
  38939. function _ngProbeTokensToMap(tokens) {
  38940. return tokens.reduce(function (prev, t) { return (prev[t.name] = t.token, prev); }, {});
  38941. }
  38942. /**
  38943. * Providers which support debugging Angular applications (e.g. via `ng.probe`).
  38944. */
  38945. var ELEMENT_PROBE_PROVIDERS = [
  38946. {
  38947. provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__["c" /* APP_INITIALIZER */],
  38948. useFactory: _createNgProbe,
  38949. deps: [
  38950. [__WEBPACK_IMPORTED_MODULE_1__angular_core__["L" /* NgProbeToken */], new __WEBPACK_IMPORTED_MODULE_1__angular_core__["N" /* Optional */]()],
  38951. ],
  38952. multi: true,
  38953. },
  38954. ];
  38955. /**
  38956. * @fileoverview added by tsickle
  38957. * @suppress {checkTypes} checked by tsc
  38958. */
  38959. /**
  38960. * @license
  38961. * Copyright Google Inc. All Rights Reserved.
  38962. *
  38963. * Use of this source code is governed by an MIT-style license that can be
  38964. * found in the LICENSE file at https://angular.io/license
  38965. */
  38966. /**
  38967. * \@stable
  38968. */
  38969. var EVENT_MANAGER_PLUGINS = new __WEBPACK_IMPORTED_MODULE_1__angular_core__["B" /* InjectionToken */]('EventManagerPlugins');
  38970. /**
  38971. * \@stable
  38972. */
  38973. var EventManager = /** @class */ (function () {
  38974. function EventManager(plugins, _zone) {
  38975. var _this = this;
  38976. this._zone = _zone;
  38977. this._eventNameToPlugin = new Map();
  38978. plugins.forEach(function (p) { return p.manager = _this; });
  38979. this._plugins = plugins.slice().reverse();
  38980. }
  38981. /**
  38982. * @param {?} element
  38983. * @param {?} eventName
  38984. * @param {?} handler
  38985. * @return {?}
  38986. */
  38987. EventManager.prototype.addEventListener = /**
  38988. * @param {?} element
  38989. * @param {?} eventName
  38990. * @param {?} handler
  38991. * @return {?}
  38992. */
  38993. function (element, eventName, handler) {
  38994. var /** @type {?} */ plugin = this._findPluginFor(eventName);
  38995. return plugin.addEventListener(element, eventName, handler);
  38996. };
  38997. /**
  38998. * @param {?} target
  38999. * @param {?} eventName
  39000. * @param {?} handler
  39001. * @return {?}
  39002. */
  39003. EventManager.prototype.addGlobalEventListener = /**
  39004. * @param {?} target
  39005. * @param {?} eventName
  39006. * @param {?} handler
  39007. * @return {?}
  39008. */
  39009. function (target, eventName, handler) {
  39010. var /** @type {?} */ plugin = this._findPluginFor(eventName);
  39011. return plugin.addGlobalEventListener(target, eventName, handler);
  39012. };
  39013. /**
  39014. * @return {?}
  39015. */
  39016. EventManager.prototype.getZone = /**
  39017. * @return {?}
  39018. */
  39019. function () { return this._zone; };
  39020. /** @internal */
  39021. /**
  39022. * \@internal
  39023. * @param {?} eventName
  39024. * @return {?}
  39025. */
  39026. EventManager.prototype._findPluginFor = /**
  39027. * \@internal
  39028. * @param {?} eventName
  39029. * @return {?}
  39030. */
  39031. function (eventName) {
  39032. var /** @type {?} */ plugin = this._eventNameToPlugin.get(eventName);
  39033. if (plugin) {
  39034. return plugin;
  39035. }
  39036. var /** @type {?} */ plugins = this._plugins;
  39037. for (var /** @type {?} */ i = 0; i < plugins.length; i++) {
  39038. var /** @type {?} */ plugin_1 = plugins[i];
  39039. if (plugin_1.supports(eventName)) {
  39040. this._eventNameToPlugin.set(eventName, plugin_1);
  39041. return plugin_1;
  39042. }
  39043. }
  39044. throw new Error("No event manager plugin found for event " + eventName);
  39045. };
  39046. EventManager.decorators = [
  39047. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["A" /* Injectable */] },
  39048. ];
  39049. /** @nocollapse */
  39050. EventManager.ctorParameters = function () { return [
  39051. { type: Array, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["z" /* Inject */], args: [EVENT_MANAGER_PLUGINS,] },] },
  39052. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["M" /* NgZone */], },
  39053. ]; };
  39054. return EventManager;
  39055. }());
  39056. /**
  39057. * @abstract
  39058. */
  39059. var EventManagerPlugin = /** @class */ (function () {
  39060. function EventManagerPlugin(_doc) {
  39061. this._doc = _doc;
  39062. }
  39063. /**
  39064. * @param {?} element
  39065. * @param {?} eventName
  39066. * @param {?} handler
  39067. * @return {?}
  39068. */
  39069. EventManagerPlugin.prototype.addGlobalEventListener = /**
  39070. * @param {?} element
  39071. * @param {?} eventName
  39072. * @param {?} handler
  39073. * @return {?}
  39074. */
  39075. function (element, eventName, handler) {
  39076. var /** @type {?} */ target = getDOM().getGlobalEventTarget(this._doc, element);
  39077. if (!target) {
  39078. throw new Error("Unsupported event target " + target + " for event " + eventName);
  39079. }
  39080. return this.addEventListener(target, eventName, handler);
  39081. };
  39082. return EventManagerPlugin;
  39083. }());
  39084. /**
  39085. * @fileoverview added by tsickle
  39086. * @suppress {checkTypes} checked by tsc
  39087. */
  39088. /**
  39089. * @license
  39090. * Copyright Google Inc. All Rights Reserved.
  39091. *
  39092. * Use of this source code is governed by an MIT-style license that can be
  39093. * found in the LICENSE file at https://angular.io/license
  39094. */
  39095. var SharedStylesHost = /** @class */ (function () {
  39096. function SharedStylesHost() {
  39097. /**
  39098. * \@internal
  39099. */
  39100. this._stylesSet = new Set();
  39101. }
  39102. /**
  39103. * @param {?} styles
  39104. * @return {?}
  39105. */
  39106. SharedStylesHost.prototype.addStyles = /**
  39107. * @param {?} styles
  39108. * @return {?}
  39109. */
  39110. function (styles) {
  39111. var _this = this;
  39112. var /** @type {?} */ additions = new Set();
  39113. styles.forEach(function (style) {
  39114. if (!_this._stylesSet.has(style)) {
  39115. _this._stylesSet.add(style);
  39116. additions.add(style);
  39117. }
  39118. });
  39119. this.onStylesAdded(additions);
  39120. };
  39121. /**
  39122. * @param {?} additions
  39123. * @return {?}
  39124. */
  39125. SharedStylesHost.prototype.onStylesAdded = /**
  39126. * @param {?} additions
  39127. * @return {?}
  39128. */
  39129. function (additions) { };
  39130. /**
  39131. * @return {?}
  39132. */
  39133. SharedStylesHost.prototype.getAllStyles = /**
  39134. * @return {?}
  39135. */
  39136. function () { return Array.from(this._stylesSet); };
  39137. SharedStylesHost.decorators = [
  39138. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["A" /* Injectable */] },
  39139. ];
  39140. /** @nocollapse */
  39141. SharedStylesHost.ctorParameters = function () { return []; };
  39142. return SharedStylesHost;
  39143. }());
  39144. var DomSharedStylesHost = /** @class */ (function (_super) {
  39145. Object(__WEBPACK_IMPORTED_MODULE_2_tslib__["b" /* __extends */])(DomSharedStylesHost, _super);
  39146. function DomSharedStylesHost(_doc) {
  39147. var _this = _super.call(this) || this;
  39148. _this._doc = _doc;
  39149. _this._hostNodes = new Set();
  39150. _this._styleNodes = new Set();
  39151. _this._hostNodes.add(_doc.head);
  39152. return _this;
  39153. }
  39154. /**
  39155. * @param {?} styles
  39156. * @param {?} host
  39157. * @return {?}
  39158. */
  39159. DomSharedStylesHost.prototype._addStylesToHost = /**
  39160. * @param {?} styles
  39161. * @param {?} host
  39162. * @return {?}
  39163. */
  39164. function (styles, host) {
  39165. var _this = this;
  39166. styles.forEach(function (style) {
  39167. var /** @type {?} */ styleEl = _this._doc.createElement('style');
  39168. styleEl.textContent = style;
  39169. _this._styleNodes.add(host.appendChild(styleEl));
  39170. });
  39171. };
  39172. /**
  39173. * @param {?} hostNode
  39174. * @return {?}
  39175. */
  39176. DomSharedStylesHost.prototype.addHost = /**
  39177. * @param {?} hostNode
  39178. * @return {?}
  39179. */
  39180. function (hostNode) {
  39181. this._addStylesToHost(this._stylesSet, hostNode);
  39182. this._hostNodes.add(hostNode);
  39183. };
  39184. /**
  39185. * @param {?} hostNode
  39186. * @return {?}
  39187. */
  39188. DomSharedStylesHost.prototype.removeHost = /**
  39189. * @param {?} hostNode
  39190. * @return {?}
  39191. */
  39192. function (hostNode) { this._hostNodes.delete(hostNode); };
  39193. /**
  39194. * @param {?} additions
  39195. * @return {?}
  39196. */
  39197. DomSharedStylesHost.prototype.onStylesAdded = /**
  39198. * @param {?} additions
  39199. * @return {?}
  39200. */
  39201. function (additions) {
  39202. var _this = this;
  39203. this._hostNodes.forEach(function (hostNode) { return _this._addStylesToHost(additions, hostNode); });
  39204. };
  39205. /**
  39206. * @return {?}
  39207. */
  39208. DomSharedStylesHost.prototype.ngOnDestroy = /**
  39209. * @return {?}
  39210. */
  39211. function () { this._styleNodes.forEach(function (styleNode) { return getDOM().remove(styleNode); }); };
  39212. DomSharedStylesHost.decorators = [
  39213. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["A" /* Injectable */] },
  39214. ];
  39215. /** @nocollapse */
  39216. DomSharedStylesHost.ctorParameters = function () { return [
  39217. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["z" /* Inject */], args: [DOCUMENT$1,] },] },
  39218. ]; };
  39219. return DomSharedStylesHost;
  39220. }(SharedStylesHost));
  39221. /**
  39222. * @fileoverview added by tsickle
  39223. * @suppress {checkTypes} checked by tsc
  39224. */
  39225. /**
  39226. * @license
  39227. * Copyright Google Inc. All Rights Reserved.
  39228. *
  39229. * Use of this source code is governed by an MIT-style license that can be
  39230. * found in the LICENSE file at https://angular.io/license
  39231. */
  39232. var NAMESPACE_URIS = {
  39233. 'svg': 'http://www.w3.org/2000/svg',
  39234. 'xhtml': 'http://www.w3.org/1999/xhtml',
  39235. 'xlink': 'http://www.w3.org/1999/xlink',
  39236. 'xml': 'http://www.w3.org/XML/1998/namespace',
  39237. 'xmlns': 'http://www.w3.org/2000/xmlns/',
  39238. };
  39239. var COMPONENT_REGEX = /%COMP%/g;
  39240. var COMPONENT_VARIABLE = '%COMP%';
  39241. var HOST_ATTR = "_nghost-" + COMPONENT_VARIABLE;
  39242. var CONTENT_ATTR = "_ngcontent-" + COMPONENT_VARIABLE;
  39243. /**
  39244. * @param {?} componentShortId
  39245. * @return {?}
  39246. */
  39247. function shimContentAttribute(componentShortId) {
  39248. return CONTENT_ATTR.replace(COMPONENT_REGEX, componentShortId);
  39249. }
  39250. /**
  39251. * @param {?} componentShortId
  39252. * @return {?}
  39253. */
  39254. function shimHostAttribute(componentShortId) {
  39255. return HOST_ATTR.replace(COMPONENT_REGEX, componentShortId);
  39256. }
  39257. /**
  39258. * @param {?} compId
  39259. * @param {?} styles
  39260. * @param {?} target
  39261. * @return {?}
  39262. */
  39263. function flattenStyles(compId, styles, target) {
  39264. for (var /** @type {?} */ i = 0; i < styles.length; i++) {
  39265. var /** @type {?} */ style = styles[i];
  39266. if (Array.isArray(style)) {
  39267. flattenStyles(compId, style, target);
  39268. }
  39269. else {
  39270. style = style.replace(COMPONENT_REGEX, compId);
  39271. target.push(style);
  39272. }
  39273. }
  39274. return target;
  39275. }
  39276. /**
  39277. * @param {?} eventHandler
  39278. * @return {?}
  39279. */
  39280. function decoratePreventDefault(eventHandler) {
  39281. return function (event) {
  39282. var /** @type {?} */ allowDefaultBehavior = eventHandler(event);
  39283. if (allowDefaultBehavior === false) {
  39284. // TODO(tbosch): move preventDefault into event plugins...
  39285. event.preventDefault();
  39286. event.returnValue = false;
  39287. }
  39288. };
  39289. }
  39290. var DomRendererFactory2 = /** @class */ (function () {
  39291. function DomRendererFactory2(eventManager, sharedStylesHost) {
  39292. this.eventManager = eventManager;
  39293. this.sharedStylesHost = sharedStylesHost;
  39294. this.rendererByCompId = new Map();
  39295. this.defaultRenderer = new DefaultDomRenderer2(eventManager);
  39296. }
  39297. /**
  39298. * @param {?} element
  39299. * @param {?} type
  39300. * @return {?}
  39301. */
  39302. DomRendererFactory2.prototype.createRenderer = /**
  39303. * @param {?} element
  39304. * @param {?} type
  39305. * @return {?}
  39306. */
  39307. function (element, type) {
  39308. if (!element || !type) {
  39309. return this.defaultRenderer;
  39310. }
  39311. switch (type.encapsulation) {
  39312. case __WEBPACK_IMPORTED_MODULE_1__angular_core__["_11" /* ViewEncapsulation */].Emulated: {
  39313. var /** @type {?} */ renderer = this.rendererByCompId.get(type.id);
  39314. if (!renderer) {
  39315. renderer =
  39316. new EmulatedEncapsulationDomRenderer2(this.eventManager, this.sharedStylesHost, type);
  39317. this.rendererByCompId.set(type.id, renderer);
  39318. }
  39319. (/** @type {?} */ (renderer)).applyToHost(element);
  39320. return renderer;
  39321. }
  39322. case __WEBPACK_IMPORTED_MODULE_1__angular_core__["_11" /* ViewEncapsulation */].Native:
  39323. return new ShadowDomRenderer(this.eventManager, this.sharedStylesHost, element, type);
  39324. default: {
  39325. if (!this.rendererByCompId.has(type.id)) {
  39326. var /** @type {?} */ styles = flattenStyles(type.id, type.styles, []);
  39327. this.sharedStylesHost.addStyles(styles);
  39328. this.rendererByCompId.set(type.id, this.defaultRenderer);
  39329. }
  39330. return this.defaultRenderer;
  39331. }
  39332. }
  39333. };
  39334. /**
  39335. * @return {?}
  39336. */
  39337. DomRendererFactory2.prototype.begin = /**
  39338. * @return {?}
  39339. */
  39340. function () { };
  39341. /**
  39342. * @return {?}
  39343. */
  39344. DomRendererFactory2.prototype.end = /**
  39345. * @return {?}
  39346. */
  39347. function () { };
  39348. DomRendererFactory2.decorators = [
  39349. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["A" /* Injectable */] },
  39350. ];
  39351. /** @nocollapse */
  39352. DomRendererFactory2.ctorParameters = function () { return [
  39353. { type: EventManager, },
  39354. { type: DomSharedStylesHost, },
  39355. ]; };
  39356. return DomRendererFactory2;
  39357. }());
  39358. var DefaultDomRenderer2 = /** @class */ (function () {
  39359. function DefaultDomRenderer2(eventManager) {
  39360. this.eventManager = eventManager;
  39361. this.data = Object.create(null);
  39362. }
  39363. /**
  39364. * @return {?}
  39365. */
  39366. DefaultDomRenderer2.prototype.destroy = /**
  39367. * @return {?}
  39368. */
  39369. function () { };
  39370. /**
  39371. * @param {?} name
  39372. * @param {?=} namespace
  39373. * @return {?}
  39374. */
  39375. DefaultDomRenderer2.prototype.createElement = /**
  39376. * @param {?} name
  39377. * @param {?=} namespace
  39378. * @return {?}
  39379. */
  39380. function (name, namespace) {
  39381. if (namespace) {
  39382. return document.createElementNS(NAMESPACE_URIS[namespace], name);
  39383. }
  39384. return document.createElement(name);
  39385. };
  39386. /**
  39387. * @param {?} value
  39388. * @return {?}
  39389. */
  39390. DefaultDomRenderer2.prototype.createComment = /**
  39391. * @param {?} value
  39392. * @return {?}
  39393. */
  39394. function (value) { return document.createComment(value); };
  39395. /**
  39396. * @param {?} value
  39397. * @return {?}
  39398. */
  39399. DefaultDomRenderer2.prototype.createText = /**
  39400. * @param {?} value
  39401. * @return {?}
  39402. */
  39403. function (value) { return document.createTextNode(value); };
  39404. /**
  39405. * @param {?} parent
  39406. * @param {?} newChild
  39407. * @return {?}
  39408. */
  39409. DefaultDomRenderer2.prototype.appendChild = /**
  39410. * @param {?} parent
  39411. * @param {?} newChild
  39412. * @return {?}
  39413. */
  39414. function (parent, newChild) { parent.appendChild(newChild); };
  39415. /**
  39416. * @param {?} parent
  39417. * @param {?} newChild
  39418. * @param {?} refChild
  39419. * @return {?}
  39420. */
  39421. DefaultDomRenderer2.prototype.insertBefore = /**
  39422. * @param {?} parent
  39423. * @param {?} newChild
  39424. * @param {?} refChild
  39425. * @return {?}
  39426. */
  39427. function (parent, newChild, refChild) {
  39428. if (parent) {
  39429. parent.insertBefore(newChild, refChild);
  39430. }
  39431. };
  39432. /**
  39433. * @param {?} parent
  39434. * @param {?} oldChild
  39435. * @return {?}
  39436. */
  39437. DefaultDomRenderer2.prototype.removeChild = /**
  39438. * @param {?} parent
  39439. * @param {?} oldChild
  39440. * @return {?}
  39441. */
  39442. function (parent, oldChild) {
  39443. if (parent) {
  39444. parent.removeChild(oldChild);
  39445. }
  39446. };
  39447. /**
  39448. * @param {?} selectorOrNode
  39449. * @return {?}
  39450. */
  39451. DefaultDomRenderer2.prototype.selectRootElement = /**
  39452. * @param {?} selectorOrNode
  39453. * @return {?}
  39454. */
  39455. function (selectorOrNode) {
  39456. var /** @type {?} */ el = typeof selectorOrNode === 'string' ? document.querySelector(selectorOrNode) :
  39457. selectorOrNode;
  39458. if (!el) {
  39459. throw new Error("The selector \"" + selectorOrNode + "\" did not match any elements");
  39460. }
  39461. el.textContent = '';
  39462. return el;
  39463. };
  39464. /**
  39465. * @param {?} node
  39466. * @return {?}
  39467. */
  39468. DefaultDomRenderer2.prototype.parentNode = /**
  39469. * @param {?} node
  39470. * @return {?}
  39471. */
  39472. function (node) { return node.parentNode; };
  39473. /**
  39474. * @param {?} node
  39475. * @return {?}
  39476. */
  39477. DefaultDomRenderer2.prototype.nextSibling = /**
  39478. * @param {?} node
  39479. * @return {?}
  39480. */
  39481. function (node) { return node.nextSibling; };
  39482. /**
  39483. * @param {?} el
  39484. * @param {?} name
  39485. * @param {?} value
  39486. * @param {?=} namespace
  39487. * @return {?}
  39488. */
  39489. DefaultDomRenderer2.prototype.setAttribute = /**
  39490. * @param {?} el
  39491. * @param {?} name
  39492. * @param {?} value
  39493. * @param {?=} namespace
  39494. * @return {?}
  39495. */
  39496. function (el, name, value, namespace) {
  39497. if (namespace) {
  39498. name = namespace + ":" + name;
  39499. var /** @type {?} */ namespaceUri = NAMESPACE_URIS[namespace];
  39500. if (namespaceUri) {
  39501. el.setAttributeNS(namespaceUri, name, value);
  39502. }
  39503. else {
  39504. el.setAttribute(name, value);
  39505. }
  39506. }
  39507. else {
  39508. el.setAttribute(name, value);
  39509. }
  39510. };
  39511. /**
  39512. * @param {?} el
  39513. * @param {?} name
  39514. * @param {?=} namespace
  39515. * @return {?}
  39516. */
  39517. DefaultDomRenderer2.prototype.removeAttribute = /**
  39518. * @param {?} el
  39519. * @param {?} name
  39520. * @param {?=} namespace
  39521. * @return {?}
  39522. */
  39523. function (el, name, namespace) {
  39524. if (namespace) {
  39525. var /** @type {?} */ namespaceUri = NAMESPACE_URIS[namespace];
  39526. if (namespaceUri) {
  39527. el.removeAttributeNS(namespaceUri, name);
  39528. }
  39529. else {
  39530. el.removeAttribute(namespace + ":" + name);
  39531. }
  39532. }
  39533. else {
  39534. el.removeAttribute(name);
  39535. }
  39536. };
  39537. /**
  39538. * @param {?} el
  39539. * @param {?} name
  39540. * @return {?}
  39541. */
  39542. DefaultDomRenderer2.prototype.addClass = /**
  39543. * @param {?} el
  39544. * @param {?} name
  39545. * @return {?}
  39546. */
  39547. function (el, name) { el.classList.add(name); };
  39548. /**
  39549. * @param {?} el
  39550. * @param {?} name
  39551. * @return {?}
  39552. */
  39553. DefaultDomRenderer2.prototype.removeClass = /**
  39554. * @param {?} el
  39555. * @param {?} name
  39556. * @return {?}
  39557. */
  39558. function (el, name) { el.classList.remove(name); };
  39559. /**
  39560. * @param {?} el
  39561. * @param {?} style
  39562. * @param {?} value
  39563. * @param {?} flags
  39564. * @return {?}
  39565. */
  39566. DefaultDomRenderer2.prototype.setStyle = /**
  39567. * @param {?} el
  39568. * @param {?} style
  39569. * @param {?} value
  39570. * @param {?} flags
  39571. * @return {?}
  39572. */
  39573. function (el, style, value, flags) {
  39574. if (flags & __WEBPACK_IMPORTED_MODULE_1__angular_core__["Y" /* RendererStyleFlags2 */].DashCase) {
  39575. el.style.setProperty(style, value, !!(flags & __WEBPACK_IMPORTED_MODULE_1__angular_core__["Y" /* RendererStyleFlags2 */].Important) ? 'important' : '');
  39576. }
  39577. else {
  39578. el.style[style] = value;
  39579. }
  39580. };
  39581. /**
  39582. * @param {?} el
  39583. * @param {?} style
  39584. * @param {?} flags
  39585. * @return {?}
  39586. */
  39587. DefaultDomRenderer2.prototype.removeStyle = /**
  39588. * @param {?} el
  39589. * @param {?} style
  39590. * @param {?} flags
  39591. * @return {?}
  39592. */
  39593. function (el, style, flags) {
  39594. if (flags & __WEBPACK_IMPORTED_MODULE_1__angular_core__["Y" /* RendererStyleFlags2 */].DashCase) {
  39595. el.style.removeProperty(style);
  39596. }
  39597. else {
  39598. // IE requires '' instead of null
  39599. // see https://github.com/angular/angular/issues/7916
  39600. el.style[style] = '';
  39601. }
  39602. };
  39603. /**
  39604. * @param {?} el
  39605. * @param {?} name
  39606. * @param {?} value
  39607. * @return {?}
  39608. */
  39609. DefaultDomRenderer2.prototype.setProperty = /**
  39610. * @param {?} el
  39611. * @param {?} name
  39612. * @param {?} value
  39613. * @return {?}
  39614. */
  39615. function (el, name, value) {
  39616. checkNoSyntheticProp(name, 'property');
  39617. el[name] = value;
  39618. };
  39619. /**
  39620. * @param {?} node
  39621. * @param {?} value
  39622. * @return {?}
  39623. */
  39624. DefaultDomRenderer2.prototype.setValue = /**
  39625. * @param {?} node
  39626. * @param {?} value
  39627. * @return {?}
  39628. */
  39629. function (node, value) { node.nodeValue = value; };
  39630. /**
  39631. * @param {?} target
  39632. * @param {?} event
  39633. * @param {?} callback
  39634. * @return {?}
  39635. */
  39636. DefaultDomRenderer2.prototype.listen = /**
  39637. * @param {?} target
  39638. * @param {?} event
  39639. * @param {?} callback
  39640. * @return {?}
  39641. */
  39642. function (target, event, callback) {
  39643. checkNoSyntheticProp(event, 'listener');
  39644. if (typeof target === 'string') {
  39645. return /** @type {?} */ (this.eventManager.addGlobalEventListener(target, event, decoratePreventDefault(callback)));
  39646. }
  39647. return /** @type {?} */ ((this.eventManager.addEventListener(target, event, decoratePreventDefault(callback))));
  39648. };
  39649. return DefaultDomRenderer2;
  39650. }());
  39651. var AT_CHARCODE = '@'.charCodeAt(0);
  39652. /**
  39653. * @param {?} name
  39654. * @param {?} nameKind
  39655. * @return {?}
  39656. */
  39657. function checkNoSyntheticProp(name, nameKind) {
  39658. if (name.charCodeAt(0) === AT_CHARCODE) {
  39659. throw new Error("Found the synthetic " + nameKind + " " + name + ". Please include either \"BrowserAnimationsModule\" or \"NoopAnimationsModule\" in your application.");
  39660. }
  39661. }
  39662. var EmulatedEncapsulationDomRenderer2 = /** @class */ (function (_super) {
  39663. Object(__WEBPACK_IMPORTED_MODULE_2_tslib__["b" /* __extends */])(EmulatedEncapsulationDomRenderer2, _super);
  39664. function EmulatedEncapsulationDomRenderer2(eventManager, sharedStylesHost, component) {
  39665. var _this = _super.call(this, eventManager) || this;
  39666. _this.component = component;
  39667. var /** @type {?} */ styles = flattenStyles(component.id, component.styles, []);
  39668. sharedStylesHost.addStyles(styles);
  39669. _this.contentAttr = shimContentAttribute(component.id);
  39670. _this.hostAttr = shimHostAttribute(component.id);
  39671. return _this;
  39672. }
  39673. /**
  39674. * @param {?} element
  39675. * @return {?}
  39676. */
  39677. EmulatedEncapsulationDomRenderer2.prototype.applyToHost = /**
  39678. * @param {?} element
  39679. * @return {?}
  39680. */
  39681. function (element) { _super.prototype.setAttribute.call(this, element, this.hostAttr, ''); };
  39682. /**
  39683. * @param {?} parent
  39684. * @param {?} name
  39685. * @return {?}
  39686. */
  39687. EmulatedEncapsulationDomRenderer2.prototype.createElement = /**
  39688. * @param {?} parent
  39689. * @param {?} name
  39690. * @return {?}
  39691. */
  39692. function (parent, name) {
  39693. var /** @type {?} */ el = _super.prototype.createElement.call(this, parent, name);
  39694. _super.prototype.setAttribute.call(this, el, this.contentAttr, '');
  39695. return el;
  39696. };
  39697. return EmulatedEncapsulationDomRenderer2;
  39698. }(DefaultDomRenderer2));
  39699. var ShadowDomRenderer = /** @class */ (function (_super) {
  39700. Object(__WEBPACK_IMPORTED_MODULE_2_tslib__["b" /* __extends */])(ShadowDomRenderer, _super);
  39701. function ShadowDomRenderer(eventManager, sharedStylesHost, hostEl, component) {
  39702. var _this = _super.call(this, eventManager) || this;
  39703. _this.sharedStylesHost = sharedStylesHost;
  39704. _this.hostEl = hostEl;
  39705. _this.component = component;
  39706. _this.shadowRoot = (/** @type {?} */ (hostEl)).createShadowRoot();
  39707. _this.sharedStylesHost.addHost(_this.shadowRoot);
  39708. var /** @type {?} */ styles = flattenStyles(component.id, component.styles, []);
  39709. for (var /** @type {?} */ i = 0; i < styles.length; i++) {
  39710. var /** @type {?} */ styleEl = document.createElement('style');
  39711. styleEl.textContent = styles[i];
  39712. _this.shadowRoot.appendChild(styleEl);
  39713. }
  39714. return _this;
  39715. }
  39716. /**
  39717. * @param {?} node
  39718. * @return {?}
  39719. */
  39720. ShadowDomRenderer.prototype.nodeOrShadowRoot = /**
  39721. * @param {?} node
  39722. * @return {?}
  39723. */
  39724. function (node) { return node === this.hostEl ? this.shadowRoot : node; };
  39725. /**
  39726. * @return {?}
  39727. */
  39728. ShadowDomRenderer.prototype.destroy = /**
  39729. * @return {?}
  39730. */
  39731. function () { this.sharedStylesHost.removeHost(this.shadowRoot); };
  39732. /**
  39733. * @param {?} parent
  39734. * @param {?} newChild
  39735. * @return {?}
  39736. */
  39737. ShadowDomRenderer.prototype.appendChild = /**
  39738. * @param {?} parent
  39739. * @param {?} newChild
  39740. * @return {?}
  39741. */
  39742. function (parent, newChild) {
  39743. return _super.prototype.appendChild.call(this, this.nodeOrShadowRoot(parent), newChild);
  39744. };
  39745. /**
  39746. * @param {?} parent
  39747. * @param {?} newChild
  39748. * @param {?} refChild
  39749. * @return {?}
  39750. */
  39751. ShadowDomRenderer.prototype.insertBefore = /**
  39752. * @param {?} parent
  39753. * @param {?} newChild
  39754. * @param {?} refChild
  39755. * @return {?}
  39756. */
  39757. function (parent, newChild, refChild) {
  39758. return _super.prototype.insertBefore.call(this, this.nodeOrShadowRoot(parent), newChild, refChild);
  39759. };
  39760. /**
  39761. * @param {?} parent
  39762. * @param {?} oldChild
  39763. * @return {?}
  39764. */
  39765. ShadowDomRenderer.prototype.removeChild = /**
  39766. * @param {?} parent
  39767. * @param {?} oldChild
  39768. * @return {?}
  39769. */
  39770. function (parent, oldChild) {
  39771. return _super.prototype.removeChild.call(this, this.nodeOrShadowRoot(parent), oldChild);
  39772. };
  39773. /**
  39774. * @param {?} node
  39775. * @return {?}
  39776. */
  39777. ShadowDomRenderer.prototype.parentNode = /**
  39778. * @param {?} node
  39779. * @return {?}
  39780. */
  39781. function (node) {
  39782. return this.nodeOrShadowRoot(_super.prototype.parentNode.call(this, this.nodeOrShadowRoot(node)));
  39783. };
  39784. return ShadowDomRenderer;
  39785. }(DefaultDomRenderer2));
  39786. /**
  39787. * @fileoverview added by tsickle
  39788. * @suppress {checkTypes} checked by tsc
  39789. */
  39790. /**
  39791. * @license
  39792. * Copyright Google Inc. All Rights Reserved.
  39793. *
  39794. * Use of this source code is governed by an MIT-style license that can be
  39795. * found in the LICENSE file at https://angular.io/license
  39796. */
  39797. var ɵ0 = function (v) {
  39798. return '__zone_symbol__' + v;
  39799. };
  39800. /**
  39801. * Detect if Zone is present. If it is then use simple zone aware 'addEventListener'
  39802. * since Angular can do much more
  39803. * efficient bookkeeping than Zone can, because we have additional information. This speeds up
  39804. * addEventListener by 3x.
  39805. */
  39806. var __symbol__ = (typeof Zone !== 'undefined') && (/** @type {?} */ (Zone))['__symbol__'] || ɵ0;
  39807. var ADD_EVENT_LISTENER = __symbol__('addEventListener');
  39808. var REMOVE_EVENT_LISTENER = __symbol__('removeEventListener');
  39809. var symbolNames = {};
  39810. var FALSE = 'FALSE';
  39811. var ANGULAR = 'ANGULAR';
  39812. var NATIVE_ADD_LISTENER = 'addEventListener';
  39813. var NATIVE_REMOVE_LISTENER = 'removeEventListener';
  39814. // use the same symbol string which is used in zone.js
  39815. var stopSymbol = '__zone_symbol__propagationStopped';
  39816. var stopMethodSymbol = '__zone_symbol__stopImmediatePropagation';
  39817. var blackListedEvents = (typeof Zone !== 'undefined') && (/** @type {?} */ (Zone))[__symbol__('BLACK_LISTED_EVENTS')];
  39818. var blackListedMap;
  39819. if (blackListedEvents) {
  39820. blackListedMap = {};
  39821. blackListedEvents.forEach(function (eventName) { blackListedMap[eventName] = eventName; });
  39822. }
  39823. var isBlackListedEvent = function (eventName) {
  39824. if (!blackListedMap) {
  39825. return false;
  39826. }
  39827. return blackListedMap.hasOwnProperty(eventName);
  39828. };
  39829. // a global listener to handle all dom event,
  39830. // so we do not need to create a closure everytime
  39831. var globalListener = function (event) {
  39832. var /** @type {?} */ symbolName = symbolNames[event.type];
  39833. if (!symbolName) {
  39834. return;
  39835. }
  39836. var /** @type {?} */ taskDatas = this[symbolName];
  39837. if (!taskDatas) {
  39838. return;
  39839. }
  39840. var /** @type {?} */ args = [event];
  39841. if (taskDatas.length === 1) {
  39842. // if taskDatas only have one element, just invoke it
  39843. var /** @type {?} */ taskData = taskDatas[0];
  39844. if (taskData.zone !== Zone.current) {
  39845. // only use Zone.run when Zone.current not equals to stored zone
  39846. return taskData.zone.run(taskData.handler, this, args);
  39847. }
  39848. else {
  39849. return taskData.handler.apply(this, args);
  39850. }
  39851. }
  39852. else {
  39853. // copy tasks as a snapshot to avoid event handlers remove
  39854. // itself or others
  39855. var /** @type {?} */ copiedTasks = taskDatas.slice();
  39856. for (var /** @type {?} */ i = 0; i < copiedTasks.length; i++) {
  39857. // if other listener call event.stopImmediatePropagation
  39858. // just break
  39859. if ((/** @type {?} */ (event))[stopSymbol] === true) {
  39860. break;
  39861. }
  39862. var /** @type {?} */ taskData = copiedTasks[i];
  39863. if (taskData.zone !== Zone.current) {
  39864. // only use Zone.run when Zone.current not equals to stored zone
  39865. taskData.zone.run(taskData.handler, this, args);
  39866. }
  39867. else {
  39868. taskData.handler.apply(this, args);
  39869. }
  39870. }
  39871. }
  39872. };
  39873. var DomEventsPlugin = /** @class */ (function (_super) {
  39874. Object(__WEBPACK_IMPORTED_MODULE_2_tslib__["b" /* __extends */])(DomEventsPlugin, _super);
  39875. function DomEventsPlugin(doc, ngZone) {
  39876. var _this = _super.call(this, doc) || this;
  39877. _this.ngZone = ngZone;
  39878. _this.patchEvent();
  39879. return _this;
  39880. }
  39881. /**
  39882. * @return {?}
  39883. */
  39884. DomEventsPlugin.prototype.patchEvent = /**
  39885. * @return {?}
  39886. */
  39887. function () {
  39888. if (!Event || !Event.prototype) {
  39889. return;
  39890. }
  39891. if ((/** @type {?} */ (Event.prototype))[stopMethodSymbol]) {
  39892. // already patched by zone.js
  39893. return;
  39894. }
  39895. var /** @type {?} */ delegate = (/** @type {?} */ (Event.prototype))[stopMethodSymbol] =
  39896. Event.prototype.stopImmediatePropagation;
  39897. Event.prototype.stopImmediatePropagation = function () {
  39898. if (this) {
  39899. this[stopSymbol] = true;
  39900. }
  39901. // should call native delegate in case
  39902. // in some enviroment part of the application
  39903. // will not use the patched Event
  39904. delegate && delegate.apply(this, arguments);
  39905. };
  39906. };
  39907. // This plugin should come last in the list of plugins, because it accepts all
  39908. // events.
  39909. /**
  39910. * @param {?} eventName
  39911. * @return {?}
  39912. */
  39913. DomEventsPlugin.prototype.supports = /**
  39914. * @param {?} eventName
  39915. * @return {?}
  39916. */
  39917. function (eventName) { return true; };
  39918. /**
  39919. * @param {?} element
  39920. * @param {?} eventName
  39921. * @param {?} handler
  39922. * @return {?}
  39923. */
  39924. DomEventsPlugin.prototype.addEventListener = /**
  39925. * @param {?} element
  39926. * @param {?} eventName
  39927. * @param {?} handler
  39928. * @return {?}
  39929. */
  39930. function (element, eventName, handler) {
  39931. var _this = this;
  39932. /**
  39933. * This code is about to add a listener to the DOM. If Zone.js is present, than
  39934. * `addEventListener` has been patched. The patched code adds overhead in both
  39935. * memory and speed (3x slower) than native. For this reason if we detect that
  39936. * Zone.js is present we use a simple version of zone aware addEventListener instead.
  39937. * The result is faster registration and the zone will be restored.
  39938. * But ZoneSpec.onScheduleTask, ZoneSpec.onInvokeTask, ZoneSpec.onCancelTask
  39939. * will not be invoked
  39940. * We also do manual zone restoration in element.ts renderEventHandlerClosure method.
  39941. *
  39942. * NOTE: it is possible that the element is from different iframe, and so we
  39943. * have to check before we execute the method.
  39944. */
  39945. var /** @type {?} */ self = this;
  39946. var /** @type {?} */ zoneJsLoaded = element[ADD_EVENT_LISTENER];
  39947. var /** @type {?} */ callback = /** @type {?} */ (handler);
  39948. // if zonejs is loaded and current zone is not ngZone
  39949. // we keep Zone.current on target for later restoration.
  39950. if (zoneJsLoaded && (!__WEBPACK_IMPORTED_MODULE_1__angular_core__["M" /* NgZone */].isInAngularZone() || isBlackListedEvent(eventName))) {
  39951. var /** @type {?} */ symbolName = symbolNames[eventName];
  39952. if (!symbolName) {
  39953. symbolName = symbolNames[eventName] = __symbol__(ANGULAR + eventName + FALSE);
  39954. }
  39955. var /** @type {?} */ taskDatas = (/** @type {?} */ (element))[symbolName];
  39956. var /** @type {?} */ globalListenerRegistered = taskDatas && taskDatas.length > 0;
  39957. if (!taskDatas) {
  39958. taskDatas = (/** @type {?} */ (element))[symbolName] = [];
  39959. }
  39960. var /** @type {?} */ zone = isBlackListedEvent(eventName) ? Zone.root : Zone.current;
  39961. if (taskDatas.length === 0) {
  39962. taskDatas.push({ zone: zone, handler: callback });
  39963. }
  39964. else {
  39965. var /** @type {?} */ callbackRegistered = false;
  39966. for (var /** @type {?} */ i = 0; i < taskDatas.length; i++) {
  39967. if (taskDatas[i].handler === callback) {
  39968. callbackRegistered = true;
  39969. break;
  39970. }
  39971. }
  39972. if (!callbackRegistered) {
  39973. taskDatas.push({ zone: zone, handler: callback });
  39974. }
  39975. }
  39976. if (!globalListenerRegistered) {
  39977. element[ADD_EVENT_LISTENER](eventName, globalListener, false);
  39978. }
  39979. }
  39980. else {
  39981. element[NATIVE_ADD_LISTENER](eventName, callback, false);
  39982. }
  39983. return function () { return _this.removeEventListener(element, eventName, callback); };
  39984. };
  39985. /**
  39986. * @param {?} target
  39987. * @param {?} eventName
  39988. * @param {?} callback
  39989. * @return {?}
  39990. */
  39991. DomEventsPlugin.prototype.removeEventListener = /**
  39992. * @param {?} target
  39993. * @param {?} eventName
  39994. * @param {?} callback
  39995. * @return {?}
  39996. */
  39997. function (target, eventName, callback) {
  39998. var /** @type {?} */ underlyingRemove = target[REMOVE_EVENT_LISTENER];
  39999. // zone.js not loaded, use native removeEventListener
  40000. if (!underlyingRemove) {
  40001. return target[NATIVE_REMOVE_LISTENER].apply(target, [eventName, callback, false]);
  40002. }
  40003. var /** @type {?} */ symbolName = symbolNames[eventName];
  40004. var /** @type {?} */ taskDatas = symbolName && target[symbolName];
  40005. if (!taskDatas) {
  40006. // addEventListener not using patched version
  40007. // just call native removeEventListener
  40008. return target[NATIVE_REMOVE_LISTENER].apply(target, [eventName, callback, false]);
  40009. }
  40010. // fix issue 20532, should be able to remove
  40011. // listener which was added inside of ngZone
  40012. var /** @type {?} */ found = false;
  40013. for (var /** @type {?} */ i = 0; i < taskDatas.length; i++) {
  40014. // remove listener from taskDatas if the callback equals
  40015. if (taskDatas[i].handler === callback) {
  40016. found = true;
  40017. taskDatas.splice(i, 1);
  40018. break;
  40019. }
  40020. }
  40021. if (found) {
  40022. if (taskDatas.length === 0) {
  40023. // all listeners are removed, we can remove the globalListener from target
  40024. underlyingRemove.apply(target, [eventName, globalListener, false]);
  40025. }
  40026. }
  40027. else {
  40028. // not found in taskDatas, the callback may be added inside of ngZone
  40029. // use native remove listener to remove the calback
  40030. target[NATIVE_REMOVE_LISTENER].apply(target, [eventName, callback, false]);
  40031. }
  40032. };
  40033. DomEventsPlugin.decorators = [
  40034. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["A" /* Injectable */] },
  40035. ];
  40036. /** @nocollapse */
  40037. DomEventsPlugin.ctorParameters = function () { return [
  40038. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["z" /* Inject */], args: [DOCUMENT$1,] },] },
  40039. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["M" /* NgZone */], },
  40040. ]; };
  40041. return DomEventsPlugin;
  40042. }(EventManagerPlugin));
  40043. /**
  40044. * @fileoverview added by tsickle
  40045. * @suppress {checkTypes} checked by tsc
  40046. */
  40047. /**
  40048. * @license
  40049. * Copyright Google Inc. All Rights Reserved.
  40050. *
  40051. * Use of this source code is governed by an MIT-style license that can be
  40052. * found in the LICENSE file at https://angular.io/license
  40053. */
  40054. var EVENT_NAMES = {
  40055. // pan
  40056. 'pan': true,
  40057. 'panstart': true,
  40058. 'panmove': true,
  40059. 'panend': true,
  40060. 'pancancel': true,
  40061. 'panleft': true,
  40062. 'panright': true,
  40063. 'panup': true,
  40064. 'pandown': true,
  40065. // pinch
  40066. 'pinch': true,
  40067. 'pinchstart': true,
  40068. 'pinchmove': true,
  40069. 'pinchend': true,
  40070. 'pinchcancel': true,
  40071. 'pinchin': true,
  40072. 'pinchout': true,
  40073. // press
  40074. 'press': true,
  40075. 'pressup': true,
  40076. // rotate
  40077. 'rotate': true,
  40078. 'rotatestart': true,
  40079. 'rotatemove': true,
  40080. 'rotateend': true,
  40081. 'rotatecancel': true,
  40082. // swipe
  40083. 'swipe': true,
  40084. 'swipeleft': true,
  40085. 'swiperight': true,
  40086. 'swipeup': true,
  40087. 'swipedown': true,
  40088. // tap
  40089. 'tap': true,
  40090. };
  40091. /**
  40092. * A DI token that you can use to provide{\@link HammerGestureConfig} to Angular. Use it to configure
  40093. * Hammer gestures.
  40094. *
  40095. * \@experimental
  40096. */
  40097. var HAMMER_GESTURE_CONFIG = new __WEBPACK_IMPORTED_MODULE_1__angular_core__["B" /* InjectionToken */]('HammerGestureConfig');
  40098. /**
  40099. * @record
  40100. */
  40101. /**
  40102. * \@experimental
  40103. */
  40104. var HammerGestureConfig = /** @class */ (function () {
  40105. function HammerGestureConfig() {
  40106. this.events = [];
  40107. this.overrides = {};
  40108. }
  40109. /**
  40110. * @param {?} element
  40111. * @return {?}
  40112. */
  40113. HammerGestureConfig.prototype.buildHammer = /**
  40114. * @param {?} element
  40115. * @return {?}
  40116. */
  40117. function (element) {
  40118. var /** @type {?} */ mc = new Hammer(element);
  40119. mc.get('pinch').set({ enable: true });
  40120. mc.get('rotate').set({ enable: true });
  40121. for (var /** @type {?} */ eventName in this.overrides) {
  40122. mc.get(eventName).set(this.overrides[eventName]);
  40123. }
  40124. return mc;
  40125. };
  40126. HammerGestureConfig.decorators = [
  40127. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["A" /* Injectable */] },
  40128. ];
  40129. /** @nocollapse */
  40130. HammerGestureConfig.ctorParameters = function () { return []; };
  40131. return HammerGestureConfig;
  40132. }());
  40133. var HammerGesturesPlugin = /** @class */ (function (_super) {
  40134. Object(__WEBPACK_IMPORTED_MODULE_2_tslib__["b" /* __extends */])(HammerGesturesPlugin, _super);
  40135. function HammerGesturesPlugin(doc, _config) {
  40136. var _this = _super.call(this, doc) || this;
  40137. _this._config = _config;
  40138. return _this;
  40139. }
  40140. /**
  40141. * @param {?} eventName
  40142. * @return {?}
  40143. */
  40144. HammerGesturesPlugin.prototype.supports = /**
  40145. * @param {?} eventName
  40146. * @return {?}
  40147. */
  40148. function (eventName) {
  40149. if (!EVENT_NAMES.hasOwnProperty(eventName.toLowerCase()) && !this.isCustomEvent(eventName)) {
  40150. return false;
  40151. }
  40152. if (!(/** @type {?} */ (window)).Hammer) {
  40153. throw new Error("Hammer.js is not loaded, can not bind " + eventName + " event");
  40154. }
  40155. return true;
  40156. };
  40157. /**
  40158. * @param {?} element
  40159. * @param {?} eventName
  40160. * @param {?} handler
  40161. * @return {?}
  40162. */
  40163. HammerGesturesPlugin.prototype.addEventListener = /**
  40164. * @param {?} element
  40165. * @param {?} eventName
  40166. * @param {?} handler
  40167. * @return {?}
  40168. */
  40169. function (element, eventName, handler) {
  40170. var _this = this;
  40171. var /** @type {?} */ zone = this.manager.getZone();
  40172. eventName = eventName.toLowerCase();
  40173. return zone.runOutsideAngular(function () {
  40174. // Creating the manager bind events, must be done outside of angular
  40175. var /** @type {?} */ mc = _this._config.buildHammer(element);
  40176. var /** @type {?} */ callback = function (eventObj) {
  40177. zone.runGuarded(function () { handler(eventObj); });
  40178. };
  40179. mc.on(eventName, callback);
  40180. return function () { return mc.off(eventName, callback); };
  40181. });
  40182. };
  40183. /**
  40184. * @param {?} eventName
  40185. * @return {?}
  40186. */
  40187. HammerGesturesPlugin.prototype.isCustomEvent = /**
  40188. * @param {?} eventName
  40189. * @return {?}
  40190. */
  40191. function (eventName) { return this._config.events.indexOf(eventName) > -1; };
  40192. HammerGesturesPlugin.decorators = [
  40193. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["A" /* Injectable */] },
  40194. ];
  40195. /** @nocollapse */
  40196. HammerGesturesPlugin.ctorParameters = function () { return [
  40197. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["z" /* Inject */], args: [DOCUMENT$1,] },] },
  40198. { type: HammerGestureConfig, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["z" /* Inject */], args: [HAMMER_GESTURE_CONFIG,] },] },
  40199. ]; };
  40200. return HammerGesturesPlugin;
  40201. }(EventManagerPlugin));
  40202. /**
  40203. * @fileoverview added by tsickle
  40204. * @suppress {checkTypes} checked by tsc
  40205. */
  40206. /**
  40207. * @license
  40208. * Copyright Google Inc. All Rights Reserved.
  40209. *
  40210. * Use of this source code is governed by an MIT-style license that can be
  40211. * found in the LICENSE file at https://angular.io/license
  40212. */
  40213. var MODIFIER_KEYS = ['alt', 'control', 'meta', 'shift'];
  40214. var ɵ0$1 = function (event) { return event.altKey; };
  40215. var ɵ1$1 = function (event) { return event.ctrlKey; };
  40216. var ɵ2$1 = function (event) { return event.metaKey; };
  40217. var ɵ3 = function (event) { return event.shiftKey; };
  40218. var MODIFIER_KEY_GETTERS = {
  40219. 'alt': ɵ0$1,
  40220. 'control': ɵ1$1,
  40221. 'meta': ɵ2$1,
  40222. 'shift': ɵ3
  40223. };
  40224. /**
  40225. * \@experimental
  40226. */
  40227. var KeyEventsPlugin = /** @class */ (function (_super) {
  40228. Object(__WEBPACK_IMPORTED_MODULE_2_tslib__["b" /* __extends */])(KeyEventsPlugin, _super);
  40229. function KeyEventsPlugin(doc) {
  40230. return _super.call(this, doc) || this;
  40231. }
  40232. /**
  40233. * @param {?} eventName
  40234. * @return {?}
  40235. */
  40236. KeyEventsPlugin.prototype.supports = /**
  40237. * @param {?} eventName
  40238. * @return {?}
  40239. */
  40240. function (eventName) { return KeyEventsPlugin.parseEventName(eventName) != null; };
  40241. /**
  40242. * @param {?} element
  40243. * @param {?} eventName
  40244. * @param {?} handler
  40245. * @return {?}
  40246. */
  40247. KeyEventsPlugin.prototype.addEventListener = /**
  40248. * @param {?} element
  40249. * @param {?} eventName
  40250. * @param {?} handler
  40251. * @return {?}
  40252. */
  40253. function (element, eventName, handler) {
  40254. var /** @type {?} */ parsedEvent = /** @type {?} */ ((KeyEventsPlugin.parseEventName(eventName)));
  40255. var /** @type {?} */ outsideHandler = KeyEventsPlugin.eventCallback(parsedEvent['fullKey'], handler, this.manager.getZone());
  40256. return this.manager.getZone().runOutsideAngular(function () {
  40257. return getDOM().onAndCancel(element, parsedEvent['domEventName'], outsideHandler);
  40258. });
  40259. };
  40260. /**
  40261. * @param {?} eventName
  40262. * @return {?}
  40263. */
  40264. KeyEventsPlugin.parseEventName = /**
  40265. * @param {?} eventName
  40266. * @return {?}
  40267. */
  40268. function (eventName) {
  40269. var /** @type {?} */ parts = eventName.toLowerCase().split('.');
  40270. var /** @type {?} */ domEventName = parts.shift();
  40271. if ((parts.length === 0) || !(domEventName === 'keydown' || domEventName === 'keyup')) {
  40272. return null;
  40273. }
  40274. var /** @type {?} */ key = KeyEventsPlugin._normalizeKey(/** @type {?} */ ((parts.pop())));
  40275. var /** @type {?} */ fullKey = '';
  40276. MODIFIER_KEYS.forEach(function (modifierName) {
  40277. var /** @type {?} */ index = parts.indexOf(modifierName);
  40278. if (index > -1) {
  40279. parts.splice(index, 1);
  40280. fullKey += modifierName + '.';
  40281. }
  40282. });
  40283. fullKey += key;
  40284. if (parts.length != 0 || key.length === 0) {
  40285. // returning null instead of throwing to let another plugin process the event
  40286. return null;
  40287. }
  40288. var /** @type {?} */ result = {};
  40289. result['domEventName'] = domEventName;
  40290. result['fullKey'] = fullKey;
  40291. return result;
  40292. };
  40293. /**
  40294. * @param {?} event
  40295. * @return {?}
  40296. */
  40297. KeyEventsPlugin.getEventFullKey = /**
  40298. * @param {?} event
  40299. * @return {?}
  40300. */
  40301. function (event) {
  40302. var /** @type {?} */ fullKey = '';
  40303. var /** @type {?} */ key = getDOM().getEventKey(event);
  40304. key = key.toLowerCase();
  40305. if (key === ' ') {
  40306. key = 'space'; // for readability
  40307. }
  40308. else if (key === '.') {
  40309. key = 'dot'; // because '.' is used as a separator in event names
  40310. }
  40311. MODIFIER_KEYS.forEach(function (modifierName) {
  40312. if (modifierName != key) {
  40313. var /** @type {?} */ modifierGetter = MODIFIER_KEY_GETTERS[modifierName];
  40314. if (modifierGetter(event)) {
  40315. fullKey += modifierName + '.';
  40316. }
  40317. }
  40318. });
  40319. fullKey += key;
  40320. return fullKey;
  40321. };
  40322. /**
  40323. * @param {?} fullKey
  40324. * @param {?} handler
  40325. * @param {?} zone
  40326. * @return {?}
  40327. */
  40328. KeyEventsPlugin.eventCallback = /**
  40329. * @param {?} fullKey
  40330. * @param {?} handler
  40331. * @param {?} zone
  40332. * @return {?}
  40333. */
  40334. function (fullKey, handler, zone) {
  40335. return function (event /** TODO #9100 */) {
  40336. if (KeyEventsPlugin.getEventFullKey(event) === fullKey) {
  40337. zone.runGuarded(function () { return handler(event); });
  40338. }
  40339. };
  40340. };
  40341. /** @internal */
  40342. /**
  40343. * \@internal
  40344. * @param {?} keyName
  40345. * @return {?}
  40346. */
  40347. KeyEventsPlugin._normalizeKey = /**
  40348. * \@internal
  40349. * @param {?} keyName
  40350. * @return {?}
  40351. */
  40352. function (keyName) {
  40353. // TODO: switch to a Map if the mapping grows too much
  40354. switch (keyName) {
  40355. case 'esc':
  40356. return 'escape';
  40357. default:
  40358. return keyName;
  40359. }
  40360. };
  40361. KeyEventsPlugin.decorators = [
  40362. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["A" /* Injectable */] },
  40363. ];
  40364. /** @nocollapse */
  40365. KeyEventsPlugin.ctorParameters = function () { return [
  40366. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["z" /* Inject */], args: [DOCUMENT$1,] },] },
  40367. ]; };
  40368. return KeyEventsPlugin;
  40369. }(EventManagerPlugin));
  40370. /**
  40371. * @fileoverview added by tsickle
  40372. * @suppress {checkTypes} checked by tsc
  40373. */
  40374. /**
  40375. * @license
  40376. * Copyright Google Inc. All Rights Reserved.
  40377. *
  40378. * Use of this source code is governed by an MIT-style license that can be
  40379. * found in the LICENSE file at https://angular.io/license
  40380. */
  40381. /**
  40382. * This helper class is used to get hold of an inert tree of DOM elements containing dirty HTML
  40383. * that needs sanitizing.
  40384. * Depending upon browser support we must use one of three strategies for doing this.
  40385. * Support: Safari 10.x -> XHR strategy
  40386. * Support: Firefox -> DomParser strategy
  40387. * Default: InertDocument strategy
  40388. */
  40389. var InertBodyHelper = /** @class */ (function () {
  40390. function InertBodyHelper(defaultDoc, DOM) {
  40391. this.defaultDoc = defaultDoc;
  40392. this.DOM = DOM;
  40393. var /** @type {?} */ inertDocument = this.DOM.createHtmlDocument();
  40394. this.inertBodyElement = inertDocument.body;
  40395. if (this.inertBodyElement == null) {
  40396. // usually there should be only one body element in the document, but IE doesn't have any, so
  40397. // we need to create one.
  40398. var /** @type {?} */ inertHtml = this.DOM.createElement('html', inertDocument);
  40399. this.inertBodyElement = this.DOM.createElement('body', inertDocument);
  40400. this.DOM.appendChild(inertHtml, this.inertBodyElement);
  40401. this.DOM.appendChild(inertDocument, inertHtml);
  40402. }
  40403. this.DOM.setInnerHTML(this.inertBodyElement, '<svg><g onload="this.parentNode.remove()"></g></svg>');
  40404. if (this.inertBodyElement.querySelector && !this.inertBodyElement.querySelector('svg')) {
  40405. // We just hit the Safari 10.1 bug - which allows JS to run inside the SVG G element
  40406. // so use the XHR strategy.
  40407. this.getInertBodyElement = this.getInertBodyElement_XHR;
  40408. return;
  40409. }
  40410. this.DOM.setInnerHTML(this.inertBodyElement, '<svg><p><style><img src="</style><img src=x onerror=alert(1)//">');
  40411. if (this.inertBodyElement.querySelector && this.inertBodyElement.querySelector('svg img')) {
  40412. // We just hit the Firefox bug - which prevents the inner img JS from being sanitized
  40413. // so use the DOMParser strategy, if it is available.
  40414. // If the DOMParser is not available then we are not in Firefox (Server/WebWorker?) so we
  40415. // fall through to the default strategy below.
  40416. if (isDOMParserAvailable()) {
  40417. this.getInertBodyElement = this.getInertBodyElement_DOMParser;
  40418. return;
  40419. }
  40420. }
  40421. // None of the bugs were hit so it is safe for us to use the default InertDocument strategy
  40422. this.getInertBodyElement = this.getInertBodyElement_InertDocument;
  40423. }
  40424. /**
  40425. * Use XHR to create and fill an inert body element (on Safari 10.1)
  40426. * See
  40427. * https://github.com/cure53/DOMPurify/blob/a992d3a75031cb8bb032e5ea8399ba972bdf9a65/src/purify.js#L439-L449
  40428. * @param {?} html
  40429. * @return {?}
  40430. */
  40431. InertBodyHelper.prototype.getInertBodyElement_XHR = /**
  40432. * Use XHR to create and fill an inert body element (on Safari 10.1)
  40433. * See
  40434. * https://github.com/cure53/DOMPurify/blob/a992d3a75031cb8bb032e5ea8399ba972bdf9a65/src/purify.js#L439-L449
  40435. * @param {?} html
  40436. * @return {?}
  40437. */
  40438. function (html) {
  40439. // We add these extra elements to ensure that the rest of the content is parsed as expected
  40440. // e.g. leading whitespace is maintained and tags like `<meta>` do not get hoisted to the
  40441. // `<head>` tag.
  40442. html = '<body><remove></remove>' + html + '</body>';
  40443. try {
  40444. html = encodeURI(html);
  40445. }
  40446. catch (/** @type {?} */ e) {
  40447. return null;
  40448. }
  40449. var /** @type {?} */ xhr = new XMLHttpRequest();
  40450. xhr.responseType = 'document';
  40451. xhr.open('GET', 'data:text/html;charset=utf-8,' + html, false);
  40452. xhr.send(null);
  40453. var /** @type {?} */ body = xhr.response.body;
  40454. body.removeChild(/** @type {?} */ ((body.firstChild)));
  40455. return body;
  40456. };
  40457. /**
  40458. * Use DOMParser to create and fill an inert body element (on Firefox)
  40459. * See https://github.com/cure53/DOMPurify/releases/tag/0.6.7
  40460. *
  40461. * @param {?} html
  40462. * @return {?}
  40463. */
  40464. InertBodyHelper.prototype.getInertBodyElement_DOMParser = /**
  40465. * Use DOMParser to create and fill an inert body element (on Firefox)
  40466. * See https://github.com/cure53/DOMPurify/releases/tag/0.6.7
  40467. *
  40468. * @param {?} html
  40469. * @return {?}
  40470. */
  40471. function (html) {
  40472. // We add these extra elements to ensure that the rest of the content is parsed as expected
  40473. // e.g. leading whitespace is maintained and tags like `<meta>` do not get hoisted to the
  40474. // `<head>` tag.
  40475. html = '<body><remove></remove>' + html + '</body>';
  40476. try {
  40477. var /** @type {?} */ body = /** @type {?} */ (new (/** @type {?} */ (window))
  40478. .DOMParser()
  40479. .parseFromString(html, 'text/html')
  40480. .body);
  40481. body.removeChild(/** @type {?} */ ((body.firstChild)));
  40482. return body;
  40483. }
  40484. catch (/** @type {?} */ e) {
  40485. return null;
  40486. }
  40487. };
  40488. /**
  40489. * Use an HTML5 `template` element, if supported, or an inert body element created via
  40490. * `createHtmlDocument` to create and fill an inert DOM element.
  40491. * This is the default sane strategy to use if the browser does not require one of the specialised
  40492. * strategies above.
  40493. * @param {?} html
  40494. * @return {?}
  40495. */
  40496. InertBodyHelper.prototype.getInertBodyElement_InertDocument = /**
  40497. * Use an HTML5 `template` element, if supported, or an inert body element created via
  40498. * `createHtmlDocument` to create and fill an inert DOM element.
  40499. * This is the default sane strategy to use if the browser does not require one of the specialised
  40500. * strategies above.
  40501. * @param {?} html
  40502. * @return {?}
  40503. */
  40504. function (html) {
  40505. // Prefer using <template> element if supported.
  40506. var /** @type {?} */ templateEl = this.DOM.createElement('template');
  40507. if ('content' in templateEl) {
  40508. this.DOM.setInnerHTML(templateEl, html);
  40509. return templateEl;
  40510. }
  40511. this.DOM.setInnerHTML(this.inertBodyElement, html);
  40512. // Support: IE 9-11 only
  40513. // strip custom-namespaced attributes on IE<=11
  40514. if (this.defaultDoc.documentMode) {
  40515. this.stripCustomNsAttrs(this.inertBodyElement);
  40516. }
  40517. return this.inertBodyElement;
  40518. };
  40519. /**
  40520. * When IE9-11 comes across an unknown namespaced attribute e.g. 'xlink:foo' it adds 'xmlns:ns1'
  40521. * attribute to declare ns1 namespace and prefixes the attribute with 'ns1' (e.g.
  40522. * 'ns1:xlink:foo').
  40523. *
  40524. * This is undesirable since we don't want to allow any of these custom attributes. This method
  40525. * strips them all.
  40526. * @param {?} el
  40527. * @return {?}
  40528. */
  40529. InertBodyHelper.prototype.stripCustomNsAttrs = /**
  40530. * When IE9-11 comes across an unknown namespaced attribute e.g. 'xlink:foo' it adds 'xmlns:ns1'
  40531. * attribute to declare ns1 namespace and prefixes the attribute with 'ns1' (e.g.
  40532. * 'ns1:xlink:foo').
  40533. *
  40534. * This is undesirable since we don't want to allow any of these custom attributes. This method
  40535. * strips them all.
  40536. * @param {?} el
  40537. * @return {?}
  40538. */
  40539. function (el) {
  40540. var _this = this;
  40541. this.DOM.attributeMap(el).forEach(function (_, attrName) {
  40542. if (attrName === 'xmlns:ns1' || attrName.indexOf('ns1:') === 0) {
  40543. _this.DOM.removeAttribute(el, attrName);
  40544. }
  40545. });
  40546. for (var _i = 0, _a = this.DOM.childNodesAsList(el); _i < _a.length; _i++) {
  40547. var n = _a[_i];
  40548. if (this.DOM.isElementNode(n))
  40549. this.stripCustomNsAttrs(/** @type {?} */ (n));
  40550. }
  40551. };
  40552. return InertBodyHelper;
  40553. }());
  40554. /**
  40555. * We need to determine whether the DOMParser exists in the global context.
  40556. * The try-catch is because, on some browsers, trying to access this property
  40557. * on window can actually throw an error.
  40558. *
  40559. * @suppress {uselessCode}
  40560. * @return {?}
  40561. */
  40562. function isDOMParserAvailable() {
  40563. try {
  40564. return !!(/** @type {?} */ (window)).DOMParser;
  40565. }
  40566. catch (/** @type {?} */ e) {
  40567. return false;
  40568. }
  40569. }
  40570. /**
  40571. * @fileoverview added by tsickle
  40572. * @suppress {checkTypes} checked by tsc
  40573. */
  40574. /**
  40575. * @license
  40576. * Copyright Google Inc. All Rights Reserved.
  40577. *
  40578. * Use of this source code is governed by an MIT-style license that can be
  40579. * found in the LICENSE file at https://angular.io/license
  40580. */
  40581. /**
  40582. * A pattern that recognizes a commonly useful subset of URLs that are safe.
  40583. *
  40584. * This regular expression matches a subset of URLs that will not cause script
  40585. * execution if used in URL context within a HTML document. Specifically, this
  40586. * regular expression matches if (comment from here on and regex copied from
  40587. * Soy's EscapingConventions):
  40588. * (1) Either a protocol in a whitelist (http, https, mailto or ftp).
  40589. * (2) or no protocol. A protocol must be followed by a colon. The below
  40590. * allows that by allowing colons only after one of the characters [/?#].
  40591. * A colon after a hash (#) must be in the fragment.
  40592. * Otherwise, a colon after a (?) must be in a query.
  40593. * Otherwise, a colon after a single solidus (/) must be in a path.
  40594. * Otherwise, a colon after a double solidus (//) must be in the authority
  40595. * (before port).
  40596. *
  40597. * The pattern disallows &, used in HTML entity declarations before
  40598. * one of the characters in [/?#]. This disallows HTML entities used in the
  40599. * protocol name, which should never happen, e.g. "h&#116;tp" for "http".
  40600. * It also disallows HTML entities in the first path part of a relative path,
  40601. * e.g. "foo&lt;bar/baz". Our existing escaping functions should not produce
  40602. * that. More importantly, it disallows masking of a colon,
  40603. * e.g. "javascript&#58;...".
  40604. *
  40605. * This regular expression was taken from the Closure sanitization library.
  40606. */
  40607. var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi;
  40608. /**
  40609. * A pattern that matches safe data URLs. Only matches image, video and audio types.
  40610. */
  40611. var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+\/]+=*$/i;
  40612. /**
  40613. * @param {?} url
  40614. * @return {?}
  40615. */
  40616. function sanitizeUrl(url) {
  40617. url = String(url);
  40618. if (url.match(SAFE_URL_PATTERN) || url.match(DATA_URL_PATTERN))
  40619. return url;
  40620. if (Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_16" /* isDevMode */])()) {
  40621. getDOM().log("WARNING: sanitizing unsafe URL value " + url + " (see http://g.co/ng/security#xss)");
  40622. }
  40623. return 'unsafe:' + url;
  40624. }
  40625. /**
  40626. * @param {?} srcset
  40627. * @return {?}
  40628. */
  40629. function sanitizeSrcset(srcset) {
  40630. srcset = String(srcset);
  40631. return srcset.split(',').map(function (srcset) { return sanitizeUrl(srcset.trim()); }).join(', ');
  40632. }
  40633. /**
  40634. * @fileoverview added by tsickle
  40635. * @suppress {checkTypes} checked by tsc
  40636. */
  40637. /**
  40638. * @license
  40639. * Copyright Google Inc. All Rights Reserved.
  40640. *
  40641. * Use of this source code is governed by an MIT-style license that can be
  40642. * found in the LICENSE file at https://angular.io/license
  40643. */
  40644. /**
  40645. * @param {?} tags
  40646. * @return {?}
  40647. */
  40648. function tagSet(tags) {
  40649. var /** @type {?} */ res = {};
  40650. for (var _i = 0, _a = tags.split(','); _i < _a.length; _i++) {
  40651. var t = _a[_i];
  40652. res[t] = true;
  40653. }
  40654. return res;
  40655. }
  40656. /**
  40657. * @param {...?} sets
  40658. * @return {?}
  40659. */
  40660. function merge() {
  40661. var sets = [];
  40662. for (var _i = 0; _i < arguments.length; _i++) {
  40663. sets[_i] = arguments[_i];
  40664. }
  40665. var /** @type {?} */ res = {};
  40666. for (var _a = 0, sets_1 = sets; _a < sets_1.length; _a++) {
  40667. var s = sets_1[_a];
  40668. for (var /** @type {?} */ v in s) {
  40669. if (s.hasOwnProperty(v))
  40670. res[v] = true;
  40671. }
  40672. }
  40673. return res;
  40674. }
  40675. // Good source of info about elements and attributes
  40676. // http://dev.w3.org/html5/spec/Overview.html#semantics
  40677. // http://simon.html5.org/html-elements
  40678. // Safe Void Elements - HTML5
  40679. // http://dev.w3.org/html5/spec/Overview.html#void-elements
  40680. var VOID_ELEMENTS = tagSet('area,br,col,hr,img,wbr');
  40681. // Elements that you can, intentionally, leave open (and which close themselves)
  40682. // http://dev.w3.org/html5/spec/Overview.html#optional-tags
  40683. var OPTIONAL_END_TAG_BLOCK_ELEMENTS = tagSet('colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr');
  40684. var OPTIONAL_END_TAG_INLINE_ELEMENTS = tagSet('rp,rt');
  40685. var OPTIONAL_END_TAG_ELEMENTS = merge(OPTIONAL_END_TAG_INLINE_ELEMENTS, OPTIONAL_END_TAG_BLOCK_ELEMENTS);
  40686. // Safe Block Elements - HTML5
  40687. var BLOCK_ELEMENTS = merge(OPTIONAL_END_TAG_BLOCK_ELEMENTS, tagSet('address,article,' +
  40688. 'aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,' +
  40689. 'h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul'));
  40690. // Inline Elements - HTML5
  40691. var INLINE_ELEMENTS = merge(OPTIONAL_END_TAG_INLINE_ELEMENTS, tagSet('a,abbr,acronym,audio,b,' +
  40692. 'bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,' +
  40693. 'samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video'));
  40694. var VALID_ELEMENTS = merge(VOID_ELEMENTS, BLOCK_ELEMENTS, INLINE_ELEMENTS, OPTIONAL_END_TAG_ELEMENTS);
  40695. // Attributes that have href and hence need to be sanitized
  40696. var URI_ATTRS = tagSet('background,cite,href,itemtype,longdesc,poster,src,xlink:href');
  40697. // Attributes that have special href set hence need to be sanitized
  40698. var SRCSET_ATTRS = tagSet('srcset');
  40699. var HTML_ATTRS = tagSet('abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,' +
  40700. 'compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,' +
  40701. 'ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,' +
  40702. 'scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,' +
  40703. 'valign,value,vspace,width');
  40704. // NB: This currently consciously doesn't support SVG. SVG sanitization has had several security
  40705. // issues in the past, so it seems safer to leave it out if possible. If support for binding SVG via
  40706. // innerHTML is required, SVG attributes should be added here.
  40707. // NB: Sanitization does not allow <form> elements or other active elements (<button> etc). Those
  40708. // can be sanitized, but they increase security surface area without a legitimate use case, so they
  40709. // are left out here.
  40710. var VALID_ATTRS = merge(URI_ATTRS, SRCSET_ATTRS, HTML_ATTRS);
  40711. /**
  40712. * SanitizingHtmlSerializer serializes a DOM fragment, stripping out any unsafe elements and unsafe
  40713. * attributes.
  40714. */
  40715. var SanitizingHtmlSerializer = /** @class */ (function () {
  40716. function SanitizingHtmlSerializer() {
  40717. this.sanitizedSomething = false;
  40718. this.buf = [];
  40719. this.DOM = getDOM();
  40720. }
  40721. /**
  40722. * @param {?} el
  40723. * @return {?}
  40724. */
  40725. SanitizingHtmlSerializer.prototype.sanitizeChildren = /**
  40726. * @param {?} el
  40727. * @return {?}
  40728. */
  40729. function (el) {
  40730. // This cannot use a TreeWalker, as it has to run on Angular's various DOM adapters.
  40731. // However this code never accesses properties off of `document` before deleting its contents
  40732. // again, so it shouldn't be vulnerable to DOM clobbering.
  40733. var /** @type {?} */ current = /** @type {?} */ ((this.DOM.firstChild(el)));
  40734. while (current) {
  40735. if (this.DOM.isElementNode(current)) {
  40736. this.startElement(/** @type {?} */ (current));
  40737. }
  40738. else if (this.DOM.isTextNode(current)) {
  40739. this.chars(/** @type {?} */ ((this.DOM.nodeValue(current))));
  40740. }
  40741. else {
  40742. // Strip non-element, non-text nodes.
  40743. this.sanitizedSomething = true;
  40744. }
  40745. if (this.DOM.firstChild(current)) {
  40746. current = /** @type {?} */ ((this.DOM.firstChild(current)));
  40747. continue;
  40748. }
  40749. while (current) {
  40750. // Leaving the element. Walk up and to the right, closing tags as we go.
  40751. if (this.DOM.isElementNode(current)) {
  40752. this.endElement(/** @type {?} */ (current));
  40753. }
  40754. var /** @type {?} */ next = this.checkClobberedElement(current, /** @type {?} */ ((this.DOM.nextSibling(current))));
  40755. if (next) {
  40756. current = next;
  40757. break;
  40758. }
  40759. current = this.checkClobberedElement(current, /** @type {?} */ ((this.DOM.parentElement(current))));
  40760. }
  40761. }
  40762. return this.buf.join('');
  40763. };
  40764. /**
  40765. * @param {?} element
  40766. * @return {?}
  40767. */
  40768. SanitizingHtmlSerializer.prototype.startElement = /**
  40769. * @param {?} element
  40770. * @return {?}
  40771. */
  40772. function (element) {
  40773. var _this = this;
  40774. var /** @type {?} */ tagName = this.DOM.nodeName(element).toLowerCase();
  40775. if (!VALID_ELEMENTS.hasOwnProperty(tagName)) {
  40776. this.sanitizedSomething = true;
  40777. return;
  40778. }
  40779. this.buf.push('<');
  40780. this.buf.push(tagName);
  40781. this.DOM.attributeMap(element).forEach(function (value, attrName) {
  40782. var /** @type {?} */ lower = attrName.toLowerCase();
  40783. if (!VALID_ATTRS.hasOwnProperty(lower)) {
  40784. _this.sanitizedSomething = true;
  40785. return;
  40786. }
  40787. // TODO(martinprobst): Special case image URIs for data:image/...
  40788. if (URI_ATTRS[lower])
  40789. value = sanitizeUrl(value);
  40790. if (SRCSET_ATTRS[lower])
  40791. value = sanitizeSrcset(value);
  40792. _this.buf.push(' ');
  40793. _this.buf.push(attrName);
  40794. _this.buf.push('="');
  40795. _this.buf.push(encodeEntities(value));
  40796. _this.buf.push('"');
  40797. });
  40798. this.buf.push('>');
  40799. };
  40800. /**
  40801. * @param {?} current
  40802. * @return {?}
  40803. */
  40804. SanitizingHtmlSerializer.prototype.endElement = /**
  40805. * @param {?} current
  40806. * @return {?}
  40807. */
  40808. function (current) {
  40809. var /** @type {?} */ tagName = this.DOM.nodeName(current).toLowerCase();
  40810. if (VALID_ELEMENTS.hasOwnProperty(tagName) && !VOID_ELEMENTS.hasOwnProperty(tagName)) {
  40811. this.buf.push('</');
  40812. this.buf.push(tagName);
  40813. this.buf.push('>');
  40814. }
  40815. };
  40816. /**
  40817. * @param {?} chars
  40818. * @return {?}
  40819. */
  40820. SanitizingHtmlSerializer.prototype.chars = /**
  40821. * @param {?} chars
  40822. * @return {?}
  40823. */
  40824. function (chars) { this.buf.push(encodeEntities(chars)); };
  40825. /**
  40826. * @param {?} node
  40827. * @param {?} nextNode
  40828. * @return {?}
  40829. */
  40830. SanitizingHtmlSerializer.prototype.checkClobberedElement = /**
  40831. * @param {?} node
  40832. * @param {?} nextNode
  40833. * @return {?}
  40834. */
  40835. function (node, nextNode) {
  40836. if (nextNode && this.DOM.contains(node, nextNode)) {
  40837. throw new Error("Failed to sanitize html because the element is clobbered: " + this.DOM.getOuterHTML(node));
  40838. }
  40839. return nextNode;
  40840. };
  40841. return SanitizingHtmlSerializer;
  40842. }());
  40843. // Regular Expressions for parsing tags and attributes
  40844. var SURROGATE_PAIR_REGEXP = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
  40845. // ! to ~ is the ASCII range.
  40846. var NON_ALPHANUMERIC_REGEXP = /([^\#-~ |!])/g;
  40847. /**
  40848. * Escapes all potentially dangerous characters, so that the
  40849. * resulting string can be safely inserted into attribute or
  40850. * element text.
  40851. * @param {?} value
  40852. * @return {?}
  40853. */
  40854. function encodeEntities(value) {
  40855. return value.replace(/&/g, '&amp;')
  40856. .replace(SURROGATE_PAIR_REGEXP, function (match) {
  40857. var /** @type {?} */ hi = match.charCodeAt(0);
  40858. var /** @type {?} */ low = match.charCodeAt(1);
  40859. return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';';
  40860. })
  40861. .replace(NON_ALPHANUMERIC_REGEXP, function (match) { return '&#' + match.charCodeAt(0) + ';'; })
  40862. .replace(/</g, '&lt;')
  40863. .replace(/>/g, '&gt;');
  40864. }
  40865. var inertBodyHelper;
  40866. /**
  40867. * Sanitizes the given unsafe, untrusted HTML fragment, and returns HTML text that is safe to add to
  40868. * the DOM in a browser environment.
  40869. * @param {?} defaultDoc
  40870. * @param {?} unsafeHtmlInput
  40871. * @return {?}
  40872. */
  40873. function sanitizeHtml(defaultDoc, unsafeHtmlInput) {
  40874. var /** @type {?} */ DOM = getDOM();
  40875. var /** @type {?} */ inertBodyElement = null;
  40876. try {
  40877. inertBodyHelper = inertBodyHelper || new InertBodyHelper(defaultDoc, DOM);
  40878. // Make sure unsafeHtml is actually a string (TypeScript types are not enforced at runtime).
  40879. var /** @type {?} */ unsafeHtml = unsafeHtmlInput ? String(unsafeHtmlInput) : '';
  40880. inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);
  40881. // mXSS protection. Repeatedly parse the document to make sure it stabilizes, so that a browser
  40882. // trying to auto-correct incorrect HTML cannot cause formerly inert HTML to become dangerous.
  40883. var /** @type {?} */ mXSSAttempts = 5;
  40884. var /** @type {?} */ parsedHtml = unsafeHtml;
  40885. do {
  40886. if (mXSSAttempts === 0) {
  40887. throw new Error('Failed to sanitize html because the input is unstable');
  40888. }
  40889. mXSSAttempts--;
  40890. unsafeHtml = parsedHtml;
  40891. parsedHtml = DOM.getInnerHTML(inertBodyElement);
  40892. inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);
  40893. } while (unsafeHtml !== parsedHtml);
  40894. var /** @type {?} */ sanitizer = new SanitizingHtmlSerializer();
  40895. var /** @type {?} */ safeHtml = sanitizer.sanitizeChildren(DOM.getTemplateContent(inertBodyElement) || inertBodyElement);
  40896. if (Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_16" /* isDevMode */])() && sanitizer.sanitizedSomething) {
  40897. DOM.log('WARNING: sanitizing HTML stripped some content (see http://g.co/ng/security#xss).');
  40898. }
  40899. return safeHtml;
  40900. }
  40901. finally {
  40902. // In case anything goes wrong, clear out inertElement to reset the entire DOM structure.
  40903. if (inertBodyElement) {
  40904. var /** @type {?} */ parent_1 = DOM.getTemplateContent(inertBodyElement) || inertBodyElement;
  40905. for (var _i = 0, _a = DOM.childNodesAsList(parent_1); _i < _a.length; _i++) {
  40906. var child = _a[_i];
  40907. DOM.removeChild(parent_1, child);
  40908. }
  40909. }
  40910. }
  40911. }
  40912. /**
  40913. * @fileoverview added by tsickle
  40914. * @suppress {checkTypes} checked by tsc
  40915. */
  40916. /**
  40917. * @license
  40918. * Copyright Google Inc. All Rights Reserved.
  40919. *
  40920. * Use of this source code is governed by an MIT-style license that can be
  40921. * found in the LICENSE file at https://angular.io/license
  40922. */
  40923. /**
  40924. * Regular expression for safe style values.
  40925. *
  40926. * Quotes (" and ') are allowed, but a check must be done elsewhere to ensure they're balanced.
  40927. *
  40928. * ',' allows multiple values to be assigned to the same property (e.g. background-attachment or
  40929. * font-family) and hence could allow multiple values to get injected, but that should pose no risk
  40930. * of XSS.
  40931. *
  40932. * The function expression checks only for XSS safety, not for CSS validity.
  40933. *
  40934. * This regular expression was taken from the Closure sanitization library, and augmented for
  40935. * transformation values.
  40936. */
  40937. var VALUES = '[-,."\'%_!# a-zA-Z0-9]+';
  40938. var TRANSFORMATION_FNS = '(?:matrix|translate|scale|rotate|skew|perspective)(?:X|Y|3d)?';
  40939. var COLOR_FNS = '(?:rgb|hsl)a?';
  40940. var GRADIENTS = '(?:repeating-)?(?:linear|radial)-gradient';
  40941. var CSS3_FNS = '(?:calc|attr)';
  40942. var FN_ARGS = '\\([-0-9.%, #a-zA-Z]+\\)';
  40943. var SAFE_STYLE_VALUE = new RegExp("^(" + VALUES + "|" +
  40944. ("(?:" + TRANSFORMATION_FNS + "|" + COLOR_FNS + "|" + GRADIENTS + "|" + CSS3_FNS + ")") +
  40945. (FN_ARGS + ")$"), 'g');
  40946. /**
  40947. * Matches a `url(...)` value with an arbitrary argument as long as it does
  40948. * not contain parentheses.
  40949. *
  40950. * The URL value still needs to be sanitized separately.
  40951. *
  40952. * `url(...)` values are a very common use case, e.g. for `background-image`. With carefully crafted
  40953. * CSS style rules, it is possible to construct an information leak with `url` values in CSS, e.g.
  40954. * by observing whether scroll bars are displayed, or character ranges used by a font face
  40955. * definition.
  40956. *
  40957. * Angular only allows binding CSS values (as opposed to entire CSS rules), so it is unlikely that
  40958. * binding a URL value without further cooperation from the page will cause an information leak, and
  40959. * if so, it is just a leak, not a full blown XSS vulnerability.
  40960. *
  40961. * Given the common use case, low likelihood of attack vector, and low impact of an attack, this
  40962. * code is permissive and allows URLs that sanitize otherwise.
  40963. */
  40964. var URL_RE = /^url\(([^)]+)\)$/;
  40965. /**
  40966. * Checks that quotes (" and ') are properly balanced inside a string. Assumes
  40967. * that neither escape (\) nor any other character that could result in
  40968. * breaking out of a string parsing context are allowed;
  40969. * see http://www.w3.org/TR/css3-syntax/#string-token-diagram.
  40970. *
  40971. * This code was taken from the Closure sanitization library.
  40972. * @param {?} value
  40973. * @return {?}
  40974. */
  40975. function hasBalancedQuotes(value) {
  40976. var /** @type {?} */ outsideSingle = true;
  40977. var /** @type {?} */ outsideDouble = true;
  40978. for (var /** @type {?} */ i = 0; i < value.length; i++) {
  40979. var /** @type {?} */ c = value.charAt(i);
  40980. if (c === '\'' && outsideDouble) {
  40981. outsideSingle = !outsideSingle;
  40982. }
  40983. else if (c === '"' && outsideSingle) {
  40984. outsideDouble = !outsideDouble;
  40985. }
  40986. }
  40987. return outsideSingle && outsideDouble;
  40988. }
  40989. /**
  40990. * Sanitizes the given untrusted CSS style property value (i.e. not an entire object, just a single
  40991. * value) and returns a value that is safe to use in a browser environment.
  40992. * @param {?} value
  40993. * @return {?}
  40994. */
  40995. function sanitizeStyle(value) {
  40996. value = String(value).trim(); // Make sure it's actually a string.
  40997. if (!value)
  40998. return '';
  40999. // Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for
  41000. // reasoning behind this.
  41001. var /** @type {?} */ urlMatch = value.match(URL_RE);
  41002. if ((urlMatch && sanitizeUrl(urlMatch[1]) === urlMatch[1]) ||
  41003. value.match(SAFE_STYLE_VALUE) && hasBalancedQuotes(value)) {
  41004. return value; // Safe style values.
  41005. }
  41006. if (Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_16" /* isDevMode */])()) {
  41007. getDOM().log("WARNING: sanitizing unsafe style value " + value + " (see http://g.co/ng/security#xss).");
  41008. }
  41009. return 'unsafe';
  41010. }
  41011. /**
  41012. * @fileoverview added by tsickle
  41013. * @suppress {checkTypes} checked by tsc
  41014. */
  41015. /**
  41016. * @license
  41017. * Copyright Google Inc. All Rights Reserved.
  41018. *
  41019. * Use of this source code is governed by an MIT-style license that can be
  41020. * found in the LICENSE file at https://angular.io/license
  41021. */
  41022. /**
  41023. * Marker interface for a value that's safe to use in a particular context.
  41024. *
  41025. * \@stable
  41026. * @record
  41027. */
  41028. /**
  41029. * Marker interface for a value that's safe to use as HTML.
  41030. *
  41031. * \@stable
  41032. * @record
  41033. */
  41034. /**
  41035. * Marker interface for a value that's safe to use as style (CSS).
  41036. *
  41037. * \@stable
  41038. * @record
  41039. */
  41040. /**
  41041. * Marker interface for a value that's safe to use as JavaScript.
  41042. *
  41043. * \@stable
  41044. * @record
  41045. */
  41046. /**
  41047. * Marker interface for a value that's safe to use as a URL linking to a document.
  41048. *
  41049. * \@stable
  41050. * @record
  41051. */
  41052. /**
  41053. * Marker interface for a value that's safe to use as a URL to load executable code from.
  41054. *
  41055. * \@stable
  41056. * @record
  41057. */
  41058. /**
  41059. * DomSanitizer helps preventing Cross Site Scripting Security bugs (XSS) by sanitizing
  41060. * values to be safe to use in the different DOM contexts.
  41061. *
  41062. * For example, when binding a URL in an `<a [href]="someValue">` hyperlink, `someValue` will be
  41063. * sanitized so that an attacker cannot inject e.g. a `javascript:` URL that would execute code on
  41064. * the website.
  41065. *
  41066. * In specific situations, it might be necessary to disable sanitization, for example if the
  41067. * application genuinely needs to produce a `javascript:` style link with a dynamic value in it.
  41068. * Users can bypass security by constructing a value with one of the `bypassSecurityTrust...`
  41069. * methods, and then binding to that value from the template.
  41070. *
  41071. * These situations should be very rare, and extraordinary care must be taken to avoid creating a
  41072. * Cross Site Scripting (XSS) security bug!
  41073. *
  41074. * When using `bypassSecurityTrust...`, make sure to call the method as early as possible and as
  41075. * close as possible to the source of the value, to make it easy to verify no security bug is
  41076. * created by its use.
  41077. *
  41078. * It is not required (and not recommended) to bypass security if the value is safe, e.g. a URL that
  41079. * does not start with a suspicious protocol, or an HTML snippet that does not contain dangerous
  41080. * code. The sanitizer leaves safe values intact.
  41081. *
  41082. * \@security Calling any of the `bypassSecurityTrust...` APIs disables Angular's built-in
  41083. * sanitization for the value passed in. Carefully check and audit all values and code paths going
  41084. * into this call. Make sure any user data is appropriately escaped for this security context.
  41085. * For more detail, see the [Security Guide](http://g.co/ng/security).
  41086. *
  41087. * \@stable
  41088. * @abstract
  41089. */
  41090. var DomSanitizer = /** @class */ (function () {
  41091. function DomSanitizer() {
  41092. }
  41093. return DomSanitizer;
  41094. }());
  41095. var DomSanitizerImpl = /** @class */ (function (_super) {
  41096. Object(__WEBPACK_IMPORTED_MODULE_2_tslib__["b" /* __extends */])(DomSanitizerImpl, _super);
  41097. function DomSanitizerImpl(_doc) {
  41098. var _this = _super.call(this) || this;
  41099. _this._doc = _doc;
  41100. return _this;
  41101. }
  41102. /**
  41103. * @param {?} ctx
  41104. * @param {?} value
  41105. * @return {?}
  41106. */
  41107. DomSanitizerImpl.prototype.sanitize = /**
  41108. * @param {?} ctx
  41109. * @param {?} value
  41110. * @return {?}
  41111. */
  41112. function (ctx, value) {
  41113. if (value == null)
  41114. return null;
  41115. switch (ctx) {
  41116. case __WEBPACK_IMPORTED_MODULE_1__angular_core__["_0" /* SecurityContext */].NONE:
  41117. return /** @type {?} */ (value);
  41118. case __WEBPACK_IMPORTED_MODULE_1__angular_core__["_0" /* SecurityContext */].HTML:
  41119. if (value instanceof SafeHtmlImpl)
  41120. return value.changingThisBreaksApplicationSecurity;
  41121. this.checkNotSafeValue(value, 'HTML');
  41122. return sanitizeHtml(this._doc, String(value));
  41123. case __WEBPACK_IMPORTED_MODULE_1__angular_core__["_0" /* SecurityContext */].STYLE:
  41124. if (value instanceof SafeStyleImpl)
  41125. return value.changingThisBreaksApplicationSecurity;
  41126. this.checkNotSafeValue(value, 'Style');
  41127. return sanitizeStyle(/** @type {?} */ (value));
  41128. case __WEBPACK_IMPORTED_MODULE_1__angular_core__["_0" /* SecurityContext */].SCRIPT:
  41129. if (value instanceof SafeScriptImpl)
  41130. return value.changingThisBreaksApplicationSecurity;
  41131. this.checkNotSafeValue(value, 'Script');
  41132. throw new Error('unsafe value used in a script context');
  41133. case __WEBPACK_IMPORTED_MODULE_1__angular_core__["_0" /* SecurityContext */].URL:
  41134. if (value instanceof SafeResourceUrlImpl || value instanceof SafeUrlImpl) {
  41135. // Allow resource URLs in URL contexts, they are strictly more trusted.
  41136. return value.changingThisBreaksApplicationSecurity;
  41137. }
  41138. this.checkNotSafeValue(value, 'URL');
  41139. return sanitizeUrl(String(value));
  41140. case __WEBPACK_IMPORTED_MODULE_1__angular_core__["_0" /* SecurityContext */].RESOURCE_URL:
  41141. if (value instanceof SafeResourceUrlImpl) {
  41142. return value.changingThisBreaksApplicationSecurity;
  41143. }
  41144. this.checkNotSafeValue(value, 'ResourceURL');
  41145. throw new Error('unsafe value used in a resource URL context (see http://g.co/ng/security#xss)');
  41146. default:
  41147. throw new Error("Unexpected SecurityContext " + ctx + " (see http://g.co/ng/security#xss)");
  41148. }
  41149. };
  41150. /**
  41151. * @param {?} value
  41152. * @param {?} expectedType
  41153. * @return {?}
  41154. */
  41155. DomSanitizerImpl.prototype.checkNotSafeValue = /**
  41156. * @param {?} value
  41157. * @param {?} expectedType
  41158. * @return {?}
  41159. */
  41160. function (value, expectedType) {
  41161. if (value instanceof SafeValueImpl) {
  41162. throw new Error("Required a safe " + expectedType + ", got a " + value.getTypeName() + " " +
  41163. "(see http://g.co/ng/security#xss)");
  41164. }
  41165. };
  41166. /**
  41167. * @param {?} value
  41168. * @return {?}
  41169. */
  41170. DomSanitizerImpl.prototype.bypassSecurityTrustHtml = /**
  41171. * @param {?} value
  41172. * @return {?}
  41173. */
  41174. function (value) { return new SafeHtmlImpl(value); };
  41175. /**
  41176. * @param {?} value
  41177. * @return {?}
  41178. */
  41179. DomSanitizerImpl.prototype.bypassSecurityTrustStyle = /**
  41180. * @param {?} value
  41181. * @return {?}
  41182. */
  41183. function (value) { return new SafeStyleImpl(value); };
  41184. /**
  41185. * @param {?} value
  41186. * @return {?}
  41187. */
  41188. DomSanitizerImpl.prototype.bypassSecurityTrustScript = /**
  41189. * @param {?} value
  41190. * @return {?}
  41191. */
  41192. function (value) { return new SafeScriptImpl(value); };
  41193. /**
  41194. * @param {?} value
  41195. * @return {?}
  41196. */
  41197. DomSanitizerImpl.prototype.bypassSecurityTrustUrl = /**
  41198. * @param {?} value
  41199. * @return {?}
  41200. */
  41201. function (value) { return new SafeUrlImpl(value); };
  41202. /**
  41203. * @param {?} value
  41204. * @return {?}
  41205. */
  41206. DomSanitizerImpl.prototype.bypassSecurityTrustResourceUrl = /**
  41207. * @param {?} value
  41208. * @return {?}
  41209. */
  41210. function (value) {
  41211. return new SafeResourceUrlImpl(value);
  41212. };
  41213. DomSanitizerImpl.decorators = [
  41214. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["A" /* Injectable */] },
  41215. ];
  41216. /** @nocollapse */
  41217. DomSanitizerImpl.ctorParameters = function () { return [
  41218. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["z" /* Inject */], args: [DOCUMENT$1,] },] },
  41219. ]; };
  41220. return DomSanitizerImpl;
  41221. }(DomSanitizer));
  41222. /**
  41223. * @abstract
  41224. */
  41225. var SafeValueImpl = /** @class */ (function () {
  41226. function SafeValueImpl(changingThisBreaksApplicationSecurity) {
  41227. // empty
  41228. this.changingThisBreaksApplicationSecurity = changingThisBreaksApplicationSecurity;
  41229. }
  41230. /**
  41231. * @return {?}
  41232. */
  41233. SafeValueImpl.prototype.toString = /**
  41234. * @return {?}
  41235. */
  41236. function () {
  41237. return "SafeValue must use [property]=binding: " + this.changingThisBreaksApplicationSecurity +
  41238. " (see http://g.co/ng/security#xss)";
  41239. };
  41240. return SafeValueImpl;
  41241. }());
  41242. var SafeHtmlImpl = /** @class */ (function (_super) {
  41243. Object(__WEBPACK_IMPORTED_MODULE_2_tslib__["b" /* __extends */])(SafeHtmlImpl, _super);
  41244. function SafeHtmlImpl() {
  41245. return _super !== null && _super.apply(this, arguments) || this;
  41246. }
  41247. /**
  41248. * @return {?}
  41249. */
  41250. SafeHtmlImpl.prototype.getTypeName = /**
  41251. * @return {?}
  41252. */
  41253. function () { return 'HTML'; };
  41254. return SafeHtmlImpl;
  41255. }(SafeValueImpl));
  41256. var SafeStyleImpl = /** @class */ (function (_super) {
  41257. Object(__WEBPACK_IMPORTED_MODULE_2_tslib__["b" /* __extends */])(SafeStyleImpl, _super);
  41258. function SafeStyleImpl() {
  41259. return _super !== null && _super.apply(this, arguments) || this;
  41260. }
  41261. /**
  41262. * @return {?}
  41263. */
  41264. SafeStyleImpl.prototype.getTypeName = /**
  41265. * @return {?}
  41266. */
  41267. function () { return 'Style'; };
  41268. return SafeStyleImpl;
  41269. }(SafeValueImpl));
  41270. var SafeScriptImpl = /** @class */ (function (_super) {
  41271. Object(__WEBPACK_IMPORTED_MODULE_2_tslib__["b" /* __extends */])(SafeScriptImpl, _super);
  41272. function SafeScriptImpl() {
  41273. return _super !== null && _super.apply(this, arguments) || this;
  41274. }
  41275. /**
  41276. * @return {?}
  41277. */
  41278. SafeScriptImpl.prototype.getTypeName = /**
  41279. * @return {?}
  41280. */
  41281. function () { return 'Script'; };
  41282. return SafeScriptImpl;
  41283. }(SafeValueImpl));
  41284. var SafeUrlImpl = /** @class */ (function (_super) {
  41285. Object(__WEBPACK_IMPORTED_MODULE_2_tslib__["b" /* __extends */])(SafeUrlImpl, _super);
  41286. function SafeUrlImpl() {
  41287. return _super !== null && _super.apply(this, arguments) || this;
  41288. }
  41289. /**
  41290. * @return {?}
  41291. */
  41292. SafeUrlImpl.prototype.getTypeName = /**
  41293. * @return {?}
  41294. */
  41295. function () { return 'URL'; };
  41296. return SafeUrlImpl;
  41297. }(SafeValueImpl));
  41298. var SafeResourceUrlImpl = /** @class */ (function (_super) {
  41299. Object(__WEBPACK_IMPORTED_MODULE_2_tslib__["b" /* __extends */])(SafeResourceUrlImpl, _super);
  41300. function SafeResourceUrlImpl() {
  41301. return _super !== null && _super.apply(this, arguments) || this;
  41302. }
  41303. /**
  41304. * @return {?}
  41305. */
  41306. SafeResourceUrlImpl.prototype.getTypeName = /**
  41307. * @return {?}
  41308. */
  41309. function () { return 'ResourceURL'; };
  41310. return SafeResourceUrlImpl;
  41311. }(SafeValueImpl));
  41312. /**
  41313. * @fileoverview added by tsickle
  41314. * @suppress {checkTypes} checked by tsc
  41315. */
  41316. /**
  41317. * @license
  41318. * Copyright Google Inc. All Rights Reserved.
  41319. *
  41320. * Use of this source code is governed by an MIT-style license that can be
  41321. * found in the LICENSE file at https://angular.io/license
  41322. */
  41323. var INTERNAL_BROWSER_PLATFORM_PROVIDERS = [
  41324. { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Q" /* PLATFORM_ID */], useValue: __WEBPACK_IMPORTED_MODULE_0__angular_common__["i" /* ɵPLATFORM_BROWSER_ID */] },
  41325. { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__["R" /* PLATFORM_INITIALIZER */], useValue: initDomAdapter, multi: true },
  41326. { provide: __WEBPACK_IMPORTED_MODULE_0__angular_common__["h" /* PlatformLocation */], useClass: BrowserPlatformLocation, deps: [DOCUMENT$1] },
  41327. { provide: DOCUMENT$1, useFactory: _document, deps: [] },
  41328. ];
  41329. /**
  41330. * \@security Replacing built-in sanitization providers exposes the application to XSS risks.
  41331. * Attacker-controlled data introduced by an unsanitized provider could expose your
  41332. * application to XSS risks. For more detail, see the [Security Guide](http://g.co/ng/security).
  41333. * \@experimental
  41334. */
  41335. var BROWSER_SANITIZATION_PROVIDERS = [
  41336. { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Z" /* Sanitizer */], useExisting: DomSanitizer },
  41337. { provide: DomSanitizer, useClass: DomSanitizerImpl, deps: [DOCUMENT$1] },
  41338. ];
  41339. /**
  41340. * \@stable
  41341. */
  41342. var platformBrowser = Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_13" /* createPlatformFactory */])(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_17" /* platformCore */], 'browser', INTERNAL_BROWSER_PLATFORM_PROVIDERS);
  41343. /**
  41344. * @return {?}
  41345. */
  41346. function initDomAdapter() {
  41347. BrowserDomAdapter.makeCurrent();
  41348. BrowserGetTestability.init();
  41349. }
  41350. /**
  41351. * @return {?}
  41352. */
  41353. function errorHandler() {
  41354. return new __WEBPACK_IMPORTED_MODULE_1__angular_core__["u" /* ErrorHandler */]();
  41355. }
  41356. /**
  41357. * @return {?}
  41358. */
  41359. function _document() {
  41360. return document;
  41361. }
  41362. /**
  41363. * The ng module for the browser.
  41364. *
  41365. * \@stable
  41366. */
  41367. var BrowserModule = /** @class */ (function () {
  41368. function BrowserModule(parentModule) {
  41369. if (parentModule) {
  41370. throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.");
  41371. }
  41372. }
  41373. /**
  41374. * Configures a browser-based application to transition from a server-rendered app, if
  41375. * one is present on the page. The specified parameters must include an application id,
  41376. * which must match between the client and server applications.
  41377. *
  41378. * @experimental
  41379. */
  41380. /**
  41381. * Configures a browser-based application to transition from a server-rendered app, if
  41382. * one is present on the page. The specified parameters must include an application id,
  41383. * which must match between the client and server applications.
  41384. *
  41385. * \@experimental
  41386. * @param {?} params
  41387. * @return {?}
  41388. */
  41389. BrowserModule.withServerTransition = /**
  41390. * Configures a browser-based application to transition from a server-rendered app, if
  41391. * one is present on the page. The specified parameters must include an application id,
  41392. * which must match between the client and server applications.
  41393. *
  41394. * \@experimental
  41395. * @param {?} params
  41396. * @return {?}
  41397. */
  41398. function (params) {
  41399. return {
  41400. ngModule: BrowserModule,
  41401. providers: [
  41402. { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__["b" /* APP_ID */], useValue: params.appId },
  41403. { provide: TRANSITION_ID, useExisting: __WEBPACK_IMPORTED_MODULE_1__angular_core__["b" /* APP_ID */] },
  41404. SERVER_TRANSITION_PROVIDERS,
  41405. ],
  41406. };
  41407. };
  41408. BrowserModule.decorators = [
  41409. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["I" /* NgModule */], args: [{
  41410. providers: [
  41411. BROWSER_SANITIZATION_PROVIDERS,
  41412. { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__["u" /* ErrorHandler */], useFactory: errorHandler, deps: [] },
  41413. { provide: EVENT_MANAGER_PLUGINS, useClass: DomEventsPlugin, multi: true },
  41414. { provide: EVENT_MANAGER_PLUGINS, useClass: KeyEventsPlugin, multi: true },
  41415. { provide: EVENT_MANAGER_PLUGINS, useClass: HammerGesturesPlugin, multi: true },
  41416. { provide: HAMMER_GESTURE_CONFIG, useClass: HammerGestureConfig },
  41417. DomRendererFactory2,
  41418. { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__["X" /* RendererFactory2 */], useExisting: DomRendererFactory2 },
  41419. { provide: SharedStylesHost, useExisting: DomSharedStylesHost },
  41420. DomSharedStylesHost,
  41421. __WEBPACK_IMPORTED_MODULE_1__angular_core__["_6" /* Testability */],
  41422. EventManager,
  41423. ELEMENT_PROBE_PROVIDERS,
  41424. Meta,
  41425. Title,
  41426. ],
  41427. exports: [__WEBPACK_IMPORTED_MODULE_0__angular_common__["b" /* CommonModule */], __WEBPACK_IMPORTED_MODULE_1__angular_core__["e" /* ApplicationModule */]]
  41428. },] },
  41429. ];
  41430. /** @nocollapse */
  41431. BrowserModule.ctorParameters = function () { return [
  41432. { type: BrowserModule, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["N" /* Optional */] }, { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["_2" /* SkipSelf */] },] },
  41433. ]; };
  41434. return BrowserModule;
  41435. }());
  41436. /**
  41437. * @fileoverview added by tsickle
  41438. * @suppress {checkTypes} checked by tsc
  41439. */
  41440. /**
  41441. * @license
  41442. * Copyright Google Inc. All Rights Reserved.
  41443. *
  41444. * Use of this source code is governed by an MIT-style license that can be
  41445. * found in the LICENSE file at https://angular.io/license
  41446. */
  41447. var win = typeof window !== 'undefined' && window || /** @type {?} */ ({});
  41448. /**
  41449. * @fileoverview added by tsickle
  41450. * @suppress {checkTypes} checked by tsc
  41451. */
  41452. /**
  41453. * @license
  41454. * Copyright Google Inc. All Rights Reserved.
  41455. *
  41456. * Use of this source code is governed by an MIT-style license that can be
  41457. * found in the LICENSE file at https://angular.io/license
  41458. */
  41459. var ChangeDetectionPerfRecord = /** @class */ (function () {
  41460. function ChangeDetectionPerfRecord(msPerTick, numTicks) {
  41461. this.msPerTick = msPerTick;
  41462. this.numTicks = numTicks;
  41463. }
  41464. return ChangeDetectionPerfRecord;
  41465. }());
  41466. /**
  41467. * Entry point for all Angular profiling-related debug tools. This object
  41468. * corresponds to the `ng.profiler` in the dev console.
  41469. */
  41470. var AngularProfiler = /** @class */ (function () {
  41471. function AngularProfiler(ref) {
  41472. this.appRef = ref.injector.get(__WEBPACK_IMPORTED_MODULE_1__angular_core__["f" /* ApplicationRef */]);
  41473. }
  41474. // tslint:disable:no-console
  41475. /**
  41476. * Exercises change detection in a loop and then prints the average amount of
  41477. * time in milliseconds how long a single round of change detection takes for
  41478. * the current state of the UI. It runs a minimum of 5 rounds for a minimum
  41479. * of 500 milliseconds.
  41480. *
  41481. * Optionally, a user may pass a `config` parameter containing a map of
  41482. * options. Supported options are:
  41483. *
  41484. * `record` (boolean) - causes the profiler to record a CPU profile while
  41485. * it exercises the change detector. Example:
  41486. *
  41487. * ```
  41488. * ng.profiler.timeChangeDetection({record: true})
  41489. * ```
  41490. */
  41491. /**
  41492. * Exercises change detection in a loop and then prints the average amount of
  41493. * time in milliseconds how long a single round of change detection takes for
  41494. * the current state of the UI. It runs a minimum of 5 rounds for a minimum
  41495. * of 500 milliseconds.
  41496. *
  41497. * Optionally, a user may pass a `config` parameter containing a map of
  41498. * options. Supported options are:
  41499. *
  41500. * `record` (boolean) - causes the profiler to record a CPU profile while
  41501. * it exercises the change detector. Example:
  41502. *
  41503. * ```
  41504. * ng.profiler.timeChangeDetection({record: true})
  41505. * ```
  41506. * @param {?} config
  41507. * @return {?}
  41508. */
  41509. AngularProfiler.prototype.timeChangeDetection = /**
  41510. * Exercises change detection in a loop and then prints the average amount of
  41511. * time in milliseconds how long a single round of change detection takes for
  41512. * the current state of the UI. It runs a minimum of 5 rounds for a minimum
  41513. * of 500 milliseconds.
  41514. *
  41515. * Optionally, a user may pass a `config` parameter containing a map of
  41516. * options. Supported options are:
  41517. *
  41518. * `record` (boolean) - causes the profiler to record a CPU profile while
  41519. * it exercises the change detector. Example:
  41520. *
  41521. * ```
  41522. * ng.profiler.timeChangeDetection({record: true})
  41523. * ```
  41524. * @param {?} config
  41525. * @return {?}
  41526. */
  41527. function (config) {
  41528. var /** @type {?} */ record = config && config['record'];
  41529. var /** @type {?} */ profileName = 'Change Detection';
  41530. // Profiler is not available in Android browsers, nor in IE 9 without dev tools opened
  41531. var /** @type {?} */ isProfilerAvailable = win.console.profile != null;
  41532. if (record && isProfilerAvailable) {
  41533. win.console.profile(profileName);
  41534. }
  41535. var /** @type {?} */ start = getDOM().performanceNow();
  41536. var /** @type {?} */ numTicks = 0;
  41537. while (numTicks < 5 || (getDOM().performanceNow() - start) < 500) {
  41538. this.appRef.tick();
  41539. numTicks++;
  41540. }
  41541. var /** @type {?} */ end = getDOM().performanceNow();
  41542. if (record && isProfilerAvailable) {
  41543. // need to cast to <any> because type checker thinks there's no argument
  41544. // while in fact there is:
  41545. //
  41546. // https://developer.mozilla.org/en-US/docs/Web/API/Console/profileEnd
  41547. (/** @type {?} */ (win.console.profileEnd))(profileName);
  41548. }
  41549. var /** @type {?} */ msPerTick = (end - start) / numTicks;
  41550. win.console.log("ran " + numTicks + " change detection cycles");
  41551. win.console.log(msPerTick.toFixed(2) + " ms per check");
  41552. return new ChangeDetectionPerfRecord(msPerTick, numTicks);
  41553. };
  41554. return AngularProfiler;
  41555. }());
  41556. /**
  41557. * @fileoverview added by tsickle
  41558. * @suppress {checkTypes} checked by tsc
  41559. */
  41560. /**
  41561. * @license
  41562. * Copyright Google Inc. All Rights Reserved.
  41563. *
  41564. * Use of this source code is governed by an MIT-style license that can be
  41565. * found in the LICENSE file at https://angular.io/license
  41566. */
  41567. var PROFILER_GLOBAL_NAME = 'profiler';
  41568. /**
  41569. * Enabled Angular debug tools that are accessible via your browser's
  41570. * developer console.
  41571. *
  41572. * Usage:
  41573. *
  41574. * 1. Open developer console (e.g. in Chrome Ctrl + Shift + j)
  41575. * 1. Type `ng.` (usually the console will show auto-complete suggestion)
  41576. * 1. Try the change detection profiler `ng.profiler.timeChangeDetection()`
  41577. * then hit Enter.
  41578. *
  41579. * \@experimental All debugging apis are currently experimental.
  41580. * @template T
  41581. * @param {?} ref
  41582. * @return {?}
  41583. */
  41584. function enableDebugTools(ref) {
  41585. exportNgVar(PROFILER_GLOBAL_NAME, new AngularProfiler(ref));
  41586. return ref;
  41587. }
  41588. /**
  41589. * Disables Angular tools.
  41590. *
  41591. * \@experimental All debugging apis are currently experimental.
  41592. * @return {?}
  41593. */
  41594. function disableDebugTools() {
  41595. exportNgVar(PROFILER_GLOBAL_NAME, null);
  41596. }
  41597. /**
  41598. * @fileoverview added by tsickle
  41599. * @suppress {checkTypes} checked by tsc
  41600. */
  41601. /**
  41602. * @license
  41603. * Copyright Google Inc. All Rights Reserved.
  41604. *
  41605. * Use of this source code is governed by an MIT-style license that can be
  41606. * found in the LICENSE file at https://angular.io/license
  41607. */
  41608. /**
  41609. * @param {?} text
  41610. * @return {?}
  41611. */
  41612. function escapeHtml(text) {
  41613. var /** @type {?} */ escapedText = {
  41614. '&': '&a;',
  41615. '"': '&q;',
  41616. '\'': '&s;',
  41617. '<': '&l;',
  41618. '>': '&g;',
  41619. };
  41620. return text.replace(/[&"'<>]/g, function (s) { return escapedText[s]; });
  41621. }
  41622. /**
  41623. * @param {?} text
  41624. * @return {?}
  41625. */
  41626. function unescapeHtml(text) {
  41627. var /** @type {?} */ unescapedText = {
  41628. '&a;': '&',
  41629. '&q;': '"',
  41630. '&s;': '\'',
  41631. '&l;': '<',
  41632. '&g;': '>',
  41633. };
  41634. return text.replace(/&[^;]+;/g, function (s) { return unescapedText[s]; });
  41635. }
  41636. /**
  41637. * Create a `StateKey<T>` that can be used to store value of type T with `TransferState`.
  41638. *
  41639. * Example:
  41640. *
  41641. * ```
  41642. * const COUNTER_KEY = makeStateKey<number>('counter');
  41643. * let value = 10;
  41644. *
  41645. * transferState.set(COUNTER_KEY, value);
  41646. * ```
  41647. *
  41648. * \@experimental
  41649. * @template T
  41650. * @param {?} key
  41651. * @return {?}
  41652. */
  41653. function makeStateKey(key) {
  41654. return /** @type {?} */ (key);
  41655. }
  41656. /**
  41657. * A key value store that is transferred from the application on the server side to the application
  41658. * on the client side.
  41659. *
  41660. * `TransferState` will be available as an injectable token. To use it import
  41661. * `ServerTransferStateModule` on the server and `BrowserTransferStateModule` on the client.
  41662. *
  41663. * The values in the store are serialized/deserialized using JSON.stringify/JSON.parse. So only
  41664. * boolean, number, string, null and non-class objects will be serialized and deserialzied in a
  41665. * non-lossy manner.
  41666. *
  41667. * \@experimental
  41668. */
  41669. var TransferState = /** @class */ (function () {
  41670. function TransferState() {
  41671. this.store = {};
  41672. this.onSerializeCallbacks = {};
  41673. }
  41674. /** @internal */
  41675. /**
  41676. * \@internal
  41677. * @param {?} initState
  41678. * @return {?}
  41679. */
  41680. TransferState.init = /**
  41681. * \@internal
  41682. * @param {?} initState
  41683. * @return {?}
  41684. */
  41685. function (initState) {
  41686. var /** @type {?} */ transferState = new TransferState();
  41687. transferState.store = initState;
  41688. return transferState;
  41689. };
  41690. /**
  41691. * Get the value corresponding to a key. Return `defaultValue` if key is not found.
  41692. */
  41693. /**
  41694. * Get the value corresponding to a key. Return `defaultValue` if key is not found.
  41695. * @template T
  41696. * @param {?} key
  41697. * @param {?} defaultValue
  41698. * @return {?}
  41699. */
  41700. TransferState.prototype.get = /**
  41701. * Get the value corresponding to a key. Return `defaultValue` if key is not found.
  41702. * @template T
  41703. * @param {?} key
  41704. * @param {?} defaultValue
  41705. * @return {?}
  41706. */
  41707. function (key, defaultValue) {
  41708. return this.store[key] !== undefined ? /** @type {?} */ (this.store[key]) : defaultValue;
  41709. };
  41710. /**
  41711. * Set the value corresponding to a key.
  41712. */
  41713. /**
  41714. * Set the value corresponding to a key.
  41715. * @template T
  41716. * @param {?} key
  41717. * @param {?} value
  41718. * @return {?}
  41719. */
  41720. TransferState.prototype.set = /**
  41721. * Set the value corresponding to a key.
  41722. * @template T
  41723. * @param {?} key
  41724. * @param {?} value
  41725. * @return {?}
  41726. */
  41727. function (key, value) { this.store[key] = value; };
  41728. /**
  41729. * Remove a key from the store.
  41730. */
  41731. /**
  41732. * Remove a key from the store.
  41733. * @template T
  41734. * @param {?} key
  41735. * @return {?}
  41736. */
  41737. TransferState.prototype.remove = /**
  41738. * Remove a key from the store.
  41739. * @template T
  41740. * @param {?} key
  41741. * @return {?}
  41742. */
  41743. function (key) { delete this.store[key]; };
  41744. /**
  41745. * Test whether a key exists in the store.
  41746. */
  41747. /**
  41748. * Test whether a key exists in the store.
  41749. * @template T
  41750. * @param {?} key
  41751. * @return {?}
  41752. */
  41753. TransferState.prototype.hasKey = /**
  41754. * Test whether a key exists in the store.
  41755. * @template T
  41756. * @param {?} key
  41757. * @return {?}
  41758. */
  41759. function (key) { return this.store.hasOwnProperty(key); };
  41760. /**
  41761. * Register a callback to provide the value for a key when `toJson` is called.
  41762. */
  41763. /**
  41764. * Register a callback to provide the value for a key when `toJson` is called.
  41765. * @template T
  41766. * @param {?} key
  41767. * @param {?} callback
  41768. * @return {?}
  41769. */
  41770. TransferState.prototype.onSerialize = /**
  41771. * Register a callback to provide the value for a key when `toJson` is called.
  41772. * @template T
  41773. * @param {?} key
  41774. * @param {?} callback
  41775. * @return {?}
  41776. */
  41777. function (key, callback) {
  41778. this.onSerializeCallbacks[key] = callback;
  41779. };
  41780. /**
  41781. * Serialize the current state of the store to JSON.
  41782. */
  41783. /**
  41784. * Serialize the current state of the store to JSON.
  41785. * @return {?}
  41786. */
  41787. TransferState.prototype.toJson = /**
  41788. * Serialize the current state of the store to JSON.
  41789. * @return {?}
  41790. */
  41791. function () {
  41792. // Call the onSerialize callbacks and put those values into the store.
  41793. for (var /** @type {?} */ key in this.onSerializeCallbacks) {
  41794. if (this.onSerializeCallbacks.hasOwnProperty(key)) {
  41795. try {
  41796. this.store[key] = this.onSerializeCallbacks[key]();
  41797. }
  41798. catch (/** @type {?} */ e) {
  41799. console.warn('Exception in onSerialize callback: ', e);
  41800. }
  41801. }
  41802. }
  41803. return JSON.stringify(this.store);
  41804. };
  41805. TransferState.decorators = [
  41806. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["A" /* Injectable */] },
  41807. ];
  41808. /** @nocollapse */
  41809. TransferState.ctorParameters = function () { return []; };
  41810. return TransferState;
  41811. }());
  41812. /**
  41813. * @param {?} doc
  41814. * @param {?} appId
  41815. * @return {?}
  41816. */
  41817. function initTransferState(doc, appId) {
  41818. // Locate the script tag with the JSON data transferred from the server.
  41819. // The id of the script tag is set to the Angular appId + 'state'.
  41820. var /** @type {?} */ script = doc.getElementById(appId + '-state');
  41821. var /** @type {?} */ initialState = {};
  41822. if (script && script.textContent) {
  41823. try {
  41824. initialState = JSON.parse(unescapeHtml(script.textContent));
  41825. }
  41826. catch (/** @type {?} */ e) {
  41827. console.warn('Exception while restoring TransferState for app ' + appId, e);
  41828. }
  41829. }
  41830. return TransferState.init(initialState);
  41831. }
  41832. /**
  41833. * NgModule to install on the client side while using the `TransferState` to transfer state from
  41834. * server to client.
  41835. *
  41836. * \@experimental
  41837. */
  41838. var BrowserTransferStateModule = /** @class */ (function () {
  41839. function BrowserTransferStateModule() {
  41840. }
  41841. BrowserTransferStateModule.decorators = [
  41842. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["I" /* NgModule */], args: [{
  41843. providers: [{ provide: TransferState, useFactory: initTransferState, deps: [DOCUMENT$1, __WEBPACK_IMPORTED_MODULE_1__angular_core__["b" /* APP_ID */]] }],
  41844. },] },
  41845. ];
  41846. /** @nocollapse */
  41847. BrowserTransferStateModule.ctorParameters = function () { return []; };
  41848. return BrowserTransferStateModule;
  41849. }());
  41850. /**
  41851. * @fileoverview added by tsickle
  41852. * @suppress {checkTypes} checked by tsc
  41853. */
  41854. /**
  41855. * @license
  41856. * Copyright Google Inc. All Rights Reserved.
  41857. *
  41858. * Use of this source code is governed by an MIT-style license that can be
  41859. * found in the LICENSE file at https://angular.io/license
  41860. */
  41861. /**
  41862. * Predicates for use with {\@link DebugElement}'s query functions.
  41863. *
  41864. * \@experimental All debugging apis are currently experimental.
  41865. */
  41866. var By = /** @class */ (function () {
  41867. function By() {
  41868. }
  41869. /**
  41870. * Match all elements.
  41871. *
  41872. * ## Example
  41873. *
  41874. * {@example platform-browser/dom/debug/ts/by/by.ts region='by_all'}
  41875. */
  41876. /**
  41877. * Match all elements.
  41878. *
  41879. * ## Example
  41880. *
  41881. * {\@example platform-browser/dom/debug/ts/by/by.ts region='by_all'}
  41882. * @return {?}
  41883. */
  41884. By.all = /**
  41885. * Match all elements.
  41886. *
  41887. * ## Example
  41888. *
  41889. * {\@example platform-browser/dom/debug/ts/by/by.ts region='by_all'}
  41890. * @return {?}
  41891. */
  41892. function () { return function (debugElement) { return true; }; };
  41893. /**
  41894. * Match elements by the given CSS selector.
  41895. *
  41896. * ## Example
  41897. *
  41898. * {@example platform-browser/dom/debug/ts/by/by.ts region='by_css'}
  41899. */
  41900. /**
  41901. * Match elements by the given CSS selector.
  41902. *
  41903. * ## Example
  41904. *
  41905. * {\@example platform-browser/dom/debug/ts/by/by.ts region='by_css'}
  41906. * @param {?} selector
  41907. * @return {?}
  41908. */
  41909. By.css = /**
  41910. * Match elements by the given CSS selector.
  41911. *
  41912. * ## Example
  41913. *
  41914. * {\@example platform-browser/dom/debug/ts/by/by.ts region='by_css'}
  41915. * @param {?} selector
  41916. * @return {?}
  41917. */
  41918. function (selector) {
  41919. return function (debugElement) {
  41920. return debugElement.nativeElement != null ?
  41921. getDOM().elementMatches(debugElement.nativeElement, selector) :
  41922. false;
  41923. };
  41924. };
  41925. /**
  41926. * Match elements that have the given directive present.
  41927. *
  41928. * ## Example
  41929. *
  41930. * {@example platform-browser/dom/debug/ts/by/by.ts region='by_directive'}
  41931. */
  41932. /**
  41933. * Match elements that have the given directive present.
  41934. *
  41935. * ## Example
  41936. *
  41937. * {\@example platform-browser/dom/debug/ts/by/by.ts region='by_directive'}
  41938. * @param {?} type
  41939. * @return {?}
  41940. */
  41941. By.directive = /**
  41942. * Match elements that have the given directive present.
  41943. *
  41944. * ## Example
  41945. *
  41946. * {\@example platform-browser/dom/debug/ts/by/by.ts region='by_directive'}
  41947. * @param {?} type
  41948. * @return {?}
  41949. */
  41950. function (type) {
  41951. return function (debugElement) { return ((debugElement.providerTokens)).indexOf(type) !== -1; };
  41952. };
  41953. return By;
  41954. }());
  41955. /**
  41956. * @fileoverview added by tsickle
  41957. * @suppress {checkTypes} checked by tsc
  41958. */
  41959. /**
  41960. * @license
  41961. * Copyright Google Inc. All Rights Reserved.
  41962. *
  41963. * Use of this source code is governed by an MIT-style license that can be
  41964. * found in the LICENSE file at https://angular.io/license
  41965. */
  41966. /**
  41967. * @fileoverview added by tsickle
  41968. * @suppress {checkTypes} checked by tsc
  41969. */
  41970. /**
  41971. * @license
  41972. * Copyright Google Inc. All Rights Reserved.
  41973. *
  41974. * Use of this source code is governed by an MIT-style license that can be
  41975. * found in the LICENSE file at https://angular.io/license
  41976. */
  41977. /**
  41978. * \@stable
  41979. */
  41980. var VERSION = new __WEBPACK_IMPORTED_MODULE_1__angular_core__["_7" /* Version */]('5.2.11');
  41981. /**
  41982. * @fileoverview added by tsickle
  41983. * @suppress {checkTypes} checked by tsc
  41984. */
  41985. /**
  41986. * @license
  41987. * Copyright Google Inc. All Rights Reserved.
  41988. *
  41989. * Use of this source code is governed by an MIT-style license that can be
  41990. * found in the LICENSE file at https://angular.io/license
  41991. */
  41992. /**
  41993. * @fileoverview added by tsickle
  41994. * @suppress {checkTypes} checked by tsc
  41995. */
  41996. /**
  41997. * @license
  41998. * Copyright Google Inc. All Rights Reserved.
  41999. *
  42000. * Use of this source code is governed by an MIT-style license that can be
  42001. * found in the LICENSE file at https://angular.io/license
  42002. */
  42003. /**
  42004. * @module
  42005. * @description
  42006. * Entry point for all public APIs of this package.
  42007. */
  42008. // This file only reexports content of the `src` folder. Keep it that way.
  42009. /**
  42010. * @fileoverview added by tsickle
  42011. * @suppress {checkTypes} checked by tsc
  42012. */
  42013. /**
  42014. * Generated bundle index. Do not edit.
  42015. */
  42016. //# sourceMappingURL=platform-browser.js.map
  42017. /***/ }),
  42018. /* 32 */
  42019. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42020. "use strict";
  42021. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PageTransition; });
  42022. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__animations_animation__ = __webpack_require__(11);
  42023. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__transition__ = __webpack_require__(27);
  42024. var __extends = (this && this.__extends) || (function () {
  42025. var extendStatics = Object.setPrototypeOf ||
  42026. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  42027. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  42028. return function (d, b) {
  42029. extendStatics(d, b);
  42030. function __() { this.constructor = d; }
  42031. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  42032. };
  42033. })();
  42034. /**
  42035. * @hidden
  42036. */
  42037. var PageTransition = (function (_super) {
  42038. __extends(PageTransition, _super);
  42039. function PageTransition() {
  42040. return _super !== null && _super.apply(this, arguments) || this;
  42041. }
  42042. PageTransition.prototype.init = function () {
  42043. var _this = this;
  42044. if (this.enteringView) {
  42045. this.enteringPage = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, this.enteringView.pageRef());
  42046. this.add(this.enteringPage.beforeAddClass('show-page'));
  42047. // Resize content before transition starts
  42048. this.beforeAddRead(function () {
  42049. _this.enteringView.readReady.emit();
  42050. });
  42051. this.beforeAddWrite(function () {
  42052. _this.enteringView.writeReady.emit();
  42053. });
  42054. }
  42055. };
  42056. PageTransition.prototype.destroy = function () {
  42057. _super.prototype.destroy.call(this);
  42058. this.enteringPage && this.enteringPage.destroy();
  42059. this.enteringPage = null;
  42060. };
  42061. return PageTransition;
  42062. }(__WEBPACK_IMPORTED_MODULE_1__transition__["a" /* Transition */]));
  42063. //# sourceMappingURL=page-transition.js.map
  42064. /***/ }),
  42065. /* 33 */
  42066. /***/ (function(module, exports, __webpack_require__) {
  42067. "use strict";
  42068. var __extends = (this && this.__extends) || function (d, b) {
  42069. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  42070. function __() { this.constructor = d; }
  42071. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  42072. };
  42073. var Observable_1 = __webpack_require__(9);
  42074. var Subscriber_1 = __webpack_require__(20);
  42075. var Subscription_1 = __webpack_require__(30);
  42076. var ObjectUnsubscribedError_1 = __webpack_require__(222);
  42077. var SubjectSubscription_1 = __webpack_require__(223);
  42078. var rxSubscriber_1 = __webpack_require__(52);
  42079. /**
  42080. * @class SubjectSubscriber<T>
  42081. */
  42082. var SubjectSubscriber = (function (_super) {
  42083. __extends(SubjectSubscriber, _super);
  42084. function SubjectSubscriber(destination) {
  42085. _super.call(this, destination);
  42086. this.destination = destination;
  42087. }
  42088. return SubjectSubscriber;
  42089. }(Subscriber_1.Subscriber));
  42090. exports.SubjectSubscriber = SubjectSubscriber;
  42091. /**
  42092. * @class Subject<T>
  42093. */
  42094. var Subject = (function (_super) {
  42095. __extends(Subject, _super);
  42096. function Subject() {
  42097. _super.call(this);
  42098. this.observers = [];
  42099. this.closed = false;
  42100. this.isStopped = false;
  42101. this.hasError = false;
  42102. this.thrownError = null;
  42103. }
  42104. Subject.prototype[rxSubscriber_1.rxSubscriber] = function () {
  42105. return new SubjectSubscriber(this);
  42106. };
  42107. Subject.prototype.lift = function (operator) {
  42108. var subject = new AnonymousSubject(this, this);
  42109. subject.operator = operator;
  42110. return subject;
  42111. };
  42112. Subject.prototype.next = function (value) {
  42113. if (this.closed) {
  42114. throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();
  42115. }
  42116. if (!this.isStopped) {
  42117. var observers = this.observers;
  42118. var len = observers.length;
  42119. var copy = observers.slice();
  42120. for (var i = 0; i < len; i++) {
  42121. copy[i].next(value);
  42122. }
  42123. }
  42124. };
  42125. Subject.prototype.error = function (err) {
  42126. if (this.closed) {
  42127. throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();
  42128. }
  42129. this.hasError = true;
  42130. this.thrownError = err;
  42131. this.isStopped = true;
  42132. var observers = this.observers;
  42133. var len = observers.length;
  42134. var copy = observers.slice();
  42135. for (var i = 0; i < len; i++) {
  42136. copy[i].error(err);
  42137. }
  42138. this.observers.length = 0;
  42139. };
  42140. Subject.prototype.complete = function () {
  42141. if (this.closed) {
  42142. throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();
  42143. }
  42144. this.isStopped = true;
  42145. var observers = this.observers;
  42146. var len = observers.length;
  42147. var copy = observers.slice();
  42148. for (var i = 0; i < len; i++) {
  42149. copy[i].complete();
  42150. }
  42151. this.observers.length = 0;
  42152. };
  42153. Subject.prototype.unsubscribe = function () {
  42154. this.isStopped = true;
  42155. this.closed = true;
  42156. this.observers = null;
  42157. };
  42158. Subject.prototype._trySubscribe = function (subscriber) {
  42159. if (this.closed) {
  42160. throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();
  42161. }
  42162. else {
  42163. return _super.prototype._trySubscribe.call(this, subscriber);
  42164. }
  42165. };
  42166. /** @deprecated internal use only */ Subject.prototype._subscribe = function (subscriber) {
  42167. if (this.closed) {
  42168. throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();
  42169. }
  42170. else if (this.hasError) {
  42171. subscriber.error(this.thrownError);
  42172. return Subscription_1.Subscription.EMPTY;
  42173. }
  42174. else if (this.isStopped) {
  42175. subscriber.complete();
  42176. return Subscription_1.Subscription.EMPTY;
  42177. }
  42178. else {
  42179. this.observers.push(subscriber);
  42180. return new SubjectSubscription_1.SubjectSubscription(this, subscriber);
  42181. }
  42182. };
  42183. Subject.prototype.asObservable = function () {
  42184. var observable = new Observable_1.Observable();
  42185. observable.source = this;
  42186. return observable;
  42187. };
  42188. Subject.create = function (destination, source) {
  42189. return new AnonymousSubject(destination, source);
  42190. };
  42191. return Subject;
  42192. }(Observable_1.Observable));
  42193. exports.Subject = Subject;
  42194. /**
  42195. * @class AnonymousSubject<T>
  42196. */
  42197. var AnonymousSubject = (function (_super) {
  42198. __extends(AnonymousSubject, _super);
  42199. function AnonymousSubject(destination, source) {
  42200. _super.call(this);
  42201. this.destination = destination;
  42202. this.source = source;
  42203. }
  42204. AnonymousSubject.prototype.next = function (value) {
  42205. var destination = this.destination;
  42206. if (destination && destination.next) {
  42207. destination.next(value);
  42208. }
  42209. };
  42210. AnonymousSubject.prototype.error = function (err) {
  42211. var destination = this.destination;
  42212. if (destination && destination.error) {
  42213. this.destination.error(err);
  42214. }
  42215. };
  42216. AnonymousSubject.prototype.complete = function () {
  42217. var destination = this.destination;
  42218. if (destination && destination.complete) {
  42219. this.destination.complete();
  42220. }
  42221. };
  42222. /** @deprecated internal use only */ AnonymousSubject.prototype._subscribe = function (subscriber) {
  42223. var source = this.source;
  42224. if (source) {
  42225. return this.source.subscribe(subscriber);
  42226. }
  42227. else {
  42228. return Subscription_1.Subscription.EMPTY;
  42229. }
  42230. };
  42231. return AnonymousSubject;
  42232. }(Subject));
  42233. exports.AnonymousSubject = AnonymousSubject;
  42234. //# sourceMappingURL=Subject.js.map
  42235. /***/ }),
  42236. /* 34 */
  42237. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42238. "use strict";
  42239. /* unused harmony export ɵregisterLocaleData */
  42240. /* unused harmony export NgLocaleLocalization */
  42241. /* unused harmony export NgLocalization */
  42242. /* unused harmony export registerLocaleData */
  42243. /* unused harmony export Plural */
  42244. /* unused harmony export NumberFormatStyle */
  42245. /* unused harmony export FormStyle */
  42246. /* unused harmony export TranslationWidth */
  42247. /* unused harmony export FormatWidth */
  42248. /* unused harmony export NumberSymbol */
  42249. /* unused harmony export WeekDay */
  42250. /* unused harmony export getCurrencySymbol */
  42251. /* unused harmony export getLocaleDayPeriods */
  42252. /* unused harmony export getLocaleDayNames */
  42253. /* unused harmony export getLocaleMonthNames */
  42254. /* unused harmony export getLocaleId */
  42255. /* unused harmony export getLocaleEraNames */
  42256. /* unused harmony export getLocaleWeekEndRange */
  42257. /* unused harmony export getLocaleFirstDayOfWeek */
  42258. /* unused harmony export getLocaleDateFormat */
  42259. /* unused harmony export getLocaleDateTimeFormat */
  42260. /* unused harmony export getLocaleExtraDayPeriodRules */
  42261. /* unused harmony export getLocaleExtraDayPeriods */
  42262. /* unused harmony export getLocalePluralCase */
  42263. /* unused harmony export getLocaleTimeFormat */
  42264. /* unused harmony export getLocaleNumberSymbol */
  42265. /* unused harmony export getLocaleNumberFormat */
  42266. /* unused harmony export getLocaleCurrencyName */
  42267. /* unused harmony export getLocaleCurrencySymbol */
  42268. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return parseCookieValue; });
  42269. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return CommonModule; });
  42270. /* unused harmony export DeprecatedI18NPipesModule */
  42271. /* unused harmony export NgClass */
  42272. /* unused harmony export NgForOf */
  42273. /* unused harmony export NgForOfContext */
  42274. /* unused harmony export NgIf */
  42275. /* unused harmony export NgIfContext */
  42276. /* unused harmony export NgPlural */
  42277. /* unused harmony export NgPluralCase */
  42278. /* unused harmony export NgStyle */
  42279. /* unused harmony export NgSwitch */
  42280. /* unused harmony export NgSwitchCase */
  42281. /* unused harmony export NgSwitchDefault */
  42282. /* unused harmony export NgTemplateOutlet */
  42283. /* unused harmony export NgComponentOutlet */
  42284. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return DOCUMENT; });
  42285. /* unused harmony export AsyncPipe */
  42286. /* unused harmony export DatePipe */
  42287. /* unused harmony export I18nPluralPipe */
  42288. /* unused harmony export I18nSelectPipe */
  42289. /* unused harmony export JsonPipe */
  42290. /* unused harmony export LowerCasePipe */
  42291. /* unused harmony export CurrencyPipe */
  42292. /* unused harmony export DecimalPipe */
  42293. /* unused harmony export PercentPipe */
  42294. /* unused harmony export SlicePipe */
  42295. /* unused harmony export UpperCasePipe */
  42296. /* unused harmony export TitleCasePipe */
  42297. /* unused harmony export DeprecatedDatePipe */
  42298. /* unused harmony export DeprecatedCurrencyPipe */
  42299. /* unused harmony export DeprecatedDecimalPipe */
  42300. /* unused harmony export DeprecatedPercentPipe */
  42301. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return PLATFORM_BROWSER_ID; });
  42302. /* unused harmony export ɵPLATFORM_SERVER_ID */
  42303. /* unused harmony export ɵPLATFORM_WORKER_APP_ID */
  42304. /* unused harmony export ɵPLATFORM_WORKER_UI_ID */
  42305. /* unused harmony export isPlatformBrowser */
  42306. /* unused harmony export isPlatformServer */
  42307. /* unused harmony export isPlatformWorkerApp */
  42308. /* unused harmony export isPlatformWorkerUi */
  42309. /* unused harmony export VERSION */
  42310. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return PlatformLocation; });
  42311. /* unused harmony export LOCATION_INITIALIZED */
  42312. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return LocationStrategy; });
  42313. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return APP_BASE_HREF; });
  42314. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return HashLocationStrategy; });
  42315. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return PathLocationStrategy; });
  42316. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return Location; });
  42317. /* unused harmony export ɵe */
  42318. /* unused harmony export ɵd */
  42319. /* unused harmony export ɵa */
  42320. /* unused harmony export ɵb */
  42321. /* unused harmony export ɵg */
  42322. /* unused harmony export ɵf */
  42323. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  42324. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_tslib__ = __webpack_require__(25);
  42325. /**
  42326. * @license Angular v5.2.11
  42327. * (c) 2010-2018 Google, Inc. https://angular.io/
  42328. * License: MIT
  42329. */
  42330. /**
  42331. * @fileoverview added by tsickle
  42332. * @suppress {checkTypes} checked by tsc
  42333. */
  42334. /**
  42335. * @license
  42336. * Copyright Google Inc. All Rights Reserved.
  42337. *
  42338. * Use of this source code is governed by an MIT-style license that can be
  42339. * found in the LICENSE file at https://angular.io/license
  42340. */
  42341. /**
  42342. * This class should not be used directly by an application developer. Instead, use
  42343. * {\@link Location}.
  42344. *
  42345. * `PlatformLocation` encapsulates all calls to DOM apis, which allows the Router to be platform
  42346. * agnostic.
  42347. * This means that we can have different implementation of `PlatformLocation` for the different
  42348. * platforms that angular supports. For example, `\@angular/platform-browser` provides an
  42349. * implementation specific to the browser environment, while `\@angular/platform-webworker` provides
  42350. * one suitable for use with web workers.
  42351. *
  42352. * The `PlatformLocation` class is used directly by all implementations of {\@link LocationStrategy}
  42353. * when they need to interact with the DOM apis like pushState, popState, etc...
  42354. *
  42355. * {\@link LocationStrategy} in turn is used by the {\@link Location} service which is used directly
  42356. * by the {\@link Router} in order to navigate between routes. Since all interactions between {\@link
  42357. * Router} /
  42358. * {\@link Location} / {\@link LocationStrategy} and DOM apis flow through the `PlatformLocation`
  42359. * class they are all platform independent.
  42360. *
  42361. * \@stable
  42362. * @abstract
  42363. */
  42364. var PlatformLocation = /** @class */ (function () {
  42365. function PlatformLocation() {
  42366. }
  42367. return PlatformLocation;
  42368. }());
  42369. /**
  42370. * \@whatItDoes indicates when a location is initialized
  42371. * \@experimental
  42372. */
  42373. var LOCATION_INITIALIZED = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["B" /* InjectionToken */]('Location Initialized');
  42374. /**
  42375. * A serializable version of the event from onPopState or onHashChange
  42376. *
  42377. * \@experimental
  42378. * @record
  42379. */
  42380. /**
  42381. * \@experimental
  42382. * @record
  42383. */
  42384. /**
  42385. * @fileoverview added by tsickle
  42386. * @suppress {checkTypes} checked by tsc
  42387. */
  42388. /**
  42389. * @license
  42390. * Copyright Google Inc. All Rights Reserved.
  42391. *
  42392. * Use of this source code is governed by an MIT-style license that can be
  42393. * found in the LICENSE file at https://angular.io/license
  42394. */
  42395. /**
  42396. * `LocationStrategy` is responsible for representing and reading route state
  42397. * from the browser's URL. Angular provides two strategies:
  42398. * {\@link HashLocationStrategy} and {\@link PathLocationStrategy}.
  42399. *
  42400. * This is used under the hood of the {\@link Location} service.
  42401. *
  42402. * Applications should use the {\@link Router} or {\@link Location} services to
  42403. * interact with application route state.
  42404. *
  42405. * For instance, {\@link HashLocationStrategy} produces URLs like
  42406. * `http://example.com#/foo`, and {\@link PathLocationStrategy} produces
  42407. * `http://example.com/foo` as an equivalent URL.
  42408. *
  42409. * See these two classes for more.
  42410. *
  42411. * \@stable
  42412. * @abstract
  42413. */
  42414. var LocationStrategy = /** @class */ (function () {
  42415. function LocationStrategy() {
  42416. }
  42417. return LocationStrategy;
  42418. }());
  42419. /**
  42420. * The `APP_BASE_HREF` token represents the base href to be used with the
  42421. * {\@link PathLocationStrategy}.
  42422. *
  42423. * If you're using {\@link PathLocationStrategy}, you must provide a provider to a string
  42424. * representing the URL prefix that should be preserved when generating and recognizing
  42425. * URLs.
  42426. *
  42427. * ### Example
  42428. *
  42429. * ```typescript
  42430. * import {Component, NgModule} from '\@angular/core';
  42431. * import {APP_BASE_HREF} from '\@angular/common';
  42432. *
  42433. * \@NgModule({
  42434. * providers: [{provide: APP_BASE_HREF, useValue: '/my/app'}]
  42435. * })
  42436. * class AppModule {}
  42437. * ```
  42438. *
  42439. * \@stable
  42440. */
  42441. var APP_BASE_HREF = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["B" /* InjectionToken */]('appBaseHref');
  42442. /**
  42443. * @fileoverview added by tsickle
  42444. * @suppress {checkTypes} checked by tsc
  42445. */
  42446. /**
  42447. * @license
  42448. * Copyright Google Inc. All Rights Reserved.
  42449. *
  42450. * Use of this source code is governed by an MIT-style license that can be
  42451. * found in the LICENSE file at https://angular.io/license
  42452. */
  42453. /**
  42454. * \@experimental
  42455. * @record
  42456. */
  42457. /**
  42458. * \@whatItDoes `Location` is a service that applications can use to interact with a browser's URL.
  42459. * \@description
  42460. * Depending on which {\@link LocationStrategy} is used, `Location` will either persist
  42461. * to the URL's path or the URL's hash segment.
  42462. *
  42463. * Note: it's better to use {\@link Router#navigate} service to trigger route changes. Use
  42464. * `Location` only if you need to interact with or create normalized URLs outside of
  42465. * routing.
  42466. *
  42467. * `Location` is responsible for normalizing the URL against the application's base href.
  42468. * A normalized URL is absolute from the URL host, includes the application's base href, and has no
  42469. * trailing slash:
  42470. * - `/my/app/user/123` is normalized
  42471. * - `my/app/user/123` **is not** normalized
  42472. * - `/my/app/user/123/` **is not** normalized
  42473. *
  42474. * ### Example
  42475. * {\@example common/location/ts/path_location_component.ts region='LocationComponent'}
  42476. * \@stable
  42477. */
  42478. var Location = /** @class */ (function () {
  42479. function Location(platformStrategy) {
  42480. var _this = this;
  42481. /**
  42482. * \@internal
  42483. */
  42484. this._subject = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  42485. this._platformStrategy = platformStrategy;
  42486. var /** @type {?} */ browserBaseHref = this._platformStrategy.getBaseHref();
  42487. this._baseHref = Location.stripTrailingSlash(_stripIndexHtml(browserBaseHref));
  42488. this._platformStrategy.onPopState(function (ev) {
  42489. _this._subject.emit({
  42490. 'url': _this.path(true),
  42491. 'pop': true,
  42492. 'type': ev.type,
  42493. });
  42494. });
  42495. }
  42496. /**
  42497. * Returns the normalized URL path.
  42498. */
  42499. // TODO: vsavkin. Remove the boolean flag and always include hash once the deprecated router is
  42500. // removed.
  42501. /**
  42502. * Returns the normalized URL path.
  42503. * @param {?=} includeHash
  42504. * @return {?}
  42505. */
  42506. Location.prototype.path = /**
  42507. * Returns the normalized URL path.
  42508. * @param {?=} includeHash
  42509. * @return {?}
  42510. */
  42511. function (includeHash) {
  42512. if (includeHash === void 0) { includeHash = false; }
  42513. return this.normalize(this._platformStrategy.path(includeHash));
  42514. };
  42515. /**
  42516. * Normalizes the given path and compares to the current normalized path.
  42517. */
  42518. /**
  42519. * Normalizes the given path and compares to the current normalized path.
  42520. * @param {?} path
  42521. * @param {?=} query
  42522. * @return {?}
  42523. */
  42524. Location.prototype.isCurrentPathEqualTo = /**
  42525. * Normalizes the given path and compares to the current normalized path.
  42526. * @param {?} path
  42527. * @param {?=} query
  42528. * @return {?}
  42529. */
  42530. function (path, query) {
  42531. if (query === void 0) { query = ''; }
  42532. return this.path() == this.normalize(path + Location.normalizeQueryParams(query));
  42533. };
  42534. /**
  42535. * Given a string representing a URL, returns the normalized URL path without leading or
  42536. * trailing slashes.
  42537. */
  42538. /**
  42539. * Given a string representing a URL, returns the normalized URL path without leading or
  42540. * trailing slashes.
  42541. * @param {?} url
  42542. * @return {?}
  42543. */
  42544. Location.prototype.normalize = /**
  42545. * Given a string representing a URL, returns the normalized URL path without leading or
  42546. * trailing slashes.
  42547. * @param {?} url
  42548. * @return {?}
  42549. */
  42550. function (url) {
  42551. return Location.stripTrailingSlash(_stripBaseHref(this._baseHref, _stripIndexHtml(url)));
  42552. };
  42553. /**
  42554. * Given a string representing a URL, returns the platform-specific external URL path.
  42555. * If the given URL doesn't begin with a leading slash (`'/'`), this method adds one
  42556. * before normalizing. This method will also add a hash if `HashLocationStrategy` is
  42557. * used, or the `APP_BASE_HREF` if the `PathLocationStrategy` is in use.
  42558. */
  42559. /**
  42560. * Given a string representing a URL, returns the platform-specific external URL path.
  42561. * If the given URL doesn't begin with a leading slash (`'/'`), this method adds one
  42562. * before normalizing. This method will also add a hash if `HashLocationStrategy` is
  42563. * used, or the `APP_BASE_HREF` if the `PathLocationStrategy` is in use.
  42564. * @param {?} url
  42565. * @return {?}
  42566. */
  42567. Location.prototype.prepareExternalUrl = /**
  42568. * Given a string representing a URL, returns the platform-specific external URL path.
  42569. * If the given URL doesn't begin with a leading slash (`'/'`), this method adds one
  42570. * before normalizing. This method will also add a hash if `HashLocationStrategy` is
  42571. * used, or the `APP_BASE_HREF` if the `PathLocationStrategy` is in use.
  42572. * @param {?} url
  42573. * @return {?}
  42574. */
  42575. function (url) {
  42576. if (url && url[0] !== '/') {
  42577. url = '/' + url;
  42578. }
  42579. return this._platformStrategy.prepareExternalUrl(url);
  42580. };
  42581. // TODO: rename this method to pushState
  42582. /**
  42583. * Changes the browsers URL to the normalized version of the given URL, and pushes a
  42584. * new item onto the platform's history.
  42585. */
  42586. /**
  42587. * Changes the browsers URL to the normalized version of the given URL, and pushes a
  42588. * new item onto the platform's history.
  42589. * @param {?} path
  42590. * @param {?=} query
  42591. * @return {?}
  42592. */
  42593. Location.prototype.go = /**
  42594. * Changes the browsers URL to the normalized version of the given URL, and pushes a
  42595. * new item onto the platform's history.
  42596. * @param {?} path
  42597. * @param {?=} query
  42598. * @return {?}
  42599. */
  42600. function (path, query) {
  42601. if (query === void 0) { query = ''; }
  42602. this._platformStrategy.pushState(null, '', path, query);
  42603. };
  42604. /**
  42605. * Changes the browsers URL to the normalized version of the given URL, and replaces
  42606. * the top item on the platform's history stack.
  42607. */
  42608. /**
  42609. * Changes the browsers URL to the normalized version of the given URL, and replaces
  42610. * the top item on the platform's history stack.
  42611. * @param {?} path
  42612. * @param {?=} query
  42613. * @return {?}
  42614. */
  42615. Location.prototype.replaceState = /**
  42616. * Changes the browsers URL to the normalized version of the given URL, and replaces
  42617. * the top item on the platform's history stack.
  42618. * @param {?} path
  42619. * @param {?=} query
  42620. * @return {?}
  42621. */
  42622. function (path, query) {
  42623. if (query === void 0) { query = ''; }
  42624. this._platformStrategy.replaceState(null, '', path, query);
  42625. };
  42626. /**
  42627. * Navigates forward in the platform's history.
  42628. */
  42629. /**
  42630. * Navigates forward in the platform's history.
  42631. * @return {?}
  42632. */
  42633. Location.prototype.forward = /**
  42634. * Navigates forward in the platform's history.
  42635. * @return {?}
  42636. */
  42637. function () { this._platformStrategy.forward(); };
  42638. /**
  42639. * Navigates back in the platform's history.
  42640. */
  42641. /**
  42642. * Navigates back in the platform's history.
  42643. * @return {?}
  42644. */
  42645. Location.prototype.back = /**
  42646. * Navigates back in the platform's history.
  42647. * @return {?}
  42648. */
  42649. function () { this._platformStrategy.back(); };
  42650. /**
  42651. * Subscribe to the platform's `popState` events.
  42652. */
  42653. /**
  42654. * Subscribe to the platform's `popState` events.
  42655. * @param {?} onNext
  42656. * @param {?=} onThrow
  42657. * @param {?=} onReturn
  42658. * @return {?}
  42659. */
  42660. Location.prototype.subscribe = /**
  42661. * Subscribe to the platform's `popState` events.
  42662. * @param {?} onNext
  42663. * @param {?=} onThrow
  42664. * @param {?=} onReturn
  42665. * @return {?}
  42666. */
  42667. function (onNext, onThrow, onReturn) {
  42668. return this._subject.subscribe({ next: onNext, error: onThrow, complete: onReturn });
  42669. };
  42670. /**
  42671. * Given a string of url parameters, prepend with '?' if needed, otherwise return parameters as
  42672. * is.
  42673. * @param {?} params
  42674. * @return {?}
  42675. */
  42676. Location.normalizeQueryParams = /**
  42677. * Given a string of url parameters, prepend with '?' if needed, otherwise return parameters as
  42678. * is.
  42679. * @param {?} params
  42680. * @return {?}
  42681. */
  42682. function (params) {
  42683. return params && params[0] !== '?' ? '?' + params : params;
  42684. };
  42685. /**
  42686. * Given 2 parts of a url, join them with a slash if needed.
  42687. * @param {?} start
  42688. * @param {?} end
  42689. * @return {?}
  42690. */
  42691. Location.joinWithSlash = /**
  42692. * Given 2 parts of a url, join them with a slash if needed.
  42693. * @param {?} start
  42694. * @param {?} end
  42695. * @return {?}
  42696. */
  42697. function (start, end) {
  42698. if (start.length == 0) {
  42699. return end;
  42700. }
  42701. if (end.length == 0) {
  42702. return start;
  42703. }
  42704. var /** @type {?} */ slashes = 0;
  42705. if (start.endsWith('/')) {
  42706. slashes++;
  42707. }
  42708. if (end.startsWith('/')) {
  42709. slashes++;
  42710. }
  42711. if (slashes == 2) {
  42712. return start + end.substring(1);
  42713. }
  42714. if (slashes == 1) {
  42715. return start + end;
  42716. }
  42717. return start + '/' + end;
  42718. };
  42719. /**
  42720. * If url has a trailing slash, remove it, otherwise return url as is. This
  42721. * method looks for the first occurence of either #, ?, or the end of the
  42722. * line as `/` characters after any of these should not be replaced.
  42723. * @param {?} url
  42724. * @return {?}
  42725. */
  42726. Location.stripTrailingSlash = /**
  42727. * If url has a trailing slash, remove it, otherwise return url as is. This
  42728. * method looks for the first occurence of either #, ?, or the end of the
  42729. * line as `/` characters after any of these should not be replaced.
  42730. * @param {?} url
  42731. * @return {?}
  42732. */
  42733. function (url) {
  42734. var /** @type {?} */ match = url.match(/#|\?|$/);
  42735. var /** @type {?} */ pathEndIdx = match && match.index || url.length;
  42736. var /** @type {?} */ droppedSlashIdx = pathEndIdx - (url[pathEndIdx - 1] === '/' ? 1 : 0);
  42737. return url.slice(0, droppedSlashIdx) + url.slice(pathEndIdx);
  42738. };
  42739. Location.decorators = [
  42740. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */] },
  42741. ];
  42742. /** @nocollapse */
  42743. Location.ctorParameters = function () { return [
  42744. { type: LocationStrategy, },
  42745. ]; };
  42746. return Location;
  42747. }());
  42748. /**
  42749. * @param {?} baseHref
  42750. * @param {?} url
  42751. * @return {?}
  42752. */
  42753. function _stripBaseHref(baseHref, url) {
  42754. return baseHref && url.startsWith(baseHref) ? url.substring(baseHref.length) : url;
  42755. }
  42756. /**
  42757. * @param {?} url
  42758. * @return {?}
  42759. */
  42760. function _stripIndexHtml(url) {
  42761. return url.replace(/\/index.html$/, '');
  42762. }
  42763. /**
  42764. * @fileoverview added by tsickle
  42765. * @suppress {checkTypes} checked by tsc
  42766. */
  42767. /**
  42768. * @license
  42769. * Copyright Google Inc. All Rights Reserved.
  42770. *
  42771. * Use of this source code is governed by an MIT-style license that can be
  42772. * found in the LICENSE file at https://angular.io/license
  42773. */
  42774. /**
  42775. * \@whatItDoes Use URL hash for storing application location data.
  42776. * \@description
  42777. * `HashLocationStrategy` is a {\@link LocationStrategy} used to configure the
  42778. * {\@link Location} service to represent its state in the
  42779. * [hash fragment](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax)
  42780. * of the browser's URL.
  42781. *
  42782. * For instance, if you call `location.go('/foo')`, the browser's URL will become
  42783. * `example.com#/foo`.
  42784. *
  42785. * ### Example
  42786. *
  42787. * {\@example common/location/ts/hash_location_component.ts region='LocationComponent'}
  42788. *
  42789. * \@stable
  42790. */
  42791. var HashLocationStrategy = /** @class */ (function (_super) {
  42792. Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["b" /* __extends */])(HashLocationStrategy, _super);
  42793. function HashLocationStrategy(_platformLocation, _baseHref) {
  42794. var _this = _super.call(this) || this;
  42795. _this._platformLocation = _platformLocation;
  42796. _this._baseHref = '';
  42797. if (_baseHref != null) {
  42798. _this._baseHref = _baseHref;
  42799. }
  42800. return _this;
  42801. }
  42802. /**
  42803. * @param {?} fn
  42804. * @return {?}
  42805. */
  42806. HashLocationStrategy.prototype.onPopState = /**
  42807. * @param {?} fn
  42808. * @return {?}
  42809. */
  42810. function (fn) {
  42811. this._platformLocation.onPopState(fn);
  42812. this._platformLocation.onHashChange(fn);
  42813. };
  42814. /**
  42815. * @return {?}
  42816. */
  42817. HashLocationStrategy.prototype.getBaseHref = /**
  42818. * @return {?}
  42819. */
  42820. function () { return this._baseHref; };
  42821. /**
  42822. * @param {?=} includeHash
  42823. * @return {?}
  42824. */
  42825. HashLocationStrategy.prototype.path = /**
  42826. * @param {?=} includeHash
  42827. * @return {?}
  42828. */
  42829. function (includeHash) {
  42830. if (includeHash === void 0) { includeHash = false; }
  42831. // the hash value is always prefixed with a `#`
  42832. // and if it is empty then it will stay empty
  42833. var /** @type {?} */ path = this._platformLocation.hash;
  42834. if (path == null)
  42835. path = '#';
  42836. return path.length > 0 ? path.substring(1) : path;
  42837. };
  42838. /**
  42839. * @param {?} internal
  42840. * @return {?}
  42841. */
  42842. HashLocationStrategy.prototype.prepareExternalUrl = /**
  42843. * @param {?} internal
  42844. * @return {?}
  42845. */
  42846. function (internal) {
  42847. var /** @type {?} */ url = Location.joinWithSlash(this._baseHref, internal);
  42848. return url.length > 0 ? ('#' + url) : url;
  42849. };
  42850. /**
  42851. * @param {?} state
  42852. * @param {?} title
  42853. * @param {?} path
  42854. * @param {?} queryParams
  42855. * @return {?}
  42856. */
  42857. HashLocationStrategy.prototype.pushState = /**
  42858. * @param {?} state
  42859. * @param {?} title
  42860. * @param {?} path
  42861. * @param {?} queryParams
  42862. * @return {?}
  42863. */
  42864. function (state, title, path, queryParams) {
  42865. var /** @type {?} */ url = this.prepareExternalUrl(path + Location.normalizeQueryParams(queryParams));
  42866. if (url.length == 0) {
  42867. url = this._platformLocation.pathname;
  42868. }
  42869. this._platformLocation.pushState(state, title, url);
  42870. };
  42871. /**
  42872. * @param {?} state
  42873. * @param {?} title
  42874. * @param {?} path
  42875. * @param {?} queryParams
  42876. * @return {?}
  42877. */
  42878. HashLocationStrategy.prototype.replaceState = /**
  42879. * @param {?} state
  42880. * @param {?} title
  42881. * @param {?} path
  42882. * @param {?} queryParams
  42883. * @return {?}
  42884. */
  42885. function (state, title, path, queryParams) {
  42886. var /** @type {?} */ url = this.prepareExternalUrl(path + Location.normalizeQueryParams(queryParams));
  42887. if (url.length == 0) {
  42888. url = this._platformLocation.pathname;
  42889. }
  42890. this._platformLocation.replaceState(state, title, url);
  42891. };
  42892. /**
  42893. * @return {?}
  42894. */
  42895. HashLocationStrategy.prototype.forward = /**
  42896. * @return {?}
  42897. */
  42898. function () { this._platformLocation.forward(); };
  42899. /**
  42900. * @return {?}
  42901. */
  42902. HashLocationStrategy.prototype.back = /**
  42903. * @return {?}
  42904. */
  42905. function () { this._platformLocation.back(); };
  42906. HashLocationStrategy.decorators = [
  42907. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */] },
  42908. ];
  42909. /** @nocollapse */
  42910. HashLocationStrategy.ctorParameters = function () { return [
  42911. { type: PlatformLocation, },
  42912. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["z" /* Inject */], args: [APP_BASE_HREF,] },] },
  42913. ]; };
  42914. return HashLocationStrategy;
  42915. }(LocationStrategy));
  42916. /**
  42917. * @fileoverview added by tsickle
  42918. * @suppress {checkTypes} checked by tsc
  42919. */
  42920. /**
  42921. * @license
  42922. * Copyright Google Inc. All Rights Reserved.
  42923. *
  42924. * Use of this source code is governed by an MIT-style license that can be
  42925. * found in the LICENSE file at https://angular.io/license
  42926. */
  42927. /**
  42928. * \@whatItDoes Use URL for storing application location data.
  42929. * \@description
  42930. * `PathLocationStrategy` is a {\@link LocationStrategy} used to configure the
  42931. * {\@link Location} service to represent its state in the
  42932. * [path](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax) of the
  42933. * browser's URL.
  42934. *
  42935. * If you're using `PathLocationStrategy`, you must provide a {\@link APP_BASE_HREF}
  42936. * or add a base element to the document. This URL prefix that will be preserved
  42937. * when generating and recognizing URLs.
  42938. *
  42939. * For instance, if you provide an `APP_BASE_HREF` of `'/my/app'` and call
  42940. * `location.go('/foo')`, the browser's URL will become
  42941. * `example.com/my/app/foo`.
  42942. *
  42943. * Similarly, if you add `<base href='/my/app'/>` to the document and call
  42944. * `location.go('/foo')`, the browser's URL will become
  42945. * `example.com/my/app/foo`.
  42946. *
  42947. * ### Example
  42948. *
  42949. * {\@example common/location/ts/path_location_component.ts region='LocationComponent'}
  42950. *
  42951. * \@stable
  42952. */
  42953. var PathLocationStrategy = /** @class */ (function (_super) {
  42954. Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["b" /* __extends */])(PathLocationStrategy, _super);
  42955. function PathLocationStrategy(_platformLocation, href) {
  42956. var _this = _super.call(this) || this;
  42957. _this._platformLocation = _platformLocation;
  42958. if (href == null) {
  42959. href = _this._platformLocation.getBaseHrefFromDOM();
  42960. }
  42961. if (href == null) {
  42962. throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");
  42963. }
  42964. _this._baseHref = href;
  42965. return _this;
  42966. }
  42967. /**
  42968. * @param {?} fn
  42969. * @return {?}
  42970. */
  42971. PathLocationStrategy.prototype.onPopState = /**
  42972. * @param {?} fn
  42973. * @return {?}
  42974. */
  42975. function (fn) {
  42976. this._platformLocation.onPopState(fn);
  42977. this._platformLocation.onHashChange(fn);
  42978. };
  42979. /**
  42980. * @return {?}
  42981. */
  42982. PathLocationStrategy.prototype.getBaseHref = /**
  42983. * @return {?}
  42984. */
  42985. function () { return this._baseHref; };
  42986. /**
  42987. * @param {?} internal
  42988. * @return {?}
  42989. */
  42990. PathLocationStrategy.prototype.prepareExternalUrl = /**
  42991. * @param {?} internal
  42992. * @return {?}
  42993. */
  42994. function (internal) {
  42995. return Location.joinWithSlash(this._baseHref, internal);
  42996. };
  42997. /**
  42998. * @param {?=} includeHash
  42999. * @return {?}
  43000. */
  43001. PathLocationStrategy.prototype.path = /**
  43002. * @param {?=} includeHash
  43003. * @return {?}
  43004. */
  43005. function (includeHash) {
  43006. if (includeHash === void 0) { includeHash = false; }
  43007. var /** @type {?} */ pathname = this._platformLocation.pathname +
  43008. Location.normalizeQueryParams(this._platformLocation.search);
  43009. var /** @type {?} */ hash = this._platformLocation.hash;
  43010. return hash && includeHash ? "" + pathname + hash : pathname;
  43011. };
  43012. /**
  43013. * @param {?} state
  43014. * @param {?} title
  43015. * @param {?} url
  43016. * @param {?} queryParams
  43017. * @return {?}
  43018. */
  43019. PathLocationStrategy.prototype.pushState = /**
  43020. * @param {?} state
  43021. * @param {?} title
  43022. * @param {?} url
  43023. * @param {?} queryParams
  43024. * @return {?}
  43025. */
  43026. function (state, title, url, queryParams) {
  43027. var /** @type {?} */ externalUrl = this.prepareExternalUrl(url + Location.normalizeQueryParams(queryParams));
  43028. this._platformLocation.pushState(state, title, externalUrl);
  43029. };
  43030. /**
  43031. * @param {?} state
  43032. * @param {?} title
  43033. * @param {?} url
  43034. * @param {?} queryParams
  43035. * @return {?}
  43036. */
  43037. PathLocationStrategy.prototype.replaceState = /**
  43038. * @param {?} state
  43039. * @param {?} title
  43040. * @param {?} url
  43041. * @param {?} queryParams
  43042. * @return {?}
  43043. */
  43044. function (state, title, url, queryParams) {
  43045. var /** @type {?} */ externalUrl = this.prepareExternalUrl(url + Location.normalizeQueryParams(queryParams));
  43046. this._platformLocation.replaceState(state, title, externalUrl);
  43047. };
  43048. /**
  43049. * @return {?}
  43050. */
  43051. PathLocationStrategy.prototype.forward = /**
  43052. * @return {?}
  43053. */
  43054. function () { this._platformLocation.forward(); };
  43055. /**
  43056. * @return {?}
  43057. */
  43058. PathLocationStrategy.prototype.back = /**
  43059. * @return {?}
  43060. */
  43061. function () { this._platformLocation.back(); };
  43062. PathLocationStrategy.decorators = [
  43063. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */] },
  43064. ];
  43065. /** @nocollapse */
  43066. PathLocationStrategy.ctorParameters = function () { return [
  43067. { type: PlatformLocation, },
  43068. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["z" /* Inject */], args: [APP_BASE_HREF,] },] },
  43069. ]; };
  43070. return PathLocationStrategy;
  43071. }(LocationStrategy));
  43072. /**
  43073. * @fileoverview added by tsickle
  43074. * @suppress {checkTypes} checked by tsc
  43075. */
  43076. /**
  43077. * @license
  43078. * Copyright Google Inc. All Rights Reserved.
  43079. *
  43080. * Use of this source code is governed by an MIT-style license that can be
  43081. * found in the LICENSE file at https://angular.io/license
  43082. */
  43083. /**
  43084. * @fileoverview added by tsickle
  43085. * @suppress {checkTypes} checked by tsc
  43086. */
  43087. /**
  43088. * @license
  43089. * Copyright Google Inc. All Rights Reserved.
  43090. *
  43091. * Use of this source code is governed by an MIT-style license that can be
  43092. * found in the LICENSE file at https://angular.io/license
  43093. */
  43094. // THIS CODE IS GENERATED - DO NOT MODIFY
  43095. // See angular/tools/gulp-tasks/cldr/extract.js
  43096. /**
  43097. * \@internal
  43098. */
  43099. var CURRENCIES = {
  43100. 'AOA': [, 'Kz'],
  43101. 'ARS': [, '$'],
  43102. 'AUD': ['A$', '$'],
  43103. 'BAM': [, 'KM'],
  43104. 'BBD': [, '$'],
  43105. 'BDT': [, '৳'],
  43106. 'BMD': [, '$'],
  43107. 'BND': [, '$'],
  43108. 'BOB': [, 'Bs'],
  43109. 'BRL': ['R$'],
  43110. 'BSD': [, '$'],
  43111. 'BWP': [, 'P'],
  43112. 'BYN': [, 'р.'],
  43113. 'BZD': [, '$'],
  43114. 'CAD': ['CA$', '$'],
  43115. 'CLP': [, '$'],
  43116. 'CNY': ['CN¥', '¥'],
  43117. 'COP': [, '$'],
  43118. 'CRC': [, '₡'],
  43119. 'CUC': [, '$'],
  43120. 'CUP': [, '$'],
  43121. 'CZK': [, 'Kč'],
  43122. 'DKK': [, 'kr'],
  43123. 'DOP': [, '$'],
  43124. 'EGP': [, 'E£'],
  43125. 'ESP': [, '₧'],
  43126. 'EUR': ['€'],
  43127. 'FJD': [, '$'],
  43128. 'FKP': [, '£'],
  43129. 'GBP': ['£'],
  43130. 'GEL': [, '₾'],
  43131. 'GIP': [, '£'],
  43132. 'GNF': [, 'FG'],
  43133. 'GTQ': [, 'Q'],
  43134. 'GYD': [, '$'],
  43135. 'HKD': ['HK$', '$'],
  43136. 'HNL': [, 'L'],
  43137. 'HRK': [, 'kn'],
  43138. 'HUF': [, 'Ft'],
  43139. 'IDR': [, 'Rp'],
  43140. 'ILS': ['₪'],
  43141. 'INR': ['₹'],
  43142. 'ISK': [, 'kr'],
  43143. 'JMD': [, '$'],
  43144. 'JPY': ['¥'],
  43145. 'KHR': [, '៛'],
  43146. 'KMF': [, 'CF'],
  43147. 'KPW': [, '₩'],
  43148. 'KRW': ['₩'],
  43149. 'KYD': [, '$'],
  43150. 'KZT': [, '₸'],
  43151. 'LAK': [, '₭'],
  43152. 'LBP': [, 'L£'],
  43153. 'LKR': [, 'Rs'],
  43154. 'LRD': [, '$'],
  43155. 'LTL': [, 'Lt'],
  43156. 'LVL': [, 'Ls'],
  43157. 'MGA': [, 'Ar'],
  43158. 'MMK': [, 'K'],
  43159. 'MNT': [, '₮'],
  43160. 'MUR': [, 'Rs'],
  43161. 'MXN': ['MX$', '$'],
  43162. 'MYR': [, 'RM'],
  43163. 'NAD': [, '$'],
  43164. 'NGN': [, '₦'],
  43165. 'NIO': [, 'C$'],
  43166. 'NOK': [, 'kr'],
  43167. 'NPR': [, 'Rs'],
  43168. 'NZD': ['NZ$', '$'],
  43169. 'PHP': [, '₱'],
  43170. 'PKR': [, 'Rs'],
  43171. 'PLN': [, 'zł'],
  43172. 'PYG': [, '₲'],
  43173. 'RON': [, 'lei'],
  43174. 'RUB': [, '₽'],
  43175. 'RUR': [, 'р.'],
  43176. 'RWF': [, 'RF'],
  43177. 'SBD': [, '$'],
  43178. 'SEK': [, 'kr'],
  43179. 'SGD': [, '$'],
  43180. 'SHP': [, '£'],
  43181. 'SRD': [, '$'],
  43182. 'SSP': [, '£'],
  43183. 'STD': [, 'Db'],
  43184. 'SYP': [, '£'],
  43185. 'THB': [, '฿'],
  43186. 'TOP': [, 'T$'],
  43187. 'TRY': [, '₺'],
  43188. 'TTD': [, '$'],
  43189. 'TWD': ['NT$', '$'],
  43190. 'UAH': [, '₴'],
  43191. 'USD': ['$'],
  43192. 'UYU': [, '$'],
  43193. 'VEF': [, 'Bs'],
  43194. 'VND': ['₫'],
  43195. 'XAF': ['FCFA'],
  43196. 'XCD': ['EC$', '$'],
  43197. 'XOF': ['CFA'],
  43198. 'XPF': ['CFPF'],
  43199. 'ZAR': [, 'R'],
  43200. 'ZMW': [, 'ZK'],
  43201. };
  43202. /**
  43203. * @fileoverview added by tsickle
  43204. * @suppress {checkTypes} checked by tsc
  43205. */
  43206. /**
  43207. * @license
  43208. * Copyright Google Inc. All Rights Reserved.
  43209. *
  43210. * Use of this source code is governed by an MIT-style license that can be
  43211. * found in the LICENSE file at https://angular.io/license
  43212. */
  43213. // THIS CODE IS GENERATED - DO NOT MODIFY
  43214. // See angular/tools/gulp-tasks/cldr/extract.js
  43215. /**
  43216. * @param {?} n
  43217. * @return {?}
  43218. */
  43219. function plural(n) {
  43220. var /** @type {?} */ i = Math.floor(Math.abs(n)), /** @type {?} */ v = n.toString().replace(/^[^.]*\.?/, '').length;
  43221. if (i === 1 && v === 0)
  43222. return 1;
  43223. return 5;
  43224. }
  43225. var localeEn = [
  43226. 'en',
  43227. [
  43228. ['a', 'p'],
  43229. ['AM', 'PM'],
  43230. ],
  43231. [
  43232. ['AM', 'PM'],
  43233. ,
  43234. ],
  43235. [
  43236. ['S', 'M', 'T', 'W', 'T', 'F', 'S'], ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
  43237. ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
  43238. ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa']
  43239. ],
  43240. ,
  43241. [
  43242. ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
  43243. ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
  43244. [
  43245. 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September',
  43246. 'October', 'November', 'December'
  43247. ]
  43248. ],
  43249. ,
  43250. [['B', 'A'], ['BC', 'AD'], ['Before Christ', 'Anno Domini']], 0, [6, 0],
  43251. ['M/d/yy', 'MMM d, y', 'MMMM d, y', 'EEEE, MMMM d, y'],
  43252. ['h:mm a', 'h:mm:ss a', 'h:mm:ss a z', 'h:mm:ss a zzzz'],
  43253. [
  43254. '{1}, {0}',
  43255. ,
  43256. '{1} \'at\' {0}',
  43257. ],
  43258. ['.', ',', ';', '%', '+', '-', 'E', '×', '‰', '∞', 'NaN', ':'],
  43259. ['#,##0.###', '#,##0%', '¤#,##0.00', '#E0'], '$', 'US Dollar', plural
  43260. ];
  43261. /**
  43262. * @fileoverview added by tsickle
  43263. * @suppress {checkTypes} checked by tsc
  43264. */
  43265. /**
  43266. * @license
  43267. * Copyright Google Inc. All Rights Reserved.
  43268. *
  43269. * Use of this source code is governed by an MIT-style license that can be
  43270. * found in the LICENSE file at https://angular.io/license
  43271. */
  43272. /**
  43273. * \@experimental i18n support is experimental.
  43274. */
  43275. var LOCALE_DATA = {};
  43276. /**
  43277. * Register global data to be used internally by Angular. See the
  43278. * {\@linkDocs guide/i18n#i18n-pipes "I18n guide"} to know how to import additional locale data.
  43279. *
  43280. * \@experimental i18n support is experimental.
  43281. * @param {?} data
  43282. * @param {?=} localeId
  43283. * @param {?=} extraData
  43284. * @return {?}
  43285. */
  43286. function registerLocaleData(data, localeId, extraData) {
  43287. if (typeof localeId !== 'string') {
  43288. extraData = localeId;
  43289. localeId = data[0 /* LocaleId */];
  43290. }
  43291. localeId = localeId.toLowerCase().replace(/_/g, '-');
  43292. LOCALE_DATA[localeId] = data;
  43293. if (extraData) {
  43294. LOCALE_DATA[localeId][18 /* ExtraData */] = extraData;
  43295. }
  43296. }
  43297. /**
  43298. * @fileoverview added by tsickle
  43299. * @suppress {checkTypes} checked by tsc
  43300. */
  43301. /**
  43302. * @license
  43303. * Copyright Google Inc. All Rights Reserved.
  43304. *
  43305. * Use of this source code is governed by an MIT-style license that can be
  43306. * found in the LICENSE file at https://angular.io/license
  43307. */
  43308. /** @enum {number} */
  43309. var NumberFormatStyle = {
  43310. Decimal: 0,
  43311. Percent: 1,
  43312. Currency: 2,
  43313. Scientific: 3,
  43314. };
  43315. NumberFormatStyle[NumberFormatStyle.Decimal] = "Decimal";
  43316. NumberFormatStyle[NumberFormatStyle.Percent] = "Percent";
  43317. NumberFormatStyle[NumberFormatStyle.Currency] = "Currency";
  43318. NumberFormatStyle[NumberFormatStyle.Scientific] = "Scientific";
  43319. /** @enum {number} */
  43320. var Plural = {
  43321. Zero: 0,
  43322. One: 1,
  43323. Two: 2,
  43324. Few: 3,
  43325. Many: 4,
  43326. Other: 5,
  43327. };
  43328. Plural[Plural.Zero] = "Zero";
  43329. Plural[Plural.One] = "One";
  43330. Plural[Plural.Two] = "Two";
  43331. Plural[Plural.Few] = "Few";
  43332. Plural[Plural.Many] = "Many";
  43333. Plural[Plural.Other] = "Other";
  43334. /** @enum {number} */
  43335. var FormStyle = {
  43336. Format: 0,
  43337. Standalone: 1,
  43338. };
  43339. FormStyle[FormStyle.Format] = "Format";
  43340. FormStyle[FormStyle.Standalone] = "Standalone";
  43341. /** @enum {number} */
  43342. var TranslationWidth = {
  43343. Narrow: 0,
  43344. Abbreviated: 1,
  43345. Wide: 2,
  43346. Short: 3,
  43347. };
  43348. TranslationWidth[TranslationWidth.Narrow] = "Narrow";
  43349. TranslationWidth[TranslationWidth.Abbreviated] = "Abbreviated";
  43350. TranslationWidth[TranslationWidth.Wide] = "Wide";
  43351. TranslationWidth[TranslationWidth.Short] = "Short";
  43352. /** @enum {number} */
  43353. var FormatWidth = {
  43354. Short: 0,
  43355. Medium: 1,
  43356. Long: 2,
  43357. Full: 3,
  43358. };
  43359. FormatWidth[FormatWidth.Short] = "Short";
  43360. FormatWidth[FormatWidth.Medium] = "Medium";
  43361. FormatWidth[FormatWidth.Long] = "Long";
  43362. FormatWidth[FormatWidth.Full] = "Full";
  43363. /** @enum {number} */
  43364. var NumberSymbol = {
  43365. Decimal: 0,
  43366. Group: 1,
  43367. List: 2,
  43368. PercentSign: 3,
  43369. PlusSign: 4,
  43370. MinusSign: 5,
  43371. Exponential: 6,
  43372. SuperscriptingExponent: 7,
  43373. PerMille: 8,
  43374. Infinity: 9,
  43375. NaN: 10,
  43376. TimeSeparator: 11,
  43377. CurrencyDecimal: 12,
  43378. CurrencyGroup: 13,
  43379. };
  43380. NumberSymbol[NumberSymbol.Decimal] = "Decimal";
  43381. NumberSymbol[NumberSymbol.Group] = "Group";
  43382. NumberSymbol[NumberSymbol.List] = "List";
  43383. NumberSymbol[NumberSymbol.PercentSign] = "PercentSign";
  43384. NumberSymbol[NumberSymbol.PlusSign] = "PlusSign";
  43385. NumberSymbol[NumberSymbol.MinusSign] = "MinusSign";
  43386. NumberSymbol[NumberSymbol.Exponential] = "Exponential";
  43387. NumberSymbol[NumberSymbol.SuperscriptingExponent] = "SuperscriptingExponent";
  43388. NumberSymbol[NumberSymbol.PerMille] = "PerMille";
  43389. NumberSymbol[NumberSymbol.Infinity] = "Infinity";
  43390. NumberSymbol[NumberSymbol.NaN] = "NaN";
  43391. NumberSymbol[NumberSymbol.TimeSeparator] = "TimeSeparator";
  43392. NumberSymbol[NumberSymbol.CurrencyDecimal] = "CurrencyDecimal";
  43393. NumberSymbol[NumberSymbol.CurrencyGroup] = "CurrencyGroup";
  43394. /** @enum {number} */
  43395. var WeekDay = {
  43396. Sunday: 0,
  43397. Monday: 1,
  43398. Tuesday: 2,
  43399. Wednesday: 3,
  43400. Thursday: 4,
  43401. Friday: 5,
  43402. Saturday: 6,
  43403. };
  43404. WeekDay[WeekDay.Sunday] = "Sunday";
  43405. WeekDay[WeekDay.Monday] = "Monday";
  43406. WeekDay[WeekDay.Tuesday] = "Tuesday";
  43407. WeekDay[WeekDay.Wednesday] = "Wednesday";
  43408. WeekDay[WeekDay.Thursday] = "Thursday";
  43409. WeekDay[WeekDay.Friday] = "Friday";
  43410. WeekDay[WeekDay.Saturday] = "Saturday";
  43411. /**
  43412. * The locale id for the chosen locale (e.g `en-GB`).
  43413. *
  43414. * \@experimental i18n support is experimental.
  43415. * @param {?} locale
  43416. * @return {?}
  43417. */
  43418. function getLocaleId(locale) {
  43419. return findLocaleData(locale)[0 /* LocaleId */];
  43420. }
  43421. /**
  43422. * Periods of the day (e.g. `[AM, PM]` for en-US).
  43423. *
  43424. * \@experimental i18n support is experimental.
  43425. * @param {?} locale
  43426. * @param {?} formStyle
  43427. * @param {?} width
  43428. * @return {?}
  43429. */
  43430. function getLocaleDayPeriods(locale, formStyle, width) {
  43431. var /** @type {?} */ data = findLocaleData(locale);
  43432. var /** @type {?} */ amPmData = /** @type {?} */ ([data[1 /* DayPeriodsFormat */], data[2 /* DayPeriodsStandalone */]]);
  43433. var /** @type {?} */ amPm = getLastDefinedValue(amPmData, formStyle);
  43434. return getLastDefinedValue(amPm, width);
  43435. }
  43436. /**
  43437. * Days of the week for the Gregorian calendar (e.g. `[Sunday, Monday, ... Saturday]` for en-US).
  43438. *
  43439. * \@experimental i18n support is experimental.
  43440. * @param {?} locale
  43441. * @param {?} formStyle
  43442. * @param {?} width
  43443. * @return {?}
  43444. */
  43445. function getLocaleDayNames(locale, formStyle, width) {
  43446. var /** @type {?} */ data = findLocaleData(locale);
  43447. var /** @type {?} */ daysData = /** @type {?} */ ([data[3 /* DaysFormat */], data[4 /* DaysStandalone */]]);
  43448. var /** @type {?} */ days = getLastDefinedValue(daysData, formStyle);
  43449. return getLastDefinedValue(days, width);
  43450. }
  43451. /**
  43452. * Months of the year for the Gregorian calendar (e.g. `[January, February, ...]` for en-US).
  43453. *
  43454. * \@experimental i18n support is experimental.
  43455. * @param {?} locale
  43456. * @param {?} formStyle
  43457. * @param {?} width
  43458. * @return {?}
  43459. */
  43460. function getLocaleMonthNames(locale, formStyle, width) {
  43461. var /** @type {?} */ data = findLocaleData(locale);
  43462. var /** @type {?} */ monthsData = /** @type {?} */ ([data[5 /* MonthsFormat */], data[6 /* MonthsStandalone */]]);
  43463. var /** @type {?} */ months = getLastDefinedValue(monthsData, formStyle);
  43464. return getLastDefinedValue(months, width);
  43465. }
  43466. /**
  43467. * Eras for the Gregorian calendar (e.g. AD/BC).
  43468. *
  43469. * \@experimental i18n support is experimental.
  43470. * @param {?} locale
  43471. * @param {?} width
  43472. * @return {?}
  43473. */
  43474. function getLocaleEraNames(locale, width) {
  43475. var /** @type {?} */ data = findLocaleData(locale);
  43476. var /** @type {?} */ erasData = /** @type {?} */ (data[7 /* Eras */]);
  43477. return getLastDefinedValue(erasData, width);
  43478. }
  43479. /**
  43480. * First day of the week for this locale, based on english days (Sunday = 0, Monday = 1, ...).
  43481. * For example in french the value would be 1 because the first day of the week is Monday.
  43482. *
  43483. * \@experimental i18n support is experimental.
  43484. * @param {?} locale
  43485. * @return {?}
  43486. */
  43487. function getLocaleFirstDayOfWeek(locale) {
  43488. var /** @type {?} */ data = findLocaleData(locale);
  43489. return data[8 /* FirstDayOfWeek */];
  43490. }
  43491. /**
  43492. * Range of days in the week that represent the week-end for this locale, based on english days
  43493. * (Sunday = 0, Monday = 1, ...).
  43494. * For example in english the value would be [6,0] for Saturday to Sunday.
  43495. *
  43496. * \@experimental i18n support is experimental.
  43497. * @param {?} locale
  43498. * @return {?}
  43499. */
  43500. function getLocaleWeekEndRange(locale) {
  43501. var /** @type {?} */ data = findLocaleData(locale);
  43502. return data[9 /* WeekendRange */];
  43503. }
  43504. /**
  43505. * Date format that depends on the locale.
  43506. *
  43507. * There are four basic date formats:
  43508. * - `full` should contain long-weekday (EEEE), year (y), long-month (MMMM), day (d).
  43509. *
  43510. * For example, English uses `EEEE, MMMM d, y`, corresponding to a date like
  43511. * "Tuesday, September 14, 1999".
  43512. *
  43513. * - `long` should contain year, long-month, day.
  43514. *
  43515. * For example, `MMMM d, y`, corresponding to a date like "September 14, 1999".
  43516. *
  43517. * - `medium` should contain year, abbreviated-month (MMM), day.
  43518. *
  43519. * For example, `MMM d, y`, corresponding to a date like "Sep 14, 1999".
  43520. * For languages that do not use abbreviated months, use the numeric month (MM/M). For example,
  43521. * `y/MM/dd`, corresponding to a date like "1999/09/14".
  43522. *
  43523. * - `short` should contain year, numeric-month (MM/M), and day.
  43524. *
  43525. * For example, `M/d/yy`, corresponding to a date like "9/14/99".
  43526. *
  43527. * \@experimental i18n support is experimental.
  43528. * @param {?} locale
  43529. * @param {?} width
  43530. * @return {?}
  43531. */
  43532. function getLocaleDateFormat(locale, width) {
  43533. var /** @type {?} */ data = findLocaleData(locale);
  43534. return getLastDefinedValue(data[10 /* DateFormat */], width);
  43535. }
  43536. /**
  43537. * Time format that depends on the locale.
  43538. *
  43539. * The standard formats include four basic time formats:
  43540. * - `full` should contain hour (h/H), minute (mm), second (ss), and zone (zzzz).
  43541. * - `long` should contain hour, minute, second, and zone (z)
  43542. * - `medium` should contain hour, minute, second.
  43543. * - `short` should contain hour, minute.
  43544. *
  43545. * Note: The patterns depend on whether the main country using your language uses 12-hour time or
  43546. * not:
  43547. * - For 12-hour time, use a pattern like `hh:mm a` using h to mean a 12-hour clock cycle running
  43548. * 1 through 12 (midnight plus 1 minute is 12:01), or using K to mean a 12-hour clock cycle
  43549. * running 0 through 11 (midnight plus 1 minute is 0:01).
  43550. * - For 24-hour time, use a pattern like `HH:mm` using H to mean a 24-hour clock cycle running 0
  43551. * through 23 (midnight plus 1 minute is 0:01), or using k to mean a 24-hour clock cycle running
  43552. * 1 through 24 (midnight plus 1 minute is 24:01).
  43553. *
  43554. * \@experimental i18n support is experimental.
  43555. * @param {?} locale
  43556. * @param {?} width
  43557. * @return {?}
  43558. */
  43559. function getLocaleTimeFormat(locale, width) {
  43560. var /** @type {?} */ data = findLocaleData(locale);
  43561. return getLastDefinedValue(data[11 /* TimeFormat */], width);
  43562. }
  43563. /**
  43564. * Date-time format that depends on the locale.
  43565. *
  43566. * The date-time pattern shows how to combine separate patterns for date (represented by {1})
  43567. * and time (represented by {0}) into a single pattern. It usually doesn't need to be changed.
  43568. * What you want to pay attention to are:
  43569. * - possibly removing a space for languages that don't use it, such as many East Asian languages
  43570. * - possibly adding a comma, other punctuation, or a combining word
  43571. *
  43572. * For example:
  43573. * - English uses `{1} 'at' {0}` or `{1}, {0}` (depending on date style), while Japanese uses
  43574. * `{1}{0}`.
  43575. * - An English formatted date-time using the combining pattern `{1}, {0}` could be
  43576. * `Dec 10, 2010, 3:59:49 PM`. Notice the comma and space between the date portion and the time
  43577. * portion.
  43578. *
  43579. * There are four formats (`full`, `long`, `medium`, `short`); the determination of which to use
  43580. * is normally based on the date style. For example, if the date has a full month and weekday
  43581. * name, the full combining pattern will be used to combine that with a time. If the date has
  43582. * numeric month, the short version of the combining pattern will be used to combine that with a
  43583. * time. English uses `{1} 'at' {0}` for full and long styles, and `{1}, {0}` for medium and short
  43584. * styles.
  43585. *
  43586. * \@experimental i18n support is experimental.
  43587. * @param {?} locale
  43588. * @param {?} width
  43589. * @return {?}
  43590. */
  43591. function getLocaleDateTimeFormat(locale, width) {
  43592. var /** @type {?} */ data = findLocaleData(locale);
  43593. var /** @type {?} */ dateTimeFormatData = /** @type {?} */ (data[12 /* DateTimeFormat */]);
  43594. return getLastDefinedValue(dateTimeFormatData, width);
  43595. }
  43596. /**
  43597. * Number symbol that can be used to replace placeholders in number formats.
  43598. * See {\@link NumberSymbol} for more information.
  43599. *
  43600. * \@experimental i18n support is experimental.
  43601. * @param {?} locale
  43602. * @param {?} symbol
  43603. * @return {?}
  43604. */
  43605. function getLocaleNumberSymbol(locale, symbol) {
  43606. var /** @type {?} */ data = findLocaleData(locale);
  43607. var /** @type {?} */ res = data[13 /* NumberSymbols */][symbol];
  43608. if (typeof res === 'undefined') {
  43609. if (symbol === NumberSymbol.CurrencyDecimal) {
  43610. return data[13 /* NumberSymbols */][NumberSymbol.Decimal];
  43611. }
  43612. else if (symbol === NumberSymbol.CurrencyGroup) {
  43613. return data[13 /* NumberSymbols */][NumberSymbol.Group];
  43614. }
  43615. }
  43616. return res;
  43617. }
  43618. /**
  43619. * Number format that depends on the locale.
  43620. *
  43621. * Numbers are formatted using patterns, like `#,###.00`. For example, the pattern `#,###.00`
  43622. * when used to format the number 12345.678 could result in "12'345,67". That would happen if the
  43623. * grouping separator for your language is an apostrophe, and the decimal separator is a comma.
  43624. *
  43625. * <b>Important:</b> The characters `.` `,` `0` `#` (and others below) are special placeholders;
  43626. * they stand for the decimal separator, and so on, and are NOT real characters.
  43627. * You must NOT "translate" the placeholders; for example, don't change `.` to `,` even though in
  43628. * your language the decimal point is written with a comma. The symbols should be replaced by the
  43629. * local equivalents, using the Number Symbols for your language.
  43630. *
  43631. * Here are the special characters used in number patterns:
  43632. *
  43633. * | Symbol | Meaning |
  43634. * |--------|---------|
  43635. * | . | Replaced automatically by the character used for the decimal point. |
  43636. * | , | Replaced by the "grouping" (thousands) separator. |
  43637. * | 0 | Replaced by a digit (or zero if there aren't enough digits). |
  43638. * | # | Replaced by a digit (or nothing if there aren't enough). |
  43639. * | ¤ | This will be replaced by a currency symbol, such as $ or USD. |
  43640. * | % | This marks a percent format. The % symbol may change position, but must be retained. |
  43641. * | E | This marks a scientific format. The E symbol may change position, but must be retained. |
  43642. * | ' | Special characters used as literal characters are quoted with ASCII single quotes. |
  43643. *
  43644. * You can find more information
  43645. * [on the CLDR website](http://cldr.unicode.org/translation/number-patterns)
  43646. *
  43647. * \@experimental i18n support is experimental.
  43648. * @param {?} locale
  43649. * @param {?} type
  43650. * @return {?}
  43651. */
  43652. function getLocaleNumberFormat(locale, type) {
  43653. var /** @type {?} */ data = findLocaleData(locale);
  43654. return data[14 /* NumberFormats */][type];
  43655. }
  43656. /**
  43657. * The symbol used to represent the currency for the main country using this locale (e.g. $ for
  43658. * the locale en-US).
  43659. * The symbol will be `null` if the main country cannot be determined.
  43660. *
  43661. * \@experimental i18n support is experimental.
  43662. * @param {?} locale
  43663. * @return {?}
  43664. */
  43665. function getLocaleCurrencySymbol(locale) {
  43666. var /** @type {?} */ data = findLocaleData(locale);
  43667. return data[15 /* CurrencySymbol */] || null;
  43668. }
  43669. /**
  43670. * The name of the currency for the main country using this locale (e.g. USD for the locale
  43671. * en-US).
  43672. * The name will be `null` if the main country cannot be determined.
  43673. *
  43674. * \@experimental i18n support is experimental.
  43675. * @param {?} locale
  43676. * @return {?}
  43677. */
  43678. function getLocaleCurrencyName(locale) {
  43679. var /** @type {?} */ data = findLocaleData(locale);
  43680. return data[16 /* CurrencyName */] || null;
  43681. }
  43682. /**
  43683. * The locale plural function used by ICU expressions to determine the plural case to use.
  43684. * See {\@link NgPlural} for more information.
  43685. *
  43686. * \@experimental i18n support is experimental.
  43687. * @param {?} locale
  43688. * @return {?}
  43689. */
  43690. function getLocalePluralCase(locale) {
  43691. var /** @type {?} */ data = findLocaleData(locale);
  43692. return data[17 /* PluralCase */];
  43693. }
  43694. /**
  43695. * @param {?} data
  43696. * @return {?}
  43697. */
  43698. function checkFullData(data) {
  43699. if (!data[18 /* ExtraData */]) {
  43700. throw new Error("Missing extra locale data for the locale \"" + data[0 /* LocaleId */] + "\". Use \"registerLocaleData\" to load new data. See the \"I18n guide\" on angular.io to know more.");
  43701. }
  43702. }
  43703. /**
  43704. * Rules used to determine which day period to use (See `dayPeriods` below).
  43705. * The rules can either be an array or a single value. If it's an array, consider it as "from"
  43706. * and "to". If it's a single value then it means that the period is only valid at this exact
  43707. * value.
  43708. * There is always the same number of rules as the number of day periods, which means that the
  43709. * first rule is applied to the first day period and so on.
  43710. * You should fallback to AM/PM when there are no rules available.
  43711. *
  43712. * Note: this is only available if you load the full locale data.
  43713. * See the {\@linkDocs guide/i18n#i18n-pipes "I18n guide"} to know how to import additional locale
  43714. * data.
  43715. *
  43716. * \@experimental i18n support is experimental.
  43717. * @param {?} locale
  43718. * @return {?}
  43719. */
  43720. function getLocaleExtraDayPeriodRules(locale) {
  43721. var /** @type {?} */ data = findLocaleData(locale);
  43722. checkFullData(data);
  43723. var /** @type {?} */ rules = data[18 /* ExtraData */][2 /* ExtraDayPeriodsRules */] || [];
  43724. return rules.map(function (rule) {
  43725. if (typeof rule === 'string') {
  43726. return extractTime(rule);
  43727. }
  43728. return [extractTime(rule[0]), extractTime(rule[1])];
  43729. });
  43730. }
  43731. /**
  43732. * Day Periods indicate roughly how the day is broken up in different languages (e.g. morning,
  43733. * noon, afternoon, midnight, ...).
  43734. * You should use the function {\@link getLocaleExtraDayPeriodRules} to determine which period to
  43735. * use.
  43736. * You should fallback to AM/PM when there are no day periods available.
  43737. *
  43738. * Note: this is only available if you load the full locale data.
  43739. * See the {\@linkDocs guide/i18n#i18n-pipes "I18n guide"} to know how to import additional locale
  43740. * data.
  43741. *
  43742. * \@experimental i18n support is experimental.
  43743. * @param {?} locale
  43744. * @param {?} formStyle
  43745. * @param {?} width
  43746. * @return {?}
  43747. */
  43748. function getLocaleExtraDayPeriods(locale, formStyle, width) {
  43749. var /** @type {?} */ data = findLocaleData(locale);
  43750. checkFullData(data);
  43751. var /** @type {?} */ dayPeriodsData = /** @type {?} */ ([
  43752. data[18 /* ExtraData */][0 /* ExtraDayPeriodFormats */],
  43753. data[18 /* ExtraData */][1 /* ExtraDayPeriodStandalone */]
  43754. ]);
  43755. var /** @type {?} */ dayPeriods = getLastDefinedValue(dayPeriodsData, formStyle) || [];
  43756. return getLastDefinedValue(dayPeriods, width) || [];
  43757. }
  43758. /**
  43759. * Returns the first value that is defined in an array, going backwards.
  43760. *
  43761. * To avoid repeating the same data (e.g. when "format" and "standalone" are the same) we only
  43762. * add the first one to the locale data arrays, the other ones are only defined when different.
  43763. * We use this function to retrieve the first defined value.
  43764. *
  43765. * \@experimental i18n support is experimental.
  43766. * @template T
  43767. * @param {?} data
  43768. * @param {?} index
  43769. * @return {?}
  43770. */
  43771. function getLastDefinedValue(data, index) {
  43772. for (var /** @type {?} */ i = index; i > -1; i--) {
  43773. if (typeof data[i] !== 'undefined') {
  43774. return data[i];
  43775. }
  43776. }
  43777. throw new Error('Locale data API: locale data undefined');
  43778. }
  43779. /**
  43780. * Extract the hours and minutes from a string like "15:45"
  43781. * @param {?} time
  43782. * @return {?}
  43783. */
  43784. function extractTime(time) {
  43785. var _a = time.split(':'), h = _a[0], m = _a[1];
  43786. return { hours: +h, minutes: +m };
  43787. }
  43788. /**
  43789. * Finds the locale data for a locale id
  43790. *
  43791. * \@experimental i18n support is experimental.
  43792. * @param {?} locale
  43793. * @return {?}
  43794. */
  43795. function findLocaleData(locale) {
  43796. var /** @type {?} */ normalizedLocale = locale.toLowerCase().replace(/_/g, '-');
  43797. var /** @type {?} */ match = LOCALE_DATA[normalizedLocale];
  43798. if (match) {
  43799. return match;
  43800. }
  43801. // let's try to find a parent locale
  43802. var /** @type {?} */ parentLocale = normalizedLocale.split('-')[0];
  43803. match = LOCALE_DATA[parentLocale];
  43804. if (match) {
  43805. return match;
  43806. }
  43807. if (parentLocale === 'en') {
  43808. return localeEn;
  43809. }
  43810. throw new Error("Missing locale data for the locale \"" + locale + "\".");
  43811. }
  43812. /**
  43813. * Return the currency symbol for a given currency code, or the code if no symbol available
  43814. * (e.g.: format narrow = $, format wide = US$, code = USD)
  43815. *
  43816. * \@experimental i18n support is experimental.
  43817. * @param {?} code
  43818. * @param {?} format
  43819. * @return {?}
  43820. */
  43821. function getCurrencySymbol(code, format) {
  43822. var /** @type {?} */ currency = CURRENCIES[code] || [];
  43823. var /** @type {?} */ symbolNarrow = currency[1];
  43824. if (format === 'narrow' && typeof symbolNarrow === 'string') {
  43825. return symbolNarrow;
  43826. }
  43827. return currency[0] || code;
  43828. }
  43829. /**
  43830. * @fileoverview added by tsickle
  43831. * @suppress {checkTypes} checked by tsc
  43832. */
  43833. /**
  43834. * @license
  43835. * Copyright Google Inc. All Rights Reserved.
  43836. *
  43837. * Use of this source code is governed by an MIT-style license that can be
  43838. * found in the LICENSE file at https://angular.io/license
  43839. */
  43840. /**
  43841. * @deprecated from v5
  43842. */
  43843. var DEPRECATED_PLURAL_FN = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["B" /* InjectionToken */]('UseV4Plurals');
  43844. /**
  43845. * \@experimental
  43846. * @abstract
  43847. */
  43848. var NgLocalization = /** @class */ (function () {
  43849. function NgLocalization() {
  43850. }
  43851. return NgLocalization;
  43852. }());
  43853. /**
  43854. * Returns the plural category for a given value.
  43855. * - "=value" when the case exists,
  43856. * - the plural category otherwise
  43857. * @param {?} value
  43858. * @param {?} cases
  43859. * @param {?} ngLocalization
  43860. * @param {?=} locale
  43861. * @return {?}
  43862. */
  43863. function getPluralCategory(value, cases, ngLocalization, locale) {
  43864. var /** @type {?} */ key = "=" + value;
  43865. if (cases.indexOf(key) > -1) {
  43866. return key;
  43867. }
  43868. key = ngLocalization.getPluralCategory(value, locale);
  43869. if (cases.indexOf(key) > -1) {
  43870. return key;
  43871. }
  43872. if (cases.indexOf('other') > -1) {
  43873. return 'other';
  43874. }
  43875. throw new Error("No plural message found for value \"" + value + "\"");
  43876. }
  43877. /**
  43878. * Returns the plural case based on the locale
  43879. *
  43880. * \@experimental
  43881. */
  43882. var NgLocaleLocalization = /** @class */ (function (_super) {
  43883. Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["b" /* __extends */])(NgLocaleLocalization, _super);
  43884. function NgLocaleLocalization(locale, /** @deprecated from v5 */
  43885. deprecatedPluralFn) {
  43886. var _this = _super.call(this) || this;
  43887. _this.locale = locale;
  43888. _this.deprecatedPluralFn = deprecatedPluralFn;
  43889. return _this;
  43890. }
  43891. /**
  43892. * @param {?} value
  43893. * @param {?=} locale
  43894. * @return {?}
  43895. */
  43896. NgLocaleLocalization.prototype.getPluralCategory = /**
  43897. * @param {?} value
  43898. * @param {?=} locale
  43899. * @return {?}
  43900. */
  43901. function (value, locale) {
  43902. var /** @type {?} */ plural = this.deprecatedPluralFn ? this.deprecatedPluralFn(locale || this.locale, value) :
  43903. getLocalePluralCase(locale || this.locale)(value);
  43904. switch (plural) {
  43905. case Plural.Zero:
  43906. return 'zero';
  43907. case Plural.One:
  43908. return 'one';
  43909. case Plural.Two:
  43910. return 'two';
  43911. case Plural.Few:
  43912. return 'few';
  43913. case Plural.Many:
  43914. return 'many';
  43915. default:
  43916. return 'other';
  43917. }
  43918. };
  43919. NgLocaleLocalization.decorators = [
  43920. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */] },
  43921. ];
  43922. /** @nocollapse */
  43923. NgLocaleLocalization.ctorParameters = function () { return [
  43924. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["z" /* Inject */], args: [__WEBPACK_IMPORTED_MODULE_0__angular_core__["G" /* LOCALE_ID */],] },] },
  43925. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["z" /* Inject */], args: [DEPRECATED_PLURAL_FN,] },] },
  43926. ]; };
  43927. return NgLocaleLocalization;
  43928. }(NgLocalization));
  43929. /**
  43930. * Returns the plural case based on the locale
  43931. *
  43932. * @deprecated from v5 the plural case function is in locale data files common/locales/*.ts
  43933. * \@experimental
  43934. * @param {?} locale
  43935. * @param {?} nLike
  43936. * @return {?}
  43937. */
  43938. function getPluralCase(locale, nLike) {
  43939. // TODO(vicb): lazy compute
  43940. if (typeof nLike === 'string') {
  43941. nLike = parseInt(/** @type {?} */ (nLike), 10);
  43942. }
  43943. var /** @type {?} */ n = /** @type {?} */ (nLike);
  43944. var /** @type {?} */ nDecimal = n.toString().replace(/^[^.]*\.?/, '');
  43945. var /** @type {?} */ i = Math.floor(Math.abs(n));
  43946. var /** @type {?} */ v = nDecimal.length;
  43947. var /** @type {?} */ f = parseInt(nDecimal, 10);
  43948. var /** @type {?} */ t = parseInt(n.toString().replace(/^[^.]*\.?|0+$/g, ''), 10) || 0;
  43949. var /** @type {?} */ lang = locale.split('-')[0].toLowerCase();
  43950. switch (lang) {
  43951. case 'af':
  43952. case 'asa':
  43953. case 'az':
  43954. case 'bem':
  43955. case 'bez':
  43956. case 'bg':
  43957. case 'brx':
  43958. case 'ce':
  43959. case 'cgg':
  43960. case 'chr':
  43961. case 'ckb':
  43962. case 'ee':
  43963. case 'el':
  43964. case 'eo':
  43965. case 'es':
  43966. case 'eu':
  43967. case 'fo':
  43968. case 'fur':
  43969. case 'gsw':
  43970. case 'ha':
  43971. case 'haw':
  43972. case 'hu':
  43973. case 'jgo':
  43974. case 'jmc':
  43975. case 'ka':
  43976. case 'kk':
  43977. case 'kkj':
  43978. case 'kl':
  43979. case 'ks':
  43980. case 'ksb':
  43981. case 'ky':
  43982. case 'lb':
  43983. case 'lg':
  43984. case 'mas':
  43985. case 'mgo':
  43986. case 'ml':
  43987. case 'mn':
  43988. case 'nb':
  43989. case 'nd':
  43990. case 'ne':
  43991. case 'nn':
  43992. case 'nnh':
  43993. case 'nyn':
  43994. case 'om':
  43995. case 'or':
  43996. case 'os':
  43997. case 'ps':
  43998. case 'rm':
  43999. case 'rof':
  44000. case 'rwk':
  44001. case 'saq':
  44002. case 'seh':
  44003. case 'sn':
  44004. case 'so':
  44005. case 'sq':
  44006. case 'ta':
  44007. case 'te':
  44008. case 'teo':
  44009. case 'tk':
  44010. case 'tr':
  44011. case 'ug':
  44012. case 'uz':
  44013. case 'vo':
  44014. case 'vun':
  44015. case 'wae':
  44016. case 'xog':
  44017. if (n === 1)
  44018. return Plural.One;
  44019. return Plural.Other;
  44020. case 'ak':
  44021. case 'ln':
  44022. case 'mg':
  44023. case 'pa':
  44024. case 'ti':
  44025. if (n === Math.floor(n) && n >= 0 && n <= 1)
  44026. return Plural.One;
  44027. return Plural.Other;
  44028. case 'am':
  44029. case 'as':
  44030. case 'bn':
  44031. case 'fa':
  44032. case 'gu':
  44033. case 'hi':
  44034. case 'kn':
  44035. case 'mr':
  44036. case 'zu':
  44037. if (i === 0 || n === 1)
  44038. return Plural.One;
  44039. return Plural.Other;
  44040. case 'ar':
  44041. if (n === 0)
  44042. return Plural.Zero;
  44043. if (n === 1)
  44044. return Plural.One;
  44045. if (n === 2)
  44046. return Plural.Two;
  44047. if (n % 100 === Math.floor(n % 100) && n % 100 >= 3 && n % 100 <= 10)
  44048. return Plural.Few;
  44049. if (n % 100 === Math.floor(n % 100) && n % 100 >= 11 && n % 100 <= 99)
  44050. return Plural.Many;
  44051. return Plural.Other;
  44052. case 'ast':
  44053. case 'ca':
  44054. case 'de':
  44055. case 'en':
  44056. case 'et':
  44057. case 'fi':
  44058. case 'fy':
  44059. case 'gl':
  44060. case 'it':
  44061. case 'nl':
  44062. case 'sv':
  44063. case 'sw':
  44064. case 'ur':
  44065. case 'yi':
  44066. if (i === 1 && v === 0)
  44067. return Plural.One;
  44068. return Plural.Other;
  44069. case 'be':
  44070. if (n % 10 === 1 && !(n % 100 === 11))
  44071. return Plural.One;
  44072. if (n % 10 === Math.floor(n % 10) && n % 10 >= 2 && n % 10 <= 4 &&
  44073. !(n % 100 >= 12 && n % 100 <= 14))
  44074. return Plural.Few;
  44075. if (n % 10 === 0 || n % 10 === Math.floor(n % 10) && n % 10 >= 5 && n % 10 <= 9 ||
  44076. n % 100 === Math.floor(n % 100) && n % 100 >= 11 && n % 100 <= 14)
  44077. return Plural.Many;
  44078. return Plural.Other;
  44079. case 'br':
  44080. if (n % 10 === 1 && !(n % 100 === 11 || n % 100 === 71 || n % 100 === 91))
  44081. return Plural.One;
  44082. if (n % 10 === 2 && !(n % 100 === 12 || n % 100 === 72 || n % 100 === 92))
  44083. return Plural.Two;
  44084. if (n % 10 === Math.floor(n % 10) && (n % 10 >= 3 && n % 10 <= 4 || n % 10 === 9) &&
  44085. !(n % 100 >= 10 && n % 100 <= 19 || n % 100 >= 70 && n % 100 <= 79 ||
  44086. n % 100 >= 90 && n % 100 <= 99))
  44087. return Plural.Few;
  44088. if (!(n === 0) && n % 1e6 === 0)
  44089. return Plural.Many;
  44090. return Plural.Other;
  44091. case 'bs':
  44092. case 'hr':
  44093. case 'sr':
  44094. if (v === 0 && i % 10 === 1 && !(i % 100 === 11) || f % 10 === 1 && !(f % 100 === 11))
  44095. return Plural.One;
  44096. if (v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 2 && i % 10 <= 4 &&
  44097. !(i % 100 >= 12 && i % 100 <= 14) ||
  44098. f % 10 === Math.floor(f % 10) && f % 10 >= 2 && f % 10 <= 4 &&
  44099. !(f % 100 >= 12 && f % 100 <= 14))
  44100. return Plural.Few;
  44101. return Plural.Other;
  44102. case 'cs':
  44103. case 'sk':
  44104. if (i === 1 && v === 0)
  44105. return Plural.One;
  44106. if (i === Math.floor(i) && i >= 2 && i <= 4 && v === 0)
  44107. return Plural.Few;
  44108. if (!(v === 0))
  44109. return Plural.Many;
  44110. return Plural.Other;
  44111. case 'cy':
  44112. if (n === 0)
  44113. return Plural.Zero;
  44114. if (n === 1)
  44115. return Plural.One;
  44116. if (n === 2)
  44117. return Plural.Two;
  44118. if (n === 3)
  44119. return Plural.Few;
  44120. if (n === 6)
  44121. return Plural.Many;
  44122. return Plural.Other;
  44123. case 'da':
  44124. if (n === 1 || !(t === 0) && (i === 0 || i === 1))
  44125. return Plural.One;
  44126. return Plural.Other;
  44127. case 'dsb':
  44128. case 'hsb':
  44129. if (v === 0 && i % 100 === 1 || f % 100 === 1)
  44130. return Plural.One;
  44131. if (v === 0 && i % 100 === 2 || f % 100 === 2)
  44132. return Plural.Two;
  44133. if (v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 3 && i % 100 <= 4 ||
  44134. f % 100 === Math.floor(f % 100) && f % 100 >= 3 && f % 100 <= 4)
  44135. return Plural.Few;
  44136. return Plural.Other;
  44137. case 'ff':
  44138. case 'fr':
  44139. case 'hy':
  44140. case 'kab':
  44141. if (i === 0 || i === 1)
  44142. return Plural.One;
  44143. return Plural.Other;
  44144. case 'fil':
  44145. if (v === 0 && (i === 1 || i === 2 || i === 3) ||
  44146. v === 0 && !(i % 10 === 4 || i % 10 === 6 || i % 10 === 9) ||
  44147. !(v === 0) && !(f % 10 === 4 || f % 10 === 6 || f % 10 === 9))
  44148. return Plural.One;
  44149. return Plural.Other;
  44150. case 'ga':
  44151. if (n === 1)
  44152. return Plural.One;
  44153. if (n === 2)
  44154. return Plural.Two;
  44155. if (n === Math.floor(n) && n >= 3 && n <= 6)
  44156. return Plural.Few;
  44157. if (n === Math.floor(n) && n >= 7 && n <= 10)
  44158. return Plural.Many;
  44159. return Plural.Other;
  44160. case 'gd':
  44161. if (n === 1 || n === 11)
  44162. return Plural.One;
  44163. if (n === 2 || n === 12)
  44164. return Plural.Two;
  44165. if (n === Math.floor(n) && (n >= 3 && n <= 10 || n >= 13 && n <= 19))
  44166. return Plural.Few;
  44167. return Plural.Other;
  44168. case 'gv':
  44169. if (v === 0 && i % 10 === 1)
  44170. return Plural.One;
  44171. if (v === 0 && i % 10 === 2)
  44172. return Plural.Two;
  44173. if (v === 0 &&
  44174. (i % 100 === 0 || i % 100 === 20 || i % 100 === 40 || i % 100 === 60 || i % 100 === 80))
  44175. return Plural.Few;
  44176. if (!(v === 0))
  44177. return Plural.Many;
  44178. return Plural.Other;
  44179. case 'he':
  44180. if (i === 1 && v === 0)
  44181. return Plural.One;
  44182. if (i === 2 && v === 0)
  44183. return Plural.Two;
  44184. if (v === 0 && !(n >= 0 && n <= 10) && n % 10 === 0)
  44185. return Plural.Many;
  44186. return Plural.Other;
  44187. case 'is':
  44188. if (t === 0 && i % 10 === 1 && !(i % 100 === 11) || !(t === 0))
  44189. return Plural.One;
  44190. return Plural.Other;
  44191. case 'ksh':
  44192. if (n === 0)
  44193. return Plural.Zero;
  44194. if (n === 1)
  44195. return Plural.One;
  44196. return Plural.Other;
  44197. case 'kw':
  44198. case 'naq':
  44199. case 'se':
  44200. case 'smn':
  44201. if (n === 1)
  44202. return Plural.One;
  44203. if (n === 2)
  44204. return Plural.Two;
  44205. return Plural.Other;
  44206. case 'lag':
  44207. if (n === 0)
  44208. return Plural.Zero;
  44209. if ((i === 0 || i === 1) && !(n === 0))
  44210. return Plural.One;
  44211. return Plural.Other;
  44212. case 'lt':
  44213. if (n % 10 === 1 && !(n % 100 >= 11 && n % 100 <= 19))
  44214. return Plural.One;
  44215. if (n % 10 === Math.floor(n % 10) && n % 10 >= 2 && n % 10 <= 9 &&
  44216. !(n % 100 >= 11 && n % 100 <= 19))
  44217. return Plural.Few;
  44218. if (!(f === 0))
  44219. return Plural.Many;
  44220. return Plural.Other;
  44221. case 'lv':
  44222. case 'prg':
  44223. if (n % 10 === 0 || n % 100 === Math.floor(n % 100) && n % 100 >= 11 && n % 100 <= 19 ||
  44224. v === 2 && f % 100 === Math.floor(f % 100) && f % 100 >= 11 && f % 100 <= 19)
  44225. return Plural.Zero;
  44226. if (n % 10 === 1 && !(n % 100 === 11) || v === 2 && f % 10 === 1 && !(f % 100 === 11) ||
  44227. !(v === 2) && f % 10 === 1)
  44228. return Plural.One;
  44229. return Plural.Other;
  44230. case 'mk':
  44231. if (v === 0 && i % 10 === 1 || f % 10 === 1)
  44232. return Plural.One;
  44233. return Plural.Other;
  44234. case 'mt':
  44235. if (n === 1)
  44236. return Plural.One;
  44237. if (n === 0 || n % 100 === Math.floor(n % 100) && n % 100 >= 2 && n % 100 <= 10)
  44238. return Plural.Few;
  44239. if (n % 100 === Math.floor(n % 100) && n % 100 >= 11 && n % 100 <= 19)
  44240. return Plural.Many;
  44241. return Plural.Other;
  44242. case 'pl':
  44243. if (i === 1 && v === 0)
  44244. return Plural.One;
  44245. if (v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 2 && i % 10 <= 4 &&
  44246. !(i % 100 >= 12 && i % 100 <= 14))
  44247. return Plural.Few;
  44248. if (v === 0 && !(i === 1) && i % 10 === Math.floor(i % 10) && i % 10 >= 0 && i % 10 <= 1 ||
  44249. v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 5 && i % 10 <= 9 ||
  44250. v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 12 && i % 100 <= 14)
  44251. return Plural.Many;
  44252. return Plural.Other;
  44253. case 'pt':
  44254. if (n === Math.floor(n) && n >= 0 && n <= 2 && !(n === 2))
  44255. return Plural.One;
  44256. return Plural.Other;
  44257. case 'ro':
  44258. if (i === 1 && v === 0)
  44259. return Plural.One;
  44260. if (!(v === 0) || n === 0 ||
  44261. !(n === 1) && n % 100 === Math.floor(n % 100) && n % 100 >= 1 && n % 100 <= 19)
  44262. return Plural.Few;
  44263. return Plural.Other;
  44264. case 'ru':
  44265. case 'uk':
  44266. if (v === 0 && i % 10 === 1 && !(i % 100 === 11))
  44267. return Plural.One;
  44268. if (v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 2 && i % 10 <= 4 &&
  44269. !(i % 100 >= 12 && i % 100 <= 14))
  44270. return Plural.Few;
  44271. if (v === 0 && i % 10 === 0 ||
  44272. v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 5 && i % 10 <= 9 ||
  44273. v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 11 && i % 100 <= 14)
  44274. return Plural.Many;
  44275. return Plural.Other;
  44276. case 'shi':
  44277. if (i === 0 || n === 1)
  44278. return Plural.One;
  44279. if (n === Math.floor(n) && n >= 2 && n <= 10)
  44280. return Plural.Few;
  44281. return Plural.Other;
  44282. case 'si':
  44283. if (n === 0 || n === 1 || i === 0 && f === 1)
  44284. return Plural.One;
  44285. return Plural.Other;
  44286. case 'sl':
  44287. if (v === 0 && i % 100 === 1)
  44288. return Plural.One;
  44289. if (v === 0 && i % 100 === 2)
  44290. return Plural.Two;
  44291. if (v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 3 && i % 100 <= 4 || !(v === 0))
  44292. return Plural.Few;
  44293. return Plural.Other;
  44294. case 'tzm':
  44295. if (n === Math.floor(n) && n >= 0 && n <= 1 || n === Math.floor(n) && n >= 11 && n <= 99)
  44296. return Plural.One;
  44297. return Plural.Other;
  44298. // When there is no specification, the default is always "other"
  44299. // Spec: http://cldr.unicode.org/index/cldr-spec/plural-rules
  44300. // > other (required—general plural form — also used if the language only has a single form)
  44301. default:
  44302. return Plural.Other;
  44303. }
  44304. }
  44305. /**
  44306. * @fileoverview added by tsickle
  44307. * @suppress {checkTypes} checked by tsc
  44308. */
  44309. /**
  44310. * @license
  44311. * Copyright Google Inc. All Rights Reserved.
  44312. *
  44313. * Use of this source code is governed by an MIT-style license that can be
  44314. * found in the LICENSE file at https://angular.io/license
  44315. */
  44316. /**
  44317. * @param {?} cookieStr
  44318. * @param {?} name
  44319. * @return {?}
  44320. */
  44321. function parseCookieValue(cookieStr, name) {
  44322. name = encodeURIComponent(name);
  44323. for (var _i = 0, _a = cookieStr.split(';'); _i < _a.length; _i++) {
  44324. var cookie = _a[_i];
  44325. var /** @type {?} */ eqIndex = cookie.indexOf('=');
  44326. var _b = eqIndex == -1 ? [cookie, ''] : [cookie.slice(0, eqIndex), cookie.slice(eqIndex + 1)], cookieName = _b[0], cookieValue = _b[1];
  44327. if (cookieName.trim() === name) {
  44328. return decodeURIComponent(cookieValue);
  44329. }
  44330. }
  44331. return null;
  44332. }
  44333. /**
  44334. * @fileoverview added by tsickle
  44335. * @suppress {checkTypes} checked by tsc
  44336. */
  44337. /**
  44338. * @license
  44339. * Copyright Google Inc. All Rights Reserved.
  44340. *
  44341. * Use of this source code is governed by an MIT-style license that can be
  44342. * found in the LICENSE file at https://angular.io/license
  44343. */
  44344. /**
  44345. * \@ngModule CommonModule
  44346. *
  44347. * \@whatItDoes Adds and removes CSS classes on an HTML element.
  44348. *
  44349. * \@howToUse
  44350. * ```
  44351. * <some-element [ngClass]="'first second'">...</some-element>
  44352. *
  44353. * <some-element [ngClass]="['first', 'second']">...</some-element>
  44354. *
  44355. * <some-element [ngClass]="{'first': true, 'second': true, 'third': false}">...</some-element>
  44356. *
  44357. * <some-element [ngClass]="stringExp|arrayExp|objExp">...</some-element>
  44358. *
  44359. * <some-element [ngClass]="{'class1 class2 class3' : true}">...</some-element>
  44360. * ```
  44361. *
  44362. * \@description
  44363. *
  44364. * The CSS classes are updated as follows, depending on the type of the expression evaluation:
  44365. * - `string` - the CSS classes listed in the string (space delimited) are added,
  44366. * - `Array` - the CSS classes declared as Array elements are added,
  44367. * - `Object` - keys are CSS classes that get added when the expression given in the value
  44368. * evaluates to a truthy value, otherwise they are removed.
  44369. *
  44370. * \@stable
  44371. */
  44372. var NgClass = /** @class */ (function () {
  44373. function NgClass(_iterableDiffers, _keyValueDiffers, _ngEl, _renderer) {
  44374. this._iterableDiffers = _iterableDiffers;
  44375. this._keyValueDiffers = _keyValueDiffers;
  44376. this._ngEl = _ngEl;
  44377. this._renderer = _renderer;
  44378. this._initialClasses = [];
  44379. }
  44380. Object.defineProperty(NgClass.prototype, "klass", {
  44381. set: /**
  44382. * @param {?} v
  44383. * @return {?}
  44384. */
  44385. function (v) {
  44386. this._removeClasses(this._initialClasses);
  44387. this._initialClasses = typeof v === 'string' ? v.split(/\s+/) : [];
  44388. this._applyClasses(this._initialClasses);
  44389. this._applyClasses(this._rawClass);
  44390. },
  44391. enumerable: true,
  44392. configurable: true
  44393. });
  44394. Object.defineProperty(NgClass.prototype, "ngClass", {
  44395. set: /**
  44396. * @param {?} v
  44397. * @return {?}
  44398. */
  44399. function (v) {
  44400. this._removeClasses(this._rawClass);
  44401. this._applyClasses(this._initialClasses);
  44402. this._iterableDiffer = null;
  44403. this._keyValueDiffer = null;
  44404. this._rawClass = typeof v === 'string' ? v.split(/\s+/) : v;
  44405. if (this._rawClass) {
  44406. if (Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_33" /* ɵisListLikeIterable */])(this._rawClass)) {
  44407. this._iterableDiffer = this._iterableDiffers.find(this._rawClass).create();
  44408. }
  44409. else {
  44410. this._keyValueDiffer = this._keyValueDiffers.find(this._rawClass).create();
  44411. }
  44412. }
  44413. },
  44414. enumerable: true,
  44415. configurable: true
  44416. });
  44417. /**
  44418. * @return {?}
  44419. */
  44420. NgClass.prototype.ngDoCheck = /**
  44421. * @return {?}
  44422. */
  44423. function () {
  44424. if (this._iterableDiffer) {
  44425. var /** @type {?} */ iterableChanges = this._iterableDiffer.diff(/** @type {?} */ (this._rawClass));
  44426. if (iterableChanges) {
  44427. this._applyIterableChanges(iterableChanges);
  44428. }
  44429. }
  44430. else if (this._keyValueDiffer) {
  44431. var /** @type {?} */ keyValueChanges = this._keyValueDiffer.diff(/** @type {?} */ (this._rawClass));
  44432. if (keyValueChanges) {
  44433. this._applyKeyValueChanges(keyValueChanges);
  44434. }
  44435. }
  44436. };
  44437. /**
  44438. * @param {?} changes
  44439. * @return {?}
  44440. */
  44441. NgClass.prototype._applyKeyValueChanges = /**
  44442. * @param {?} changes
  44443. * @return {?}
  44444. */
  44445. function (changes) {
  44446. var _this = this;
  44447. changes.forEachAddedItem(function (record) { return _this._toggleClass(record.key, record.currentValue); });
  44448. changes.forEachChangedItem(function (record) { return _this._toggleClass(record.key, record.currentValue); });
  44449. changes.forEachRemovedItem(function (record) {
  44450. if (record.previousValue) {
  44451. _this._toggleClass(record.key, false);
  44452. }
  44453. });
  44454. };
  44455. /**
  44456. * @param {?} changes
  44457. * @return {?}
  44458. */
  44459. NgClass.prototype._applyIterableChanges = /**
  44460. * @param {?} changes
  44461. * @return {?}
  44462. */
  44463. function (changes) {
  44464. var _this = this;
  44465. changes.forEachAddedItem(function (record) {
  44466. if (typeof record.item === 'string') {
  44467. _this._toggleClass(record.item, true);
  44468. }
  44469. else {
  44470. throw new Error("NgClass can only toggle CSS classes expressed as strings, got " + Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_48" /* ɵstringify */])(record.item));
  44471. }
  44472. });
  44473. changes.forEachRemovedItem(function (record) { return _this._toggleClass(record.item, false); });
  44474. };
  44475. /**
  44476. * Applies a collection of CSS classes to the DOM element.
  44477. *
  44478. * For argument of type Set and Array CSS class names contained in those collections are always
  44479. * added.
  44480. * For argument of type Map CSS class name in the map's key is toggled based on the value (added
  44481. * for truthy and removed for falsy).
  44482. * @param {?} rawClassVal
  44483. * @return {?}
  44484. */
  44485. NgClass.prototype._applyClasses = /**
  44486. * Applies a collection of CSS classes to the DOM element.
  44487. *
  44488. * For argument of type Set and Array CSS class names contained in those collections are always
  44489. * added.
  44490. * For argument of type Map CSS class name in the map's key is toggled based on the value (added
  44491. * for truthy and removed for falsy).
  44492. * @param {?} rawClassVal
  44493. * @return {?}
  44494. */
  44495. function (rawClassVal) {
  44496. var _this = this;
  44497. if (rawClassVal) {
  44498. if (Array.isArray(rawClassVal) || rawClassVal instanceof Set) {
  44499. (/** @type {?} */ (rawClassVal)).forEach(function (klass) { return _this._toggleClass(klass, true); });
  44500. }
  44501. else {
  44502. Object.keys(rawClassVal).forEach(function (klass) { return _this._toggleClass(klass, !!rawClassVal[klass]); });
  44503. }
  44504. }
  44505. };
  44506. /**
  44507. * Removes a collection of CSS classes from the DOM element. This is mostly useful for cleanup
  44508. * purposes.
  44509. * @param {?} rawClassVal
  44510. * @return {?}
  44511. */
  44512. NgClass.prototype._removeClasses = /**
  44513. * Removes a collection of CSS classes from the DOM element. This is mostly useful for cleanup
  44514. * purposes.
  44515. * @param {?} rawClassVal
  44516. * @return {?}
  44517. */
  44518. function (rawClassVal) {
  44519. var _this = this;
  44520. if (rawClassVal) {
  44521. if (Array.isArray(rawClassVal) || rawClassVal instanceof Set) {
  44522. (/** @type {?} */ (rawClassVal)).forEach(function (klass) { return _this._toggleClass(klass, false); });
  44523. }
  44524. else {
  44525. Object.keys(rawClassVal).forEach(function (klass) { return _this._toggleClass(klass, false); });
  44526. }
  44527. }
  44528. };
  44529. /**
  44530. * @param {?} klass
  44531. * @param {?} enabled
  44532. * @return {?}
  44533. */
  44534. NgClass.prototype._toggleClass = /**
  44535. * @param {?} klass
  44536. * @param {?} enabled
  44537. * @return {?}
  44538. */
  44539. function (klass, enabled) {
  44540. var _this = this;
  44541. klass = klass.trim();
  44542. if (klass) {
  44543. klass.split(/\s+/g).forEach(function (klass) {
  44544. if (enabled) {
  44545. _this._renderer.addClass(_this._ngEl.nativeElement, klass);
  44546. }
  44547. else {
  44548. _this._renderer.removeClass(_this._ngEl.nativeElement, klass);
  44549. }
  44550. });
  44551. }
  44552. };
  44553. NgClass.decorators = [
  44554. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{ selector: '[ngClass]' },] },
  44555. ];
  44556. /** @nocollapse */
  44557. NgClass.ctorParameters = function () { return [
  44558. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["E" /* IterableDiffers */], },
  44559. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["F" /* KeyValueDiffers */], },
  44560. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  44561. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["W" /* Renderer2 */], },
  44562. ]; };
  44563. NgClass.propDecorators = {
  44564. "klass": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */], args: ['class',] },],
  44565. "ngClass": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  44566. };
  44567. return NgClass;
  44568. }());
  44569. /**
  44570. * @fileoverview added by tsickle
  44571. * @suppress {checkTypes} checked by tsc
  44572. */
  44573. /**
  44574. * @license
  44575. * Copyright Google Inc. All Rights Reserved.
  44576. *
  44577. * Use of this source code is governed by an MIT-style license that can be
  44578. * found in the LICENSE file at https://angular.io/license
  44579. */
  44580. /**
  44581. * Instantiates a single {\@link Component} type and inserts its Host View into current View.
  44582. * `NgComponentOutlet` provides a declarative approach for dynamic component creation.
  44583. *
  44584. * `NgComponentOutlet` requires a component type, if a falsy value is set the view will clear and
  44585. * any existing component will get destroyed.
  44586. *
  44587. * ### Fine tune control
  44588. *
  44589. * You can control the component creation process by using the following optional attributes:
  44590. *
  44591. * * `ngComponentOutletInjector`: Optional custom {\@link Injector} that will be used as parent for
  44592. * the Component. Defaults to the injector of the current view container.
  44593. *
  44594. * * `ngComponentOutletContent`: Optional list of projectable nodes to insert into the content
  44595. * section of the component, if exists.
  44596. *
  44597. * * `ngComponentOutletNgModuleFactory`: Optional module factory to allow dynamically loading other
  44598. * module, then load a component from that module.
  44599. *
  44600. * ### Syntax
  44601. *
  44602. * Simple
  44603. * ```
  44604. * <ng-container *ngComponentOutlet="componentTypeExpression"></ng-container>
  44605. * ```
  44606. *
  44607. * Customized injector/content
  44608. * ```
  44609. * <ng-container *ngComponentOutlet="componentTypeExpression;
  44610. * injector: injectorExpression;
  44611. * content: contentNodesExpression;">
  44612. * </ng-container>
  44613. * ```
  44614. *
  44615. * Customized ngModuleFactory
  44616. * ```
  44617. * <ng-container *ngComponentOutlet="componentTypeExpression;
  44618. * ngModuleFactory: moduleFactory;">
  44619. * </ng-container>
  44620. * ```
  44621. * ## Example
  44622. *
  44623. * {\@example common/ngComponentOutlet/ts/module.ts region='SimpleExample'}
  44624. *
  44625. * A more complete example with additional options:
  44626. *
  44627. * {\@example common/ngComponentOutlet/ts/module.ts region='CompleteExample'}
  44628. * A more complete example with ngModuleFactory:
  44629. *
  44630. * {\@example common/ngComponentOutlet/ts/module.ts region='NgModuleFactoryExample'}
  44631. *
  44632. * \@experimental
  44633. */
  44634. var NgComponentOutlet = /** @class */ (function () {
  44635. function NgComponentOutlet(_viewContainerRef) {
  44636. this._viewContainerRef = _viewContainerRef;
  44637. this._componentRef = null;
  44638. this._moduleRef = null;
  44639. }
  44640. /**
  44641. * @param {?} changes
  44642. * @return {?}
  44643. */
  44644. NgComponentOutlet.prototype.ngOnChanges = /**
  44645. * @param {?} changes
  44646. * @return {?}
  44647. */
  44648. function (changes) {
  44649. this._viewContainerRef.clear();
  44650. this._componentRef = null;
  44651. if (this.ngComponentOutlet) {
  44652. var /** @type {?} */ elInjector = this.ngComponentOutletInjector || this._viewContainerRef.parentInjector;
  44653. if (changes['ngComponentOutletNgModuleFactory']) {
  44654. if (this._moduleRef)
  44655. this._moduleRef.destroy();
  44656. if (this.ngComponentOutletNgModuleFactory) {
  44657. var /** @type {?} */ parentModule = elInjector.get(__WEBPACK_IMPORTED_MODULE_0__angular_core__["K" /* NgModuleRef */]);
  44658. this._moduleRef = this.ngComponentOutletNgModuleFactory.create(parentModule.injector);
  44659. }
  44660. else {
  44661. this._moduleRef = null;
  44662. }
  44663. }
  44664. var /** @type {?} */ componentFactoryResolver = this._moduleRef ? this._moduleRef.componentFactoryResolver :
  44665. elInjector.get(__WEBPACK_IMPORTED_MODULE_0__angular_core__["o" /* ComponentFactoryResolver */]);
  44666. var /** @type {?} */ componentFactory = componentFactoryResolver.resolveComponentFactory(this.ngComponentOutlet);
  44667. this._componentRef = this._viewContainerRef.createComponent(componentFactory, this._viewContainerRef.length, elInjector, this.ngComponentOutletContent);
  44668. }
  44669. };
  44670. /**
  44671. * @return {?}
  44672. */
  44673. NgComponentOutlet.prototype.ngOnDestroy = /**
  44674. * @return {?}
  44675. */
  44676. function () {
  44677. if (this._moduleRef)
  44678. this._moduleRef.destroy();
  44679. };
  44680. NgComponentOutlet.decorators = [
  44681. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{ selector: '[ngComponentOutlet]' },] },
  44682. ];
  44683. /** @nocollapse */
  44684. NgComponentOutlet.ctorParameters = function () { return [
  44685. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_10" /* ViewContainerRef */], },
  44686. ]; };
  44687. NgComponentOutlet.propDecorators = {
  44688. "ngComponentOutlet": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  44689. "ngComponentOutletInjector": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  44690. "ngComponentOutletContent": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  44691. "ngComponentOutletNgModuleFactory": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  44692. };
  44693. return NgComponentOutlet;
  44694. }());
  44695. /**
  44696. * @fileoverview added by tsickle
  44697. * @suppress {checkTypes} checked by tsc
  44698. */
  44699. /**
  44700. * @license
  44701. * Copyright Google Inc. All Rights Reserved.
  44702. *
  44703. * Use of this source code is governed by an MIT-style license that can be
  44704. * found in the LICENSE file at https://angular.io/license
  44705. */
  44706. /**
  44707. * \@stable
  44708. * @template T
  44709. */
  44710. var NgForOfContext = /** @class */ (function () {
  44711. function NgForOfContext($implicit, ngForOf, index, count) {
  44712. this.$implicit = $implicit;
  44713. this.ngForOf = ngForOf;
  44714. this.index = index;
  44715. this.count = count;
  44716. }
  44717. Object.defineProperty(NgForOfContext.prototype, "first", {
  44718. get: /**
  44719. * @return {?}
  44720. */
  44721. function () { return this.index === 0; },
  44722. enumerable: true,
  44723. configurable: true
  44724. });
  44725. Object.defineProperty(NgForOfContext.prototype, "last", {
  44726. get: /**
  44727. * @return {?}
  44728. */
  44729. function () { return this.index === this.count - 1; },
  44730. enumerable: true,
  44731. configurable: true
  44732. });
  44733. Object.defineProperty(NgForOfContext.prototype, "even", {
  44734. get: /**
  44735. * @return {?}
  44736. */
  44737. function () { return this.index % 2 === 0; },
  44738. enumerable: true,
  44739. configurable: true
  44740. });
  44741. Object.defineProperty(NgForOfContext.prototype, "odd", {
  44742. get: /**
  44743. * @return {?}
  44744. */
  44745. function () { return !this.even; },
  44746. enumerable: true,
  44747. configurable: true
  44748. });
  44749. return NgForOfContext;
  44750. }());
  44751. /**
  44752. * The `NgForOf` directive instantiates a template once per item from an iterable. The context
  44753. * for each instantiated template inherits from the outer context with the given loop variable
  44754. * set to the current item from the iterable.
  44755. *
  44756. * ### Local Variables
  44757. *
  44758. * `NgForOf` provides several exported values that can be aliased to local variables:
  44759. *
  44760. * - `$implicit: T`: The value of the individual items in the iterable (`ngForOf`).
  44761. * - `ngForOf: NgIterable<T>`: The value of the iterable expression. Useful when the expression is
  44762. * more complex then a property access, for example when using the async pipe (`userStreams |
  44763. * async`).
  44764. * - `index: number`: The index of the current item in the iterable.
  44765. * - `first: boolean`: True when the item is the first item in the iterable.
  44766. * - `last: boolean`: True when the item is the last item in the iterable.
  44767. * - `even: boolean`: True when the item has an even index in the iterable.
  44768. * - `odd: boolean`: True when the item has an odd index in the iterable.
  44769. *
  44770. * ```
  44771. * <li *ngFor="let user of userObservable | async as users; index as i; first as isFirst">
  44772. * {{i}}/{{users.length}}. {{user}} <span *ngIf="isFirst">default</span>
  44773. * </li>
  44774. * ```
  44775. *
  44776. * ### Change Propagation
  44777. *
  44778. * When the contents of the iterator changes, `NgForOf` makes the corresponding changes to the DOM:
  44779. *
  44780. * * When an item is added, a new instance of the template is added to the DOM.
  44781. * * When an item is removed, its template instance is removed from the DOM.
  44782. * * When items are reordered, their respective templates are reordered in the DOM.
  44783. * * Otherwise, the DOM element for that item will remain the same.
  44784. *
  44785. * Angular uses object identity to track insertions and deletions within the iterator and reproduce
  44786. * those changes in the DOM. This has important implications for animations and any stateful
  44787. * controls (such as `<input>` elements which accept user input) that are present. Inserted rows can
  44788. * be animated in, deleted rows can be animated out, and unchanged rows retain any unsaved state
  44789. * such as user input.
  44790. *
  44791. * It is possible for the identities of elements in the iterator to change while the data does not.
  44792. * This can happen, for example, if the iterator produced from an RPC to the server, and that
  44793. * RPC is re-run. Even if the data hasn't changed, the second response will produce objects with
  44794. * different identities, and Angular will tear down the entire DOM and rebuild it (as if all old
  44795. * elements were deleted and all new elements inserted). This is an expensive operation and should
  44796. * be avoided if possible.
  44797. *
  44798. * To customize the default tracking algorithm, `NgForOf` supports `trackBy` option.
  44799. * `trackBy` takes a function which has two arguments: `index` and `item`.
  44800. * If `trackBy` is given, Angular tracks changes by the return value of the function.
  44801. *
  44802. * ### Syntax
  44803. *
  44804. * - `<li *ngFor="let item of items; index as i; trackBy: trackByFn">...</li>`
  44805. *
  44806. * With `<ng-template>` element:
  44807. *
  44808. * ```
  44809. * <ng-template ngFor let-item [ngForOf]="items" let-i="index" [ngForTrackBy]="trackByFn">
  44810. * <li>...</li>
  44811. * </ng-template>
  44812. * ```
  44813. *
  44814. * ### Example
  44815. *
  44816. * See a [live demo](http://plnkr.co/edit/KVuXxDp0qinGDyo307QW?p=preview) for a more detailed
  44817. * example.
  44818. *
  44819. * \@stable
  44820. * @template T
  44821. */
  44822. var NgForOf = /** @class */ (function () {
  44823. function NgForOf(_viewContainer, _template, _differs) {
  44824. this._viewContainer = _viewContainer;
  44825. this._template = _template;
  44826. this._differs = _differs;
  44827. this._differ = null;
  44828. }
  44829. Object.defineProperty(NgForOf.prototype, "ngForTrackBy", {
  44830. get: /**
  44831. * @return {?}
  44832. */
  44833. function () { return this._trackByFn; },
  44834. set: /**
  44835. * @param {?} fn
  44836. * @return {?}
  44837. */
  44838. function (fn) {
  44839. if (Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_16" /* isDevMode */])() && fn != null && typeof fn !== 'function') {
  44840. // TODO(vicb): use a log service once there is a public one available
  44841. if (/** @type {?} */ (console) && /** @type {?} */ (console.warn)) {
  44842. console.warn("trackBy must be a function, but received " + JSON.stringify(fn) + ". " +
  44843. "See https://angular.io/docs/ts/latest/api/common/index/NgFor-directive.html#!#change-propagation for more information.");
  44844. }
  44845. }
  44846. this._trackByFn = fn;
  44847. },
  44848. enumerable: true,
  44849. configurable: true
  44850. });
  44851. Object.defineProperty(NgForOf.prototype, "ngForTemplate", {
  44852. set: /**
  44853. * @param {?} value
  44854. * @return {?}
  44855. */
  44856. function (value) {
  44857. // TODO(TS2.1): make TemplateRef<Partial<NgForRowOf<T>>> once we move to TS v2.1
  44858. // The current type is too restrictive; a template that just uses index, for example,
  44859. // should be acceptable.
  44860. if (value) {
  44861. this._template = value;
  44862. }
  44863. },
  44864. enumerable: true,
  44865. configurable: true
  44866. });
  44867. /**
  44868. * @param {?} changes
  44869. * @return {?}
  44870. */
  44871. NgForOf.prototype.ngOnChanges = /**
  44872. * @param {?} changes
  44873. * @return {?}
  44874. */
  44875. function (changes) {
  44876. if ('ngForOf' in changes) {
  44877. // React on ngForOf changes only once all inputs have been initialized
  44878. var /** @type {?} */ value = changes['ngForOf'].currentValue;
  44879. if (!this._differ && value) {
  44880. try {
  44881. this._differ = this._differs.find(value).create(this.ngForTrackBy);
  44882. }
  44883. catch (/** @type {?} */ e) {
  44884. throw new Error("Cannot find a differ supporting object '" + value + "' of type '" + getTypeNameForDebugging(value) + "'. NgFor only supports binding to Iterables such as Arrays.");
  44885. }
  44886. }
  44887. }
  44888. };
  44889. /**
  44890. * @return {?}
  44891. */
  44892. NgForOf.prototype.ngDoCheck = /**
  44893. * @return {?}
  44894. */
  44895. function () {
  44896. if (this._differ) {
  44897. var /** @type {?} */ changes = this._differ.diff(this.ngForOf);
  44898. if (changes)
  44899. this._applyChanges(changes);
  44900. }
  44901. };
  44902. /**
  44903. * @param {?} changes
  44904. * @return {?}
  44905. */
  44906. NgForOf.prototype._applyChanges = /**
  44907. * @param {?} changes
  44908. * @return {?}
  44909. */
  44910. function (changes) {
  44911. var _this = this;
  44912. var /** @type {?} */ insertTuples = [];
  44913. changes.forEachOperation(function (item, adjustedPreviousIndex, currentIndex) {
  44914. if (item.previousIndex == null) {
  44915. var /** @type {?} */ view = _this._viewContainer.createEmbeddedView(_this._template, new NgForOfContext(/** @type {?} */ ((null)), _this.ngForOf, -1, -1), currentIndex);
  44916. var /** @type {?} */ tuple = new RecordViewTuple(item, view);
  44917. insertTuples.push(tuple);
  44918. }
  44919. else if (currentIndex == null) {
  44920. _this._viewContainer.remove(adjustedPreviousIndex);
  44921. }
  44922. else {
  44923. var /** @type {?} */ view = /** @type {?} */ ((_this._viewContainer.get(adjustedPreviousIndex)));
  44924. _this._viewContainer.move(view, currentIndex);
  44925. var /** @type {?} */ tuple = new RecordViewTuple(item, /** @type {?} */ (view));
  44926. insertTuples.push(tuple);
  44927. }
  44928. });
  44929. for (var /** @type {?} */ i = 0; i < insertTuples.length; i++) {
  44930. this._perViewChange(insertTuples[i].view, insertTuples[i].record);
  44931. }
  44932. for (var /** @type {?} */ i = 0, /** @type {?} */ ilen = this._viewContainer.length; i < ilen; i++) {
  44933. var /** @type {?} */ viewRef = /** @type {?} */ (this._viewContainer.get(i));
  44934. viewRef.context.index = i;
  44935. viewRef.context.count = ilen;
  44936. }
  44937. changes.forEachIdentityChange(function (record) {
  44938. var /** @type {?} */ viewRef = /** @type {?} */ (_this._viewContainer.get(record.currentIndex));
  44939. viewRef.context.$implicit = record.item;
  44940. });
  44941. };
  44942. /**
  44943. * @param {?} view
  44944. * @param {?} record
  44945. * @return {?}
  44946. */
  44947. NgForOf.prototype._perViewChange = /**
  44948. * @param {?} view
  44949. * @param {?} record
  44950. * @return {?}
  44951. */
  44952. function (view, record) {
  44953. view.context.$implicit = record.item;
  44954. };
  44955. NgForOf.decorators = [
  44956. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{ selector: '[ngFor][ngForOf]' },] },
  44957. ];
  44958. /** @nocollapse */
  44959. NgForOf.ctorParameters = function () { return [
  44960. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_10" /* ViewContainerRef */], },
  44961. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_5" /* TemplateRef */], },
  44962. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["E" /* IterableDiffers */], },
  44963. ]; };
  44964. NgForOf.propDecorators = {
  44965. "ngForOf": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  44966. "ngForTrackBy": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  44967. "ngForTemplate": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  44968. };
  44969. return NgForOf;
  44970. }());
  44971. /**
  44972. * @template T
  44973. */
  44974. var RecordViewTuple = /** @class */ (function () {
  44975. function RecordViewTuple(record, view) {
  44976. this.record = record;
  44977. this.view = view;
  44978. }
  44979. return RecordViewTuple;
  44980. }());
  44981. /**
  44982. * @param {?} type
  44983. * @return {?}
  44984. */
  44985. function getTypeNameForDebugging(type) {
  44986. return type['name'] || typeof type;
  44987. }
  44988. /**
  44989. * @fileoverview added by tsickle
  44990. * @suppress {checkTypes} checked by tsc
  44991. */
  44992. /**
  44993. * @license
  44994. * Copyright Google Inc. All Rights Reserved.
  44995. *
  44996. * Use of this source code is governed by an MIT-style license that can be
  44997. * found in the LICENSE file at https://angular.io/license
  44998. */
  44999. /**
  45000. * Conditionally includes a template based on the value of an `expression`.
  45001. *
  45002. * `ngIf` evaluates the `expression` and then renders the `then` or `else` template in its place
  45003. * when expression is truthy or falsy respectively. Typically the:
  45004. * - `then` template is the inline template of `ngIf` unless bound to a different value.
  45005. * - `else` template is blank unless it is bound.
  45006. *
  45007. * ## Most common usage
  45008. *
  45009. * The most common usage of the `ngIf` directive is to conditionally show the inline template as
  45010. * seen in this example:
  45011. * {\@example common/ngIf/ts/module.ts region='NgIfSimple'}
  45012. *
  45013. * ## Showing an alternative template using `else`
  45014. *
  45015. * If it is necessary to display a template when the `expression` is falsy use the `else` template
  45016. * binding as shown. Note that the `else` binding points to a `<ng-template>` labeled `#elseBlock`.
  45017. * The template can be defined anywhere in the component view but is typically placed right after
  45018. * `ngIf` for readability.
  45019. *
  45020. * {\@example common/ngIf/ts/module.ts region='NgIfElse'}
  45021. *
  45022. * ## Using non-inlined `then` template
  45023. *
  45024. * Usually the `then` template is the inlined template of the `ngIf`, but it can be changed using
  45025. * a binding (just like `else`). Because `then` and `else` are bindings, the template references can
  45026. * change at runtime as shown in this example.
  45027. *
  45028. * {\@example common/ngIf/ts/module.ts region='NgIfThenElse'}
  45029. *
  45030. * ## Storing conditional result in a variable
  45031. *
  45032. * A common pattern is that we need to show a set of properties from the same object. If the
  45033. * object is undefined, then we have to use the safe-traversal-operator `?.` to guard against
  45034. * dereferencing a `null` value. This is especially the case when waiting on async data such as
  45035. * when using the `async` pipe as shown in following example:
  45036. *
  45037. * ```
  45038. * Hello {{ (userStream|async)?.last }}, {{ (userStream|async)?.first }}!
  45039. * ```
  45040. *
  45041. * There are several inefficiencies in the above example:
  45042. * - We create multiple subscriptions on `userStream`. One for each `async` pipe, or two in the
  45043. * example above.
  45044. * - We cannot display an alternative screen while waiting for the data to arrive asynchronously.
  45045. * - We have to use the safe-traversal-operator `?.` to access properties, which is cumbersome.
  45046. * - We have to place the `async` pipe in parenthesis.
  45047. *
  45048. * A better way to do this is to use `ngIf` and store the result of the condition in a local
  45049. * variable as shown in the the example below:
  45050. *
  45051. * {\@example common/ngIf/ts/module.ts region='NgIfAs'}
  45052. *
  45053. * Notice that:
  45054. * - We use only one `async` pipe and hence only one subscription gets created.
  45055. * - `ngIf` stores the result of the `userStream|async` in the local variable `user`.
  45056. * - The local `user` can then be bound repeatedly in a more efficient way.
  45057. * - No need to use the safe-traversal-operator `?.` to access properties as `ngIf` will only
  45058. * display the data if `userStream` returns a value.
  45059. * - We can display an alternative template while waiting for the data.
  45060. *
  45061. * ### Syntax
  45062. *
  45063. * Simple form:
  45064. * - `<div *ngIf="condition">...</div>`
  45065. * - `<ng-template [ngIf]="condition"><div>...</div></ng-template>`
  45066. *
  45067. * Form with an else block:
  45068. * ```
  45069. * <div *ngIf="condition; else elseBlock">...</div>
  45070. * <ng-template #elseBlock>...</ng-template>
  45071. * ```
  45072. *
  45073. * Form with a `then` and `else` block:
  45074. * ```
  45075. * <div *ngIf="condition; then thenBlock else elseBlock"></div>
  45076. * <ng-template #thenBlock>...</ng-template>
  45077. * <ng-template #elseBlock>...</ng-template>
  45078. * ```
  45079. *
  45080. * Form with storing the value locally:
  45081. * ```
  45082. * <div *ngIf="condition as value; else elseBlock">{{value}}</div>
  45083. * <ng-template #elseBlock>...</ng-template>
  45084. * ```
  45085. *
  45086. * \@stable
  45087. */
  45088. var NgIf = /** @class */ (function () {
  45089. function NgIf(_viewContainer, templateRef) {
  45090. this._viewContainer = _viewContainer;
  45091. this._context = new NgIfContext();
  45092. this._thenTemplateRef = null;
  45093. this._elseTemplateRef = null;
  45094. this._thenViewRef = null;
  45095. this._elseViewRef = null;
  45096. this._thenTemplateRef = templateRef;
  45097. }
  45098. Object.defineProperty(NgIf.prototype, "ngIf", {
  45099. set: /**
  45100. * @param {?} condition
  45101. * @return {?}
  45102. */
  45103. function (condition) {
  45104. this._context.$implicit = this._context.ngIf = condition;
  45105. this._updateView();
  45106. },
  45107. enumerable: true,
  45108. configurable: true
  45109. });
  45110. Object.defineProperty(NgIf.prototype, "ngIfThen", {
  45111. set: /**
  45112. * @param {?} templateRef
  45113. * @return {?}
  45114. */
  45115. function (templateRef) {
  45116. this._thenTemplateRef = templateRef;
  45117. this._thenViewRef = null; // clear previous view if any.
  45118. this._updateView();
  45119. },
  45120. enumerable: true,
  45121. configurable: true
  45122. });
  45123. Object.defineProperty(NgIf.prototype, "ngIfElse", {
  45124. set: /**
  45125. * @param {?} templateRef
  45126. * @return {?}
  45127. */
  45128. function (templateRef) {
  45129. this._elseTemplateRef = templateRef;
  45130. this._elseViewRef = null; // clear previous view if any.
  45131. this._updateView();
  45132. },
  45133. enumerable: true,
  45134. configurable: true
  45135. });
  45136. /**
  45137. * @return {?}
  45138. */
  45139. NgIf.prototype._updateView = /**
  45140. * @return {?}
  45141. */
  45142. function () {
  45143. if (this._context.$implicit) {
  45144. if (!this._thenViewRef) {
  45145. this._viewContainer.clear();
  45146. this._elseViewRef = null;
  45147. if (this._thenTemplateRef) {
  45148. this._thenViewRef =
  45149. this._viewContainer.createEmbeddedView(this._thenTemplateRef, this._context);
  45150. }
  45151. }
  45152. }
  45153. else {
  45154. if (!this._elseViewRef) {
  45155. this._viewContainer.clear();
  45156. this._thenViewRef = null;
  45157. if (this._elseTemplateRef) {
  45158. this._elseViewRef =
  45159. this._viewContainer.createEmbeddedView(this._elseTemplateRef, this._context);
  45160. }
  45161. }
  45162. }
  45163. };
  45164. NgIf.decorators = [
  45165. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{ selector: '[ngIf]' },] },
  45166. ];
  45167. /** @nocollapse */
  45168. NgIf.ctorParameters = function () { return [
  45169. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_10" /* ViewContainerRef */], },
  45170. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_5" /* TemplateRef */], },
  45171. ]; };
  45172. NgIf.propDecorators = {
  45173. "ngIf": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  45174. "ngIfThen": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  45175. "ngIfElse": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  45176. };
  45177. return NgIf;
  45178. }());
  45179. /**
  45180. * \@stable
  45181. */
  45182. var NgIfContext = /** @class */ (function () {
  45183. function NgIfContext() {
  45184. this.$implicit = null;
  45185. this.ngIf = null;
  45186. }
  45187. return NgIfContext;
  45188. }());
  45189. /**
  45190. * @fileoverview added by tsickle
  45191. * @suppress {checkTypes} checked by tsc
  45192. */
  45193. /**
  45194. * @license
  45195. * Copyright Google Inc. All Rights Reserved.
  45196. *
  45197. * Use of this source code is governed by an MIT-style license that can be
  45198. * found in the LICENSE file at https://angular.io/license
  45199. */
  45200. var SwitchView = /** @class */ (function () {
  45201. function SwitchView(_viewContainerRef, _templateRef) {
  45202. this._viewContainerRef = _viewContainerRef;
  45203. this._templateRef = _templateRef;
  45204. this._created = false;
  45205. }
  45206. /**
  45207. * @return {?}
  45208. */
  45209. SwitchView.prototype.create = /**
  45210. * @return {?}
  45211. */
  45212. function () {
  45213. this._created = true;
  45214. this._viewContainerRef.createEmbeddedView(this._templateRef);
  45215. };
  45216. /**
  45217. * @return {?}
  45218. */
  45219. SwitchView.prototype.destroy = /**
  45220. * @return {?}
  45221. */
  45222. function () {
  45223. this._created = false;
  45224. this._viewContainerRef.clear();
  45225. };
  45226. /**
  45227. * @param {?} created
  45228. * @return {?}
  45229. */
  45230. SwitchView.prototype.enforceState = /**
  45231. * @param {?} created
  45232. * @return {?}
  45233. */
  45234. function (created) {
  45235. if (created && !this._created) {
  45236. this.create();
  45237. }
  45238. else if (!created && this._created) {
  45239. this.destroy();
  45240. }
  45241. };
  45242. return SwitchView;
  45243. }());
  45244. /**
  45245. * \@ngModule CommonModule
  45246. *
  45247. * \@whatItDoes Adds / removes DOM sub-trees when the nest match expressions matches the switch
  45248. * expression.
  45249. *
  45250. * \@howToUse
  45251. * ```
  45252. * <container-element [ngSwitch]="switch_expression">
  45253. * <some-element *ngSwitchCase="match_expression_1">...</some-element>
  45254. * <some-element *ngSwitchCase="match_expression_2">...</some-element>
  45255. * <some-other-element *ngSwitchCase="match_expression_3">...</some-other-element>
  45256. * <ng-container *ngSwitchCase="match_expression_3">
  45257. * <!-- use a ng-container to group multiple root nodes -->
  45258. * <inner-element></inner-element>
  45259. * <inner-other-element></inner-other-element>
  45260. * </ng-container>
  45261. * <some-element *ngSwitchDefault>...</some-element>
  45262. * </container-element>
  45263. * ```
  45264. * \@description
  45265. *
  45266. * `NgSwitch` stamps out nested views when their match expression value matches the value of the
  45267. * switch expression.
  45268. *
  45269. * In other words:
  45270. * - you define a container element (where you place the directive with a switch expression on the
  45271. * `[ngSwitch]="..."` attribute)
  45272. * - you define inner views inside the `NgSwitch` and place a `*ngSwitchCase` attribute on the view
  45273. * root elements.
  45274. *
  45275. * Elements within `NgSwitch` but outside of a `NgSwitchCase` or `NgSwitchDefault` directives will
  45276. * be preserved at the location.
  45277. *
  45278. * The `ngSwitchCase` directive informs the parent `NgSwitch` of which view to display when the
  45279. * expression is evaluated.
  45280. * When no matching expression is found on a `ngSwitchCase` view, the `ngSwitchDefault` view is
  45281. * stamped out.
  45282. *
  45283. * \@stable
  45284. */
  45285. var NgSwitch = /** @class */ (function () {
  45286. function NgSwitch() {
  45287. this._defaultUsed = false;
  45288. this._caseCount = 0;
  45289. this._lastCaseCheckIndex = 0;
  45290. this._lastCasesMatched = false;
  45291. }
  45292. Object.defineProperty(NgSwitch.prototype, "ngSwitch", {
  45293. set: /**
  45294. * @param {?} newValue
  45295. * @return {?}
  45296. */
  45297. function (newValue) {
  45298. this._ngSwitch = newValue;
  45299. if (this._caseCount === 0) {
  45300. this._updateDefaultCases(true);
  45301. }
  45302. },
  45303. enumerable: true,
  45304. configurable: true
  45305. });
  45306. /** @internal */
  45307. /**
  45308. * \@internal
  45309. * @return {?}
  45310. */
  45311. NgSwitch.prototype._addCase = /**
  45312. * \@internal
  45313. * @return {?}
  45314. */
  45315. function () { return this._caseCount++; };
  45316. /** @internal */
  45317. /**
  45318. * \@internal
  45319. * @param {?} view
  45320. * @return {?}
  45321. */
  45322. NgSwitch.prototype._addDefault = /**
  45323. * \@internal
  45324. * @param {?} view
  45325. * @return {?}
  45326. */
  45327. function (view) {
  45328. if (!this._defaultViews) {
  45329. this._defaultViews = [];
  45330. }
  45331. this._defaultViews.push(view);
  45332. };
  45333. /** @internal */
  45334. /**
  45335. * \@internal
  45336. * @param {?} value
  45337. * @return {?}
  45338. */
  45339. NgSwitch.prototype._matchCase = /**
  45340. * \@internal
  45341. * @param {?} value
  45342. * @return {?}
  45343. */
  45344. function (value) {
  45345. var /** @type {?} */ matched = value == this._ngSwitch;
  45346. this._lastCasesMatched = this._lastCasesMatched || matched;
  45347. this._lastCaseCheckIndex++;
  45348. if (this._lastCaseCheckIndex === this._caseCount) {
  45349. this._updateDefaultCases(!this._lastCasesMatched);
  45350. this._lastCaseCheckIndex = 0;
  45351. this._lastCasesMatched = false;
  45352. }
  45353. return matched;
  45354. };
  45355. /**
  45356. * @param {?} useDefault
  45357. * @return {?}
  45358. */
  45359. NgSwitch.prototype._updateDefaultCases = /**
  45360. * @param {?} useDefault
  45361. * @return {?}
  45362. */
  45363. function (useDefault) {
  45364. if (this._defaultViews && useDefault !== this._defaultUsed) {
  45365. this._defaultUsed = useDefault;
  45366. for (var /** @type {?} */ i = 0; i < this._defaultViews.length; i++) {
  45367. var /** @type {?} */ defaultView = this._defaultViews[i];
  45368. defaultView.enforceState(useDefault);
  45369. }
  45370. }
  45371. };
  45372. NgSwitch.decorators = [
  45373. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{ selector: '[ngSwitch]' },] },
  45374. ];
  45375. /** @nocollapse */
  45376. NgSwitch.ctorParameters = function () { return []; };
  45377. NgSwitch.propDecorators = {
  45378. "ngSwitch": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  45379. };
  45380. return NgSwitch;
  45381. }());
  45382. /**
  45383. * \@ngModule CommonModule
  45384. *
  45385. * \@whatItDoes Creates a view that will be added/removed from the parent {\@link NgSwitch} when the
  45386. * given expression evaluate to respectively the same/different value as the switch
  45387. * expression.
  45388. *
  45389. * \@howToUse
  45390. * ```
  45391. * <container-element [ngSwitch]="switch_expression">
  45392. * <some-element *ngSwitchCase="match_expression_1">...</some-element>
  45393. * </container-element>
  45394. * ```
  45395. * \@description
  45396. *
  45397. * Insert the sub-tree when the expression evaluates to the same value as the enclosing switch
  45398. * expression.
  45399. *
  45400. * If multiple match expressions match the switch expression value, all of them are displayed.
  45401. *
  45402. * See {\@link NgSwitch} for more details and example.
  45403. *
  45404. * \@stable
  45405. */
  45406. var NgSwitchCase = /** @class */ (function () {
  45407. function NgSwitchCase(viewContainer, templateRef, ngSwitch) {
  45408. this.ngSwitch = ngSwitch;
  45409. ngSwitch._addCase();
  45410. this._view = new SwitchView(viewContainer, templateRef);
  45411. }
  45412. /**
  45413. * @return {?}
  45414. */
  45415. NgSwitchCase.prototype.ngDoCheck = /**
  45416. * @return {?}
  45417. */
  45418. function () { this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase)); };
  45419. NgSwitchCase.decorators = [
  45420. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{ selector: '[ngSwitchCase]' },] },
  45421. ];
  45422. /** @nocollapse */
  45423. NgSwitchCase.ctorParameters = function () { return [
  45424. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_10" /* ViewContainerRef */], },
  45425. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_5" /* TemplateRef */], },
  45426. { type: NgSwitch, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["w" /* Host */] },] },
  45427. ]; };
  45428. NgSwitchCase.propDecorators = {
  45429. "ngSwitchCase": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  45430. };
  45431. return NgSwitchCase;
  45432. }());
  45433. /**
  45434. * \@ngModule CommonModule
  45435. * \@whatItDoes Creates a view that is added to the parent {\@link NgSwitch} when no case expressions
  45436. * match the
  45437. * switch expression.
  45438. *
  45439. * \@howToUse
  45440. * ```
  45441. * <container-element [ngSwitch]="switch_expression">
  45442. * <some-element *ngSwitchCase="match_expression_1">...</some-element>
  45443. * <some-other-element *ngSwitchDefault>...</some-other-element>
  45444. * </container-element>
  45445. * ```
  45446. *
  45447. * \@description
  45448. *
  45449. * Insert the sub-tree when no case expressions evaluate to the same value as the enclosing switch
  45450. * expression.
  45451. *
  45452. * See {\@link NgSwitch} for more details and example.
  45453. *
  45454. * \@stable
  45455. */
  45456. var NgSwitchDefault = /** @class */ (function () {
  45457. function NgSwitchDefault(viewContainer, templateRef, ngSwitch) {
  45458. ngSwitch._addDefault(new SwitchView(viewContainer, templateRef));
  45459. }
  45460. NgSwitchDefault.decorators = [
  45461. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{ selector: '[ngSwitchDefault]' },] },
  45462. ];
  45463. /** @nocollapse */
  45464. NgSwitchDefault.ctorParameters = function () { return [
  45465. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_10" /* ViewContainerRef */], },
  45466. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_5" /* TemplateRef */], },
  45467. { type: NgSwitch, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["w" /* Host */] },] },
  45468. ]; };
  45469. return NgSwitchDefault;
  45470. }());
  45471. /**
  45472. * @fileoverview added by tsickle
  45473. * @suppress {checkTypes} checked by tsc
  45474. */
  45475. /**
  45476. * @license
  45477. * Copyright Google Inc. All Rights Reserved.
  45478. *
  45479. * Use of this source code is governed by an MIT-style license that can be
  45480. * found in the LICENSE file at https://angular.io/license
  45481. */
  45482. /**
  45483. * \@ngModule CommonModule
  45484. *
  45485. * \@whatItDoes Adds / removes DOM sub-trees based on a numeric value. Tailored for pluralization.
  45486. *
  45487. * \@howToUse
  45488. * ```
  45489. * <some-element [ngPlural]="value">
  45490. * <ng-template ngPluralCase="=0">there is nothing</ng-template>
  45491. * <ng-template ngPluralCase="=1">there is one</ng-template>
  45492. * <ng-template ngPluralCase="few">there are a few</ng-template>
  45493. * </some-element>
  45494. * ```
  45495. *
  45496. * \@description
  45497. *
  45498. * Displays DOM sub-trees that match the switch expression value, or failing that, DOM sub-trees
  45499. * that match the switch expression's pluralization category.
  45500. *
  45501. * To use this directive you must provide a container element that sets the `[ngPlural]` attribute
  45502. * to a switch expression. Inner elements with a `[ngPluralCase]` will display based on their
  45503. * expression:
  45504. * - if `[ngPluralCase]` is set to a value starting with `=`, it will only display if the value
  45505. * matches the switch expression exactly,
  45506. * - otherwise, the view will be treated as a "category match", and will only display if exact
  45507. * value matches aren't found and the value maps to its category for the defined locale.
  45508. *
  45509. * See http://cldr.unicode.org/index/cldr-spec/plural-rules
  45510. *
  45511. * \@experimental
  45512. */
  45513. var NgPlural = /** @class */ (function () {
  45514. function NgPlural(_localization) {
  45515. this._localization = _localization;
  45516. this._caseViews = {};
  45517. }
  45518. Object.defineProperty(NgPlural.prototype, "ngPlural", {
  45519. set: /**
  45520. * @param {?} value
  45521. * @return {?}
  45522. */
  45523. function (value) {
  45524. this._switchValue = value;
  45525. this._updateView();
  45526. },
  45527. enumerable: true,
  45528. configurable: true
  45529. });
  45530. /**
  45531. * @param {?} value
  45532. * @param {?} switchView
  45533. * @return {?}
  45534. */
  45535. NgPlural.prototype.addCase = /**
  45536. * @param {?} value
  45537. * @param {?} switchView
  45538. * @return {?}
  45539. */
  45540. function (value, switchView) { this._caseViews[value] = switchView; };
  45541. /**
  45542. * @return {?}
  45543. */
  45544. NgPlural.prototype._updateView = /**
  45545. * @return {?}
  45546. */
  45547. function () {
  45548. this._clearViews();
  45549. var /** @type {?} */ cases = Object.keys(this._caseViews);
  45550. var /** @type {?} */ key = getPluralCategory(this._switchValue, cases, this._localization);
  45551. this._activateView(this._caseViews[key]);
  45552. };
  45553. /**
  45554. * @return {?}
  45555. */
  45556. NgPlural.prototype._clearViews = /**
  45557. * @return {?}
  45558. */
  45559. function () {
  45560. if (this._activeView)
  45561. this._activeView.destroy();
  45562. };
  45563. /**
  45564. * @param {?} view
  45565. * @return {?}
  45566. */
  45567. NgPlural.prototype._activateView = /**
  45568. * @param {?} view
  45569. * @return {?}
  45570. */
  45571. function (view) {
  45572. if (view) {
  45573. this._activeView = view;
  45574. this._activeView.create();
  45575. }
  45576. };
  45577. NgPlural.decorators = [
  45578. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{ selector: '[ngPlural]' },] },
  45579. ];
  45580. /** @nocollapse */
  45581. NgPlural.ctorParameters = function () { return [
  45582. { type: NgLocalization, },
  45583. ]; };
  45584. NgPlural.propDecorators = {
  45585. "ngPlural": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  45586. };
  45587. return NgPlural;
  45588. }());
  45589. /**
  45590. * \@ngModule CommonModule
  45591. *
  45592. * \@whatItDoes Creates a view that will be added/removed from the parent {\@link NgPlural} when the
  45593. * given expression matches the plural expression according to CLDR rules.
  45594. *
  45595. * \@howToUse
  45596. * ```
  45597. * <some-element [ngPlural]="value">
  45598. * <ng-template ngPluralCase="=0">...</ng-template>
  45599. * <ng-template ngPluralCase="other">...</ng-template>
  45600. * </some-element>
  45601. * ```
  45602. *
  45603. * See {\@link NgPlural} for more details and example.
  45604. *
  45605. * \@experimental
  45606. */
  45607. var NgPluralCase = /** @class */ (function () {
  45608. function NgPluralCase(value, template, viewContainer, ngPlural) {
  45609. this.value = value;
  45610. var /** @type {?} */ isANumber = !isNaN(Number(value));
  45611. ngPlural.addCase(isANumber ? "=" + value : value, new SwitchView(viewContainer, template));
  45612. }
  45613. NgPluralCase.decorators = [
  45614. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{ selector: '[ngPluralCase]' },] },
  45615. ];
  45616. /** @nocollapse */
  45617. NgPluralCase.ctorParameters = function () { return [
  45618. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["g" /* Attribute */], args: ['ngPluralCase',] },] },
  45619. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_5" /* TemplateRef */], },
  45620. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_10" /* ViewContainerRef */], },
  45621. { type: NgPlural, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["w" /* Host */] },] },
  45622. ]; };
  45623. return NgPluralCase;
  45624. }());
  45625. /**
  45626. * @fileoverview added by tsickle
  45627. * @suppress {checkTypes} checked by tsc
  45628. */
  45629. /**
  45630. * @license
  45631. * Copyright Google Inc. All Rights Reserved.
  45632. *
  45633. * Use of this source code is governed by an MIT-style license that can be
  45634. * found in the LICENSE file at https://angular.io/license
  45635. */
  45636. /**
  45637. * \@ngModule CommonModule
  45638. *
  45639. * \@whatItDoes Update an HTML element styles.
  45640. *
  45641. * \@howToUse
  45642. * ```
  45643. * <some-element [ngStyle]="{'font-style': styleExp}">...</some-element>
  45644. *
  45645. * <some-element [ngStyle]="{'max-width.px': widthExp}">...</some-element>
  45646. *
  45647. * <some-element [ngStyle]="objExp">...</some-element>
  45648. * ```
  45649. *
  45650. * \@description
  45651. *
  45652. * The styles are updated according to the value of the expression evaluation:
  45653. * - keys are style names with an optional `.<unit>` suffix (ie 'top.px', 'font-style.em'),
  45654. * - values are the values assigned to those properties (expressed in the given unit).
  45655. *
  45656. * \@stable
  45657. */
  45658. var NgStyle = /** @class */ (function () {
  45659. function NgStyle(_differs, _ngEl, _renderer) {
  45660. this._differs = _differs;
  45661. this._ngEl = _ngEl;
  45662. this._renderer = _renderer;
  45663. }
  45664. Object.defineProperty(NgStyle.prototype, "ngStyle", {
  45665. set: /**
  45666. * @param {?} v
  45667. * @return {?}
  45668. */
  45669. function (v) {
  45670. this._ngStyle = v;
  45671. if (!this._differ && v) {
  45672. this._differ = this._differs.find(v).create();
  45673. }
  45674. },
  45675. enumerable: true,
  45676. configurable: true
  45677. });
  45678. /**
  45679. * @return {?}
  45680. */
  45681. NgStyle.prototype.ngDoCheck = /**
  45682. * @return {?}
  45683. */
  45684. function () {
  45685. if (this._differ) {
  45686. var /** @type {?} */ changes = this._differ.diff(this._ngStyle);
  45687. if (changes) {
  45688. this._applyChanges(changes);
  45689. }
  45690. }
  45691. };
  45692. /**
  45693. * @param {?} changes
  45694. * @return {?}
  45695. */
  45696. NgStyle.prototype._applyChanges = /**
  45697. * @param {?} changes
  45698. * @return {?}
  45699. */
  45700. function (changes) {
  45701. var _this = this;
  45702. changes.forEachRemovedItem(function (record) { return _this._setStyle(record.key, null); });
  45703. changes.forEachAddedItem(function (record) { return _this._setStyle(record.key, record.currentValue); });
  45704. changes.forEachChangedItem(function (record) { return _this._setStyle(record.key, record.currentValue); });
  45705. };
  45706. /**
  45707. * @param {?} nameAndUnit
  45708. * @param {?} value
  45709. * @return {?}
  45710. */
  45711. NgStyle.prototype._setStyle = /**
  45712. * @param {?} nameAndUnit
  45713. * @param {?} value
  45714. * @return {?}
  45715. */
  45716. function (nameAndUnit, value) {
  45717. var _a = nameAndUnit.split('.'), name = _a[0], unit = _a[1];
  45718. value = value != null && unit ? "" + value + unit : value;
  45719. if (value != null) {
  45720. this._renderer.setStyle(this._ngEl.nativeElement, name, /** @type {?} */ (value));
  45721. }
  45722. else {
  45723. this._renderer.removeStyle(this._ngEl.nativeElement, name);
  45724. }
  45725. };
  45726. NgStyle.decorators = [
  45727. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{ selector: '[ngStyle]' },] },
  45728. ];
  45729. /** @nocollapse */
  45730. NgStyle.ctorParameters = function () { return [
  45731. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["F" /* KeyValueDiffers */], },
  45732. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  45733. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["W" /* Renderer2 */], },
  45734. ]; };
  45735. NgStyle.propDecorators = {
  45736. "ngStyle": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  45737. };
  45738. return NgStyle;
  45739. }());
  45740. /**
  45741. * @fileoverview added by tsickle
  45742. * @suppress {checkTypes} checked by tsc
  45743. */
  45744. /**
  45745. * @license
  45746. * Copyright Google Inc. All Rights Reserved.
  45747. *
  45748. * Use of this source code is governed by an MIT-style license that can be
  45749. * found in the LICENSE file at https://angular.io/license
  45750. */
  45751. /**
  45752. * \@ngModule CommonModule
  45753. *
  45754. * \@whatItDoes Inserts an embedded view from a prepared `TemplateRef`
  45755. *
  45756. * \@howToUse
  45757. * ```
  45758. * <ng-container *ngTemplateOutlet="templateRefExp; context: contextExp"></ng-container>
  45759. * ```
  45760. *
  45761. * \@description
  45762. *
  45763. * You can attach a context object to the `EmbeddedViewRef` by setting `[ngTemplateOutletContext]`.
  45764. * `[ngTemplateOutletContext]` should be an object, the object's keys will be available for binding
  45765. * by the local template `let` declarations.
  45766. *
  45767. * Note: using the key `$implicit` in the context object will set its value as default.
  45768. *
  45769. * ## Example
  45770. *
  45771. * {\@example common/ngTemplateOutlet/ts/module.ts region='NgTemplateOutlet'}
  45772. *
  45773. * \@stable
  45774. */
  45775. var NgTemplateOutlet = /** @class */ (function () {
  45776. function NgTemplateOutlet(_viewContainerRef) {
  45777. this._viewContainerRef = _viewContainerRef;
  45778. }
  45779. /**
  45780. * @param {?} changes
  45781. * @return {?}
  45782. */
  45783. NgTemplateOutlet.prototype.ngOnChanges = /**
  45784. * @param {?} changes
  45785. * @return {?}
  45786. */
  45787. function (changes) {
  45788. var /** @type {?} */ recreateView = this._shouldRecreateView(changes);
  45789. if (recreateView) {
  45790. if (this._viewRef) {
  45791. this._viewContainerRef.remove(this._viewContainerRef.indexOf(this._viewRef));
  45792. }
  45793. if (this.ngTemplateOutlet) {
  45794. this._viewRef = this._viewContainerRef.createEmbeddedView(this.ngTemplateOutlet, this.ngTemplateOutletContext);
  45795. }
  45796. }
  45797. else {
  45798. if (this._viewRef && this.ngTemplateOutletContext) {
  45799. this._updateExistingContext(this.ngTemplateOutletContext);
  45800. }
  45801. }
  45802. };
  45803. /**
  45804. * We need to re-create existing embedded view if:
  45805. * - templateRef has changed
  45806. * - context has changes
  45807. *
  45808. * We mark context object as changed when the corresponding object
  45809. * shape changes (new properties are added or existing properties are removed).
  45810. * In other words we consider context with the same properties as "the same" even
  45811. * if object reference changes (see https://github.com/angular/angular/issues/13407).
  45812. * @param {?} changes
  45813. * @return {?}
  45814. */
  45815. NgTemplateOutlet.prototype._shouldRecreateView = /**
  45816. * We need to re-create existing embedded view if:
  45817. * - templateRef has changed
  45818. * - context has changes
  45819. *
  45820. * We mark context object as changed when the corresponding object
  45821. * shape changes (new properties are added or existing properties are removed).
  45822. * In other words we consider context with the same properties as "the same" even
  45823. * if object reference changes (see https://github.com/angular/angular/issues/13407).
  45824. * @param {?} changes
  45825. * @return {?}
  45826. */
  45827. function (changes) {
  45828. var /** @type {?} */ ctxChange = changes['ngTemplateOutletContext'];
  45829. return !!changes['ngTemplateOutlet'] || (ctxChange && this._hasContextShapeChanged(ctxChange));
  45830. };
  45831. /**
  45832. * @param {?} ctxChange
  45833. * @return {?}
  45834. */
  45835. NgTemplateOutlet.prototype._hasContextShapeChanged = /**
  45836. * @param {?} ctxChange
  45837. * @return {?}
  45838. */
  45839. function (ctxChange) {
  45840. var /** @type {?} */ prevCtxKeys = Object.keys(ctxChange.previousValue || {});
  45841. var /** @type {?} */ currCtxKeys = Object.keys(ctxChange.currentValue || {});
  45842. if (prevCtxKeys.length === currCtxKeys.length) {
  45843. for (var _i = 0, currCtxKeys_1 = currCtxKeys; _i < currCtxKeys_1.length; _i++) {
  45844. var propName = currCtxKeys_1[_i];
  45845. if (prevCtxKeys.indexOf(propName) === -1) {
  45846. return true;
  45847. }
  45848. }
  45849. return false;
  45850. }
  45851. else {
  45852. return true;
  45853. }
  45854. };
  45855. /**
  45856. * @param {?} ctx
  45857. * @return {?}
  45858. */
  45859. NgTemplateOutlet.prototype._updateExistingContext = /**
  45860. * @param {?} ctx
  45861. * @return {?}
  45862. */
  45863. function (ctx) {
  45864. for (var _i = 0, _a = Object.keys(ctx); _i < _a.length; _i++) {
  45865. var propName = _a[_i];
  45866. (/** @type {?} */ (this._viewRef.context))[propName] = (/** @type {?} */ (this.ngTemplateOutletContext))[propName];
  45867. }
  45868. };
  45869. NgTemplateOutlet.decorators = [
  45870. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{ selector: '[ngTemplateOutlet]' },] },
  45871. ];
  45872. /** @nocollapse */
  45873. NgTemplateOutlet.ctorParameters = function () { return [
  45874. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_10" /* ViewContainerRef */], },
  45875. ]; };
  45876. NgTemplateOutlet.propDecorators = {
  45877. "ngTemplateOutletContext": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  45878. "ngTemplateOutlet": [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  45879. };
  45880. return NgTemplateOutlet;
  45881. }());
  45882. /**
  45883. * @fileoverview added by tsickle
  45884. * @suppress {checkTypes} checked by tsc
  45885. */
  45886. /**
  45887. * @license
  45888. * Copyright Google Inc. All Rights Reserved.
  45889. *
  45890. * Use of this source code is governed by an MIT-style license that can be
  45891. * found in the LICENSE file at https://angular.io/license
  45892. */
  45893. /**
  45894. * A collection of Angular directives that are likely to be used in each and every Angular
  45895. * application.
  45896. */
  45897. var COMMON_DIRECTIVES = [
  45898. NgClass,
  45899. NgComponentOutlet,
  45900. NgForOf,
  45901. NgIf,
  45902. NgTemplateOutlet,
  45903. NgStyle,
  45904. NgSwitch,
  45905. NgSwitchCase,
  45906. NgSwitchDefault,
  45907. NgPlural,
  45908. NgPluralCase,
  45909. ];
  45910. /**
  45911. * @fileoverview added by tsickle
  45912. * @suppress {checkTypes} checked by tsc
  45913. */
  45914. /**
  45915. * @license
  45916. * Copyright Google Inc. All Rights Reserved.
  45917. *
  45918. * Use of this source code is governed by an MIT-style license that can be
  45919. * found in the LICENSE file at https://angular.io/license
  45920. */
  45921. var NAMED_FORMATS = {};
  45922. var DATE_FORMATS_SPLIT = /((?:[^GyMLwWdEabBhHmsSzZO']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/;
  45923. /** @enum {number} */
  45924. var ZoneWidth = {
  45925. Short: 0,
  45926. ShortGMT: 1,
  45927. Long: 2,
  45928. Extended: 3,
  45929. };
  45930. ZoneWidth[ZoneWidth.Short] = "Short";
  45931. ZoneWidth[ZoneWidth.ShortGMT] = "ShortGMT";
  45932. ZoneWidth[ZoneWidth.Long] = "Long";
  45933. ZoneWidth[ZoneWidth.Extended] = "Extended";
  45934. /** @enum {number} */
  45935. var DateType = {
  45936. FullYear: 0,
  45937. Month: 1,
  45938. Date: 2,
  45939. Hours: 3,
  45940. Minutes: 4,
  45941. Seconds: 5,
  45942. Milliseconds: 6,
  45943. Day: 7,
  45944. };
  45945. DateType[DateType.FullYear] = "FullYear";
  45946. DateType[DateType.Month] = "Month";
  45947. DateType[DateType.Date] = "Date";
  45948. DateType[DateType.Hours] = "Hours";
  45949. DateType[DateType.Minutes] = "Minutes";
  45950. DateType[DateType.Seconds] = "Seconds";
  45951. DateType[DateType.Milliseconds] = "Milliseconds";
  45952. DateType[DateType.Day] = "Day";
  45953. /** @enum {number} */
  45954. var TranslationType = {
  45955. DayPeriods: 0,
  45956. Days: 1,
  45957. Months: 2,
  45958. Eras: 3,
  45959. };
  45960. TranslationType[TranslationType.DayPeriods] = "DayPeriods";
  45961. TranslationType[TranslationType.Days] = "Days";
  45962. TranslationType[TranslationType.Months] = "Months";
  45963. TranslationType[TranslationType.Eras] = "Eras";
  45964. /**
  45965. * Transforms a date to a locale string based on a pattern and a timezone
  45966. *
  45967. * \@internal
  45968. * @param {?} date
  45969. * @param {?} format
  45970. * @param {?} locale
  45971. * @param {?=} timezone
  45972. * @return {?}
  45973. */
  45974. function formatDate(date, format, locale, timezone) {
  45975. var /** @type {?} */ namedFormat = getNamedFormat(locale, format);
  45976. format = namedFormat || format;
  45977. var /** @type {?} */ parts = [];
  45978. var /** @type {?} */ match;
  45979. while (format) {
  45980. match = DATE_FORMATS_SPLIT.exec(format);
  45981. if (match) {
  45982. parts = parts.concat(match.slice(1));
  45983. var /** @type {?} */ part = parts.pop();
  45984. if (!part) {
  45985. break;
  45986. }
  45987. format = part;
  45988. }
  45989. else {
  45990. parts.push(format);
  45991. break;
  45992. }
  45993. }
  45994. var /** @type {?} */ dateTimezoneOffset = date.getTimezoneOffset();
  45995. if (timezone) {
  45996. dateTimezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);
  45997. date = convertTimezoneToLocal(date, timezone, true);
  45998. }
  45999. var /** @type {?} */ text = '';
  46000. parts.forEach(function (value) {
  46001. var /** @type {?} */ dateFormatter = getDateFormatter(value);
  46002. text += dateFormatter ?
  46003. dateFormatter(date, locale, dateTimezoneOffset) :
  46004. value === '\'\'' ? '\'' : value.replace(/(^'|'$)/g, '').replace(/''/g, '\'');
  46005. });
  46006. return text;
  46007. }
  46008. /**
  46009. * @param {?} locale
  46010. * @param {?} format
  46011. * @return {?}
  46012. */
  46013. function getNamedFormat(locale, format) {
  46014. var /** @type {?} */ localeId = getLocaleId(locale);
  46015. NAMED_FORMATS[localeId] = NAMED_FORMATS[localeId] || {};
  46016. if (NAMED_FORMATS[localeId][format]) {
  46017. return NAMED_FORMATS[localeId][format];
  46018. }
  46019. var /** @type {?} */ formatValue = '';
  46020. switch (format) {
  46021. case 'shortDate':
  46022. formatValue = getLocaleDateFormat(locale, FormatWidth.Short);
  46023. break;
  46024. case 'mediumDate':
  46025. formatValue = getLocaleDateFormat(locale, FormatWidth.Medium);
  46026. break;
  46027. case 'longDate':
  46028. formatValue = getLocaleDateFormat(locale, FormatWidth.Long);
  46029. break;
  46030. case 'fullDate':
  46031. formatValue = getLocaleDateFormat(locale, FormatWidth.Full);
  46032. break;
  46033. case 'shortTime':
  46034. formatValue = getLocaleTimeFormat(locale, FormatWidth.Short);
  46035. break;
  46036. case 'mediumTime':
  46037. formatValue = getLocaleTimeFormat(locale, FormatWidth.Medium);
  46038. break;
  46039. case 'longTime':
  46040. formatValue = getLocaleTimeFormat(locale, FormatWidth.Long);
  46041. break;
  46042. case 'fullTime':
  46043. formatValue = getLocaleTimeFormat(locale, FormatWidth.Full);
  46044. break;
  46045. case 'short':
  46046. var /** @type {?} */ shortTime = getNamedFormat(locale, 'shortTime');
  46047. var /** @type {?} */ shortDate = getNamedFormat(locale, 'shortDate');
  46048. formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Short), [shortTime, shortDate]);
  46049. break;
  46050. case 'medium':
  46051. var /** @type {?} */ mediumTime = getNamedFormat(locale, 'mediumTime');
  46052. var /** @type {?} */ mediumDate = getNamedFormat(locale, 'mediumDate');
  46053. formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Medium), [mediumTime, mediumDate]);
  46054. break;
  46055. case 'long':
  46056. var /** @type {?} */ longTime = getNamedFormat(locale, 'longTime');
  46057. var /** @type {?} */ longDate = getNamedFormat(locale, 'longDate');
  46058. formatValue =
  46059. formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Long), [longTime, longDate]);
  46060. break;
  46061. case 'full':
  46062. var /** @type {?} */ fullTime = getNamedFormat(locale, 'fullTime');
  46063. var /** @type {?} */ fullDate = getNamedFormat(locale, 'fullDate');
  46064. formatValue =
  46065. formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Full), [fullTime, fullDate]);
  46066. break;
  46067. }
  46068. if (formatValue) {
  46069. NAMED_FORMATS[localeId][format] = formatValue;
  46070. }
  46071. return formatValue;
  46072. }
  46073. /**
  46074. * @param {?} str
  46075. * @param {?} opt_values
  46076. * @return {?}
  46077. */
  46078. function formatDateTime(str, opt_values) {
  46079. if (opt_values) {
  46080. str = str.replace(/\{([^}]+)}/g, function (match, key) {
  46081. return (opt_values != null && key in opt_values) ? opt_values[key] : match;
  46082. });
  46083. }
  46084. return str;
  46085. }
  46086. /**
  46087. * @param {?} num
  46088. * @param {?} digits
  46089. * @param {?=} minusSign
  46090. * @param {?=} trim
  46091. * @param {?=} negWrap
  46092. * @return {?}
  46093. */
  46094. function padNumber(num, digits, minusSign, trim, negWrap) {
  46095. if (minusSign === void 0) { minusSign = '-'; }
  46096. var /** @type {?} */ neg = '';
  46097. if (num < 0 || (negWrap && num <= 0)) {
  46098. if (negWrap) {
  46099. num = -num + 1;
  46100. }
  46101. else {
  46102. num = -num;
  46103. neg = minusSign;
  46104. }
  46105. }
  46106. var /** @type {?} */ strNum = '' + num;
  46107. while (strNum.length < digits)
  46108. strNum = '0' + strNum;
  46109. if (trim) {
  46110. strNum = strNum.substr(strNum.length - digits);
  46111. }
  46112. return neg + strNum;
  46113. }
  46114. /**
  46115. * Returns a date formatter that transforms a date into its locale digit representation
  46116. * @param {?} name
  46117. * @param {?} size
  46118. * @param {?=} offset
  46119. * @param {?=} trim
  46120. * @param {?=} negWrap
  46121. * @return {?}
  46122. */
  46123. function dateGetter(name, size, offset, trim, negWrap) {
  46124. if (offset === void 0) { offset = 0; }
  46125. if (trim === void 0) { trim = false; }
  46126. if (negWrap === void 0) { negWrap = false; }
  46127. return function (date, locale) {
  46128. var /** @type {?} */ part = getDatePart(name, date, size);
  46129. if (offset > 0 || part > -offset) {
  46130. part += offset;
  46131. }
  46132. if (name === DateType.Hours && part === 0 && offset === -12) {
  46133. part = 12;
  46134. }
  46135. return padNumber(part, size, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign), trim, negWrap);
  46136. };
  46137. }
  46138. /**
  46139. * @param {?} name
  46140. * @param {?} date
  46141. * @param {?} size
  46142. * @return {?}
  46143. */
  46144. function getDatePart(name, date, size) {
  46145. switch (name) {
  46146. case DateType.FullYear:
  46147. return date.getFullYear();
  46148. case DateType.Month:
  46149. return date.getMonth();
  46150. case DateType.Date:
  46151. return date.getDate();
  46152. case DateType.Hours:
  46153. return date.getHours();
  46154. case DateType.Minutes:
  46155. return date.getMinutes();
  46156. case DateType.Seconds:
  46157. return date.getSeconds();
  46158. case DateType.Milliseconds:
  46159. var /** @type {?} */ div = size === 1 ? 100 : (size === 2 ? 10 : 1);
  46160. return Math.round(date.getMilliseconds() / div);
  46161. case DateType.Day:
  46162. return date.getDay();
  46163. default:
  46164. throw new Error("Unknown DateType value \"" + name + "\".");
  46165. }
  46166. }
  46167. /**
  46168. * Returns a date formatter that transforms a date into its locale string representation
  46169. * @param {?} name
  46170. * @param {?} width
  46171. * @param {?=} form
  46172. * @param {?=} extended
  46173. * @return {?}
  46174. */
  46175. function dateStrGetter(name, width, form, extended) {
  46176. if (form === void 0) { form = FormStyle.Format; }
  46177. if (extended === void 0) { extended = false; }
  46178. return function (date, locale) {
  46179. return getDateTranslation(date, locale, name, width, form, extended);
  46180. };
  46181. }
  46182. /**
  46183. * Returns the locale translation of a date for a given form, type and width
  46184. * @param {?} date
  46185. * @param {?} locale
  46186. * @param {?} name
  46187. * @param {?} width
  46188. * @param {?} form
  46189. * @param {?} extended
  46190. * @return {?}
  46191. */
  46192. function getDateTranslation(date, locale, name, width, form, extended) {
  46193. switch (name) {
  46194. case TranslationType.Months:
  46195. return getLocaleMonthNames(locale, form, width)[date.getMonth()];
  46196. case TranslationType.Days:
  46197. return getLocaleDayNames(locale, form, width)[date.getDay()];
  46198. case TranslationType.DayPeriods:
  46199. var /** @type {?} */ currentHours_1 = date.getHours();
  46200. var /** @type {?} */ currentMinutes_1 = date.getMinutes();
  46201. if (extended) {
  46202. var /** @type {?} */ rules = getLocaleExtraDayPeriodRules(locale);
  46203. var /** @type {?} */ dayPeriods_1 = getLocaleExtraDayPeriods(locale, form, width);
  46204. var /** @type {?} */ result_1;
  46205. rules.forEach(function (rule, index) {
  46206. if (Array.isArray(rule)) {
  46207. // morning, afternoon, evening, night
  46208. var _a = rule[0], hoursFrom = _a.hours, minutesFrom = _a.minutes;
  46209. var _b = rule[1], hoursTo = _b.hours, minutesTo = _b.minutes;
  46210. if (currentHours_1 >= hoursFrom && currentMinutes_1 >= minutesFrom &&
  46211. (currentHours_1 < hoursTo ||
  46212. (currentHours_1 === hoursTo && currentMinutes_1 < minutesTo))) {
  46213. result_1 = dayPeriods_1[index];
  46214. }
  46215. }
  46216. else {
  46217. // noon or midnight
  46218. var hours = rule.hours, minutes = rule.minutes;
  46219. if (hours === currentHours_1 && minutes === currentMinutes_1) {
  46220. result_1 = dayPeriods_1[index];
  46221. }
  46222. }
  46223. });
  46224. if (result_1) {
  46225. return result_1;
  46226. }
  46227. }
  46228. // if no rules for the day periods, we use am/pm by default
  46229. return getLocaleDayPeriods(locale, form, /** @type {?} */ (width))[currentHours_1 < 12 ? 0 : 1];
  46230. case TranslationType.Eras:
  46231. return getLocaleEraNames(locale, /** @type {?} */ (width))[date.getFullYear() <= 0 ? 0 : 1];
  46232. default:
  46233. // This default case is not needed by TypeScript compiler, as the switch is exhaustive.
  46234. // However Closure Compiler does not understand that and reports an error in typed mode.
  46235. // The `throw new Error` below works around the problem, and the unexpected: never variable
  46236. // makes sure tsc still checks this code is unreachable.
  46237. var /** @type {?} */ unexpected = name;
  46238. throw new Error("unexpected translation type " + unexpected);
  46239. }
  46240. }
  46241. /**
  46242. * Returns a date formatter that transforms a date and an offset into a timezone with ISO8601 or
  46243. * GMT format depending on the width (eg: short = +0430, short:GMT = GMT+4, long = GMT+04:30,
  46244. * extended = +04:30)
  46245. * @param {?} width
  46246. * @return {?}
  46247. */
  46248. function timeZoneGetter(width) {
  46249. return function (date, locale, offset) {
  46250. var /** @type {?} */ zone = -1 * offset;
  46251. var /** @type {?} */ minusSign = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);
  46252. var /** @type {?} */ hours = zone > 0 ? Math.floor(zone / 60) : Math.ceil(zone / 60);
  46253. switch (width) {
  46254. case ZoneWidth.Short:
  46255. return ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) +
  46256. padNumber(Math.abs(zone % 60), 2, minusSign);
  46257. case ZoneWidth.ShortGMT:
  46258. return 'GMT' + ((zone >= 0) ? '+' : '') + padNumber(hours, 1, minusSign);
  46259. case ZoneWidth.Long:
  46260. return 'GMT' + ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) + ':' +
  46261. padNumber(Math.abs(zone % 60), 2, minusSign);
  46262. case ZoneWidth.Extended:
  46263. if (offset === 0) {
  46264. return 'Z';
  46265. }
  46266. else {
  46267. return ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) + ':' +
  46268. padNumber(Math.abs(zone % 60), 2, minusSign);
  46269. }
  46270. default:
  46271. throw new Error("Unknown zone width \"" + width + "\"");
  46272. }
  46273. };
  46274. }
  46275. var JANUARY = 0;
  46276. var THURSDAY = 4;
  46277. /**
  46278. * @param {?} year
  46279. * @return {?}
  46280. */
  46281. function getFirstThursdayOfYear(year) {
  46282. var /** @type {?} */ firstDayOfYear = (new Date(year, JANUARY, 1)).getDay();
  46283. return new Date(year, 0, 1 + ((firstDayOfYear <= THURSDAY) ? THURSDAY : THURSDAY + 7) - firstDayOfYear);
  46284. }
  46285. /**
  46286. * @param {?} datetime
  46287. * @return {?}
  46288. */
  46289. function getThursdayThisWeek(datetime) {
  46290. return new Date(datetime.getFullYear(), datetime.getMonth(), datetime.getDate() + (THURSDAY - datetime.getDay()));
  46291. }
  46292. /**
  46293. * @param {?} size
  46294. * @param {?=} monthBased
  46295. * @return {?}
  46296. */
  46297. function weekGetter(size, monthBased) {
  46298. if (monthBased === void 0) { monthBased = false; }
  46299. return function (date, locale) {
  46300. var /** @type {?} */ result;
  46301. if (monthBased) {
  46302. var /** @type {?} */ nbDaysBefore1stDayOfMonth = new Date(date.getFullYear(), date.getMonth(), 1).getDay() - 1;
  46303. var /** @type {?} */ today = date.getDate();
  46304. result = 1 + Math.floor((today + nbDaysBefore1stDayOfMonth) / 7);
  46305. }
  46306. else {
  46307. var /** @type {?} */ firstThurs = getFirstThursdayOfYear(date.getFullYear());
  46308. var /** @type {?} */ thisThurs = getThursdayThisWeek(date);
  46309. var /** @type {?} */ diff = thisThurs.getTime() - firstThurs.getTime();
  46310. result = 1 + Math.round(diff / 6.048e8); // 6.048e8 ms per week
  46311. }
  46312. return padNumber(result, size, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
  46313. };
  46314. }
  46315. var DATE_FORMATS = {};
  46316. /**
  46317. * @param {?} format
  46318. * @return {?}
  46319. */
  46320. function getDateFormatter(format) {
  46321. if (DATE_FORMATS[format]) {
  46322. return DATE_FORMATS[format];
  46323. }
  46324. var /** @type {?} */ formatter;
  46325. switch (format) {
  46326. // Era name (AD/BC)
  46327. case 'G':
  46328. case 'GG':
  46329. case 'GGG':
  46330. formatter = dateStrGetter(TranslationType.Eras, TranslationWidth.Abbreviated);
  46331. break;
  46332. case 'GGGG':
  46333. formatter = dateStrGetter(TranslationType.Eras, TranslationWidth.Wide);
  46334. break;
  46335. case 'GGGGG':
  46336. formatter = dateStrGetter(TranslationType.Eras, TranslationWidth.Narrow);
  46337. break;
  46338. // 1 digit representation of the year, e.g. (AD 1 => 1, AD 199 => 199)
  46339. case 'y':
  46340. formatter = dateGetter(DateType.FullYear, 1, 0, false, true);
  46341. break;
  46342. // 2 digit representation of the year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10)
  46343. case 'yy':
  46344. formatter = dateGetter(DateType.FullYear, 2, 0, true, true);
  46345. break;
  46346. // 3 digit representation of the year, padded (000-999). (e.g. AD 2001 => 01, AD 2010 => 10)
  46347. case 'yyy':
  46348. formatter = dateGetter(DateType.FullYear, 3, 0, false, true);
  46349. break;
  46350. // 4 digit representation of the year (e.g. AD 1 => 0001, AD 2010 => 2010)
  46351. case 'yyyy':
  46352. formatter = dateGetter(DateType.FullYear, 4, 0, false, true);
  46353. break;
  46354. // Month of the year (1-12), numeric
  46355. case 'M':
  46356. case 'L':
  46357. formatter = dateGetter(DateType.Month, 1, 1);
  46358. break;
  46359. case 'MM':
  46360. case 'LL':
  46361. formatter = dateGetter(DateType.Month, 2, 1);
  46362. break;
  46363. // Month of the year (January, ...), string, format
  46364. case 'MMM':
  46365. formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Abbreviated);
  46366. break;
  46367. case 'MMMM':
  46368. formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Wide);
  46369. break;
  46370. case 'MMMMM':
  46371. formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Narrow);
  46372. break;
  46373. // Month of the year (January, ...), string, standalone
  46374. case 'LLL':
  46375. formatter =
  46376. dateStrGetter(TranslationType.Months, TranslationWidth.Abbreviated, FormStyle.Standalone);
  46377. break;
  46378. case 'LLLL':
  46379. formatter =
  46380. dateStrGetter(TranslationType.Months, TranslationWidth.Wide, FormStyle.Standalone);
  46381. break;
  46382. case 'LLLLL':
  46383. formatter =
  46384. dateStrGetter(TranslationType.Months, TranslationWidth.Narrow, FormStyle.Standalone);
  46385. break;
  46386. // Week of the year (1, ... 52)
  46387. case 'w':
  46388. formatter = weekGetter(1);
  46389. break;
  46390. case 'ww':
  46391. formatter = weekGetter(2);
  46392. break;
  46393. // Week of the month (1, ...)
  46394. case 'W':
  46395. formatter = weekGetter(1, true);
  46396. break;
  46397. // Day of the month (1-31)
  46398. case 'd':
  46399. formatter = dateGetter(DateType.Date, 1);
  46400. break;
  46401. case 'dd':
  46402. formatter = dateGetter(DateType.Date, 2);
  46403. break;
  46404. // Day of the Week
  46405. case 'E':
  46406. case 'EE':
  46407. case 'EEE':
  46408. formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Abbreviated);
  46409. break;
  46410. case 'EEEE':
  46411. formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Wide);
  46412. break;
  46413. case 'EEEEE':
  46414. formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Narrow);
  46415. break;
  46416. case 'EEEEEE':
  46417. formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Short);
  46418. break;
  46419. // Generic period of the day (am-pm)
  46420. case 'a':
  46421. case 'aa':
  46422. case 'aaa':
  46423. formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Abbreviated);
  46424. break;
  46425. case 'aaaa':
  46426. formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Wide);
  46427. break;
  46428. case 'aaaaa':
  46429. formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Narrow);
  46430. break;
  46431. // Extended period of the day (midnight, at night, ...), standalone
  46432. case 'b':
  46433. case 'bb':
  46434. case 'bbb':
  46435. formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Abbreviated, FormStyle.Standalone, true);
  46436. break;
  46437. case 'bbbb':
  46438. formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Wide, FormStyle.Standalone, true);
  46439. break;
  46440. case 'bbbbb':
  46441. formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Narrow, FormStyle.Standalone, true);
  46442. break;
  46443. // Extended period of the day (midnight, night, ...), standalone
  46444. case 'B':
  46445. case 'BB':
  46446. case 'BBB':
  46447. formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Abbreviated, FormStyle.Format, true);
  46448. break;
  46449. case 'BBBB':
  46450. formatter =
  46451. dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Wide, FormStyle.Format, true);
  46452. break;
  46453. case 'BBBBB':
  46454. formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Narrow, FormStyle.Format, true);
  46455. break;
  46456. // Hour in AM/PM, (1-12)
  46457. case 'h':
  46458. formatter = dateGetter(DateType.Hours, 1, -12);
  46459. break;
  46460. case 'hh':
  46461. formatter = dateGetter(DateType.Hours, 2, -12);
  46462. break;
  46463. // Hour of the day (0-23)
  46464. case 'H':
  46465. formatter = dateGetter(DateType.Hours, 1);
  46466. break;
  46467. // Hour in day, padded (00-23)
  46468. case 'HH':
  46469. formatter = dateGetter(DateType.Hours, 2);
  46470. break;
  46471. // Minute of the hour (0-59)
  46472. case 'm':
  46473. formatter = dateGetter(DateType.Minutes, 1);
  46474. break;
  46475. case 'mm':
  46476. formatter = dateGetter(DateType.Minutes, 2);
  46477. break;
  46478. // Second of the minute (0-59)
  46479. case 's':
  46480. formatter = dateGetter(DateType.Seconds, 1);
  46481. break;
  46482. case 'ss':
  46483. formatter = dateGetter(DateType.Seconds, 2);
  46484. break;
  46485. // Fractional second padded (0-9)
  46486. case 'S':
  46487. formatter = dateGetter(DateType.Milliseconds, 1);
  46488. break;
  46489. case 'SS':
  46490. formatter = dateGetter(DateType.Milliseconds, 2);
  46491. break;
  46492. // = millisecond
  46493. case 'SSS':
  46494. formatter = dateGetter(DateType.Milliseconds, 3);
  46495. break;
  46496. // Timezone ISO8601 short format (-0430)
  46497. case 'Z':
  46498. case 'ZZ':
  46499. case 'ZZZ':
  46500. formatter = timeZoneGetter(ZoneWidth.Short);
  46501. break;
  46502. // Timezone ISO8601 extended format (-04:30)
  46503. case 'ZZZZZ':
  46504. formatter = timeZoneGetter(ZoneWidth.Extended);
  46505. break;
  46506. // Timezone GMT short format (GMT+4)
  46507. case 'O':
  46508. case 'OO':
  46509. case 'OOO':
  46510. // Should be location, but fallback to format O instead because we don't have the data yet
  46511. case 'z':
  46512. case 'zz':
  46513. case 'zzz':
  46514. formatter = timeZoneGetter(ZoneWidth.ShortGMT);
  46515. break;
  46516. // Timezone GMT long format (GMT+0430)
  46517. case 'OOOO':
  46518. case 'ZZZZ':
  46519. // Should be location, but fallback to format O instead because we don't have the data yet
  46520. case 'zzzz':
  46521. formatter = timeZoneGetter(ZoneWidth.Long);
  46522. break;
  46523. default:
  46524. return null;
  46525. }
  46526. DATE_FORMATS[format] = formatter;
  46527. return formatter;
  46528. }
  46529. /**
  46530. * @param {?} timezone
  46531. * @param {?} fallback
  46532. * @return {?}
  46533. */
  46534. function timezoneToOffset(timezone, fallback) {
  46535. // Support: IE 9-11 only, Edge 13-15+
  46536. // IE/Edge do not "understand" colon (`:`) in timezone
  46537. timezone = timezone.replace(/:/g, '');
  46538. var /** @type {?} */ requestedTimezoneOffset = Date.parse('Jan 01, 1970 00:00:00 ' + timezone) / 60000;
  46539. return isNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset;
  46540. }
  46541. /**
  46542. * @param {?} date
  46543. * @param {?} minutes
  46544. * @return {?}
  46545. */
  46546. function addDateMinutes(date, minutes) {
  46547. date = new Date(date.getTime());
  46548. date.setMinutes(date.getMinutes() + minutes);
  46549. return date;
  46550. }
  46551. /**
  46552. * @param {?} date
  46553. * @param {?} timezone
  46554. * @param {?} reverse
  46555. * @return {?}
  46556. */
  46557. function convertTimezoneToLocal(date, timezone, reverse) {
  46558. var /** @type {?} */ reverseValue = reverse ? -1 : 1;
  46559. var /** @type {?} */ dateTimezoneOffset = date.getTimezoneOffset();
  46560. var /** @type {?} */ timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);
  46561. return addDateMinutes(date, reverseValue * (timezoneOffset - dateTimezoneOffset));
  46562. }
  46563. /**
  46564. * @fileoverview added by tsickle
  46565. * @suppress {checkTypes} checked by tsc
  46566. */
  46567. /**
  46568. * @license
  46569. * Copyright Google Inc. All Rights Reserved.
  46570. *
  46571. * Use of this source code is governed by an MIT-style license that can be
  46572. * found in the LICENSE file at https://angular.io/license
  46573. */
  46574. /**
  46575. * @param {?} type
  46576. * @param {?} value
  46577. * @return {?}
  46578. */
  46579. function invalidPipeArgumentError(type, value) {
  46580. return Error("InvalidPipeArgument: '" + value + "' for pipe '" + Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_48" /* ɵstringify */])(type) + "'");
  46581. }
  46582. /**
  46583. * @fileoverview added by tsickle
  46584. * @suppress {checkTypes} checked by tsc
  46585. */
  46586. /**
  46587. * @license
  46588. * Copyright Google Inc. All Rights Reserved.
  46589. *
  46590. * Use of this source code is governed by an MIT-style license that can be
  46591. * found in the LICENSE file at https://angular.io/license
  46592. */
  46593. var ISO8601_DATE_REGEX = /^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;
  46594. /**
  46595. * \@ngModule CommonModule
  46596. * \@whatItDoes Formats a date according to locale rules.
  46597. * \@howToUse `date_expression | date[:format[:timezone[:locale]]]`
  46598. * \@description
  46599. *
  46600. * Where:
  46601. * - `expression` is a date object or a number (milliseconds since UTC epoch) or an ISO string
  46602. * (https://www.w3.org/TR/NOTE-datetime).
  46603. * - `format` indicates which date/time components to include. The format can be predefined as
  46604. * shown below (all examples are given for `en-US`) or custom as shown in the table.
  46605. * - `'short'`: equivalent to `'M/d/yy, h:mm a'` (e.g. `6/15/15, 9:03 AM`)
  46606. * - `'medium'`: equivalent to `'MMM d, y, h:mm:ss a'` (e.g. `Jun 15, 2015, 9:03:01 AM`)
  46607. * - `'long'`: equivalent to `'MMMM d, y, h:mm:ss a z'` (e.g. `June 15, 2015 at 9:03:01 AM GMT+1`)
  46608. * - `'full'`: equivalent to `'EEEE, MMMM d, y, h:mm:ss a zzzz'` (e.g. `Monday, June 15, 2015 at
  46609. * 9:03:01 AM GMT+01:00`)
  46610. * - `'shortDate'`: equivalent to `'M/d/yy'` (e.g. `6/15/15`)
  46611. * - `'mediumDate'`: equivalent to `'MMM d, y'` (e.g. `Jun 15, 2015`)
  46612. * - `'longDate'`: equivalent to `'MMMM d, y'` (e.g. `June 15, 2015`)
  46613. * - `'fullDate'`: equivalent to `'EEEE, MMMM d, y'` (e.g. `Monday, June 15, 2015`)
  46614. * - `'shortTime'`: equivalent to `'h:mm a'` (e.g. `9:03 AM`)
  46615. * - `'mediumTime'`: equivalent to `'h:mm:ss a'` (e.g. `9:03:01 AM`)
  46616. * - `'longTime'`: equivalent to `'h:mm:ss a z'` (e.g. `9:03:01 AM GMT+1`)
  46617. * - `'fullTime'`: equivalent to `'h:mm:ss a zzzz'` (e.g. `9:03:01 AM GMT+01:00`)
  46618. * - `timezone` to be used for formatting. It understands UTC/GMT and the continental US time zone
  46619. * abbreviations, but for general use, use a time zone offset, for example,
  46620. * `'+0430'` (4 hours, 30 minutes east of the Greenwich meridian)
  46621. * If not specified, the local system timezone of the end-user's browser will be used.
  46622. * - `locale` is a `string` defining the locale to use (uses the current {\@link LOCALE_ID} by
  46623. * default)
  46624. *
  46625. *
  46626. * | Field Type | Format | Description | Example Value |
  46627. * |--------------------|-------------|---------------------------------------------------------------|------------------------------------------------------------|
  46628. * | Era | G, GG & GGG | Abbreviated | AD |
  46629. * | | GGGG | Wide | Anno Domini |
  46630. * | | GGGGG | Narrow | A |
  46631. * | Year | y | Numeric: minimum digits | 2, 20, 201, 2017, 20173 |
  46632. * | | yy | Numeric: 2 digits + zero padded | 02, 20, 01, 17, 73 |
  46633. * | | yyy | Numeric: 3 digits + zero padded | 002, 020, 201, 2017, 20173 |
  46634. * | | yyyy | Numeric: 4 digits or more + zero padded | 0002, 0020, 0201, 2017, 20173 |
  46635. * | Month | M | Numeric: 1 digit | 9, 12 |
  46636. * | | MM | Numeric: 2 digits + zero padded | 09, 12 |
  46637. * | | MMM | Abbreviated | Sep |
  46638. * | | MMMM | Wide | September |
  46639. * | | MMMMM | Narrow | S |
  46640. * | Month standalone | L | Numeric: 1 digit | 9, 12 |
  46641. * | | LL | Numeric: 2 digits + zero padded | 09, 12 |
  46642. * | | LLL | Abbreviated | Sep |
  46643. * | | LLLL | Wide | September |
  46644. * | | LLLLL | Narrow | S |
  46645. * | Week of year | w | Numeric: minimum digits | 1... 53 |
  46646. * | | ww | Numeric: 2 digits + zero padded | 01... 53 |
  46647. * | Week of month | W | Numeric: 1 digit | 1... 5 |
  46648. * | Day of month | d | Numeric: minimum digits | 1 |
  46649. * | | dd | Numeric: 2 digits + zero padded | 01 |
  46650. * | Week day | E, EE & EEE | Abbreviated | Tue |
  46651. * | | EEEE | Wide | Tuesday |
  46652. * | | EEEEE | Narrow | T |
  46653. * | | EEEEEE | Short | Tu |
  46654. * | Period | a, aa & aaa | Abbreviated | am/pm or AM/PM |
  46655. * | | aaaa | Wide (fallback to `a` when missing) | ante meridiem/post meridiem |
  46656. * | | aaaaa | Narrow | a/p |
  46657. * | Period* | B, BB & BBB | Abbreviated | mid. |
  46658. * | | BBBB | Wide | am, pm, midnight, noon, morning, afternoon, evening, night |
  46659. * | | BBBBB | Narrow | md |
  46660. * | Period standalone* | b, bb & bbb | Abbreviated | mid. |
  46661. * | | bbbb | Wide | am, pm, midnight, noon, morning, afternoon, evening, night |
  46662. * | | bbbbb | Narrow | md |
  46663. * | Hour 1-12 | h | Numeric: minimum digits | 1, 12 |
  46664. * | | hh | Numeric: 2 digits + zero padded | 01, 12 |
  46665. * | Hour 0-23 | H | Numeric: minimum digits | 0, 23 |
  46666. * | | HH | Numeric: 2 digits + zero padded | 00, 23 |
  46667. * | Minute | m | Numeric: minimum digits | 8, 59 |
  46668. * | | mm | Numeric: 2 digits + zero padded | 08, 59 |
  46669. * | Second | s | Numeric: minimum digits | 0... 59 |
  46670. * | | ss | Numeric: 2 digits + zero padded | 00... 59 |
  46671. * | Fractional seconds | S | Numeric: 1 digit | 0... 9 |
  46672. * | | SS | Numeric: 2 digits + zero padded | 00... 99 |
  46673. * | | SSS | Numeric: 3 digits + zero padded (= milliseconds) | 000... 999 |
  46674. * | Zone | z, zz & zzz | Short specific non location format (fallback to O) | GMT-8 |
  46675. * | | zzzz | Long specific non location format (fallback to OOOO) | GMT-08:00 |
  46676. * | | Z, ZZ & ZZZ | ISO8601 basic format | -0800 |
  46677. * | | ZZZZ | Long localized GMT format | GMT-8:00 |
  46678. * | | ZZZZZ | ISO8601 extended format + Z indicator for offset 0 (= XXXXX) | -08:00 |
  46679. * | | O, OO & OOO | Short localized GMT format | GMT-8 |
  46680. * | | OOOO | Long localized GMT format | GMT-08:00 |
  46681. *
  46682. *
  46683. * When the expression is a ISO string without time (e.g. 2016-09-19) the time zone offset is not
  46684. * applied and the formatted text will have the same day, month and year of the expression.
  46685. *
  46686. * WARNINGS:
  46687. * - this pipe has only access to en-US locale data by default. If you want to localize the dates
  46688. * in another language, you will have to import data for other locales.
  46689. * See the {\@linkDocs guide/i18n#i18n-pipes "I18n guide"} to know how to import additional locale
  46690. * data.
  46691. * - Fields suffixed with * are only available in the extra dataset.
  46692. * See the {\@linkDocs guide/i18n#i18n-pipes "I18n guide"} to know how to import extra locale
  46693. * data.
  46694. * - this pipe is marked as pure hence it will not be re-evaluated when the input is mutated.
  46695. * Instead users should treat the date as an immutable object and change the reference when the
  46696. * pipe needs to re-run (this is to avoid reformatting the date on every change detection run
  46697. * which would be an expensive operation).
  46698. *
  46699. * ### Examples
  46700. *
  46701. * Assuming `dateObj` is (year: 2015, month: 6, day: 15, hour: 21, minute: 43, second: 11)
  46702. * in the _local_ time and locale is 'en-US':
  46703. *
  46704. * {\@example common/pipes/ts/date_pipe.ts region='DatePipe'}
  46705. *
  46706. * \@stable
  46707. */
  46708. var DatePipe = /** @class */ (function () {
  46709. function DatePipe(locale) {
  46710. this.locale = locale;
  46711. }
  46712. /**
  46713. * @param {?} value
  46714. * @param {?=} format
  46715. * @param {?=} timezone
  46716. * @param {?=} locale
  46717. * @return {?}
  46718. */
  46719. DatePipe.prototype.transform = /**
  46720. * @param {?} value
  46721. * @param {?=} format
  46722. * @param {?=} timezone
  46723. * @param {?=} locale
  46724. * @return {?}
  46725. */
  46726. function (value, format, timezone, locale) {
  46727. if (format === void 0) { format = 'mediumDate'; }
  46728. if (value == null || value === '' || value !== value)
  46729. return null;
  46730. if (typeof value === 'string') {
  46731. value = value.trim();
  46732. }
  46733. var /** @type {?} */ date;
  46734. var /** @type {?} */ match;
  46735. if (isDate$1(value)) {
  46736. date = value;
  46737. }
  46738. else if (!isNaN(value - parseFloat(value))) {
  46739. date = new Date(parseFloat(value));
  46740. }
  46741. else if (typeof value === 'string' && /^(\d{4}-\d{1,2}-\d{1,2})$/.test(value)) {
  46742. /**
  46743. * For ISO Strings without time the day, month and year must be extracted from the ISO String
  46744. * before Date creation to avoid time offset and errors in the new Date.
  46745. * If we only replace '-' with ',' in the ISO String ("2015,01,01"), and try to create a new
  46746. * date, some browsers (e.g. IE 9) will throw an invalid Date error
  46747. * If we leave the '-' ("2015-01-01") and try to create a new Date("2015-01-01") the timeoffset
  46748. * is applied
  46749. * Note: ISO months are 0 for January, 1 for February, ...
  46750. */
  46751. var _a = value.split('-').map(function (val) { return +val; }), y = _a[0], m = _a[1], d = _a[2];
  46752. date = new Date(y, m - 1, d);
  46753. }
  46754. else if ((typeof value === 'string') && (match = value.match(ISO8601_DATE_REGEX))) {
  46755. date = isoStringToDate(match);
  46756. }
  46757. else {
  46758. date = new Date(value);
  46759. }
  46760. if (!isDate$1(date)) {
  46761. throw invalidPipeArgumentError(DatePipe, value);
  46762. }
  46763. return formatDate(date, format, locale || this.locale, timezone);
  46764. };
  46765. DatePipe.decorators = [
  46766. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["S" /* Pipe */], args: [{ name: 'date', pure: true },] },
  46767. ];
  46768. /** @nocollapse */
  46769. DatePipe.ctorParameters = function () { return [
  46770. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["z" /* Inject */], args: [__WEBPACK_IMPORTED_MODULE_0__angular_core__["G" /* LOCALE_ID */],] },] },
  46771. ]; };
  46772. return DatePipe;
  46773. }());
  46774. /**
  46775. * \@internal
  46776. * @param {?} match
  46777. * @return {?}
  46778. */
  46779. function isoStringToDate(match) {
  46780. var /** @type {?} */ date = new Date(0);
  46781. var /** @type {?} */ tzHour = 0;
  46782. var /** @type {?} */ tzMin = 0;
  46783. // match[8] means that the string contains "Z" (UTC) or a timezone like "+01:00" or "+0100"
  46784. var /** @type {?} */ dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;
  46785. var /** @type {?} */ timeSetter = match[8] ? date.setUTCHours : date.setHours;
  46786. // if there is a timezone defined like "+01:00" or "+0100"
  46787. if (match[9]) {
  46788. tzHour = +(match[9] + match[10]);
  46789. tzMin = +(match[9] + match[11]);
  46790. }
  46791. dateSetter.call(date, +(match[1]), +(match[2]) - 1, +(match[3]));
  46792. var /** @type {?} */ h = +(match[4] || '0') - tzHour;
  46793. var /** @type {?} */ m = +(match[5] || '0') - tzMin;
  46794. var /** @type {?} */ s = +(match[6] || '0');
  46795. var /** @type {?} */ ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);
  46796. timeSetter.call(date, h, m, s, ms);
  46797. return date;
  46798. }
  46799. /**
  46800. * @param {?} value
  46801. * @return {?}
  46802. */
  46803. function isDate$1(value) {
  46804. return value instanceof Date && !isNaN(value.valueOf());
  46805. }
  46806. /**
  46807. * @fileoverview added by tsickle
  46808. * @suppress {checkTypes} checked by tsc
  46809. */
  46810. var NumberFormatter = /** @class */ (function () {
  46811. function NumberFormatter() {
  46812. }
  46813. /**
  46814. * @param {?} num
  46815. * @param {?} locale
  46816. * @param {?} style
  46817. * @param {?=} opts
  46818. * @return {?}
  46819. */
  46820. NumberFormatter.format = /**
  46821. * @param {?} num
  46822. * @param {?} locale
  46823. * @param {?} style
  46824. * @param {?=} opts
  46825. * @return {?}
  46826. */
  46827. function (num, locale, style, opts) {
  46828. if (opts === void 0) { opts = {}; }
  46829. var minimumIntegerDigits = opts.minimumIntegerDigits, minimumFractionDigits = opts.minimumFractionDigits, maximumFractionDigits = opts.maximumFractionDigits, currency = opts.currency, _a = opts.currencyAsSymbol, currencyAsSymbol = _a === void 0 ? false : _a;
  46830. var /** @type {?} */ options = {
  46831. minimumIntegerDigits: minimumIntegerDigits,
  46832. minimumFractionDigits: minimumFractionDigits,
  46833. maximumFractionDigits: maximumFractionDigits,
  46834. style: NumberFormatStyle[style].toLowerCase()
  46835. };
  46836. if (style == NumberFormatStyle.Currency) {
  46837. options.currency = typeof currency == 'string' ? currency : undefined;
  46838. options.currencyDisplay = currencyAsSymbol ? 'symbol' : 'code';
  46839. }
  46840. return new Intl.NumberFormat(locale, options).format(num);
  46841. };
  46842. return NumberFormatter;
  46843. }());
  46844. var DATE_FORMATS_SPLIT$1 = /((?:[^yMLdHhmsazZEwGjJ']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|J+|j+|m+|s+|a|z|Z|G+|w+))(.*)/;
  46845. var PATTERN_ALIASES = {
  46846. // Keys are quoted so they do not get renamed during closure compilation.
  46847. 'yMMMdjms': datePartGetterFactory(combine([
  46848. digitCondition('year', 1),
  46849. nameCondition('month', 3),
  46850. digitCondition('day', 1),
  46851. digitCondition('hour', 1),
  46852. digitCondition('minute', 1),
  46853. digitCondition('second', 1),
  46854. ])),
  46855. 'yMdjm': datePartGetterFactory(combine([
  46856. digitCondition('year', 1), digitCondition('month', 1), digitCondition('day', 1),
  46857. digitCondition('hour', 1), digitCondition('minute', 1)
  46858. ])),
  46859. 'yMMMMEEEEd': datePartGetterFactory(combine([
  46860. digitCondition('year', 1), nameCondition('month', 4), nameCondition('weekday', 4),
  46861. digitCondition('day', 1)
  46862. ])),
  46863. 'yMMMMd': datePartGetterFactory(combine([digitCondition('year', 1), nameCondition('month', 4), digitCondition('day', 1)])),
  46864. 'yMMMd': datePartGetterFactory(combine([digitCondition('year', 1), nameCondition('month', 3), digitCondition('day', 1)])),
  46865. 'yMd': datePartGetterFactory(combine([digitCondition('year', 1), digitCondition('month', 1), digitCondition('day', 1)])),
  46866. 'jms': datePartGetterFactory(combine([digitCondition('hour', 1), digitCondition('second', 1), digitCondition('minute', 1)])),
  46867. 'jm': datePartGetterFactory(combine([digitCondition('hour', 1), digitCondition('minute', 1)]))
  46868. };
  46869. var DATE_FORMATS$1 = {
  46870. // Keys are quoted so they do not get renamed.
  46871. 'yyyy': datePartGetterFactory(digitCondition('year', 4)),
  46872. 'yy': datePartGetterFactory(digitCondition('year', 2)),
  46873. 'y': datePartGetterFactory(digitCondition('year', 1)),
  46874. 'MMMM': datePartGetterFactory(nameCondition('month', 4)),
  46875. 'MMM': datePartGetterFactory(nameCondition('month', 3)),
  46876. 'MM': datePartGetterFactory(digitCondition('month', 2)),
  46877. 'M': datePartGetterFactory(digitCondition('month', 1)),
  46878. 'LLLL': datePartGetterFactory(nameCondition('month', 4)),
  46879. 'L': datePartGetterFactory(nameCondition('month', 1)),
  46880. 'dd': datePartGetterFactory(digitCondition('day', 2)),
  46881. 'd': datePartGetterFactory(digitCondition('day', 1)),
  46882. 'HH': digitModifier(hourExtractor(datePartGetterFactory(hour12Modify(digitCondition('hour', 2), false)))),
  46883. 'H': hourExtractor(datePartGetterFactory(hour12Modify(digitCondition('hour', 1), false))),
  46884. 'hh': digitModifier(hourExtractor(datePartGetterFactory(hour12Modify(digitCondition('hour', 2), true)))),
  46885. 'h': hourExtractor(datePartGetterFactory(hour12Modify(digitCondition('hour', 1), true))),
  46886. 'jj': datePartGetterFactory(digitCondition('hour', 2)),
  46887. 'j': datePartGetterFactory(digitCondition('hour', 1)),
  46888. 'mm': digitModifier(datePartGetterFactory(digitCondition('minute', 2))),
  46889. 'm': datePartGetterFactory(digitCondition('minute', 1)),
  46890. 'ss': digitModifier(datePartGetterFactory(digitCondition('second', 2))),
  46891. 's': datePartGetterFactory(digitCondition('second', 1)),
  46892. // while ISO 8601 requires fractions to be prefixed with `.` or `,`
  46893. // we can be just safely rely on using `sss` since we currently don't support single or two digit
  46894. // fractions
  46895. 'sss': datePartGetterFactory(digitCondition('second', 3)),
  46896. 'EEEE': datePartGetterFactory(nameCondition('weekday', 4)),
  46897. 'EEE': datePartGetterFactory(nameCondition('weekday', 3)),
  46898. 'EE': datePartGetterFactory(nameCondition('weekday', 2)),
  46899. 'E': datePartGetterFactory(nameCondition('weekday', 1)),
  46900. 'a': hourClockExtractor(datePartGetterFactory(hour12Modify(digitCondition('hour', 1), true))),
  46901. 'Z': timeZoneGetter$1('short'),
  46902. 'z': timeZoneGetter$1('long'),
  46903. 'ww': datePartGetterFactory({}),
  46904. // Week of year, padded (00-53). Week 01 is the week with the
  46905. // first Thursday of the year. not support ?
  46906. 'w': datePartGetterFactory({}),
  46907. // Week of year (0-53). Week 1 is the week with the first Thursday
  46908. // of the year not support ?
  46909. 'G': datePartGetterFactory(nameCondition('era', 1)),
  46910. 'GG': datePartGetterFactory(nameCondition('era', 2)),
  46911. 'GGG': datePartGetterFactory(nameCondition('era', 3)),
  46912. 'GGGG': datePartGetterFactory(nameCondition('era', 4))
  46913. };
  46914. /**
  46915. * @param {?} inner
  46916. * @return {?}
  46917. */
  46918. function digitModifier(inner) {
  46919. return function (date, locale) {
  46920. var /** @type {?} */ result = inner(date, locale);
  46921. return result.length == 1 ? '0' + result : result;
  46922. };
  46923. }
  46924. /**
  46925. * @param {?} inner
  46926. * @return {?}
  46927. */
  46928. function hourClockExtractor(inner) {
  46929. return function (date, locale) { return inner(date, locale).split(' ')[1]; };
  46930. }
  46931. /**
  46932. * @param {?} inner
  46933. * @return {?}
  46934. */
  46935. function hourExtractor(inner) {
  46936. return function (date, locale) { return inner(date, locale).split(' ')[0]; };
  46937. }
  46938. /**
  46939. * @param {?} date
  46940. * @param {?} locale
  46941. * @param {?} options
  46942. * @return {?}
  46943. */
  46944. function intlDateFormat(date, locale, options) {
  46945. return new Intl.DateTimeFormat(locale, options).format(date).replace(/[\u200e\u200f]/g, '');
  46946. }
  46947. /**
  46948. * @param {?} timezone
  46949. * @return {?}
  46950. */
  46951. function timeZoneGetter$1(timezone) {
  46952. // To workaround `Intl` API restriction for single timezone let format with 24 hours
  46953. var /** @type {?} */ options = { hour: '2-digit', hour12: false, timeZoneName: timezone };
  46954. return function (date, locale) {
  46955. var /** @type {?} */ result = intlDateFormat(date, locale, options);
  46956. // Then extract first 3 letters that related to hours
  46957. return result ? result.substring(3) : '';
  46958. };
  46959. }
  46960. /**
  46961. * @param {?} options
  46962. * @param {?} value
  46963. * @return {?}
  46964. */
  46965. function hour12Modify(options, value) {
  46966. options.hour12 = value;
  46967. return options;
  46968. }
  46969. /**
  46970. * @param {?} prop
  46971. * @param {?} len
  46972. * @return {?}
  46973. */
  46974. function digitCondition(prop, len) {
  46975. var /** @type {?} */ result = {};
  46976. result[prop] = len === 2 ? '2-digit' : 'numeric';
  46977. return result;
  46978. }
  46979. /**
  46980. * @param {?} prop
  46981. * @param {?} len
  46982. * @return {?}
  46983. */
  46984. function nameCondition(prop, len) {
  46985. var /** @type {?} */ result = {};
  46986. if (len < 4) {
  46987. result[prop] = len > 1 ? 'short' : 'narrow';
  46988. }
  46989. else {
  46990. result[prop] = 'long';
  46991. }
  46992. return result;
  46993. }
  46994. /**
  46995. * @param {?} options
  46996. * @return {?}
  46997. */
  46998. function combine(options) {
  46999. return options.reduce(function (merged, opt) { return (Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["a" /* __assign */])({}, merged, opt)); }, {});
  47000. }
  47001. /**
  47002. * @param {?} ret
  47003. * @return {?}
  47004. */
  47005. function datePartGetterFactory(ret) {
  47006. return function (date, locale) { return intlDateFormat(date, locale, ret); };
  47007. }
  47008. var DATE_FORMATTER_CACHE = new Map();
  47009. /**
  47010. * @param {?} format
  47011. * @param {?} date
  47012. * @param {?} locale
  47013. * @return {?}
  47014. */
  47015. function dateFormatter(format, date, locale) {
  47016. var /** @type {?} */ fn = PATTERN_ALIASES[format];
  47017. if (fn)
  47018. return fn(date, locale);
  47019. var /** @type {?} */ cacheKey = format;
  47020. var /** @type {?} */ parts = DATE_FORMATTER_CACHE.get(cacheKey);
  47021. if (!parts) {
  47022. parts = [];
  47023. var /** @type {?} */ match = void 0;
  47024. DATE_FORMATS_SPLIT$1.exec(format);
  47025. var /** @type {?} */ _format = format;
  47026. while (_format) {
  47027. match = DATE_FORMATS_SPLIT$1.exec(_format);
  47028. if (match) {
  47029. parts = parts.concat(match.slice(1));
  47030. _format = /** @type {?} */ ((parts.pop()));
  47031. }
  47032. else {
  47033. parts.push(_format);
  47034. _format = null;
  47035. }
  47036. }
  47037. DATE_FORMATTER_CACHE.set(cacheKey, parts);
  47038. }
  47039. return parts.reduce(function (text, part) {
  47040. var /** @type {?} */ fn = DATE_FORMATS$1[part];
  47041. return text + (fn ? fn(date, locale) : partToTime(part));
  47042. }, '');
  47043. }
  47044. /**
  47045. * @param {?} part
  47046. * @return {?}
  47047. */
  47048. function partToTime(part) {
  47049. return part === '\'\'' ? '\'' : part.replace(/(^'|'$)/g, '').replace(/''/g, '\'');
  47050. }
  47051. var DateFormatter = /** @class */ (function () {
  47052. function DateFormatter() {
  47053. }
  47054. /**
  47055. * @param {?} date
  47056. * @param {?} locale
  47057. * @param {?} pattern
  47058. * @return {?}
  47059. */
  47060. DateFormatter.format = /**
  47061. * @param {?} date
  47062. * @param {?} locale
  47063. * @param {?} pattern
  47064. * @return {?}
  47065. */
  47066. function (date, locale, pattern) {
  47067. return dateFormatter(pattern, date, locale);
  47068. };
  47069. return DateFormatter;
  47070. }());
  47071. /**
  47072. * @fileoverview added by tsickle
  47073. * @suppress {checkTypes} checked by tsc
  47074. */
  47075. /**
  47076. * @license
  47077. * Copyright Google Inc. All Rights Reserved.
  47078. *
  47079. * Use of this source code is governed by an MIT-style license that can be
  47080. * found in the LICENSE file at https://angular.io/license
  47081. */
  47082. /**
  47083. * \@ngModule CommonModule
  47084. * \@whatItDoes Formats a date according to locale rules.
  47085. * \@howToUse `date_expression | date[:format]`
  47086. * \@description
  47087. *
  47088. * Where:
  47089. * - `expression` is a date object or a number (milliseconds since UTC epoch) or an ISO string
  47090. * (https://www.w3.org/TR/NOTE-datetime).
  47091. * - `format` indicates which date/time components to include. The format can be predefined as
  47092. * shown below or custom as shown in the table.
  47093. * - `'medium'`: equivalent to `'yMMMdjms'` (e.g. `Sep 3, 2010, 12:05:08 PM` for `en-US`)
  47094. * - `'short'`: equivalent to `'yMdjm'` (e.g. `9/3/2010, 12:05 PM` for `en-US`)
  47095. * - `'fullDate'`: equivalent to `'yMMMMEEEEd'` (e.g. `Friday, September 3, 2010` for `en-US`)
  47096. * - `'longDate'`: equivalent to `'yMMMMd'` (e.g. `September 3, 2010` for `en-US`)
  47097. * - `'mediumDate'`: equivalent to `'yMMMd'` (e.g. `Sep 3, 2010` for `en-US`)
  47098. * - `'shortDate'`: equivalent to `'yMd'` (e.g. `9/3/2010` for `en-US`)
  47099. * - `'mediumTime'`: equivalent to `'jms'` (e.g. `12:05:08 PM` for `en-US`)
  47100. * - `'shortTime'`: equivalent to `'jm'` (e.g. `12:05 PM` for `en-US`)
  47101. *
  47102. *
  47103. * | Component | Symbol | Narrow | Short Form | Long Form | Numeric | 2-digit |
  47104. * |-----------|:------:|--------|--------------|-------------------|-----------|-----------|
  47105. * | era | G | G (A) | GGG (AD) | GGGG (Anno Domini)| - | - |
  47106. * | year | y | - | - | - | y (2015) | yy (15) |
  47107. * | month | M | L (S) | MMM (Sep) | MMMM (September) | M (9) | MM (09) |
  47108. * | day | d | - | - | - | d (3) | dd (03) |
  47109. * | weekday | E | E (S) | EEE (Sun) | EEEE (Sunday) | - | - |
  47110. * | hour | j | - | - | - | j (13) | jj (13) |
  47111. * | hour12 | h | - | - | - | h (1 PM) | hh (01 PM)|
  47112. * | hour24 | H | - | - | - | H (13) | HH (13) |
  47113. * | minute | m | - | - | - | m (5) | mm (05) |
  47114. * | second | s | - | - | - | s (9) | ss (09) |
  47115. * | timezone | z | - | - | z (Pacific Standard Time)| - | - |
  47116. * | timezone | Z | - | Z (GMT-8:00) | - | - | - |
  47117. * | timezone | a | - | a (PM) | - | - | - |
  47118. *
  47119. * In javascript, only the components specified will be respected (not the ordering,
  47120. * punctuations, ...) and details of the formatting will be dependent on the locale.
  47121. *
  47122. * Timezone of the formatted text will be the local system timezone of the end-user's machine.
  47123. *
  47124. * When the expression is a ISO string without time (e.g. 2016-09-19) the time zone offset is not
  47125. * applied and the formatted text will have the same day, month and year of the expression.
  47126. *
  47127. * WARNINGS:
  47128. * - this pipe is marked as pure hence it will not be re-evaluated when the input is mutated.
  47129. * Instead users should treat the date as an immutable object and change the reference when the
  47130. * pipe needs to re-run (this is to avoid reformatting the date on every change detection run
  47131. * which would be an expensive operation).
  47132. * - this pipe uses the Internationalization API. Therefore it is only reliable in Chrome and Opera
  47133. * browsers.
  47134. *
  47135. * ### Examples
  47136. *
  47137. * Assuming `dateObj` is (year: 2010, month: 9, day: 3, hour: 12 PM, minute: 05, second: 08)
  47138. * in the _local_ time and locale is 'en-US':
  47139. *
  47140. * {\@example common/pipes/ts/date_pipe.ts region='DeprecatedDatePipe'}
  47141. *
  47142. * \@stable
  47143. */
  47144. var DeprecatedDatePipe = /** @class */ (function () {
  47145. function DeprecatedDatePipe(_locale) {
  47146. this._locale = _locale;
  47147. }
  47148. /**
  47149. * @param {?} value
  47150. * @param {?=} pattern
  47151. * @return {?}
  47152. */
  47153. DeprecatedDatePipe.prototype.transform = /**
  47154. * @param {?} value
  47155. * @param {?=} pattern
  47156. * @return {?}
  47157. */
  47158. function (value, pattern) {
  47159. if (pattern === void 0) { pattern = 'mediumDate'; }
  47160. if (value == null || value === '' || value !== value)
  47161. return null;
  47162. var /** @type {?} */ date;
  47163. if (typeof value === 'string') {
  47164. value = value.trim();
  47165. }
  47166. if (isDate(value)) {
  47167. date = value;
  47168. }
  47169. else if (!isNaN(value - parseFloat(value))) {
  47170. date = new Date(parseFloat(value));
  47171. }
  47172. else if (typeof value === 'string' && /^(\d{4}-\d{1,2}-\d{1,2})$/.test(value)) {
  47173. /**
  47174. * For ISO Strings without time the day, month and year must be extracted from the ISO String
  47175. * before Date creation to avoid time offset and errors in the new Date.
  47176. * If we only replace '-' with ',' in the ISO String ("2015,01,01"), and try to create a new
  47177. * date, some browsers (e.g. IE 9) will throw an invalid Date error
  47178. * If we leave the '-' ("2015-01-01") and try to create a new Date("2015-01-01") the
  47179. * timeoffset
  47180. * is applied
  47181. * Note: ISO months are 0 for January, 1 for February, ...
  47182. */
  47183. var _a = value.split('-').map(function (val) { return parseInt(val, 10); }), y = _a[0], m = _a[1], d = _a[2];
  47184. date = new Date(y, m - 1, d);
  47185. }
  47186. else {
  47187. date = new Date(value);
  47188. }
  47189. if (!isDate(date)) {
  47190. var /** @type {?} */ match = void 0;
  47191. if ((typeof value === 'string') && (match = value.match(ISO8601_DATE_REGEX))) {
  47192. date = isoStringToDate(match);
  47193. }
  47194. else {
  47195. throw invalidPipeArgumentError(DeprecatedDatePipe, value);
  47196. }
  47197. }
  47198. return DateFormatter.format(date, this._locale, DeprecatedDatePipe._ALIASES[pattern] || pattern);
  47199. };
  47200. /**
  47201. * \@internal
  47202. */
  47203. DeprecatedDatePipe._ALIASES = {
  47204. 'medium': 'yMMMdjms',
  47205. 'short': 'yMdjm',
  47206. 'fullDate': 'yMMMMEEEEd',
  47207. 'longDate': 'yMMMMd',
  47208. 'mediumDate': 'yMMMd',
  47209. 'shortDate': 'yMd',
  47210. 'mediumTime': 'jms',
  47211. 'shortTime': 'jm'
  47212. };
  47213. DeprecatedDatePipe.decorators = [
  47214. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["S" /* Pipe */], args: [{ name: 'date', pure: true },] },
  47215. ];
  47216. /** @nocollapse */
  47217. DeprecatedDatePipe.ctorParameters = function () { return [
  47218. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["z" /* Inject */], args: [__WEBPACK_IMPORTED_MODULE_0__angular_core__["G" /* LOCALE_ID */],] },] },
  47219. ]; };
  47220. return DeprecatedDatePipe;
  47221. }());
  47222. /**
  47223. * @param {?} value
  47224. * @return {?}
  47225. */
  47226. function isDate(value) {
  47227. return value instanceof Date && !isNaN(value.valueOf());
  47228. }
  47229. /**
  47230. * @fileoverview added by tsickle
  47231. * @suppress {checkTypes} checked by tsc
  47232. */
  47233. /**
  47234. * @license
  47235. * Copyright Google Inc. All Rights Reserved.
  47236. *
  47237. * Use of this source code is governed by an MIT-style license that can be
  47238. * found in the LICENSE file at https://angular.io/license
  47239. */
  47240. var NUMBER_FORMAT_REGEXP = /^(\d+)?\.((\d+)(-(\d+))?)?$/;
  47241. var MAX_DIGITS = 22;
  47242. var DECIMAL_SEP = '.';
  47243. var ZERO_CHAR = '0';
  47244. var PATTERN_SEP = ';';
  47245. var GROUP_SEP = ',';
  47246. var DIGIT_CHAR = '#';
  47247. var CURRENCY_CHAR = '¤';
  47248. var PERCENT_CHAR = '%';
  47249. /**
  47250. * Transform a number to a locale string based on a style and a format
  47251. *
  47252. * \@internal
  47253. * @param {?} value
  47254. * @param {?} locale
  47255. * @param {?} style
  47256. * @param {?=} digitsInfo
  47257. * @param {?=} currency
  47258. * @return {?}
  47259. */
  47260. function formatNumber$1(value, locale, style, digitsInfo, currency) {
  47261. if (currency === void 0) { currency = null; }
  47262. var /** @type {?} */ res = { str: null };
  47263. var /** @type {?} */ format = getLocaleNumberFormat(locale, style);
  47264. var /** @type {?} */ num;
  47265. // Convert strings to numbers
  47266. if (typeof value === 'string' && !isNaN(+value - parseFloat(value))) {
  47267. num = +value;
  47268. }
  47269. else if (typeof value !== 'number') {
  47270. res.error = value + " is not a number";
  47271. return res;
  47272. }
  47273. else {
  47274. num = value;
  47275. }
  47276. var /** @type {?} */ pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
  47277. var /** @type {?} */ formattedText = '';
  47278. var /** @type {?} */ isZero = false;
  47279. if (!isFinite(num)) {
  47280. formattedText = getLocaleNumberSymbol(locale, NumberSymbol.Infinity);
  47281. }
  47282. else {
  47283. var /** @type {?} */ parsedNumber = parseNumber(num);
  47284. if (style === NumberFormatStyle.Percent) {
  47285. parsedNumber = toPercent(parsedNumber);
  47286. }
  47287. var /** @type {?} */ minInt = pattern.minInt;
  47288. var /** @type {?} */ minFraction = pattern.minFrac;
  47289. var /** @type {?} */ maxFraction = pattern.maxFrac;
  47290. if (digitsInfo) {
  47291. var /** @type {?} */ parts = digitsInfo.match(NUMBER_FORMAT_REGEXP);
  47292. if (parts === null) {
  47293. res.error = digitsInfo + " is not a valid digit info";
  47294. return res;
  47295. }
  47296. var /** @type {?} */ minIntPart = parts[1];
  47297. var /** @type {?} */ minFractionPart = parts[3];
  47298. var /** @type {?} */ maxFractionPart = parts[5];
  47299. if (minIntPart != null) {
  47300. minInt = parseIntAutoRadix(minIntPart);
  47301. }
  47302. if (minFractionPart != null) {
  47303. minFraction = parseIntAutoRadix(minFractionPart);
  47304. }
  47305. if (maxFractionPart != null) {
  47306. maxFraction = parseIntAutoRadix(maxFractionPart);
  47307. }
  47308. else if (minFractionPart != null && minFraction > maxFraction) {
  47309. maxFraction = minFraction;
  47310. }
  47311. }
  47312. roundNumber(parsedNumber, minFraction, maxFraction);
  47313. var /** @type {?} */ digits = parsedNumber.digits;
  47314. var /** @type {?} */ integerLen = parsedNumber.integerLen;
  47315. var /** @type {?} */ exponent = parsedNumber.exponent;
  47316. var /** @type {?} */ decimals = [];
  47317. isZero = digits.every(function (d) { return !d; });
  47318. // pad zeros for small numbers
  47319. for (; integerLen < minInt; integerLen++) {
  47320. digits.unshift(0);
  47321. }
  47322. // pad zeros for small numbers
  47323. for (; integerLen < 0; integerLen++) {
  47324. digits.unshift(0);
  47325. }
  47326. // extract decimals digits
  47327. if (integerLen > 0) {
  47328. decimals = digits.splice(integerLen, digits.length);
  47329. }
  47330. else {
  47331. decimals = digits;
  47332. digits = [0];
  47333. }
  47334. // format the integer digits with grouping separators
  47335. var /** @type {?} */ groups = [];
  47336. if (digits.length >= pattern.lgSize) {
  47337. groups.unshift(digits.splice(-pattern.lgSize, digits.length).join(''));
  47338. }
  47339. while (digits.length > pattern.gSize) {
  47340. groups.unshift(digits.splice(-pattern.gSize, digits.length).join(''));
  47341. }
  47342. if (digits.length) {
  47343. groups.unshift(digits.join(''));
  47344. }
  47345. var /** @type {?} */ groupSymbol = currency ? NumberSymbol.CurrencyGroup : NumberSymbol.Group;
  47346. formattedText = groups.join(getLocaleNumberSymbol(locale, groupSymbol));
  47347. // append the decimal digits
  47348. if (decimals.length) {
  47349. var /** @type {?} */ decimalSymbol = currency ? NumberSymbol.CurrencyDecimal : NumberSymbol.Decimal;
  47350. formattedText += getLocaleNumberSymbol(locale, decimalSymbol) + decimals.join('');
  47351. }
  47352. if (exponent) {
  47353. formattedText += getLocaleNumberSymbol(locale, NumberSymbol.Exponential) + '+' + exponent;
  47354. }
  47355. }
  47356. if (num < 0 && !isZero) {
  47357. formattedText = pattern.negPre + formattedText + pattern.negSuf;
  47358. }
  47359. else {
  47360. formattedText = pattern.posPre + formattedText + pattern.posSuf;
  47361. }
  47362. if (style === NumberFormatStyle.Currency && currency !== null) {
  47363. res.str = formattedText
  47364. .replace(CURRENCY_CHAR, currency)
  47365. .replace(CURRENCY_CHAR, '');
  47366. return res;
  47367. }
  47368. if (style === NumberFormatStyle.Percent) {
  47369. res.str = formattedText.replace(new RegExp(PERCENT_CHAR, 'g'), getLocaleNumberSymbol(locale, NumberSymbol.PercentSign));
  47370. return res;
  47371. }
  47372. res.str = formattedText;
  47373. return res;
  47374. }
  47375. /**
  47376. * @param {?} format
  47377. * @param {?=} minusSign
  47378. * @return {?}
  47379. */
  47380. function parseNumberFormat(format, minusSign) {
  47381. if (minusSign === void 0) { minusSign = '-'; }
  47382. var /** @type {?} */ p = {
  47383. minInt: 1,
  47384. minFrac: 0,
  47385. maxFrac: 0,
  47386. posPre: '',
  47387. posSuf: '',
  47388. negPre: '',
  47389. negSuf: '',
  47390. gSize: 0,
  47391. lgSize: 0
  47392. };
  47393. var /** @type {?} */ patternParts = format.split(PATTERN_SEP);
  47394. var /** @type {?} */ positive = patternParts[0];
  47395. var /** @type {?} */ negative = patternParts[1];
  47396. var /** @type {?} */ positiveParts = positive.indexOf(DECIMAL_SEP) !== -1 ?
  47397. positive.split(DECIMAL_SEP) :
  47398. [
  47399. positive.substring(0, positive.lastIndexOf(ZERO_CHAR) + 1),
  47400. positive.substring(positive.lastIndexOf(ZERO_CHAR) + 1)
  47401. ], /** @type {?} */
  47402. integer = positiveParts[0], /** @type {?} */ fraction = positiveParts[1] || '';
  47403. p.posPre = integer.substr(0, integer.indexOf(DIGIT_CHAR));
  47404. for (var /** @type {?} */ i = 0; i < fraction.length; i++) {
  47405. var /** @type {?} */ ch = fraction.charAt(i);
  47406. if (ch === ZERO_CHAR) {
  47407. p.minFrac = p.maxFrac = i + 1;
  47408. }
  47409. else if (ch === DIGIT_CHAR) {
  47410. p.maxFrac = i + 1;
  47411. }
  47412. else {
  47413. p.posSuf += ch;
  47414. }
  47415. }
  47416. var /** @type {?} */ groups = integer.split(GROUP_SEP);
  47417. p.gSize = groups[1] ? groups[1].length : 0;
  47418. p.lgSize = (groups[2] || groups[1]) ? (groups[2] || groups[1]).length : 0;
  47419. if (negative) {
  47420. var /** @type {?} */ trunkLen = positive.length - p.posPre.length - p.posSuf.length, /** @type {?} */
  47421. pos = negative.indexOf(DIGIT_CHAR);
  47422. p.negPre = negative.substr(0, pos).replace(/'/g, '');
  47423. p.negSuf = negative.substr(pos + trunkLen).replace(/'/g, '');
  47424. }
  47425. else {
  47426. p.negPre = minusSign + p.posPre;
  47427. p.negSuf = p.posSuf;
  47428. }
  47429. return p;
  47430. }
  47431. /**
  47432. * @param {?} parsedNumber
  47433. * @return {?}
  47434. */
  47435. function toPercent(parsedNumber) {
  47436. // if the number is 0, don't do anything
  47437. if (parsedNumber.digits[0] === 0) {
  47438. return parsedNumber;
  47439. }
  47440. // Getting the current number of decimals
  47441. var /** @type {?} */ fractionLen = parsedNumber.digits.length - parsedNumber.integerLen;
  47442. if (parsedNumber.exponent) {
  47443. parsedNumber.exponent += 2;
  47444. }
  47445. else {
  47446. if (fractionLen === 0) {
  47447. parsedNumber.digits.push(0, 0);
  47448. }
  47449. else if (fractionLen === 1) {
  47450. parsedNumber.digits.push(0);
  47451. }
  47452. parsedNumber.integerLen += 2;
  47453. }
  47454. return parsedNumber;
  47455. }
  47456. /**
  47457. * Parses a number.
  47458. * Significant bits of this parse algorithm came from https://github.com/MikeMcl/big.js/
  47459. * @param {?} num
  47460. * @return {?}
  47461. */
  47462. function parseNumber(num) {
  47463. var /** @type {?} */ numStr = Math.abs(num) + '';
  47464. var /** @type {?} */ exponent = 0, /** @type {?} */ digits, /** @type {?} */ integerLen;
  47465. var /** @type {?} */ i, /** @type {?} */ j, /** @type {?} */ zeros;
  47466. // Decimal point?
  47467. if ((integerLen = numStr.indexOf(DECIMAL_SEP)) > -1) {
  47468. numStr = numStr.replace(DECIMAL_SEP, '');
  47469. }
  47470. // Exponential form?
  47471. if ((i = numStr.search(/e/i)) > 0) {
  47472. // Work out the exponent.
  47473. if (integerLen < 0)
  47474. integerLen = i;
  47475. integerLen += +numStr.slice(i + 1);
  47476. numStr = numStr.substring(0, i);
  47477. }
  47478. else if (integerLen < 0) {
  47479. // There was no decimal point or exponent so it is an integer.
  47480. integerLen = numStr.length;
  47481. }
  47482. // Count the number of leading zeros.
  47483. for (i = 0; numStr.charAt(i) === ZERO_CHAR; i++) {
  47484. /* empty */
  47485. }
  47486. if (i === (zeros = numStr.length)) {
  47487. // The digits are all zero.
  47488. digits = [0];
  47489. integerLen = 1;
  47490. }
  47491. else {
  47492. // Count the number of trailing zeros
  47493. zeros--;
  47494. while (numStr.charAt(zeros) === ZERO_CHAR)
  47495. zeros--;
  47496. // Trailing zeros are insignificant so ignore them
  47497. integerLen -= i;
  47498. digits = [];
  47499. // Convert string to array of digits without leading/trailing zeros.
  47500. for (j = 0; i <= zeros; i++, j++) {
  47501. digits[j] = +numStr.charAt(i);
  47502. }
  47503. }
  47504. // If the number overflows the maximum allowed digits then use an exponent.
  47505. if (integerLen > MAX_DIGITS) {
  47506. digits = digits.splice(0, MAX_DIGITS - 1);
  47507. exponent = integerLen - 1;
  47508. integerLen = 1;
  47509. }
  47510. return { digits: digits, exponent: exponent, integerLen: integerLen };
  47511. }
  47512. /**
  47513. * Round the parsed number to the specified number of decimal places
  47514. * This function changes the parsedNumber in-place
  47515. * @param {?} parsedNumber
  47516. * @param {?} minFrac
  47517. * @param {?} maxFrac
  47518. * @return {?}
  47519. */
  47520. function roundNumber(parsedNumber, minFrac, maxFrac) {
  47521. if (minFrac > maxFrac) {
  47522. throw new Error("The minimum number of digits after fraction (" + minFrac + ") is higher than the maximum (" + maxFrac + ").");
  47523. }
  47524. var /** @type {?} */ digits = parsedNumber.digits;
  47525. var /** @type {?} */ fractionLen = digits.length - parsedNumber.integerLen;
  47526. var /** @type {?} */ fractionSize = Math.min(Math.max(minFrac, fractionLen), maxFrac);
  47527. // The index of the digit to where rounding is to occur
  47528. var /** @type {?} */ roundAt = fractionSize + parsedNumber.integerLen;
  47529. var /** @type {?} */ digit = digits[roundAt];
  47530. if (roundAt > 0) {
  47531. // Drop fractional digits beyond `roundAt`
  47532. digits.splice(Math.max(parsedNumber.integerLen, roundAt));
  47533. // Set non-fractional digits beyond `roundAt` to 0
  47534. for (var /** @type {?} */ j = roundAt; j < digits.length; j++) {
  47535. digits[j] = 0;
  47536. }
  47537. }
  47538. else {
  47539. // We rounded to zero so reset the parsedNumber
  47540. fractionLen = Math.max(0, fractionLen);
  47541. parsedNumber.integerLen = 1;
  47542. digits.length = Math.max(1, roundAt = fractionSize + 1);
  47543. digits[0] = 0;
  47544. for (var /** @type {?} */ i = 1; i < roundAt; i++)
  47545. digits[i] = 0;
  47546. }
  47547. if (digit >= 5) {
  47548. if (roundAt - 1 < 0) {
  47549. for (var /** @type {?} */ k = 0; k > roundAt; k--) {
  47550. digits.unshift(0);
  47551. parsedNumber.integerLen++;
  47552. }
  47553. digits.unshift(1);
  47554. parsedNumber.integerLen++;
  47555. }
  47556. else {
  47557. digits[roundAt - 1]++;
  47558. }
  47559. }
  47560. // Pad out with zeros to get the required fraction length
  47561. for (; fractionLen < Math.max(0, fractionSize); fractionLen++)
  47562. digits.push(0);
  47563. var /** @type {?} */ dropTrailingZeros = fractionSize !== 0;
  47564. // Minimal length = nb of decimals required + current nb of integers
  47565. // Any number besides that is optional and can be removed if it's a trailing 0
  47566. var /** @type {?} */ minLen = minFrac + parsedNumber.integerLen;
  47567. // Do any carrying, e.g. a digit was rounded up to 10
  47568. var /** @type {?} */ carry = digits.reduceRight(function (carry, d, i, digits) {
  47569. d = d + carry;
  47570. digits[i] = d < 10 ? d : d - 10; // d % 10
  47571. if (dropTrailingZeros) {
  47572. // Do not keep meaningless fractional trailing zeros (e.g. 15.52000 --> 15.52)
  47573. if (digits[i] === 0 && i >= minLen) {
  47574. digits.pop();
  47575. }
  47576. else {
  47577. dropTrailingZeros = false;
  47578. }
  47579. }
  47580. return d >= 10 ? 1 : 0; // Math.floor(d / 10);
  47581. }, 0);
  47582. if (carry) {
  47583. digits.unshift(carry);
  47584. parsedNumber.integerLen++;
  47585. }
  47586. }
  47587. /**
  47588. * \@internal
  47589. * @param {?} text
  47590. * @return {?}
  47591. */
  47592. function parseIntAutoRadix(text) {
  47593. var /** @type {?} */ result = parseInt(text);
  47594. if (isNaN(result)) {
  47595. throw new Error('Invalid integer literal when parsing ' + text);
  47596. }
  47597. return result;
  47598. }
  47599. /**
  47600. * @fileoverview added by tsickle
  47601. * @suppress {checkTypes} checked by tsc
  47602. */
  47603. /**
  47604. * @license
  47605. * Copyright Google Inc. All Rights Reserved.
  47606. *
  47607. * Use of this source code is governed by an MIT-style license that can be
  47608. * found in the LICENSE file at https://angular.io/license
  47609. */
  47610. /**
  47611. * @param {?} pipe
  47612. * @param {?} locale
  47613. * @param {?} value
  47614. * @param {?} style
  47615. * @param {?=} digits
  47616. * @param {?=} currency
  47617. * @param {?=} currencyAsSymbol
  47618. * @return {?}
  47619. */
  47620. function formatNumber(pipe, locale, value, style, digits, currency, currencyAsSymbol) {
  47621. if (currency === void 0) { currency = null; }
  47622. if (currencyAsSymbol === void 0) { currencyAsSymbol = false; }
  47623. if (value == null)
  47624. return null;
  47625. // Convert strings to numbers
  47626. value = typeof value === 'string' && !isNaN(+value - parseFloat(value)) ? +value : value;
  47627. if (typeof value !== 'number') {
  47628. throw invalidPipeArgumentError(pipe, value);
  47629. }
  47630. var /** @type {?} */ minInt;
  47631. var /** @type {?} */ minFraction;
  47632. var /** @type {?} */ maxFraction;
  47633. if (style !== NumberFormatStyle.Currency) {
  47634. // rely on Intl default for currency
  47635. minInt = 1;
  47636. minFraction = 0;
  47637. maxFraction = 3;
  47638. }
  47639. if (digits) {
  47640. var /** @type {?} */ parts = digits.match(NUMBER_FORMAT_REGEXP);
  47641. if (parts === null) {
  47642. throw new Error(digits + " is not a valid digit info for number pipes");
  47643. }
  47644. if (parts[1] != null) {
  47645. // min integer digits
  47646. minInt = parseIntAutoRadix(parts[1]);
  47647. }
  47648. if (parts[3] != null) {
  47649. // min fraction digits
  47650. minFraction = parseIntAutoRadix(parts[3]);
  47651. }
  47652. if (parts[5] != null) {
  47653. // max fraction digits
  47654. maxFraction = parseIntAutoRadix(parts[5]);
  47655. }
  47656. }
  47657. return NumberFormatter.format(/** @type {?} */ (value), locale, style, {
  47658. minimumIntegerDigits: minInt,
  47659. minimumFractionDigits: minFraction,
  47660. maximumFractionDigits: maxFraction,
  47661. currency: currency,
  47662. currencyAsSymbol: currencyAsSymbol,
  47663. });
  47664. }
  47665. /**
  47666. * \@ngModule CommonModule
  47667. * \@whatItDoes Formats a number according to locale rules.
  47668. * \@howToUse `number_expression | number[:digitInfo]`
  47669. *
  47670. * Formats a number as text. Group sizing and separator and other locale-specific
  47671. * configurations are based on the active locale.
  47672. *
  47673. * where `expression` is a number:
  47674. * - `digitInfo` is a `string` which has a following format: <br>
  47675. * <code>{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}</code>
  47676. * - `minIntegerDigits` is the minimum number of integer digits to use. Defaults to `1`.
  47677. * - `minFractionDigits` is the minimum number of digits after fraction. Defaults to `0`.
  47678. * - `maxFractionDigits` is the maximum number of digits after fraction. Defaults to `3`.
  47679. *
  47680. * For more information on the acceptable range for each of these numbers and other
  47681. * details see your native internationalization library.
  47682. *
  47683. * WARNING: this pipe uses the Internationalization API which is not yet available in all browsers
  47684. * and may require a polyfill. See [Browser Support](guide/browser-support) for details.
  47685. *
  47686. * ### Example
  47687. *
  47688. * {\@example common/pipes/ts/number_pipe.ts region='DeprecatedNumberPipe'}
  47689. *
  47690. * \@stable
  47691. */
  47692. var DeprecatedDecimalPipe = /** @class */ (function () {
  47693. function DeprecatedDecimalPipe(_locale) {
  47694. this._locale = _locale;
  47695. }
  47696. /**
  47697. * @param {?} value
  47698. * @param {?=} digits
  47699. * @return {?}
  47700. */
  47701. DeprecatedDecimalPipe.prototype.transform = /**
  47702. * @param {?} value
  47703. * @param {?=} digits
  47704. * @return {?}
  47705. */
  47706. function (value, digits) {
  47707. return formatNumber(DeprecatedDecimalPipe, this._locale, value, NumberFormatStyle.Decimal, digits);
  47708. };
  47709. DeprecatedDecimalPipe.decorators = [
  47710. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["S" /* Pipe */], args: [{ name: 'number' },] },
  47711. ];
  47712. /** @nocollapse */
  47713. DeprecatedDecimalPipe.ctorParameters = function () { return [
  47714. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["z" /* Inject */], args: [__WEBPACK_IMPORTED_MODULE_0__angular_core__["G" /* LOCALE_ID */],] },] },
  47715. ]; };
  47716. return DeprecatedDecimalPipe;
  47717. }());
  47718. /**
  47719. * \@ngModule CommonModule
  47720. * \@whatItDoes Formats a number as a percentage according to locale rules.
  47721. * \@howToUse `number_expression | percent[:digitInfo]`
  47722. *
  47723. * \@description
  47724. *
  47725. * Formats a number as percentage.
  47726. *
  47727. * - `digitInfo` See {\@link DecimalPipe} for detailed description.
  47728. *
  47729. * WARNING: this pipe uses the Internationalization API which is not yet available in all browsers
  47730. * and may require a polyfill. See [Browser Support](guide/browser-support) for details.
  47731. *
  47732. * ### Example
  47733. *
  47734. * {\@example common/pipes/ts/percent_pipe.ts region='DeprecatedPercentPipe'}
  47735. *
  47736. * \@stable
  47737. */
  47738. var DeprecatedPercentPipe = /** @class */ (function () {
  47739. function DeprecatedPercentPipe(_locale) {
  47740. this._locale = _locale;
  47741. }
  47742. /**
  47743. * @param {?} value
  47744. * @param {?=} digits
  47745. * @return {?}
  47746. */
  47747. DeprecatedPercentPipe.prototype.transform = /**
  47748. * @param {?} value
  47749. * @param {?=} digits
  47750. * @return {?}
  47751. */
  47752. function (value, digits) {
  47753. return formatNumber(DeprecatedPercentPipe, this._locale, value, NumberFormatStyle.Percent, digits);
  47754. };
  47755. DeprecatedPercentPipe.decorators = [
  47756. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["S" /* Pipe */], args: [{ name: 'percent' },] },
  47757. ];
  47758. /** @nocollapse */
  47759. DeprecatedPercentPipe.ctorParameters = function () { return [
  47760. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["z" /* Inject */], args: [__WEBPACK_IMPORTED_MODULE_0__angular_core__["G" /* LOCALE_ID */],] },] },
  47761. ]; };
  47762. return DeprecatedPercentPipe;
  47763. }());
  47764. /**
  47765. * \@ngModule CommonModule
  47766. * \@whatItDoes Formats a number as currency using locale rules.
  47767. * \@howToUse `number_expression | currency[:currencyCode[:symbolDisplay[:digitInfo]]]`
  47768. * \@description
  47769. *
  47770. * Use `currency` to format a number as currency.
  47771. *
  47772. * - `currencyCode` is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, such
  47773. * as `USD` for the US dollar and `EUR` for the euro.
  47774. * - `symbolDisplay` is a boolean indicating whether to use the currency symbol or code.
  47775. * - `true`: use symbol (e.g. `$`).
  47776. * - `false`(default): use code (e.g. `USD`).
  47777. * - `digitInfo` See {\@link DecimalPipe} for detailed description.
  47778. *
  47779. * WARNING: this pipe uses the Internationalization API which is not yet available in all browsers
  47780. * and may require a polyfill. See [Browser Support](guide/browser-support) for details.
  47781. *
  47782. * ### Example
  47783. *
  47784. * {\@example common/pipes/ts/currency_pipe.ts region='DeprecatedCurrencyPipe'}
  47785. *
  47786. * \@stable
  47787. */
  47788. var DeprecatedCurrencyPipe = /** @class */ (function () {
  47789. function DeprecatedCurrencyPipe(_locale) {
  47790. this._locale = _locale;
  47791. }
  47792. /**
  47793. * @param {?} value
  47794. * @param {?=} currencyCode
  47795. * @param {?=} symbolDisplay
  47796. * @param {?=} digits
  47797. * @return {?}
  47798. */
  47799. DeprecatedCurrencyPipe.prototype.transform = /**
  47800. * @param {?} value
  47801. * @param {?=} currencyCode
  47802. * @param {?=} symbolDisplay
  47803. * @param {?=} digits
  47804. * @return {?}
  47805. */
  47806. function (value, currencyCode, symbolDisplay, digits) {
  47807. if (currencyCode === void 0) { currencyCode = 'USD'; }
  47808. if (symbolDisplay === void 0) { symbolDisplay = false; }
  47809. return formatNumber(DeprecatedCurrencyPipe, this._locale, value, NumberFormatStyle.Currency, digits, currencyCode, symbolDisplay);
  47810. };
  47811. DeprecatedCurrencyPipe.decorators = [
  47812. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["S" /* Pipe */], args: [{ name: 'currency' },] },
  47813. ];
  47814. /** @nocollapse */
  47815. DeprecatedCurrencyPipe.ctorParameters = function () { return [
  47816. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["z" /* Inject */], args: [__WEBPACK_IMPORTED_MODULE_0__angular_core__["G" /* LOCALE_ID */],] },] },
  47817. ]; };
  47818. return DeprecatedCurrencyPipe;
  47819. }());
  47820. /**
  47821. * @fileoverview added by tsickle
  47822. * @suppress {checkTypes} checked by tsc
  47823. */
  47824. /**
  47825. * @license
  47826. * Copyright Google Inc. All Rights Reserved.
  47827. *
  47828. * Use of this source code is governed by an MIT-style license that can be
  47829. * found in the LICENSE file at https://angular.io/license
  47830. */
  47831. /**
  47832. * A collection of deprecated i18n pipes that require intl api
  47833. *
  47834. * @deprecated from v5
  47835. */
  47836. var COMMON_DEPRECATED_I18N_PIPES = [DeprecatedDecimalPipe, DeprecatedPercentPipe, DeprecatedCurrencyPipe, DeprecatedDatePipe];
  47837. /**
  47838. * @fileoverview added by tsickle
  47839. * @suppress {checkTypes} checked by tsc
  47840. */
  47841. /**
  47842. * @license
  47843. * Copyright Google Inc. All Rights Reserved.
  47844. *
  47845. * Use of this source code is governed by an MIT-style license that can be
  47846. * found in the LICENSE file at https://angular.io/license
  47847. */
  47848. var ObservableStrategy = /** @class */ (function () {
  47849. function ObservableStrategy() {
  47850. }
  47851. /**
  47852. * @param {?} async
  47853. * @param {?} updateLatestValue
  47854. * @return {?}
  47855. */
  47856. ObservableStrategy.prototype.createSubscription = /**
  47857. * @param {?} async
  47858. * @param {?} updateLatestValue
  47859. * @return {?}
  47860. */
  47861. function (async, updateLatestValue) {
  47862. return async.subscribe({ next: updateLatestValue, error: function (e) { throw e; } });
  47863. };
  47864. /**
  47865. * @param {?} subscription
  47866. * @return {?}
  47867. */
  47868. ObservableStrategy.prototype.dispose = /**
  47869. * @param {?} subscription
  47870. * @return {?}
  47871. */
  47872. function (subscription) { subscription.unsubscribe(); };
  47873. /**
  47874. * @param {?} subscription
  47875. * @return {?}
  47876. */
  47877. ObservableStrategy.prototype.onDestroy = /**
  47878. * @param {?} subscription
  47879. * @return {?}
  47880. */
  47881. function (subscription) { subscription.unsubscribe(); };
  47882. return ObservableStrategy;
  47883. }());
  47884. var PromiseStrategy = /** @class */ (function () {
  47885. function PromiseStrategy() {
  47886. }
  47887. /**
  47888. * @param {?} async
  47889. * @param {?} updateLatestValue
  47890. * @return {?}
  47891. */
  47892. PromiseStrategy.prototype.createSubscription = /**
  47893. * @param {?} async
  47894. * @param {?} updateLatestValue
  47895. * @return {?}
  47896. */
  47897. function (async, updateLatestValue) {
  47898. return async.then(updateLatestValue, function (e) { throw e; });
  47899. };
  47900. /**
  47901. * @param {?} subscription
  47902. * @return {?}
  47903. */
  47904. PromiseStrategy.prototype.dispose = /**
  47905. * @param {?} subscription
  47906. * @return {?}
  47907. */
  47908. function (subscription) { };
  47909. /**
  47910. * @param {?} subscription
  47911. * @return {?}
  47912. */
  47913. PromiseStrategy.prototype.onDestroy = /**
  47914. * @param {?} subscription
  47915. * @return {?}
  47916. */
  47917. function (subscription) { };
  47918. return PromiseStrategy;
  47919. }());
  47920. var _promiseStrategy = new PromiseStrategy();
  47921. var _observableStrategy = new ObservableStrategy();
  47922. /**
  47923. * \@ngModule CommonModule
  47924. * \@whatItDoes Unwraps a value from an asynchronous primitive.
  47925. * \@howToUse `observable_or_promise_expression | async`
  47926. * \@description
  47927. * The `async` pipe subscribes to an `Observable` or `Promise` and returns the latest value it has
  47928. * emitted. When a new value is emitted, the `async` pipe marks the component to be checked for
  47929. * changes. When the component gets destroyed, the `async` pipe unsubscribes automatically to avoid
  47930. * potential memory leaks.
  47931. *
  47932. *
  47933. * ## Examples
  47934. *
  47935. * This example binds a `Promise` to the view. Clicking the `Resolve` button resolves the
  47936. * promise.
  47937. *
  47938. * {\@example common/pipes/ts/async_pipe.ts region='AsyncPipePromise'}
  47939. *
  47940. * It's also possible to use `async` with Observables. The example below binds the `time` Observable
  47941. * to the view. The Observable continuously updates the view with the current time.
  47942. *
  47943. * {\@example common/pipes/ts/async_pipe.ts region='AsyncPipeObservable'}
  47944. *
  47945. * \@stable
  47946. */
  47947. var AsyncPipe = /** @class */ (function () {
  47948. function AsyncPipe(_ref) {
  47949. this._ref = _ref;
  47950. this._latestValue = null;
  47951. this._latestReturnedValue = null;
  47952. this._subscription = null;
  47953. this._obj = null;
  47954. this._strategy = /** @type {?} */ ((null));
  47955. }
  47956. /**
  47957. * @return {?}
  47958. */
  47959. AsyncPipe.prototype.ngOnDestroy = /**
  47960. * @return {?}
  47961. */
  47962. function () {
  47963. if (this._subscription) {
  47964. this._dispose();
  47965. }
  47966. };
  47967. /**
  47968. * @param {?} obj
  47969. * @return {?}
  47970. */
  47971. AsyncPipe.prototype.transform = /**
  47972. * @param {?} obj
  47973. * @return {?}
  47974. */
  47975. function (obj) {
  47976. if (!this._obj) {
  47977. if (obj) {
  47978. this._subscribe(obj);
  47979. }
  47980. this._latestReturnedValue = this._latestValue;
  47981. return this._latestValue;
  47982. }
  47983. if (obj !== this._obj) {
  47984. this._dispose();
  47985. return this.transform(/** @type {?} */ (obj));
  47986. }
  47987. if (this._latestValue === this._latestReturnedValue) {
  47988. return this._latestReturnedValue;
  47989. }
  47990. this._latestReturnedValue = this._latestValue;
  47991. return __WEBPACK_IMPORTED_MODULE_0__angular_core__["_12" /* WrappedValue */].wrap(this._latestValue);
  47992. };
  47993. /**
  47994. * @param {?} obj
  47995. * @return {?}
  47996. */
  47997. AsyncPipe.prototype._subscribe = /**
  47998. * @param {?} obj
  47999. * @return {?}
  48000. */
  48001. function (obj) {
  48002. var _this = this;
  48003. this._obj = obj;
  48004. this._strategy = this._selectStrategy(obj);
  48005. this._subscription = this._strategy.createSubscription(obj, function (value) { return _this._updateLatestValue(obj, value); });
  48006. };
  48007. /**
  48008. * @param {?} obj
  48009. * @return {?}
  48010. */
  48011. AsyncPipe.prototype._selectStrategy = /**
  48012. * @param {?} obj
  48013. * @return {?}
  48014. */
  48015. function (obj) {
  48016. if (Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_35" /* ɵisPromise */])(obj)) {
  48017. return _promiseStrategy;
  48018. }
  48019. if (Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_34" /* ɵisObservable */])(obj)) {
  48020. return _observableStrategy;
  48021. }
  48022. throw invalidPipeArgumentError(AsyncPipe, obj);
  48023. };
  48024. /**
  48025. * @return {?}
  48026. */
  48027. AsyncPipe.prototype._dispose = /**
  48028. * @return {?}
  48029. */
  48030. function () {
  48031. this._strategy.dispose(/** @type {?} */ ((this._subscription)));
  48032. this._latestValue = null;
  48033. this._latestReturnedValue = null;
  48034. this._subscription = null;
  48035. this._obj = null;
  48036. };
  48037. /**
  48038. * @param {?} async
  48039. * @param {?} value
  48040. * @return {?}
  48041. */
  48042. AsyncPipe.prototype._updateLatestValue = /**
  48043. * @param {?} async
  48044. * @param {?} value
  48045. * @return {?}
  48046. */
  48047. function (async, value) {
  48048. if (async === this._obj) {
  48049. this._latestValue = value;
  48050. this._ref.markForCheck();
  48051. }
  48052. };
  48053. AsyncPipe.decorators = [
  48054. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["S" /* Pipe */], args: [{ name: 'async', pure: false },] },
  48055. ];
  48056. /** @nocollapse */
  48057. AsyncPipe.ctorParameters = function () { return [
  48058. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["j" /* ChangeDetectorRef */], },
  48059. ]; };
  48060. return AsyncPipe;
  48061. }());
  48062. /**
  48063. * @fileoverview added by tsickle
  48064. * @suppress {checkTypes} checked by tsc
  48065. */
  48066. /**
  48067. * @license
  48068. * Copyright Google Inc. All Rights Reserved.
  48069. *
  48070. * Use of this source code is governed by an MIT-style license that can be
  48071. * found in the LICENSE file at https://angular.io/license
  48072. */
  48073. /**
  48074. * Transforms text to lowercase.
  48075. *
  48076. * {\@example common/pipes/ts/lowerupper_pipe.ts region='LowerUpperPipe' }
  48077. *
  48078. * \@stable
  48079. */
  48080. var LowerCasePipe = /** @class */ (function () {
  48081. function LowerCasePipe() {
  48082. }
  48083. /**
  48084. * @param {?} value
  48085. * @return {?}
  48086. */
  48087. LowerCasePipe.prototype.transform = /**
  48088. * @param {?} value
  48089. * @return {?}
  48090. */
  48091. function (value) {
  48092. if (!value)
  48093. return value;
  48094. if (typeof value !== 'string') {
  48095. throw invalidPipeArgumentError(LowerCasePipe, value);
  48096. }
  48097. return value.toLowerCase();
  48098. };
  48099. LowerCasePipe.decorators = [
  48100. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["S" /* Pipe */], args: [{ name: 'lowercase' },] },
  48101. ];
  48102. /** @nocollapse */
  48103. LowerCasePipe.ctorParameters = function () { return []; };
  48104. return LowerCasePipe;
  48105. }());
  48106. /**
  48107. * Helper method to transform a single word to titlecase.
  48108. *
  48109. * \@stable
  48110. * @param {?} word
  48111. * @return {?}
  48112. */
  48113. function titleCaseWord(word) {
  48114. if (!word)
  48115. return word;
  48116. return word[0].toUpperCase() + word.substr(1).toLowerCase();
  48117. }
  48118. /**
  48119. * Transforms text to titlecase.
  48120. *
  48121. * \@stable
  48122. */
  48123. var TitleCasePipe = /** @class */ (function () {
  48124. function TitleCasePipe() {
  48125. }
  48126. /**
  48127. * @param {?} value
  48128. * @return {?}
  48129. */
  48130. TitleCasePipe.prototype.transform = /**
  48131. * @param {?} value
  48132. * @return {?}
  48133. */
  48134. function (value) {
  48135. if (!value)
  48136. return value;
  48137. if (typeof value !== 'string') {
  48138. throw invalidPipeArgumentError(TitleCasePipe, value);
  48139. }
  48140. return value.split(/\b/g).map(function (word) { return titleCaseWord(word); }).join('');
  48141. };
  48142. TitleCasePipe.decorators = [
  48143. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["S" /* Pipe */], args: [{ name: 'titlecase' },] },
  48144. ];
  48145. /** @nocollapse */
  48146. TitleCasePipe.ctorParameters = function () { return []; };
  48147. return TitleCasePipe;
  48148. }());
  48149. /**
  48150. * Transforms text to uppercase.
  48151. *
  48152. * \@stable
  48153. */
  48154. var UpperCasePipe = /** @class */ (function () {
  48155. function UpperCasePipe() {
  48156. }
  48157. /**
  48158. * @param {?} value
  48159. * @return {?}
  48160. */
  48161. UpperCasePipe.prototype.transform = /**
  48162. * @param {?} value
  48163. * @return {?}
  48164. */
  48165. function (value) {
  48166. if (!value)
  48167. return value;
  48168. if (typeof value !== 'string') {
  48169. throw invalidPipeArgumentError(UpperCasePipe, value);
  48170. }
  48171. return value.toUpperCase();
  48172. };
  48173. UpperCasePipe.decorators = [
  48174. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["S" /* Pipe */], args: [{ name: 'uppercase' },] },
  48175. ];
  48176. /** @nocollapse */
  48177. UpperCasePipe.ctorParameters = function () { return []; };
  48178. return UpperCasePipe;
  48179. }());
  48180. /**
  48181. * @fileoverview added by tsickle
  48182. * @suppress {checkTypes} checked by tsc
  48183. */
  48184. /**
  48185. * @license
  48186. * Copyright Google Inc. All Rights Reserved.
  48187. *
  48188. * Use of this source code is governed by an MIT-style license that can be
  48189. * found in the LICENSE file at https://angular.io/license
  48190. */
  48191. var _INTERPOLATION_REGEXP = /#/g;
  48192. /**
  48193. * \@ngModule CommonModule
  48194. * \@whatItDoes Maps a value to a string that pluralizes the value according to locale rules.
  48195. * \@howToUse `expression | i18nPlural:mapping[:locale]`
  48196. * \@description
  48197. *
  48198. * Where:
  48199. * - `expression` is a number.
  48200. * - `mapping` is an object that mimics the ICU format, see
  48201. * http://userguide.icu-project.org/formatparse/messages
  48202. * - `locale` is a `string` defining the locale to use (uses the current {\@link LOCALE_ID} by
  48203. * default)
  48204. *
  48205. * ## Example
  48206. *
  48207. * {\@example common/pipes/ts/i18n_pipe.ts region='I18nPluralPipeComponent'}
  48208. *
  48209. * \@experimental
  48210. */
  48211. var I18nPluralPipe = /** @class */ (function () {
  48212. function I18nPluralPipe(_localization) {
  48213. this._localization = _localization;
  48214. }
  48215. /**
  48216. * @param {?} value
  48217. * @param {?} pluralMap
  48218. * @param {?=} locale
  48219. * @return {?}
  48220. */
  48221. I18nPluralPipe.prototype.transform = /**
  48222. * @param {?} value
  48223. * @param {?} pluralMap
  48224. * @param {?=} locale
  48225. * @return {?}
  48226. */
  48227. function (value, pluralMap, locale) {
  48228. if (value == null)
  48229. return '';
  48230. if (typeof pluralMap !== 'object' || pluralMap === null) {
  48231. throw invalidPipeArgumentError(I18nPluralPipe, pluralMap);
  48232. }
  48233. var /** @type {?} */ key = getPluralCategory(value, Object.keys(pluralMap), this._localization, locale);
  48234. return pluralMap[key].replace(_INTERPOLATION_REGEXP, value.toString());
  48235. };
  48236. I18nPluralPipe.decorators = [
  48237. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["S" /* Pipe */], args: [{ name: 'i18nPlural', pure: true },] },
  48238. ];
  48239. /** @nocollapse */
  48240. I18nPluralPipe.ctorParameters = function () { return [
  48241. { type: NgLocalization, },
  48242. ]; };
  48243. return I18nPluralPipe;
  48244. }());
  48245. /**
  48246. * @fileoverview added by tsickle
  48247. * @suppress {checkTypes} checked by tsc
  48248. */
  48249. /**
  48250. * @license
  48251. * Copyright Google Inc. All Rights Reserved.
  48252. *
  48253. * Use of this source code is governed by an MIT-style license that can be
  48254. * found in the LICENSE file at https://angular.io/license
  48255. */
  48256. /**
  48257. * \@ngModule CommonModule
  48258. * \@whatItDoes Generic selector that displays the string that matches the current value.
  48259. * \@howToUse `expression | i18nSelect:mapping`
  48260. * \@description
  48261. *
  48262. * Where `mapping` is an object that indicates the text that should be displayed
  48263. * for different values of the provided `expression`.
  48264. * If none of the keys of the mapping match the value of the `expression`, then the content
  48265. * of the `other` key is returned when present, otherwise an empty string is returned.
  48266. *
  48267. * ## Example
  48268. *
  48269. * {\@example common/pipes/ts/i18n_pipe.ts region='I18nSelectPipeComponent'}
  48270. *
  48271. * \@experimental
  48272. */
  48273. var I18nSelectPipe = /** @class */ (function () {
  48274. function I18nSelectPipe() {
  48275. }
  48276. /**
  48277. * @param {?} value
  48278. * @param {?} mapping
  48279. * @return {?}
  48280. */
  48281. I18nSelectPipe.prototype.transform = /**
  48282. * @param {?} value
  48283. * @param {?} mapping
  48284. * @return {?}
  48285. */
  48286. function (value, mapping) {
  48287. if (value == null)
  48288. return '';
  48289. if (typeof mapping !== 'object' || typeof value !== 'string') {
  48290. throw invalidPipeArgumentError(I18nSelectPipe, mapping);
  48291. }
  48292. if (mapping.hasOwnProperty(value)) {
  48293. return mapping[value];
  48294. }
  48295. if (mapping.hasOwnProperty('other')) {
  48296. return mapping['other'];
  48297. }
  48298. return '';
  48299. };
  48300. I18nSelectPipe.decorators = [
  48301. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["S" /* Pipe */], args: [{ name: 'i18nSelect', pure: true },] },
  48302. ];
  48303. /** @nocollapse */
  48304. I18nSelectPipe.ctorParameters = function () { return []; };
  48305. return I18nSelectPipe;
  48306. }());
  48307. /**
  48308. * @fileoverview added by tsickle
  48309. * @suppress {checkTypes} checked by tsc
  48310. */
  48311. /**
  48312. * @license
  48313. * Copyright Google Inc. All Rights Reserved.
  48314. *
  48315. * Use of this source code is governed by an MIT-style license that can be
  48316. * found in the LICENSE file at https://angular.io/license
  48317. */
  48318. /**
  48319. * \@ngModule CommonModule
  48320. * \@whatItDoes Converts value into JSON string.
  48321. * \@howToUse `expression | json`
  48322. * \@description
  48323. *
  48324. * Converts value into string using `JSON.stringify`. Useful for debugging.
  48325. *
  48326. * ### Example
  48327. * {\@example common/pipes/ts/json_pipe.ts region='JsonPipe'}
  48328. *
  48329. * \@stable
  48330. */
  48331. var JsonPipe = /** @class */ (function () {
  48332. function JsonPipe() {
  48333. }
  48334. /**
  48335. * @param {?} value
  48336. * @return {?}
  48337. */
  48338. JsonPipe.prototype.transform = /**
  48339. * @param {?} value
  48340. * @return {?}
  48341. */
  48342. function (value) { return JSON.stringify(value, null, 2); };
  48343. JsonPipe.decorators = [
  48344. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["S" /* Pipe */], args: [{ name: 'json', pure: false },] },
  48345. ];
  48346. /** @nocollapse */
  48347. JsonPipe.ctorParameters = function () { return []; };
  48348. return JsonPipe;
  48349. }());
  48350. /**
  48351. * @fileoverview added by tsickle
  48352. * @suppress {checkTypes} checked by tsc
  48353. */
  48354. /**
  48355. * @license
  48356. * Copyright Google Inc. All Rights Reserved.
  48357. *
  48358. * Use of this source code is governed by an MIT-style license that can be
  48359. * found in the LICENSE file at https://angular.io/license
  48360. */
  48361. /**
  48362. * \@ngModule CommonModule
  48363. * \@whatItDoes Formats a number according to locale rules.
  48364. * \@howToUse `number_expression | number[:digitInfo[:locale]]`
  48365. *
  48366. * Formats a number as text. Group sizing and separator and other locale-specific
  48367. * configurations are based on the active locale.
  48368. *
  48369. * where `expression` is a number:
  48370. * - `digitInfo` is a `string` which has a following format: <br>
  48371. * <code>{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}</code>
  48372. * - `minIntegerDigits` is the minimum number of integer digits to use. Defaults to `1`.
  48373. * - `minFractionDigits` is the minimum number of digits after fraction. Defaults to `0`.
  48374. * - `maxFractionDigits` is the maximum number of digits after fraction. Defaults to `3`.
  48375. * - `locale` is a `string` defining the locale to use (uses the current {\@link LOCALE_ID} by
  48376. * default)
  48377. *
  48378. * For more information on the acceptable range for each of these numbers and other
  48379. * details see your native internationalization library.
  48380. *
  48381. * ### Example
  48382. *
  48383. * {\@example common/pipes/ts/number_pipe.ts region='NumberPipe'}
  48384. *
  48385. * \@stable
  48386. */
  48387. var DecimalPipe = /** @class */ (function () {
  48388. function DecimalPipe(_locale) {
  48389. this._locale = _locale;
  48390. }
  48391. /**
  48392. * @param {?} value
  48393. * @param {?=} digits
  48394. * @param {?=} locale
  48395. * @return {?}
  48396. */
  48397. DecimalPipe.prototype.transform = /**
  48398. * @param {?} value
  48399. * @param {?=} digits
  48400. * @param {?=} locale
  48401. * @return {?}
  48402. */
  48403. function (value, digits, locale) {
  48404. if (isEmpty(value))
  48405. return null;
  48406. locale = locale || this._locale;
  48407. var _a = formatNumber$1(value, locale, NumberFormatStyle.Decimal, digits), str = _a.str, error = _a.error;
  48408. if (error) {
  48409. throw invalidPipeArgumentError(DecimalPipe, error);
  48410. }
  48411. return str;
  48412. };
  48413. DecimalPipe.decorators = [
  48414. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["S" /* Pipe */], args: [{ name: 'number' },] },
  48415. ];
  48416. /** @nocollapse */
  48417. DecimalPipe.ctorParameters = function () { return [
  48418. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["z" /* Inject */], args: [__WEBPACK_IMPORTED_MODULE_0__angular_core__["G" /* LOCALE_ID */],] },] },
  48419. ]; };
  48420. return DecimalPipe;
  48421. }());
  48422. /**
  48423. * \@ngModule CommonModule
  48424. * \@whatItDoes Formats a number as a percentage according to locale rules.
  48425. * \@howToUse `number_expression | percent[:digitInfo[:locale]]`
  48426. *
  48427. * \@description
  48428. *
  48429. * Formats a number as percentage.
  48430. *
  48431. * - `digitInfo` See {\@link DecimalPipe} for detailed description.
  48432. * - `locale` is a `string` defining the locale to use (uses the current {\@link LOCALE_ID} by
  48433. * default)
  48434. *
  48435. * ### Example
  48436. *
  48437. * {\@example common/pipes/ts/percent_pipe.ts region='PercentPipe'}
  48438. *
  48439. * \@stable
  48440. */
  48441. var PercentPipe = /** @class */ (function () {
  48442. function PercentPipe(_locale) {
  48443. this._locale = _locale;
  48444. }
  48445. /**
  48446. * @param {?} value
  48447. * @param {?=} digits
  48448. * @param {?=} locale
  48449. * @return {?}
  48450. */
  48451. PercentPipe.prototype.transform = /**
  48452. * @param {?} value
  48453. * @param {?=} digits
  48454. * @param {?=} locale
  48455. * @return {?}
  48456. */
  48457. function (value, digits, locale) {
  48458. if (isEmpty(value))
  48459. return null;
  48460. locale = locale || this._locale;
  48461. var _a = formatNumber$1(value, locale, NumberFormatStyle.Percent, digits), str = _a.str, error = _a.error;
  48462. if (error) {
  48463. throw invalidPipeArgumentError(PercentPipe, error);
  48464. }
  48465. return str;
  48466. };
  48467. PercentPipe.decorators = [
  48468. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["S" /* Pipe */], args: [{ name: 'percent' },] },
  48469. ];
  48470. /** @nocollapse */
  48471. PercentPipe.ctorParameters = function () { return [
  48472. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["z" /* Inject */], args: [__WEBPACK_IMPORTED_MODULE_0__angular_core__["G" /* LOCALE_ID */],] },] },
  48473. ]; };
  48474. return PercentPipe;
  48475. }());
  48476. /**
  48477. * \@ngModule CommonModule
  48478. * \@whatItDoes Formats a number as currency using locale rules.
  48479. * \@howToUse `number_expression | currency[:currencyCode[:display[:digitInfo[:locale]]]]`
  48480. * \@description
  48481. *
  48482. * Use `currency` to format a number as currency.
  48483. *
  48484. * - `currencyCode` is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, such
  48485. * as `USD` for the US dollar and `EUR` for the euro.
  48486. * - `display` indicates whether to show the currency symbol or the code.
  48487. * - `code`: use code (e.g. `USD`).
  48488. * - `symbol`(default): use symbol (e.g. `$`).
  48489. * - `symbol-narrow`: some countries have two symbols for their currency, one regular and one
  48490. * narrow (e.g. the canadian dollar CAD has the symbol `CA$` and the symbol-narrow `$`).
  48491. * - boolean (deprecated from v5): `true` for symbol and false for `code`
  48492. * If there is no narrow symbol for the chosen currency, the regular symbol will be used.
  48493. * - `digitInfo` See {\@link DecimalPipe} for detailed description.
  48494. * - `locale` is a `string` defining the locale to use (uses the current {\@link LOCALE_ID} by
  48495. * default)
  48496. *
  48497. * ### Example
  48498. *
  48499. * {\@example common/pipes/ts/currency_pipe.ts region='CurrencyPipe'}
  48500. *
  48501. * \@stable
  48502. */
  48503. var CurrencyPipe = /** @class */ (function () {
  48504. function CurrencyPipe(_locale) {
  48505. this._locale = _locale;
  48506. }
  48507. /**
  48508. * @param {?} value
  48509. * @param {?=} currencyCode
  48510. * @param {?=} display
  48511. * @param {?=} digits
  48512. * @param {?=} locale
  48513. * @return {?}
  48514. */
  48515. CurrencyPipe.prototype.transform = /**
  48516. * @param {?} value
  48517. * @param {?=} currencyCode
  48518. * @param {?=} display
  48519. * @param {?=} digits
  48520. * @param {?=} locale
  48521. * @return {?}
  48522. */
  48523. function (value, currencyCode, display, digits, locale) {
  48524. if (display === void 0) { display = 'symbol'; }
  48525. if (isEmpty(value))
  48526. return null;
  48527. locale = locale || this._locale;
  48528. if (typeof display === 'boolean') {
  48529. if (/** @type {?} */ (console) && /** @type {?} */ (console.warn)) {
  48530. console.warn("Warning: the currency pipe has been changed in Angular v5. The symbolDisplay option (third parameter) is now a string instead of a boolean. The accepted values are \"code\", \"symbol\" or \"symbol-narrow\".");
  48531. }
  48532. display = display ? 'symbol' : 'code';
  48533. }
  48534. var /** @type {?} */ currency = currencyCode || 'USD';
  48535. if (display !== 'code') {
  48536. currency = getCurrencySymbol(currency, display === 'symbol' ? 'wide' : 'narrow');
  48537. }
  48538. var _a = formatNumber$1(value, locale, NumberFormatStyle.Currency, digits, currency), str = _a.str, error = _a.error;
  48539. if (error) {
  48540. throw invalidPipeArgumentError(CurrencyPipe, error);
  48541. }
  48542. return str;
  48543. };
  48544. CurrencyPipe.decorators = [
  48545. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["S" /* Pipe */], args: [{ name: 'currency' },] },
  48546. ];
  48547. /** @nocollapse */
  48548. CurrencyPipe.ctorParameters = function () { return [
  48549. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["z" /* Inject */], args: [__WEBPACK_IMPORTED_MODULE_0__angular_core__["G" /* LOCALE_ID */],] },] },
  48550. ]; };
  48551. return CurrencyPipe;
  48552. }());
  48553. /**
  48554. * @param {?} value
  48555. * @return {?}
  48556. */
  48557. function isEmpty(value) {
  48558. return value == null || value === '' || value !== value;
  48559. }
  48560. /**
  48561. * @fileoverview added by tsickle
  48562. * @suppress {checkTypes} checked by tsc
  48563. */
  48564. /**
  48565. * @license
  48566. * Copyright Google Inc. All Rights Reserved.
  48567. *
  48568. * Use of this source code is governed by an MIT-style license that can be
  48569. * found in the LICENSE file at https://angular.io/license
  48570. */
  48571. /**
  48572. * \@ngModule CommonModule
  48573. * \@whatItDoes Creates a new List or String containing a subset (slice) of the elements.
  48574. * \@howToUse `array_or_string_expression | slice:start[:end]`
  48575. * \@description
  48576. *
  48577. * Where the input expression is a `List` or `String`, and:
  48578. * - `start`: The starting index of the subset to return.
  48579. * - **a positive integer**: return the item at `start` index and all items after
  48580. * in the list or string expression.
  48581. * - **a negative integer**: return the item at `start` index from the end and all items after
  48582. * in the list or string expression.
  48583. * - **if positive and greater than the size of the expression**: return an empty list or string.
  48584. * - **if negative and greater than the size of the expression**: return entire list or string.
  48585. * - `end`: The ending index of the subset to return.
  48586. * - **omitted**: return all items until the end.
  48587. * - **if positive**: return all items before `end` index of the list or string.
  48588. * - **if negative**: return all items before `end` index from the end of the list or string.
  48589. *
  48590. * All behavior is based on the expected behavior of the JavaScript API `Array.prototype.slice()`
  48591. * and `String.prototype.slice()`.
  48592. *
  48593. * When operating on a [List], the returned list is always a copy even when all
  48594. * the elements are being returned.
  48595. *
  48596. * When operating on a blank value, the pipe returns the blank value.
  48597. *
  48598. * ## List Example
  48599. *
  48600. * This `ngFor` example:
  48601. *
  48602. * {\@example common/pipes/ts/slice_pipe.ts region='SlicePipe_list'}
  48603. *
  48604. * produces the following:
  48605. *
  48606. * <li>b</li>
  48607. * <li>c</li>
  48608. *
  48609. * ## String Examples
  48610. *
  48611. * {\@example common/pipes/ts/slice_pipe.ts region='SlicePipe_string'}
  48612. *
  48613. * \@stable
  48614. */
  48615. var SlicePipe = /** @class */ (function () {
  48616. function SlicePipe() {
  48617. }
  48618. /**
  48619. * @param {?} value
  48620. * @param {?} start
  48621. * @param {?=} end
  48622. * @return {?}
  48623. */
  48624. SlicePipe.prototype.transform = /**
  48625. * @param {?} value
  48626. * @param {?} start
  48627. * @param {?=} end
  48628. * @return {?}
  48629. */
  48630. function (value, start, end) {
  48631. if (value == null)
  48632. return value;
  48633. if (!this.supports(value)) {
  48634. throw invalidPipeArgumentError(SlicePipe, value);
  48635. }
  48636. return value.slice(start, end);
  48637. };
  48638. /**
  48639. * @param {?} obj
  48640. * @return {?}
  48641. */
  48642. SlicePipe.prototype.supports = /**
  48643. * @param {?} obj
  48644. * @return {?}
  48645. */
  48646. function (obj) { return typeof obj === 'string' || Array.isArray(obj); };
  48647. SlicePipe.decorators = [
  48648. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["S" /* Pipe */], args: [{ name: 'slice', pure: false },] },
  48649. ];
  48650. /** @nocollapse */
  48651. SlicePipe.ctorParameters = function () { return []; };
  48652. return SlicePipe;
  48653. }());
  48654. /**
  48655. * @fileoverview added by tsickle
  48656. * @suppress {checkTypes} checked by tsc
  48657. */
  48658. /**
  48659. * @license
  48660. * Copyright Google Inc. All Rights Reserved.
  48661. *
  48662. * Use of this source code is governed by an MIT-style license that can be
  48663. * found in the LICENSE file at https://angular.io/license
  48664. */
  48665. /**
  48666. * A collection of Angular pipes that are likely to be used in each and every application.
  48667. */
  48668. var COMMON_PIPES = [
  48669. AsyncPipe,
  48670. UpperCasePipe,
  48671. LowerCasePipe,
  48672. JsonPipe,
  48673. SlicePipe,
  48674. DecimalPipe,
  48675. PercentPipe,
  48676. TitleCasePipe,
  48677. CurrencyPipe,
  48678. DatePipe,
  48679. I18nPluralPipe,
  48680. I18nSelectPipe,
  48681. ];
  48682. /**
  48683. * @fileoverview added by tsickle
  48684. * @suppress {checkTypes} checked by tsc
  48685. */
  48686. /**
  48687. * @license
  48688. * Copyright Google Inc. All Rights Reserved.
  48689. *
  48690. * Use of this source code is governed by an MIT-style license that can be
  48691. * found in the LICENSE file at https://angular.io/license
  48692. */
  48693. /**
  48694. * The module that includes all the basic Angular directives like {\@link NgIf}, {\@link NgForOf}, ...
  48695. *
  48696. * \@stable
  48697. */
  48698. var CommonModule = /** @class */ (function () {
  48699. function CommonModule() {
  48700. }
  48701. CommonModule.decorators = [
  48702. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["I" /* NgModule */], args: [{
  48703. declarations: [COMMON_DIRECTIVES, COMMON_PIPES],
  48704. exports: [COMMON_DIRECTIVES, COMMON_PIPES],
  48705. providers: [
  48706. { provide: NgLocalization, useClass: NgLocaleLocalization },
  48707. ],
  48708. },] },
  48709. ];
  48710. /** @nocollapse */
  48711. CommonModule.ctorParameters = function () { return []; };
  48712. return CommonModule;
  48713. }());
  48714. var ɵ0 = getPluralCase;
  48715. /**
  48716. * A module that contains the deprecated i18n pipes.
  48717. *
  48718. * @deprecated from v5
  48719. */
  48720. var DeprecatedI18NPipesModule = /** @class */ (function () {
  48721. function DeprecatedI18NPipesModule() {
  48722. }
  48723. DeprecatedI18NPipesModule.decorators = [
  48724. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["I" /* NgModule */], args: [{
  48725. declarations: [COMMON_DEPRECATED_I18N_PIPES],
  48726. exports: [COMMON_DEPRECATED_I18N_PIPES],
  48727. providers: [{ provide: DEPRECATED_PLURAL_FN, useValue: ɵ0 }],
  48728. },] },
  48729. ];
  48730. /** @nocollapse */
  48731. DeprecatedI18NPipesModule.ctorParameters = function () { return []; };
  48732. return DeprecatedI18NPipesModule;
  48733. }());
  48734. /**
  48735. * @fileoverview added by tsickle
  48736. * @suppress {checkTypes} checked by tsc
  48737. */
  48738. /**
  48739. * @license
  48740. * Copyright Google Inc. All Rights Reserved.
  48741. *
  48742. * Use of this source code is governed by an MIT-style license that can be
  48743. * found in the LICENSE file at https://angular.io/license
  48744. */
  48745. /**
  48746. * A DI Token representing the main rendering context. In a browser this is the DOM Document.
  48747. *
  48748. * Note: Document might not be available in the Application Context when Application and Rendering
  48749. * Contexts are not the same (e.g. when running the application into a Web Worker).
  48750. *
  48751. * \@stable
  48752. */
  48753. var DOCUMENT = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["B" /* InjectionToken */]('DocumentToken');
  48754. /**
  48755. * @fileoverview added by tsickle
  48756. * @suppress {checkTypes} checked by tsc
  48757. */
  48758. /**
  48759. * @license
  48760. * Copyright Google Inc. All Rights Reserved.
  48761. *
  48762. * Use of this source code is governed by an MIT-style license that can be
  48763. * found in the LICENSE file at https://angular.io/license
  48764. */
  48765. var PLATFORM_BROWSER_ID = 'browser';
  48766. var PLATFORM_SERVER_ID = 'server';
  48767. var PLATFORM_WORKER_APP_ID = 'browserWorkerApp';
  48768. var PLATFORM_WORKER_UI_ID = 'browserWorkerUi';
  48769. /**
  48770. * Returns whether a platform id represents a browser platform.
  48771. * \@experimental
  48772. * @param {?} platformId
  48773. * @return {?}
  48774. */
  48775. function isPlatformBrowser(platformId) {
  48776. return platformId === PLATFORM_BROWSER_ID;
  48777. }
  48778. /**
  48779. * Returns whether a platform id represents a server platform.
  48780. * \@experimental
  48781. * @param {?} platformId
  48782. * @return {?}
  48783. */
  48784. function isPlatformServer(platformId) {
  48785. return platformId === PLATFORM_SERVER_ID;
  48786. }
  48787. /**
  48788. * Returns whether a platform id represents a web worker app platform.
  48789. * \@experimental
  48790. * @param {?} platformId
  48791. * @return {?}
  48792. */
  48793. function isPlatformWorkerApp(platformId) {
  48794. return platformId === PLATFORM_WORKER_APP_ID;
  48795. }
  48796. /**
  48797. * Returns whether a platform id represents a web worker UI platform.
  48798. * \@experimental
  48799. * @param {?} platformId
  48800. * @return {?}
  48801. */
  48802. function isPlatformWorkerUi(platformId) {
  48803. return platformId === PLATFORM_WORKER_UI_ID;
  48804. }
  48805. /**
  48806. * @fileoverview added by tsickle
  48807. * @suppress {checkTypes} checked by tsc
  48808. */
  48809. /**
  48810. * @license
  48811. * Copyright Google Inc. All Rights Reserved.
  48812. *
  48813. * Use of this source code is governed by an MIT-style license that can be
  48814. * found in the LICENSE file at https://angular.io/license
  48815. */
  48816. /**
  48817. * \@stable
  48818. */
  48819. var VERSION = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["_7" /* Version */]('5.2.11');
  48820. /**
  48821. * @fileoverview added by tsickle
  48822. * @suppress {checkTypes} checked by tsc
  48823. */
  48824. /**
  48825. * @license
  48826. * Copyright Google Inc. All Rights Reserved.
  48827. *
  48828. * Use of this source code is governed by an MIT-style license that can be
  48829. * found in the LICENSE file at https://angular.io/license
  48830. */
  48831. /**
  48832. * @module
  48833. * @description
  48834. * Entry point for all public APIs of the common package.
  48835. */
  48836. /**
  48837. * @fileoverview added by tsickle
  48838. * @suppress {checkTypes} checked by tsc
  48839. */
  48840. /**
  48841. * @license
  48842. * Copyright Google Inc. All Rights Reserved.
  48843. *
  48844. * Use of this source code is governed by an MIT-style license that can be
  48845. * found in the LICENSE file at https://angular.io/license
  48846. */
  48847. /**
  48848. * @module
  48849. * @description
  48850. * Entry point for all public APIs of this package.
  48851. */
  48852. // This file only reexports content of the `src` folder. Keep it that way.
  48853. /**
  48854. * @fileoverview added by tsickle
  48855. * @suppress {checkTypes} checked by tsc
  48856. */
  48857. /**
  48858. * Generated bundle index. Do not edit.
  48859. */
  48860. //# sourceMappingURL=common.js.map
  48861. /***/ }),
  48862. /* 35 */
  48863. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  48864. "use strict";
  48865. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PORTAL_DEFAULT; });
  48866. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return PORTAL_MODAL; });
  48867. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return PORTAL_LOADING; });
  48868. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return PORTAL_TOAST; });
  48869. var PORTAL_DEFAULT = 1;
  48870. var PORTAL_MODAL = 2;
  48871. var PORTAL_LOADING = 3;
  48872. var PORTAL_TOAST = 4;
  48873. //# sourceMappingURL=app-constants.js.map
  48874. /***/ }),
  48875. /* 36 */
  48876. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  48877. "use strict";
  48878. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Button; });
  48879. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  48880. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__config_config__ = __webpack_require__(1);
  48881. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ion__ = __webpack_require__(4);
  48882. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_util__ = __webpack_require__(2);
  48883. var __extends = (this && this.__extends) || (function () {
  48884. var extendStatics = Object.setPrototypeOf ||
  48885. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  48886. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  48887. return function (d, b) {
  48888. extendStatics(d, b);
  48889. function __() { this.constructor = d; }
  48890. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  48891. };
  48892. })();
  48893. /**
  48894. * @name Button
  48895. * @module ionic
  48896. * @description
  48897. * Buttons are simple components in Ionic. They can consist of text and icons
  48898. * and be enhanced by a wide range of attributes.
  48899. *
  48900. * @usage
  48901. *
  48902. * ```html
  48903. *
  48904. * <!-- Colors -->
  48905. * <button ion-button>Default</button>
  48906. *
  48907. * <button ion-button color="secondary">Secondary</button>
  48908. *
  48909. * <button ion-button color="danger">Danger</button>
  48910. *
  48911. * <button ion-button color="light">Light</button>
  48912. *
  48913. * <button ion-button color="dark">Dark</button>
  48914. *
  48915. * <!-- Shapes -->
  48916. * <button ion-button full>Full Button</button>
  48917. *
  48918. * <button ion-button block>Block Button</button>
  48919. *
  48920. * <button ion-button round>Round Button</button>
  48921. *
  48922. * <!-- Outline -->
  48923. * <button ion-button full outline>Outline + Full</button>
  48924. *
  48925. * <button ion-button block outline>Outline + Block</button>
  48926. *
  48927. * <button ion-button round outline>Outline + Round</button>
  48928. *
  48929. * <!-- Icons -->
  48930. * <button ion-button icon-start>
  48931. * <ion-icon name="star"></ion-icon>
  48932. * Left Icon
  48933. * </button>
  48934. *
  48935. * <button ion-button icon-end>
  48936. * Right Icon
  48937. * <ion-icon name="star"></ion-icon>
  48938. * </button>
  48939. *
  48940. * <button ion-button icon-only>
  48941. * <ion-icon name="star"></ion-icon>
  48942. * </button>
  48943. *
  48944. * <!-- Sizes -->
  48945. * <button ion-button large>Large</button>
  48946. *
  48947. * <button ion-button>Default</button>
  48948. *
  48949. * <button ion-button small>Small</button>
  48950. * ```
  48951. *
  48952. * @advanced
  48953. *
  48954. * ```html
  48955. *
  48956. * <!-- Bind the color and outline inputs to an expression -->
  48957. * <button ion-button [color]="isDanger ? 'danger' : 'primary'" [outline]="isOutline">
  48958. * Danger (Solid)
  48959. * </button>
  48960. *
  48961. * <!-- Bind the color and round inputs to an expression -->
  48962. * <button ion-button [color]="myColor" [round]="isRound">
  48963. * Secondary (Round)
  48964. * </button>
  48965. *
  48966. * <!-- Bind the color and clear inputs to an expression -->
  48967. * <button ion-button [color]="isSecondary ? 'secondary' : 'primary'" [clear]="isClear">
  48968. * Primary (Clear)
  48969. * </button>
  48970. *
  48971. * <!-- Bind the color, outline and round inputs to an expression -->
  48972. * <button ion-button [color]="myColor2" [outline]="isOutline" [round]="isRound">
  48973. * Dark (Solid + Round)
  48974. * </button>
  48975. *
  48976. * <!-- Bind the click event to a method -->
  48977. * <button ion-button (click)="logEvent($event)">
  48978. * Click me!
  48979. * </button>
  48980. * ```
  48981. *
  48982. * ```ts
  48983. * @Component({
  48984. * templateUrl: 'main.html'
  48985. * })
  48986. * class E2EPage {
  48987. * isDanger: boolean = true;
  48988. * isSecondary: boolean = false;
  48989. * isRound: boolean = true;
  48990. * isOutline: boolean = false;
  48991. * isClear: boolean = true;
  48992. * myColor: string = 'secondary';
  48993. * myColor2: string = 'dark';
  48994. *
  48995. * logEvent(event) {
  48996. * console.log(event)
  48997. * }
  48998. * }
  48999. *
  49000. * ```
  49001. *
  49002. * @demo /docs/demos/src/button/
  49003. * @see {@link /docs/components#buttons Button Component Docs}
  49004. * @see {@link /docs/components#fabs FabButton Docs}
  49005. * @see {@link ../../fab/FabButton FabButton API Docs}
  49006. * @see {@link ../../fab/FabContainer FabContainer API Docs}
  49007. */
  49008. var Button = (function (_super) {
  49009. __extends(Button, _super);
  49010. function Button(ionButton, config, elementRef, renderer) {
  49011. var _this = _super.call(this, config, elementRef, renderer) || this;
  49012. /** @hidden */
  49013. _this._role = 'button'; // bar-button
  49014. /** @hidden */
  49015. _this._style = 'default'; // outline/clear/solid
  49016. _this._mode = config.get('mode');
  49017. if (config.get('hoverCSS') === false) {
  49018. _this.setElementClass('disable-hover', true);
  49019. }
  49020. if (ionButton.trim().length > 0) {
  49021. _this.setRole(ionButton);
  49022. }
  49023. return _this;
  49024. }
  49025. Object.defineProperty(Button.prototype, "large", {
  49026. /**
  49027. * @input {boolean} If true, activates the large button size.
  49028. */
  49029. set: function (val) {
  49030. this._attr('_size', 'large', val);
  49031. },
  49032. enumerable: true,
  49033. configurable: true
  49034. });
  49035. Object.defineProperty(Button.prototype, "small", {
  49036. /**
  49037. * @input {boolean} If true, activates the small button size.
  49038. */
  49039. set: function (val) {
  49040. this._attr('_size', 'small', val);
  49041. },
  49042. enumerable: true,
  49043. configurable: true
  49044. });
  49045. Object.defineProperty(Button.prototype, "default", {
  49046. /**
  49047. * @input {boolean} If true, activates the default button size. Normally the default, useful for buttons in an item.
  49048. */
  49049. set: function (val) {
  49050. this._attr('_size', 'default', val);
  49051. },
  49052. enumerable: true,
  49053. configurable: true
  49054. });
  49055. Object.defineProperty(Button.prototype, "outline", {
  49056. /**
  49057. * @input {boolean} If true, activates a transparent button style with a border.
  49058. */
  49059. set: function (val) {
  49060. this._attr('_style', 'outline', val);
  49061. },
  49062. enumerable: true,
  49063. configurable: true
  49064. });
  49065. Object.defineProperty(Button.prototype, "clear", {
  49066. /**
  49067. * @input {boolean} If true, activates a transparent button style without a border.
  49068. */
  49069. set: function (val) {
  49070. this._attr('_style', 'clear', val);
  49071. },
  49072. enumerable: true,
  49073. configurable: true
  49074. });
  49075. Object.defineProperty(Button.prototype, "solid", {
  49076. /**
  49077. * @input {boolean} If true, activates a solid button style. Normally the default, useful for buttons in a toolbar.
  49078. */
  49079. set: function (val) {
  49080. this._attr('_style', 'solid', val);
  49081. },
  49082. enumerable: true,
  49083. configurable: true
  49084. });
  49085. Object.defineProperty(Button.prototype, "round", {
  49086. /**
  49087. * @input {boolean} If true, activates a button with rounded corners.
  49088. */
  49089. set: function (val) {
  49090. this._attr('_shape', 'round', val);
  49091. },
  49092. enumerable: true,
  49093. configurable: true
  49094. });
  49095. Object.defineProperty(Button.prototype, "block", {
  49096. /**
  49097. * @input {boolean} If true, activates a button style that fills the available width.
  49098. */
  49099. set: function (val) {
  49100. this._attr('_display', 'block', val);
  49101. },
  49102. enumerable: true,
  49103. configurable: true
  49104. });
  49105. Object.defineProperty(Button.prototype, "full", {
  49106. /**
  49107. * @input {boolean} If true, activates a button style that fills the available width without
  49108. * a left and right border.
  49109. */
  49110. set: function (val) {
  49111. this._attr('_display', 'full', val);
  49112. },
  49113. enumerable: true,
  49114. configurable: true
  49115. });
  49116. Object.defineProperty(Button.prototype, "strong", {
  49117. /**
  49118. * @input {boolean} If true, activates a button with a heavier font weight.
  49119. */
  49120. set: function (val) {
  49121. this._attr('_decorator', 'strong', val);
  49122. },
  49123. enumerable: true,
  49124. configurable: true
  49125. });
  49126. Object.defineProperty(Button.prototype, "mode", {
  49127. /**
  49128. * @input {string} The mode determines which platform styles to use.
  49129. * Possible values are: `"ios"`, `"md"`, or `"wp"`.
  49130. * For more information, see [Platform Styles](/docs/theming/platform-specific-styles).
  49131. */
  49132. set: function (val) {
  49133. this._assignCss(false);
  49134. this._mode = val;
  49135. this._assignCss(true);
  49136. },
  49137. enumerable: true,
  49138. configurable: true
  49139. });
  49140. /** @hidden */
  49141. Button.prototype._attr = function (type, attrName, attrValue) {
  49142. if (type === '_style') {
  49143. this._updateColor(this._color, false);
  49144. }
  49145. this._setClass(this[type], false);
  49146. if (Object(__WEBPACK_IMPORTED_MODULE_3__util_util__["o" /* isTrueProperty */])(attrValue)) {
  49147. this[type] = attrName;
  49148. this._setClass(attrName, true);
  49149. }
  49150. else {
  49151. // Special handling for '_style' which defaults to 'default'.
  49152. this[type] = (type === '_style' ? 'default' : null);
  49153. this._setClass(this[type], true);
  49154. }
  49155. if (type === '_style') {
  49156. this._updateColor(this._color, true);
  49157. }
  49158. };
  49159. Object.defineProperty(Button.prototype, "color", {
  49160. /**
  49161. * @input {string} The color to use from your Sass `$colors` map.
  49162. * Default options are: `"primary"`, `"secondary"`, `"danger"`, `"light"`, and `"dark"`.
  49163. * For more information, see [Theming your App](/docs/theming/theming-your-app).
  49164. */
  49165. set: function (val) {
  49166. this._updateColor(this._color, false);
  49167. this._updateColor(val, true);
  49168. this._color = val;
  49169. },
  49170. enumerable: true,
  49171. configurable: true
  49172. });
  49173. /** @hidden */
  49174. Button.prototype.ngAfterContentInit = function () {
  49175. this._init = true;
  49176. this._assignCss(true);
  49177. };
  49178. /**
  49179. * @hidden
  49180. */
  49181. Button.prototype.setRole = function (val) {
  49182. this._assignCss(false);
  49183. this._role = val;
  49184. this._assignCss(true);
  49185. };
  49186. /**
  49187. * @hidden
  49188. */
  49189. Button.prototype._assignCss = function (assignCssClass) {
  49190. var role = this._role;
  49191. if (role) {
  49192. this.setElementClass(role, assignCssClass); // button
  49193. this.setElementClass(role + "-" + this._mode, assignCssClass); // button
  49194. this._setClass(this._style, assignCssClass); // button-clear
  49195. this._setClass(this._shape, assignCssClass); // button-round
  49196. this._setClass(this._display, assignCssClass); // button-full
  49197. this._setClass(this._size, assignCssClass); // button-small
  49198. this._setClass(this._decorator, assignCssClass); // button-strong
  49199. this._updateColor(this._color, assignCssClass); // button-secondary, bar-button-secondary
  49200. }
  49201. };
  49202. /**
  49203. * @hidden
  49204. */
  49205. Button.prototype._setClass = function (type, assignCssClass) {
  49206. if (type && this._init) {
  49207. type = type.toLocaleLowerCase();
  49208. this.setElementClass(this._role + "-" + type, assignCssClass);
  49209. this.setElementClass(this._role + "-" + type + "-" + this._mode, assignCssClass);
  49210. }
  49211. };
  49212. /**
  49213. * @hidden
  49214. */
  49215. Button.prototype._updateColor = function (color, isAdd) {
  49216. if (color && this._init) {
  49217. // The class should begin with the button role
  49218. // button, bar-button
  49219. var className = this._role;
  49220. // If the role is not a bar-button, don't apply the solid style
  49221. var style = this._style;
  49222. style = (this._role !== 'bar-button' && style === 'solid' ? 'default' : style);
  49223. className += (style !== null && style !== '' && style !== 'default' ? '-' + style.toLowerCase() : '');
  49224. if (color !== null && color !== '') {
  49225. this.setElementClass(className + "-" + this._mode + "-" + color, isAdd);
  49226. }
  49227. }
  49228. };
  49229. Button.decorators = [
  49230. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  49231. selector: '[ion-button]',
  49232. template: '<span class="button-inner">' +
  49233. '<ng-content></ng-content>' +
  49234. '</span>' +
  49235. '<div class="button-effect"></div>',
  49236. changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["i" /* ChangeDetectionStrategy */].OnPush,
  49237. encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_11" /* ViewEncapsulation */].None,
  49238. },] },
  49239. ];
  49240. /** @nocollapse */
  49241. Button.ctorParameters = function () { return [
  49242. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["g" /* Attribute */], args: ['ion-button',] },] },
  49243. { type: __WEBPACK_IMPORTED_MODULE_1__config_config__["a" /* Config */], },
  49244. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  49245. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  49246. ]; };
  49247. Button.propDecorators = {
  49248. 'large': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  49249. 'small': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  49250. 'default': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  49251. 'outline': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  49252. 'clear': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  49253. 'solid': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  49254. 'round': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  49255. 'block': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  49256. 'full': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  49257. 'strong': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  49258. 'mode': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  49259. 'color': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  49260. };
  49261. return Button;
  49262. }(__WEBPACK_IMPORTED_MODULE_2__ion__["a" /* Ion */]));
  49263. //# sourceMappingURL=button.js.map
  49264. /***/ }),
  49265. /* 37 */
  49266. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  49267. "use strict";
  49268. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Keyboard; });
  49269. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  49270. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__config_config__ = __webpack_require__(1);
  49271. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__dom_controller__ = __webpack_require__(8);
  49272. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_dom__ = __webpack_require__(10);
  49273. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__key__ = __webpack_require__(18);
  49274. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__platform__ = __webpack_require__(3);
  49275. /**
  49276. * @name Keyboard
  49277. * @description
  49278. * The `Keyboard` class allows you to work with the keyboard events provided
  49279. * by the Ionic keyboard plugin.
  49280. *
  49281. * @usage
  49282. * ```ts
  49283. * export class MyClass {
  49284. *
  49285. * constructor(public keyboard: Keyboard) { }
  49286. *
  49287. * }
  49288. * ```
  49289. */
  49290. var Keyboard = (function () {
  49291. function Keyboard(config, _plt, _zone, _dom) {
  49292. this._plt = _plt;
  49293. this._zone = _zone;
  49294. this._dom = _dom;
  49295. this.willShow = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  49296. this.willHide = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  49297. this.didShow = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  49298. this.didHide = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  49299. this.eventsAvailable = false;
  49300. this.focusOutline(config.get('focusOutline'));
  49301. var win = _plt.win();
  49302. if (win.Ionic && win.Ionic.keyboardPlugin) {
  49303. this.listenV2(win);
  49304. }
  49305. else {
  49306. this.listenV1(win);
  49307. }
  49308. }
  49309. Keyboard.prototype.listenV2 = function (win) {
  49310. var _this = this;
  49311. var platform = this._plt;
  49312. platform.registerListener(win, 'keyboardWillShow', function (ev) {
  49313. _this._zone.run(function () {
  49314. _this.willShow.emit(ev.keyboardHeight);
  49315. });
  49316. }, { zone: false, passive: true });
  49317. platform.registerListener(win, 'keyboardWillHide', function () {
  49318. _this._zone.run(function () {
  49319. _this.willHide.emit();
  49320. });
  49321. }, { zone: false, passive: true });
  49322. platform.registerListener(win, 'keyboardDidShow', function (ev) {
  49323. _this._zone.run(function () {
  49324. _this.didShow.emit(ev.keyboardHeight);
  49325. });
  49326. }, { zone: false, passive: true });
  49327. platform.registerListener(win, 'keyboardDidHide', function () {
  49328. _this._zone.run(function () {
  49329. _this.didHide.emit();
  49330. });
  49331. }, { zone: false, passive: true });
  49332. this.eventsAvailable = true;
  49333. };
  49334. Keyboard.prototype.listenV1 = function (win) {
  49335. var _this = this;
  49336. var platform = this._plt;
  49337. platform.registerListener(win, 'native.keyboardhide', function () {
  49338. _this.blurActiveInput(true);
  49339. }, { zone: false, passive: true });
  49340. platform.registerListener(win, 'native.keyboardshow', function () {
  49341. _this.blurActiveInput(false);
  49342. }, { zone: false, passive: true });
  49343. };
  49344. Keyboard.prototype.blurActiveInput = function (shouldBlur) {
  49345. var _this = this;
  49346. var platform = this._plt;
  49347. platform.cancelTimeout(this._tmr);
  49348. if (shouldBlur) {
  49349. this._tmr = platform.timeout(function () {
  49350. // this custom cordova plugin event fires when the keyboard will hide
  49351. // useful when the virtual keyboard is closed natively
  49352. // https://github.com/ionic-team/ionic-plugin-keyboard
  49353. if (_this.isOpen()) {
  49354. platform.focusOutActiveElement();
  49355. }
  49356. }, 80);
  49357. }
  49358. };
  49359. /**
  49360. * Check to see if the keyboard is open or not.
  49361. *
  49362. * ```ts
  49363. * export class MyClass {
  49364. * constructor(public keyboard: Keyboard) {
  49365. *
  49366. * }
  49367. *
  49368. * keyboardCheck() {
  49369. * console.log('The keyboard is open:', this.keyboard.isOpen());
  49370. * }
  49371. * }
  49372. * ```
  49373. *
  49374. * @return {boolean} returns a true or false value if the keyboard is open or not.
  49375. */
  49376. Keyboard.prototype.isOpen = function () {
  49377. return this.hasFocusedTextInput();
  49378. };
  49379. /**
  49380. * When the keyboard is closed, call any methods you want.
  49381. *
  49382. * ```ts
  49383. * export class MyClass {
  49384. * constructor(public keyboard: Keyboard) {
  49385. * this.keyboard.onClose(this.closeCallback);
  49386. * }
  49387. * closeCallback() {
  49388. * // call what ever functionality you want on keyboard close
  49389. * console.log('Closing time');
  49390. * }
  49391. * }
  49392. * ```
  49393. *
  49394. * @param {function} callback method you want to call when the keyboard has been closed.
  49395. * @return {function} returns a callback that gets fired when the keyboard is closed.
  49396. */
  49397. Keyboard.prototype.onClose = function (callback, pollingInternval, pollingChecksMax) {
  49398. if (pollingInternval === void 0) { pollingInternval = KEYBOARD_CLOSE_POLLING; }
  49399. if (pollingChecksMax === void 0) { pollingChecksMax = KEYBOARD_POLLING_CHECKS_MAX; }
  49400. (void 0) /* console.debug */;
  49401. var self = this;
  49402. var checks = 0;
  49403. var promise = null;
  49404. if (!callback) {
  49405. // a callback wasn't provided, so let's return a promise instead
  49406. promise = new Promise(function (resolve) { callback = resolve; });
  49407. }
  49408. function checkKeyboard() {
  49409. (void 0) /* console.debug */;
  49410. if (!self.isOpen() || checks > pollingChecksMax) {
  49411. self._plt.timeout(function () {
  49412. self._zone.run(function () {
  49413. (void 0) /* console.debug */;
  49414. callback();
  49415. });
  49416. }, 400);
  49417. }
  49418. else {
  49419. self._plt.timeout(checkKeyboard, pollingInternval);
  49420. }
  49421. checks++;
  49422. }
  49423. self._plt.timeout(checkKeyboard, pollingInternval);
  49424. return promise;
  49425. };
  49426. /**
  49427. * Programmatically close the keyboard.
  49428. */
  49429. Keyboard.prototype.close = function () {
  49430. var _this = this;
  49431. this._dom.read(function () {
  49432. if (_this.isOpen()) {
  49433. // only focus out when a text input has focus
  49434. (void 0) /* console.debug */;
  49435. _this._dom.write(function () {
  49436. _this._plt.focusOutActiveElement();
  49437. });
  49438. }
  49439. });
  49440. };
  49441. /**
  49442. * @hidden
  49443. */
  49444. Keyboard.prototype.focusOutline = function (setting) {
  49445. /* Focus Outline
  49446. * --------------------------------------------------
  49447. * By default, when a keydown event happens from a tab key, then
  49448. * the 'focus-outline' css class is added to the body element
  49449. * so focusable elements have an outline. On a mousedown or
  49450. * touchstart event, then the 'focus-outline' css class is removed.
  49451. *
  49452. * Config default overrides:
  49453. * focusOutline: true - Always add the focus-outline
  49454. * focusOutline: false - Do not add the focus-outline
  49455. */
  49456. var self = this;
  49457. var platform = self._plt;
  49458. var doc = platform.doc();
  49459. var isKeyInputEnabled = false;
  49460. var unRegMouse;
  49461. var unRegTouch;
  49462. var evOpts = { passive: true, zone: false };
  49463. function cssClass() {
  49464. self._dom.write(function () {
  49465. platform.doc().body.classList[isKeyInputEnabled ? 'add' : 'remove']('focus-outline');
  49466. });
  49467. }
  49468. if (setting === true) {
  49469. isKeyInputEnabled = true;
  49470. return cssClass();
  49471. }
  49472. else if (setting === false) {
  49473. return;
  49474. }
  49475. // default is to add the focus-outline when the tab key is used
  49476. function keyDown(ev) {
  49477. if (!isKeyInputEnabled && ev.keyCode === __WEBPACK_IMPORTED_MODULE_4__key__["g" /* KEY_TAB */]) {
  49478. isKeyInputEnabled = true;
  49479. enableKeyInput();
  49480. }
  49481. }
  49482. function pointerDown() {
  49483. isKeyInputEnabled = false;
  49484. enableKeyInput();
  49485. }
  49486. function enableKeyInput() {
  49487. cssClass();
  49488. unRegMouse && unRegMouse();
  49489. unRegTouch && unRegTouch();
  49490. if (isKeyInputEnabled) {
  49491. // listen for when a mousedown or touchstart event happens
  49492. unRegMouse = platform.registerListener(doc, 'mousedown', pointerDown, evOpts);
  49493. unRegTouch = platform.registerListener(doc, 'touchstart', pointerDown, evOpts);
  49494. }
  49495. }
  49496. // always listen for tab keydown events
  49497. platform.registerListener(platform.doc(), 'keydown', keyDown, evOpts);
  49498. };
  49499. Keyboard.prototype.hasFocusedTextInput = function () {
  49500. var activeEle = this._plt.getActiveElement();
  49501. if (Object(__WEBPACK_IMPORTED_MODULE_3__util_dom__["e" /* isTextInput */])(activeEle)) {
  49502. return (activeEle.parentElement.querySelector(':focus') === activeEle);
  49503. }
  49504. return false;
  49505. };
  49506. /**
  49507. * Set to true to hide the additional toolbar that is on top of the keyboard.
  49508. * This toolbar features the Prev, Next, and Done buttons.
  49509. * @param hidden
  49510. */
  49511. Keyboard.prototype.hideFormAccessoryBar = function (hidden) {
  49512. var win = this._plt.win();
  49513. if (win && win.Keyboard && win.Keyboard.hideFormAccessoryBar) {
  49514. win.Keyboard.hideFormAccessoryBar(hidden);
  49515. }
  49516. };
  49517. Keyboard.decorators = [
  49518. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */] },
  49519. ];
  49520. /** @nocollapse */
  49521. Keyboard.ctorParameters = function () { return [
  49522. { type: __WEBPACK_IMPORTED_MODULE_1__config_config__["a" /* Config */], },
  49523. { type: __WEBPACK_IMPORTED_MODULE_5__platform__["a" /* Platform */], },
  49524. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["M" /* NgZone */], },
  49525. { type: __WEBPACK_IMPORTED_MODULE_2__dom_controller__["a" /* DomController */], },
  49526. ]; };
  49527. return Keyboard;
  49528. }());
  49529. var KEYBOARD_CLOSE_POLLING = 150;
  49530. var KEYBOARD_POLLING_CHECKS_MAX = 100;
  49531. //# sourceMappingURL=keyboard.js.map
  49532. /***/ }),
  49533. /* 38 */
  49534. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  49535. "use strict";
  49536. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Haptic; });
  49537. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  49538. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__platform_platform__ = __webpack_require__(3);
  49539. /**
  49540. * @name Haptic
  49541. * @description
  49542. * The `Haptic` class interacts with a haptic engine on the device, if
  49543. * available. Generally, Ionic components use this under the hood, but you're
  49544. * welcome to get a bit crazy with it if you fancy.
  49545. *
  49546. * Currently, this uses the Taptic engine on iOS.
  49547. *
  49548. * @usage
  49549. * ```ts
  49550. * export class MyClass {
  49551. *
  49552. * constructor(haptic: Haptic) {
  49553. * haptic.selection();
  49554. * }
  49555. * }
  49556. *
  49557. * ```
  49558. */
  49559. var Haptic = (function () {
  49560. function Haptic(plt) {
  49561. var _this = this;
  49562. if (plt) {
  49563. plt.ready().then(function () {
  49564. _this._p = plt.win().TapticEngine;
  49565. });
  49566. }
  49567. }
  49568. /**
  49569. * Check to see if the Haptic Plugin is available
  49570. * @return {boolean} Returns true or false if the plugin is available
  49571. *
  49572. */
  49573. Haptic.prototype.available = function () {
  49574. return !!this._p;
  49575. };
  49576. /**
  49577. * Trigger a selection changed haptic event. Good for one-time events
  49578. * (not for gestures)
  49579. */
  49580. Haptic.prototype.selection = function () {
  49581. this._p && this._p.selection();
  49582. };
  49583. /**
  49584. * Tell the haptic engine that a gesture for a selection change is starting.
  49585. */
  49586. Haptic.prototype.gestureSelectionStart = function () {
  49587. this._p && this._p.gestureSelectionStart();
  49588. };
  49589. /**
  49590. * Tell the haptic engine that a selection changed during a gesture.
  49591. */
  49592. Haptic.prototype.gestureSelectionChanged = function () {
  49593. this._p && this._p.gestureSelectionChanged();
  49594. };
  49595. /**
  49596. * Tell the haptic engine we are done with a gesture. This needs to be
  49597. * called lest resources are not properly recycled.
  49598. */
  49599. Haptic.prototype.gestureSelectionEnd = function () {
  49600. this._p && this._p.gestureSelectionEnd();
  49601. };
  49602. /**
  49603. * Use this to indicate success/failure/warning to the user.
  49604. * options should be of the type `{ type: 'success' }` (or `warning`/`error`)
  49605. */
  49606. Haptic.prototype.notification = function (options) {
  49607. this._p && this._p.notification(options);
  49608. };
  49609. /**
  49610. * Use this to indicate success/failure/warning to the user.
  49611. * options should be of the type `{ style: 'light' }` (or `medium`/`heavy`)
  49612. */
  49613. Haptic.prototype.impact = function (options) {
  49614. this._p && this._p.impact(options);
  49615. };
  49616. Haptic.decorators = [
  49617. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */] },
  49618. ];
  49619. /** @nocollapse */
  49620. Haptic.ctorParameters = function () { return [
  49621. { type: __WEBPACK_IMPORTED_MODULE_1__platform_platform__["a" /* Platform */], },
  49622. ]; };
  49623. return Haptic;
  49624. }());
  49625. //# sourceMappingURL=haptic.js.map
  49626. /***/ }),
  49627. /* 39 */
  49628. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  49629. "use strict";
  49630. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return RootNode; });
  49631. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return SplitPane; });
  49632. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  49633. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__ion__ = __webpack_require__(4);
  49634. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_util__ = __webpack_require__(2);
  49635. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__config_config__ = __webpack_require__(1);
  49636. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__platform_platform__ = __webpack_require__(3);
  49637. var __extends = (this && this.__extends) || (function () {
  49638. var extendStatics = Object.setPrototypeOf ||
  49639. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  49640. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  49641. return function (d, b) {
  49642. extendStatics(d, b);
  49643. function __() { this.constructor = d; }
  49644. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  49645. };
  49646. })();
  49647. var QUERY = {
  49648. xs: '(min-width: 0px)',
  49649. sm: '(min-width: 576px)',
  49650. md: '(min-width: 768px)',
  49651. lg: '(min-width: 992px)',
  49652. xl: '(min-width: 1200px)',
  49653. never: ''
  49654. };
  49655. /**
  49656. * @hidden
  49657. */
  49658. var RootNode = (function () {
  49659. function RootNode() {
  49660. }
  49661. return RootNode;
  49662. }());
  49663. /**
  49664. * @name SplitPane
  49665. *
  49666. * @description
  49667. * SplitPane is a component that makes it possible to create multi-view layout.
  49668. * Similar to iPad apps, SplitPane allows UI elements, like Menus, to be
  49669. * displayed as the viewport increases.
  49670. *
  49671. * If the devices screen size is below a certain size, the SplitPane will
  49672. * collapse and the menu will become hidden again. This is especially useful when
  49673. * creating an app that will be served over a browser or deployed through the app
  49674. * store to phones and tablets.
  49675. *
  49676. * @usage
  49677. * To use SplitPane, simply add the component around your root component.
  49678. * In this example, we'll be using a sidemenu layout, similar to what is
  49679. * provided from the sidemenu starter template.
  49680. *
  49681. * ```html
  49682. * <ion-split-pane>
  49683. * <!-- our side menu -->
  49684. * <ion-menu [content]="content">
  49685. * <ion-header>
  49686. * <ion-toolbar>
  49687. * <ion-title>Menu</ion-title>
  49688. * </ion-toolbar>
  49689. * </ion-header>
  49690. * </ion-menu>
  49691. *
  49692. * <!-- the main content -->
  49693. * <ion-nav [root]="root" main #content></ion-nav>
  49694. * </ion-split-pane>
  49695. * ```
  49696. *
  49697. * Here, SplitPane will look for the element with the `main` attribute and make
  49698. * that the central component on larger screens. The `main` component can be any
  49699. * Ionic component (`ion-nav` or `ion-tabs`) except `ion-menu`.
  49700. *
  49701. * ### Setting breakpoints
  49702. *
  49703. * By default, SplitPane will expand when the screen is larger than 768px.
  49704. * If you want to customize this, use the `when` input. The `when` input can
  49705. * accept any valid media query, as it uses `matchMedia()` underneath.
  49706. *
  49707. * ```
  49708. * <ion-split-pane when="(min-width: 475px)">
  49709. *
  49710. * <!-- our side menu -->
  49711. * <ion-menu [content]="content">
  49712. * ....
  49713. * </ion-menu>
  49714. *
  49715. * <!-- the main content -->
  49716. * <ion-nav [root]="root" main #content></ion-nav>
  49717. * </ion-split-pane>
  49718. * ```
  49719. *
  49720. * SplitPane also provides some predefined media queries that can be used.
  49721. *
  49722. * ```html
  49723. * <!-- could be "xs", "sm", "md", "lg", or "xl" -->
  49724. * <ion-split-pane when="lg">
  49725. * ...
  49726. * </ion-split-pane>
  49727. * ```
  49728. *
  49729. *
  49730. * | Size | Value | Description |
  49731. * |------|-----------------------|-----------------------------------------------------------------------|
  49732. * | `xs` | `(min-width: 0px)` | Show the split-pane when the min-width is 0px (meaning, always) |
  49733. * | `sm` | `(min-width: 576px)` | Show the split-pane when the min-width is 576px |
  49734. * | `md` | `(min-width: 768px)` | Show the split-pane when the min-width is 768px (default break point) |
  49735. * | `lg` | `(min-width: 992px)` | Show the split-pane when the min-width is 992px |
  49736. * | `xl` | `(min-width: 1200px)` | Show the split-pane when the min-width is 1200px |
  49737. *
  49738. * You can also pass in boolean values that will trigger SplitPane when the value
  49739. * or expression evaluates to true.
  49740. *
  49741. *
  49742. * ```html
  49743. * <ion-split-pane [when]="isLarge">
  49744. * ...
  49745. * </ion-split-pane>
  49746. * ```
  49747. *
  49748. * ```ts
  49749. * class MyClass {
  49750. * public isLarge = false;
  49751. * constructor(){}
  49752. * }
  49753. * ```
  49754. *
  49755. * Or
  49756. *
  49757. * ```html
  49758. * <ion-split-pane [when]="shouldShow()">
  49759. * ...
  49760. * </ion-split-pane>
  49761. * ```
  49762. *
  49763. * ```ts
  49764. * class MyClass {
  49765. * constructor(){}
  49766. * shouldShow(){
  49767. * if(conditionA){
  49768. * return true
  49769. * } else {
  49770. * return false
  49771. * }
  49772. * }
  49773. * }
  49774. * ```
  49775. *
  49776. */
  49777. var SplitPane = (function (_super) {
  49778. __extends(SplitPane, _super);
  49779. function SplitPane(_zone, _plt, config, elementRef, renderer) {
  49780. var _this = _super.call(this, config, elementRef, renderer, 'split-pane') || this;
  49781. _this._zone = _zone;
  49782. _this._plt = _plt;
  49783. _this._init = false;
  49784. _this._visible = false;
  49785. _this._isEnabled = true;
  49786. _this._mediaQuery = QUERY['md'];
  49787. /**
  49788. * @hidden
  49789. */
  49790. _this.sideContent = null;
  49791. /**
  49792. * @hidden
  49793. */
  49794. _this.mainContent = null;
  49795. /**
  49796. * @output {any} Expression to be called when the split-pane visibility has changed
  49797. */
  49798. _this.ionChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  49799. return _this;
  49800. }
  49801. Object.defineProperty(SplitPane.prototype, "_setchildren", {
  49802. /**
  49803. * @hidden
  49804. */
  49805. set: function (query) {
  49806. var _this = this;
  49807. var children = this._children = query.filter((function (child) { return child !== _this; }));
  49808. children.forEach(function (child) {
  49809. var isMain = child.initPane();
  49810. _this._setPaneCSSClass(child.getElementRef(), isMain);
  49811. });
  49812. },
  49813. enumerable: true,
  49814. configurable: true
  49815. });
  49816. Object.defineProperty(SplitPane.prototype, "when", {
  49817. get: function () {
  49818. return this._mediaQuery;
  49819. },
  49820. /**
  49821. * @input {string | boolean} When the split-pane should be shown.
  49822. * Can be a CSS media query expression, or a shortcut expression.
  49823. * Can also be a boolean expression.
  49824. */
  49825. set: function (query) {
  49826. if (typeof query === 'boolean') {
  49827. this._mediaQuery = query;
  49828. }
  49829. else {
  49830. var defaultQuery = QUERY[query];
  49831. this._mediaQuery = (defaultQuery)
  49832. ? defaultQuery
  49833. : query;
  49834. }
  49835. this._update();
  49836. },
  49837. enumerable: true,
  49838. configurable: true
  49839. });
  49840. Object.defineProperty(SplitPane.prototype, "enabled", {
  49841. get: function () {
  49842. return this._isEnabled;
  49843. },
  49844. /**
  49845. * @input {boolean} If `false`, the split-pane is disabled, ie. the side pane will
  49846. * never be displayed. Default `true`.
  49847. */
  49848. set: function (val) {
  49849. this._isEnabled = Object(__WEBPACK_IMPORTED_MODULE_2__util_util__["o" /* isTrueProperty */])(val);
  49850. this._update();
  49851. },
  49852. enumerable: true,
  49853. configurable: true
  49854. });
  49855. /**
  49856. * @hidden
  49857. */
  49858. SplitPane.prototype._register = function (node, isMain, callback) {
  49859. if (this.getElementRef().nativeElement !== node.getElementRef().nativeElement.parentNode) {
  49860. return false;
  49861. }
  49862. this._setPaneCSSClass(node.getElementRef(), isMain);
  49863. if (callback) {
  49864. this.ionChange.subscribe(callback);
  49865. }
  49866. if (isMain) {
  49867. if (this.mainContent) {
  49868. console.error('split pane: main content was already set');
  49869. }
  49870. this.mainContent = node;
  49871. }
  49872. return true;
  49873. };
  49874. /**
  49875. * @hidden
  49876. */
  49877. SplitPane.prototype.ngAfterViewInit = function () {
  49878. this._init = true;
  49879. this._update();
  49880. };
  49881. /**
  49882. * @hidden
  49883. */
  49884. SplitPane.prototype._update = function () {
  49885. var _this = this;
  49886. if (!this._init) {
  49887. return;
  49888. }
  49889. // Unlisten
  49890. this._rmListener && this._rmListener();
  49891. this._rmListener = null;
  49892. // Check if the split-pane is disabled
  49893. if (!this._isEnabled) {
  49894. this._setVisible(false);
  49895. return;
  49896. }
  49897. var query = this._mediaQuery;
  49898. if (typeof query === 'boolean') {
  49899. this._setVisible(query);
  49900. return;
  49901. }
  49902. if (query && query.length > 0) {
  49903. // Listen
  49904. var callback_1 = function (query) { return _this._setVisible(query.matches); };
  49905. var mediaList_1 = this._plt.win().matchMedia(query);
  49906. mediaList_1.addListener(callback_1);
  49907. this._setVisible(mediaList_1.matches);
  49908. this._rmListener = function () {
  49909. mediaList_1.removeListener(callback_1);
  49910. };
  49911. }
  49912. else {
  49913. this._setVisible(false);
  49914. }
  49915. };
  49916. /**
  49917. * @hidden
  49918. */
  49919. SplitPane.prototype._updateChildren = function () {
  49920. this.mainContent = null;
  49921. this.sideContent = null;
  49922. var visible = this._visible;
  49923. this._children.forEach(function (child) { return child.paneChanged && child.paneChanged(visible); });
  49924. };
  49925. /**
  49926. * @hidden
  49927. */
  49928. SplitPane.prototype._setVisible = function (visible) {
  49929. var _this = this;
  49930. if (this._visible === visible) {
  49931. return;
  49932. }
  49933. this._visible = visible;
  49934. this.setElementClass('split-pane-visible', visible);
  49935. this._updateChildren();
  49936. this._zone.run(function () {
  49937. _this.ionChange.emit(_this);
  49938. });
  49939. };
  49940. /**
  49941. * @hidden
  49942. */
  49943. SplitPane.prototype.isVisible = function () {
  49944. return this._visible;
  49945. };
  49946. /**
  49947. * @hidden
  49948. */
  49949. SplitPane.prototype.setElementClass = function (className, add) {
  49950. this._renderer.setElementClass(this._elementRef.nativeElement, className, add);
  49951. };
  49952. /**
  49953. * @hidden
  49954. */
  49955. SplitPane.prototype._setPaneCSSClass = function (elementRef, isMain) {
  49956. var ele = elementRef.nativeElement;
  49957. this._renderer.setElementClass(ele, 'split-pane-main', isMain);
  49958. this._renderer.setElementClass(ele, 'split-pane-side', !isMain);
  49959. };
  49960. /**
  49961. * @hidden
  49962. */
  49963. SplitPane.prototype.ngOnDestroy = function () {
  49964. (void 0) /* assert */;
  49965. this._rmListener && this._rmListener();
  49966. this._rmListener = null;
  49967. };
  49968. /**
  49969. * @hidden
  49970. */
  49971. SplitPane.prototype.initPane = function () {
  49972. return true;
  49973. };
  49974. SplitPane.decorators = [
  49975. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  49976. selector: 'ion-split-pane',
  49977. providers: [{ provide: RootNode, useExisting: Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_14" /* forwardRef */])(function () { return SplitPane; }) }]
  49978. },] },
  49979. ];
  49980. /** @nocollapse */
  49981. SplitPane.ctorParameters = function () { return [
  49982. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["M" /* NgZone */], },
  49983. { type: __WEBPACK_IMPORTED_MODULE_4__platform_platform__["a" /* Platform */], },
  49984. { type: __WEBPACK_IMPORTED_MODULE_3__config_config__["a" /* Config */], },
  49985. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  49986. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  49987. ]; };
  49988. SplitPane.propDecorators = {
  49989. '_setchildren': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["r" /* ContentChildren */], args: [RootNode, { descendants: false },] },],
  49990. 'when': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  49991. 'enabled': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  49992. 'ionChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  49993. };
  49994. return SplitPane;
  49995. }(__WEBPACK_IMPORTED_MODULE_1__ion__["a" /* Ion */]));
  49996. //# sourceMappingURL=split-pane.js.map
  49997. /***/ }),
  49998. /* 40 */
  49999. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  50000. "use strict";
  50001. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Navbar; });
  50002. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  50003. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__app_app__ = __webpack_require__(6);
  50004. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__config_config__ = __webpack_require__(1);
  50005. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_util__ = __webpack_require__(2);
  50006. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__navigation_nav_controller__ = __webpack_require__(22);
  50007. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__toolbar_base__ = __webpack_require__(152);
  50008. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__navigation_view_controller__ = __webpack_require__(5);
  50009. var __extends = (this && this.__extends) || (function () {
  50010. var extendStatics = Object.setPrototypeOf ||
  50011. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  50012. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  50013. return function (d, b) {
  50014. extendStatics(d, b);
  50015. function __() { this.constructor = d; }
  50016. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  50017. };
  50018. })();
  50019. /**
  50020. * @name Navbar
  50021. * @description
  50022. * Navbar acts as the navigational toolbar, which also comes with a back
  50023. * button. A navbar can contain a `ion-title`, any number of buttons,
  50024. * a segment, or a searchbar. Navbars must be placed within an
  50025. * `<ion-header>` in order for them to be placed above the content.
  50026. * It's important to note that navbar's are part of the dynamic navigation
  50027. * stack. If you need a static toolbar, use ion-toolbar.
  50028. *
  50029. * @usage
  50030. * ```html
  50031. * <ion-header>
  50032. *
  50033. * <ion-navbar>
  50034. * <button ion-button icon-only menuToggle>
  50035. * <ion-icon name="menu"></ion-icon>
  50036. * </button>
  50037. *
  50038. * <ion-title>
  50039. * Page Title
  50040. * </ion-title>
  50041. *
  50042. * <ion-buttons end>
  50043. * <button ion-button icon-only (click)="openModal()">
  50044. * <ion-icon name="options"></ion-icon>
  50045. * </button>
  50046. * </ion-buttons>
  50047. * </ion-navbar>
  50048. *
  50049. * </ion-header>
  50050. * ```
  50051. *
  50052. * @demo /docs/demos/src/navbar/
  50053. * @see {@link ../../toolbar/Toolbar/ Toolbar API Docs}
  50054. */
  50055. var Navbar = (function (_super) {
  50056. __extends(Navbar, _super);
  50057. function Navbar(_app, viewCtrl, navCtrl, config, elementRef, renderer) {
  50058. var _this = _super.call(this, config, elementRef, renderer) || this;
  50059. _this._app = _app;
  50060. _this.navCtrl = navCtrl;
  50061. /**
  50062. * @hidden
  50063. */
  50064. _this._hidden = false;
  50065. /**
  50066. * @hidden
  50067. */
  50068. _this._hideBb = false;
  50069. viewCtrl && viewCtrl._setNavbar(_this);
  50070. _this._bbIcon = config.get('backButtonIcon');
  50071. _this._sbPadding = config.getBoolean('statusbarPadding');
  50072. _this._backText = config.get('backButtonText', 'Back');
  50073. return _this;
  50074. }
  50075. Object.defineProperty(Navbar.prototype, "hideBackButton", {
  50076. /**
  50077. * @input {boolean} If true, the back button will be hidden.
  50078. */
  50079. get: function () {
  50080. return this._hideBb;
  50081. },
  50082. set: function (val) {
  50083. this._hideBb = Object(__WEBPACK_IMPORTED_MODULE_3__util_util__["o" /* isTrueProperty */])(val);
  50084. },
  50085. enumerable: true,
  50086. configurable: true
  50087. });
  50088. Navbar.prototype.backButtonClick = function (ev) {
  50089. ev.preventDefault();
  50090. ev.stopPropagation();
  50091. this.navCtrl && this.navCtrl.pop(null, null);
  50092. };
  50093. /**
  50094. * Set the text of the Back Button in the Nav Bar. Defaults to "Back".
  50095. */
  50096. Navbar.prototype.setBackButtonText = function (text) {
  50097. this._backText = text;
  50098. };
  50099. /**
  50100. * @hidden
  50101. */
  50102. Navbar.prototype.didEnter = function () {
  50103. try {
  50104. this._app.setTitle(this.getTitleText());
  50105. }
  50106. catch (e) {
  50107. console.error(e);
  50108. }
  50109. };
  50110. /**
  50111. * @hidden
  50112. */
  50113. Navbar.prototype.setHidden = function (isHidden) {
  50114. // used to display none/block the navbar
  50115. this._hidden = isHidden;
  50116. };
  50117. Navbar.decorators = [
  50118. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  50119. selector: 'ion-navbar',
  50120. template: '<div class="toolbar-background" [ngClass]="\'toolbar-background-\' + _mode"></div>' +
  50121. '<button (click)="backButtonClick($event)" ion-button="bar-button" class="back-button" [ngClass]="\'back-button-\' + _mode" [hidden]="_hideBb">' +
  50122. '<ion-icon class="back-button-icon" [ngClass]="\'back-button-icon-\' + _mode" [name]="_bbIcon"></ion-icon>' +
  50123. '<span class="back-button-text" [ngClass]="\'back-button-text-\' + _mode">{{_backText}}</span>' +
  50124. '</button>' +
  50125. '<ng-content select="[menuToggle],ion-buttons[left]"></ng-content>' +
  50126. '<ng-content select="ion-buttons[start]"></ng-content>' +
  50127. '<ng-content select="ion-buttons[end],ion-buttons[right]"></ng-content>' +
  50128. '<div class="toolbar-content" [ngClass]="\'toolbar-content-\' + _mode">' +
  50129. '<ng-content></ng-content>' +
  50130. '</div>',
  50131. host: {
  50132. '[hidden]': '_hidden',
  50133. 'class': 'toolbar',
  50134. '[class.statusbar-padding]': '_sbPadding'
  50135. }
  50136. },] },
  50137. ];
  50138. /** @nocollapse */
  50139. Navbar.ctorParameters = function () { return [
  50140. { type: __WEBPACK_IMPORTED_MODULE_1__app_app__["a" /* App */], },
  50141. { type: __WEBPACK_IMPORTED_MODULE_6__navigation_view_controller__["a" /* ViewController */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  50142. { type: __WEBPACK_IMPORTED_MODULE_4__navigation_nav_controller__["a" /* NavController */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  50143. { type: __WEBPACK_IMPORTED_MODULE_2__config_config__["a" /* Config */], },
  50144. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  50145. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  50146. ]; };
  50147. Navbar.propDecorators = {
  50148. 'hideBackButton': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  50149. };
  50150. return Navbar;
  50151. }(__WEBPACK_IMPORTED_MODULE_5__toolbar_base__["a" /* ToolbarBase */]));
  50152. //# sourceMappingURL=navbar.js.map
  50153. /***/ }),
  50154. /* 41 */
  50155. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  50156. "use strict";
  50157. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return UrlSerializer; });
  50158. /* harmony export (immutable) */ __webpack_exports__["c"] = formatUrlPart;
  50159. /* unused harmony export isPartMatch */
  50160. /* unused harmony export createMatchedData */
  50161. /* unused harmony export findLinkByComponentData */
  50162. /* unused harmony export normalizeLinks */
  50163. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DeepLinkConfigToken; });
  50164. /* harmony export (immutable) */ __webpack_exports__["d"] = setupUrlSerializer;
  50165. /* unused harmony export navGroupStringtoObjects */
  50166. /* unused harmony export urlToNavGroupStrings */
  50167. /* unused harmony export convertUrlToSegments */
  50168. /* unused harmony export convertUrlToDehydratedSegments */
  50169. /* unused harmony export hydrateSegmentsWithNav */
  50170. /* unused harmony export getNavFromNavGroup */
  50171. /* unused harmony export getSegmentsFromNavGroups */
  50172. /* unused harmony export getSegmentsFromUrlPieces */
  50173. /* unused harmony export hydrateSegment */
  50174. /* unused harmony export getNonHydratedSegmentIfLinkAndUrlMatch */
  50175. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  50176. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_util__ = __webpack_require__(2);
  50177. /**
  50178. * @hidden
  50179. */
  50180. var UrlSerializer = (function () {
  50181. function UrlSerializer(_app, config) {
  50182. this._app = _app;
  50183. if (config && Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["e" /* isArray */])(config.links)) {
  50184. this.links = normalizeLinks(config.links);
  50185. }
  50186. else {
  50187. this.links = [];
  50188. }
  50189. }
  50190. /**
  50191. * Parse the URL into a Path, which is made up of multiple NavSegments.
  50192. * Match which components belong to each segment.
  50193. */
  50194. UrlSerializer.prototype.parse = function (browserUrl) {
  50195. if (browserUrl.charAt(0) === '/') {
  50196. browserUrl = browserUrl.substr(1);
  50197. }
  50198. // trim off data after ? and #
  50199. browserUrl = browserUrl.split('?')[0].split('#')[0];
  50200. return convertUrlToSegments(this._app, browserUrl, this.links);
  50201. };
  50202. UrlSerializer.prototype.createSegmentFromName = function (navContainer, nameOrComponent) {
  50203. var configLink = this.getLinkFromName(nameOrComponent);
  50204. if (configLink) {
  50205. return this._createSegment(this._app, navContainer, configLink, null);
  50206. }
  50207. return null;
  50208. };
  50209. UrlSerializer.prototype.getLinkFromName = function (nameOrComponent) {
  50210. return this.links.find(function (link) {
  50211. return (link.component === nameOrComponent) ||
  50212. (link.name === nameOrComponent);
  50213. });
  50214. };
  50215. /**
  50216. * Serialize a path, which is made up of multiple NavSegments,
  50217. * into a URL string. Turn each segment into a string and concat them to a URL.
  50218. */
  50219. UrlSerializer.prototype.serialize = function (segments) {
  50220. if (!segments || !segments.length) {
  50221. return '/';
  50222. }
  50223. var sections = segments.map(function (segment) {
  50224. if (segment.type === 'tabs') {
  50225. if (segment.requiresExplicitNavPrefix) {
  50226. return "/" + segment.type + "/" + segment.navId + "/" + segment.secondaryId + "/" + segment.id;
  50227. }
  50228. return "/" + segment.secondaryId + "/" + segment.id;
  50229. }
  50230. // it's a nav
  50231. if (segment.requiresExplicitNavPrefix) {
  50232. return "/" + segment.type + "/" + segment.navId + "/" + segment.id;
  50233. }
  50234. return "/" + segment.id;
  50235. });
  50236. return sections.join('');
  50237. };
  50238. /**
  50239. * Serializes a component and its data into a NavSegment.
  50240. */
  50241. UrlSerializer.prototype.serializeComponent = function (navContainer, component, data) {
  50242. if (component) {
  50243. var link = findLinkByComponentData(this.links, component, data);
  50244. if (link) {
  50245. return this._createSegment(this._app, navContainer, link, data);
  50246. }
  50247. }
  50248. return null;
  50249. };
  50250. /**
  50251. * @internal
  50252. */
  50253. UrlSerializer.prototype._createSegment = function (app, navContainer, configLink, data) {
  50254. var urlParts = configLink.segmentParts;
  50255. if (Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["l" /* isPresent */])(data)) {
  50256. // create a copy of the original parts in the link config
  50257. urlParts = urlParts.slice();
  50258. // loop through all the data and convert it to a string
  50259. var keys = Object.keys(data);
  50260. var keysLength = keys.length;
  50261. if (keysLength) {
  50262. for (var i = 0; i < urlParts.length; i++) {
  50263. if (urlParts[i].charAt(0) === ':') {
  50264. for (var j = 0; j < keysLength; j++) {
  50265. if (urlParts[i] === ":" + keys[j]) {
  50266. // this data goes into the URL part (between slashes)
  50267. urlParts[i] = encodeURIComponent(data[keys[j]]);
  50268. break;
  50269. }
  50270. }
  50271. }
  50272. }
  50273. }
  50274. }
  50275. var requiresExplicitPrefix = true;
  50276. if (navContainer.parent) {
  50277. requiresExplicitPrefix = navContainer.parent && navContainer.parent.getAllChildNavs().length > 1;
  50278. }
  50279. else {
  50280. // if it's a root nav, and there are multiple root navs, we need an explicit prefix
  50281. requiresExplicitPrefix = app.getRootNavById(navContainer.id) && app.getRootNavs().length > 1;
  50282. }
  50283. return {
  50284. id: urlParts.join('/'),
  50285. name: configLink.name,
  50286. component: configLink.component,
  50287. loadChildren: configLink.loadChildren,
  50288. data: data,
  50289. defaultHistory: configLink.defaultHistory,
  50290. navId: navContainer.name || navContainer.id,
  50291. type: navContainer.getType(),
  50292. secondaryId: navContainer.getSecondaryIdentifier(),
  50293. requiresExplicitNavPrefix: requiresExplicitPrefix
  50294. };
  50295. };
  50296. return UrlSerializer;
  50297. }());
  50298. function formatUrlPart(name) {
  50299. name = name.replace(URL_REPLACE_REG, '-');
  50300. name = name.charAt(0).toLowerCase() + name.substring(1).replace(/[A-Z]/g, function (match) {
  50301. return '-' + match.toLowerCase();
  50302. });
  50303. while (name.indexOf('--') > -1) {
  50304. name = name.replace('--', '-');
  50305. }
  50306. if (name.charAt(0) === '-') {
  50307. name = name.substring(1);
  50308. }
  50309. if (name.substring(name.length - 1) === '-') {
  50310. name = name.substring(0, name.length - 1);
  50311. }
  50312. return encodeURIComponent(name);
  50313. }
  50314. var isPartMatch = function (urlPart, configLinkPart) {
  50315. if (Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["l" /* isPresent */])(urlPart) && Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["l" /* isPresent */])(configLinkPart)) {
  50316. if (configLinkPart.charAt(0) === ':') {
  50317. return true;
  50318. }
  50319. return (urlPart === configLinkPart);
  50320. }
  50321. return false;
  50322. };
  50323. var createMatchedData = function (matchedUrlParts, link) {
  50324. var data = null;
  50325. for (var i = 0; i < link.segmentPartsLen; i++) {
  50326. if (link.segmentParts[i].charAt(0) === ':') {
  50327. data = data || {};
  50328. data[link.segmentParts[i].substring(1)] = decodeURIComponent(matchedUrlParts[i]);
  50329. }
  50330. }
  50331. return data;
  50332. };
  50333. var findLinkByComponentData = function (links, component, instanceData) {
  50334. var foundLink = null;
  50335. var foundLinkDataMatches = -1;
  50336. for (var i = 0; i < links.length; i++) {
  50337. var link = links[i];
  50338. if (link.component === component) {
  50339. // ok, so the component matched, but multiple links can point
  50340. // to the same component, so let's make sure this is the right link
  50341. var dataMatches = 0;
  50342. if (instanceData) {
  50343. var instanceDataKeys = Object.keys(instanceData);
  50344. // this link has data
  50345. for (var j = 0; j < instanceDataKeys.length; j++) {
  50346. if (Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["l" /* isPresent */])(link.dataKeys[instanceDataKeys[j]])) {
  50347. dataMatches++;
  50348. }
  50349. }
  50350. }
  50351. else if (link.dataLen) {
  50352. // this component does not have data but the link does
  50353. continue;
  50354. }
  50355. if (dataMatches >= foundLinkDataMatches) {
  50356. foundLink = link;
  50357. foundLinkDataMatches = dataMatches;
  50358. }
  50359. }
  50360. }
  50361. return foundLink;
  50362. };
  50363. var normalizeLinks = function (links) {
  50364. for (var i = 0, ilen = links.length; i < ilen; i++) {
  50365. var link = links[i];
  50366. if (Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["f" /* isBlank */])(link.segment)) {
  50367. link.segment = link.name;
  50368. }
  50369. link.dataKeys = {};
  50370. link.segmentParts = link.segment.split('/');
  50371. link.segmentPartsLen = link.segmentParts.length;
  50372. // used for sorting
  50373. link.staticLen = link.dataLen = 0;
  50374. var stillCountingStatic = true;
  50375. for (var j = 0; j < link.segmentPartsLen; j++) {
  50376. if (link.segmentParts[j].charAt(0) === ':') {
  50377. link.dataLen++;
  50378. stillCountingStatic = false;
  50379. link.dataKeys[link.segmentParts[j].substring(1)] = true;
  50380. }
  50381. else if (stillCountingStatic) {
  50382. link.staticLen++;
  50383. }
  50384. }
  50385. }
  50386. // sort by the number of parts, with the links
  50387. // with the most parts first
  50388. return links.sort(sortConfigLinks);
  50389. };
  50390. function sortConfigLinks(a, b) {
  50391. // sort by the number of parts
  50392. if (a.segmentPartsLen > b.segmentPartsLen) {
  50393. return -1;
  50394. }
  50395. if (a.segmentPartsLen < b.segmentPartsLen) {
  50396. return 1;
  50397. }
  50398. // sort by the number of static parts in a row
  50399. if (a.staticLen > b.staticLen) {
  50400. return -1;
  50401. }
  50402. if (a.staticLen < b.staticLen) {
  50403. return 1;
  50404. }
  50405. // sort by the number of total data parts
  50406. if (a.dataLen < b.dataLen) {
  50407. return -1;
  50408. }
  50409. if (a.dataLen > b.dataLen) {
  50410. return 1;
  50411. }
  50412. return 0;
  50413. }
  50414. var URL_REPLACE_REG = /\s+|\?|\!|\$|\,|\.|\+|\"|\'|\*|\^|\||\/|\\|\[|\]|#|%|`|>|<|;|:|@|&|=/g;
  50415. /**
  50416. * @hidden
  50417. */
  50418. var DeepLinkConfigToken = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["B" /* InjectionToken */]('USERLINKS');
  50419. function setupUrlSerializer(app, userDeepLinkConfig) {
  50420. return new UrlSerializer(app, userDeepLinkConfig);
  50421. }
  50422. function navGroupStringtoObjects(navGroupStrings) {
  50423. // each string has a known format-ish, convert it to it
  50424. return navGroupStrings.map(function (navGroupString) {
  50425. var sections = navGroupString.split('/');
  50426. if (sections[0] === 'nav') {
  50427. return {
  50428. type: 'nav',
  50429. navId: sections[1],
  50430. niceId: sections[1],
  50431. secondaryId: null,
  50432. segmentPieces: sections.splice(2)
  50433. };
  50434. }
  50435. else if (sections[0] === 'tabs') {
  50436. return {
  50437. type: 'tabs',
  50438. navId: sections[1],
  50439. niceId: sections[1],
  50440. secondaryId: sections[2],
  50441. segmentPieces: sections.splice(3)
  50442. };
  50443. }
  50444. return {
  50445. type: null,
  50446. navId: null,
  50447. niceId: null,
  50448. secondaryId: null,
  50449. segmentPieces: sections
  50450. };
  50451. });
  50452. }
  50453. function urlToNavGroupStrings(url) {
  50454. var tokens = url.split('/');
  50455. var keywordIndexes = [];
  50456. for (var i = 0; i < tokens.length; i++) {
  50457. if (i !== 0 && (tokens[i] === 'nav' || tokens[i] === 'tabs')) {
  50458. keywordIndexes.push(i);
  50459. }
  50460. }
  50461. // append the last index + 1 to the list no matter what
  50462. keywordIndexes.push(tokens.length);
  50463. var groupings = [];
  50464. var activeKeywordIndex = 0;
  50465. var tmpArray = [];
  50466. for (var i = 0; i < tokens.length; i++) {
  50467. if (i >= keywordIndexes[activeKeywordIndex]) {
  50468. groupings.push(tmpArray.join('/'));
  50469. tmpArray = [];
  50470. activeKeywordIndex++;
  50471. }
  50472. tmpArray.push(tokens[i]);
  50473. }
  50474. // okay, after the loop we've gotta push one more time just to be safe
  50475. groupings.push(tmpArray.join('/'));
  50476. return groupings;
  50477. }
  50478. function convertUrlToSegments(app, url, navLinks) {
  50479. var pairs = convertUrlToDehydratedSegments(url, navLinks);
  50480. return hydrateSegmentsWithNav(app, pairs);
  50481. }
  50482. function convertUrlToDehydratedSegments(url, navLinks) {
  50483. var navGroupStrings = urlToNavGroupStrings(url);
  50484. var navGroups = navGroupStringtoObjects(navGroupStrings);
  50485. return getSegmentsFromNavGroups(navGroups, navLinks);
  50486. }
  50487. function hydrateSegmentsWithNav(app, dehydratedSegmentPairs) {
  50488. var segments = [];
  50489. for (var i = 0; i < dehydratedSegmentPairs.length; i++) {
  50490. var navs = getNavFromNavGroup(dehydratedSegmentPairs[i].navGroup, app);
  50491. // okay, cool, let's walk through the segments and hydrate them
  50492. for (var _i = 0, _a = dehydratedSegmentPairs[i].segments; _i < _a.length; _i++) {
  50493. var dehydratedSegment = _a[_i];
  50494. if (navs.length === 1) {
  50495. segments.push(hydrateSegment(dehydratedSegment, navs[0]));
  50496. navs = navs[0].getActiveChildNavs();
  50497. }
  50498. else if (navs.length > 1) {
  50499. // this is almost certainly an async race condition bug in userland
  50500. // if you're in this state, it would be nice to just bail here
  50501. // but alas we must perservere and handle the issue
  50502. // the simple solution is to just use the last child
  50503. // because that is probably what the user wants anyway
  50504. // remember, do not harm, even if it makes our shizzle ugly
  50505. segments.push(hydrateSegment(dehydratedSegment, navs[navs.length - 1]));
  50506. navs = navs[navs.length - 1].getActiveChildNavs();
  50507. }
  50508. else {
  50509. break;
  50510. }
  50511. }
  50512. }
  50513. return segments;
  50514. }
  50515. function getNavFromNavGroup(navGroup, app) {
  50516. if (navGroup.navId) {
  50517. var rootNav = app.getNavByIdOrName(navGroup.navId);
  50518. if (rootNav) {
  50519. return [rootNav];
  50520. }
  50521. return [];
  50522. }
  50523. // we don't know what nav to use, so just use the root nav.
  50524. // if there is more than one root nav, throw an error
  50525. return app.getRootNavs();
  50526. }
  50527. /*
  50528. * Let's face the facts: Getting a dehydrated segment from the url is really hard
  50529. * because we need to do a ton of crazy looping
  50530. * the are chunks of a url that are totally irrelevant at this stage, such as the secondary identifier
  50531. * stating which tab is selected, etc.
  50532. * but is necessary.
  50533. * We look at segment pieces in reverse order to try to build segments
  50534. * as in, if you had an array like this
  50535. * ['my', 'super', 'cool', 'url']
  50536. * we want to look at the pieces in reverse order:
  50537. * url
  50538. * cool url
  50539. * super cool url
  50540. * my super cool url
  50541. * cool
  50542. * super cool
  50543. * my super cool
  50544. * super
  50545. * my super
  50546. * my
  50547. **/
  50548. function getSegmentsFromNavGroups(navGroups, navLinks) {
  50549. var pairs = [];
  50550. var usedNavLinks = new Set();
  50551. for (var _i = 0, navGroups_1 = navGroups; _i < navGroups_1.length; _i++) {
  50552. var navGroup = navGroups_1[_i];
  50553. var segments = [];
  50554. var segmentPieces = navGroup.segmentPieces.concat([]);
  50555. for (var i = segmentPieces.length; i >= 0; i--) {
  50556. var created = false;
  50557. for (var j = 0; j < i; j++) {
  50558. var startIndex = i - j - 1;
  50559. var endIndex = i;
  50560. var subsetOfUrl = segmentPieces.slice(startIndex, endIndex);
  50561. for (var _a = 0, navLinks_1 = navLinks; _a < navLinks_1.length; _a++) {
  50562. var navLink = navLinks_1[_a];
  50563. if (!usedNavLinks.has(navLink.name)) {
  50564. var segment = getSegmentsFromUrlPieces(subsetOfUrl, navLink);
  50565. if (segment) {
  50566. i = startIndex + 1;
  50567. usedNavLinks.add(navLink.name);
  50568. created = true;
  50569. // sweet, we found a segment
  50570. segments.push(segment);
  50571. // now we want to null out the url subsection in the segmentPieces
  50572. for (var k = startIndex; k < endIndex; k++) {
  50573. segmentPieces[k] = null;
  50574. }
  50575. break;
  50576. }
  50577. }
  50578. }
  50579. if (created) {
  50580. break;
  50581. }
  50582. }
  50583. if (!created && segmentPieces[i - 1]) {
  50584. // this is very likely a tab's secondary identifier
  50585. segments.push({
  50586. id: null,
  50587. name: null,
  50588. secondaryId: segmentPieces[i - 1],
  50589. component: null,
  50590. loadChildren: null,
  50591. data: null,
  50592. defaultHistory: null
  50593. });
  50594. }
  50595. }
  50596. // since we're getting segments in from right-to-left in the url, reverse them
  50597. // so they're in the correct order. Also filter out and bogus segments
  50598. var orderedSegments = segments.reverse();
  50599. // okay, this is the lazy persons approach here.
  50600. // so here's the deal! Right now if section of the url is not a part of a segment
  50601. // it is almost certainly the secondaryId for a tabs component
  50602. // basically, knowing the segment for the `tab` itself is good, but we also need to know
  50603. // which tab is selected, so we have an identifer in the url that is associated with the tabs component
  50604. // telling us which tab is selected. With that in mind, we are going to go through and find the segments with only secondary identifiers,
  50605. // and simply add the secondaryId to the next segment, and then remove the empty segment from the list
  50606. for (var i = 0; i < orderedSegments.length; i++) {
  50607. if (orderedSegments[i].secondaryId && !orderedSegments[i].id && ((i + 1) <= orderedSegments.length - 1)) {
  50608. orderedSegments[i + 1].secondaryId = orderedSegments[i].secondaryId;
  50609. orderedSegments[i] = null;
  50610. }
  50611. }
  50612. var cleanedSegments = segments.filter(function (segment) { return !!segment; });
  50613. // if the nav group has a secondary id, make sure the first segment also has it set
  50614. if (navGroup.secondaryId && segments.length) {
  50615. cleanedSegments[0].secondaryId = navGroup.secondaryId;
  50616. }
  50617. pairs.push({
  50618. navGroup: navGroup,
  50619. segments: cleanedSegments
  50620. });
  50621. }
  50622. return pairs;
  50623. }
  50624. function getSegmentsFromUrlPieces(urlSections, navLink) {
  50625. if (navLink.segmentPartsLen !== urlSections.length) {
  50626. return null;
  50627. }
  50628. for (var i = 0; i < urlSections.length; i++) {
  50629. if (!isPartMatch(urlSections[i], navLink.segmentParts[i])) {
  50630. // just return an empty array if the part doesn't match
  50631. return null;
  50632. }
  50633. }
  50634. return {
  50635. id: urlSections.join('/'),
  50636. name: navLink.name,
  50637. component: navLink.component,
  50638. loadChildren: navLink.loadChildren,
  50639. data: createMatchedData(urlSections, navLink),
  50640. defaultHistory: navLink.defaultHistory
  50641. };
  50642. }
  50643. function hydrateSegment(segment, nav) {
  50644. var hydratedSegment = Object.assign({}, segment);
  50645. hydratedSegment.type = nav.getType();
  50646. hydratedSegment.navId = nav.name || nav.id;
  50647. // secondaryId is set on an empty dehydrated segment in the case of tabs to identify which tab is selected
  50648. hydratedSegment.secondaryId = segment.secondaryId;
  50649. return hydratedSegment;
  50650. }
  50651. function getNonHydratedSegmentIfLinkAndUrlMatch(urlChunks, navLink) {
  50652. var allSegmentsMatch = true;
  50653. for (var i = 0; i < urlChunks.length; i++) {
  50654. if (!isPartMatch(urlChunks[i], navLink.segmentParts[i])) {
  50655. allSegmentsMatch = false;
  50656. break;
  50657. }
  50658. }
  50659. if (allSegmentsMatch) {
  50660. return {
  50661. id: navLink.segmentParts.join('/'),
  50662. name: navLink.name,
  50663. component: navLink.component,
  50664. loadChildren: navLink.loadChildren,
  50665. data: createMatchedData(urlChunks, navLink),
  50666. defaultHistory: navLink.defaultHistory
  50667. };
  50668. }
  50669. return null;
  50670. }
  50671. //# sourceMappingURL=url-serializer.js.map
  50672. /***/ }),
  50673. /* 42 */
  50674. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  50675. "use strict";
  50676. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return NavControllerBase; });
  50677. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  50678. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__nav_util__ = __webpack_require__(21);
  50679. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_util__ = __webpack_require__(2);
  50680. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__view_controller__ = __webpack_require__(5);
  50681. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__components_ion__ = __webpack_require__(4);
  50682. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__nav_controller__ = __webpack_require__(22);
  50683. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__nav_params__ = __webpack_require__(13);
  50684. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__swipe_back__ = __webpack_require__(229);
  50685. var __extends = (this && this.__extends) || (function () {
  50686. var extendStatics = Object.setPrototypeOf ||
  50687. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  50688. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  50689. return function (d, b) {
  50690. extendStatics(d, b);
  50691. function __() { this.constructor = d; }
  50692. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  50693. };
  50694. })();
  50695. /**
  50696. * @hidden
  50697. * This class is for internal use only. It is not exported publicly.
  50698. */
  50699. var NavControllerBase = (function (_super) {
  50700. __extends(NavControllerBase, _super);
  50701. function NavControllerBase(parent, _app, config, plt, elementRef, _zone, renderer, _cfr, _gestureCtrl, _trnsCtrl, _linker, _domCtrl, _errHandler) {
  50702. var _this = _super.call(this, config, elementRef, renderer) || this;
  50703. _this.parent = parent;
  50704. _this._app = _app;
  50705. _this.config = config;
  50706. _this.plt = plt;
  50707. _this._zone = _zone;
  50708. _this._cfr = _cfr;
  50709. _this._gestureCtrl = _gestureCtrl;
  50710. _this._trnsCtrl = _trnsCtrl;
  50711. _this._linker = _linker;
  50712. _this._domCtrl = _domCtrl;
  50713. _this._errHandler = _errHandler;
  50714. _this._ids = -1;
  50715. _this._init = false;
  50716. _this._queue = [];
  50717. _this._trnsId = null;
  50718. _this._trnsTm = false;
  50719. _this._views = [];
  50720. _this._zIndexOffset = 0;
  50721. _this.viewDidLoad = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  50722. _this.viewWillEnter = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  50723. _this.viewDidEnter = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  50724. _this.viewWillLeave = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  50725. _this.viewDidLeave = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  50726. _this.viewWillUnload = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  50727. _this._sbEnabled = config.getBoolean('swipeBackEnabled');
  50728. _this._children = [];
  50729. _this.id = 'n' + (++ctrlIds);
  50730. _this._destroyed = false;
  50731. return _this;
  50732. }
  50733. Object.defineProperty(NavControllerBase.prototype, "swipeBackEnabled", {
  50734. get: function () {
  50735. return this._sbEnabled;
  50736. },
  50737. set: function (val) {
  50738. this._sbEnabled = Object(__WEBPACK_IMPORTED_MODULE_2__util_util__["o" /* isTrueProperty */])(val);
  50739. this._swipeBackCheck();
  50740. },
  50741. enumerable: true,
  50742. configurable: true
  50743. });
  50744. NavControllerBase.prototype.push = function (page, params, opts, done) {
  50745. return this._queueTrns({
  50746. insertStart: -1,
  50747. insertViews: [{ page: page, params: params }],
  50748. opts: opts,
  50749. }, done);
  50750. };
  50751. NavControllerBase.prototype.insert = function (insertIndex, page, params, opts, done) {
  50752. return this._queueTrns({
  50753. insertStart: insertIndex,
  50754. insertViews: [{ page: page, params: params }],
  50755. opts: opts,
  50756. }, done);
  50757. };
  50758. NavControllerBase.prototype.insertPages = function (insertIndex, insertPages, opts, done) {
  50759. return this._queueTrns({
  50760. insertStart: insertIndex,
  50761. insertViews: insertPages,
  50762. opts: opts,
  50763. }, done);
  50764. };
  50765. NavControllerBase.prototype.pop = function (opts, done) {
  50766. return this._queueTrns({
  50767. removeStart: -1,
  50768. removeCount: 1,
  50769. opts: opts,
  50770. }, done);
  50771. };
  50772. NavControllerBase.prototype.popTo = function (indexOrViewCtrl, opts, done) {
  50773. var config = {
  50774. removeStart: -1,
  50775. removeCount: -1,
  50776. opts: opts
  50777. };
  50778. if (Object(__WEBPACK_IMPORTED_MODULE_3__view_controller__["b" /* isViewController */])(indexOrViewCtrl)) {
  50779. config.removeView = indexOrViewCtrl;
  50780. config.removeStart = 1;
  50781. }
  50782. else if (Object(__WEBPACK_IMPORTED_MODULE_2__util_util__["j" /* isNumber */])(indexOrViewCtrl)) {
  50783. config.removeStart = indexOrViewCtrl + 1;
  50784. }
  50785. return this._queueTrns(config, done);
  50786. };
  50787. NavControllerBase.prototype.popToRoot = function (opts, done) {
  50788. return this._queueTrns({
  50789. removeStart: 1,
  50790. removeCount: -1,
  50791. opts: opts,
  50792. }, done);
  50793. };
  50794. NavControllerBase.prototype.popAll = function () {
  50795. var promises = [];
  50796. for (var i = this._views.length - 1; i >= 0; i--) {
  50797. promises.push(this.pop(null));
  50798. }
  50799. return Promise.all(promises);
  50800. };
  50801. NavControllerBase.prototype.remove = function (startIndex, removeCount, opts, done) {
  50802. if (removeCount === void 0) { removeCount = 1; }
  50803. return this._queueTrns({
  50804. removeStart: startIndex,
  50805. removeCount: removeCount,
  50806. opts: opts,
  50807. }, done);
  50808. };
  50809. NavControllerBase.prototype.removeView = function (viewController, opts, done) {
  50810. return this._queueTrns({
  50811. removeView: viewController,
  50812. removeStart: 0,
  50813. removeCount: 1,
  50814. opts: opts,
  50815. }, done);
  50816. };
  50817. NavControllerBase.prototype.setRoot = function (pageOrViewCtrl, params, opts, done) {
  50818. return this.setPages([{ page: pageOrViewCtrl, params: params }], opts, done);
  50819. };
  50820. NavControllerBase.prototype.setPages = function (viewControllers, opts, done) {
  50821. if (Object(__WEBPACK_IMPORTED_MODULE_2__util_util__["f" /* isBlank */])(opts)) {
  50822. opts = {};
  50823. }
  50824. // if animation wasn't set to true then default it to NOT animate
  50825. if (opts.animate !== true) {
  50826. opts.animate = false;
  50827. }
  50828. return this._queueTrns({
  50829. insertStart: 0,
  50830. insertViews: viewControllers,
  50831. removeStart: 0,
  50832. removeCount: -1,
  50833. opts: opts
  50834. }, done);
  50835. };
  50836. // _queueTrns() adds a navigation stack change to the queue and schedules it to run:
  50837. // 1. _nextTrns(): consumes the next transition in the queue
  50838. // 2. _viewInit(): initializes enteringView if required
  50839. // 3. _viewTest(): ensures canLeave/canEnter returns true, so the operation can continue
  50840. // 4. _postViewInit(): add/remove the views from the navigation stack
  50841. // 5. _transitionInit(): initializes the visual transition if required and schedules it to run
  50842. // 6. _viewAttachToDOM(): attaches the enteringView to the DOM
  50843. // 7. _transitionStart(): called once the transition actually starts, it initializes the Animation underneath.
  50844. // 8. _transitionFinish(): called once the transition finishes
  50845. // 9. _cleanup(): syncs the navigation internal state with the DOM. For example it removes the pages from the DOM or hides/show them.
  50846. NavControllerBase.prototype._queueTrns = function (ti, done) {
  50847. var promise = new Promise(function (resolve, reject) {
  50848. ti.resolve = resolve;
  50849. ti.reject = reject;
  50850. });
  50851. ti.done = done;
  50852. // Normalize empty
  50853. if (ti.insertViews && ti.insertViews.length === 0) {
  50854. ti.insertViews = undefined;
  50855. }
  50856. // Enqueue transition instruction
  50857. this._queue.push(ti);
  50858. // if there isn't a transition already happening
  50859. // then this will kick off this transition
  50860. this._nextTrns();
  50861. return promise;
  50862. };
  50863. NavControllerBase.prototype._success = function (result, ti) {
  50864. if (this._queue === null) {
  50865. this._fireError('nav controller was destroyed', ti);
  50866. return;
  50867. }
  50868. this._init = true;
  50869. this._trnsId = null;
  50870. // ensure we're not transitioning here
  50871. this.setTransitioning(false);
  50872. this._swipeBackCheck();
  50873. // let's see if there's another to kick off
  50874. this._nextTrns();
  50875. if (ti.done) {
  50876. ti.done(result.hasCompleted, result.requiresTransition, result.enteringName, result.leavingName, result.direction);
  50877. }
  50878. ti.resolve(result.hasCompleted);
  50879. };
  50880. NavControllerBase.prototype._failed = function (rejectReason, ti) {
  50881. if (this._queue === null) {
  50882. this._fireError('nav controller was destroyed', ti);
  50883. return;
  50884. }
  50885. this._trnsId = null;
  50886. this._queue.length = 0;
  50887. // let's see if there's another to kick off
  50888. this.setTransitioning(false);
  50889. this._swipeBackCheck();
  50890. this._nextTrns();
  50891. this._fireError(rejectReason, ti);
  50892. };
  50893. NavControllerBase.prototype._fireError = function (rejectReason, ti) {
  50894. if (ti.done) {
  50895. ti.done(false, false, rejectReason);
  50896. }
  50897. if (ti.reject && !this._destroyed) {
  50898. ti.reject(rejectReason);
  50899. }
  50900. else {
  50901. ti.resolve(false);
  50902. }
  50903. };
  50904. NavControllerBase.prototype._nextTrns = function () {
  50905. var _this = this;
  50906. // this is the framework's bread 'n butta function
  50907. // only one transition is allowed at any given time
  50908. if (this.isTransitioning()) {
  50909. return false;
  50910. }
  50911. // there is no transition happening right now
  50912. // get the next instruction
  50913. var ti = this._queue.shift();
  50914. if (!ti) {
  50915. return false;
  50916. }
  50917. // set that this nav is actively transitioning
  50918. var enteringView;
  50919. var leavingView;
  50920. this._startTI(ti)
  50921. .then(function () { return _this._loadLazyLoading(ti); })
  50922. .then(function () {
  50923. leavingView = _this.getActive();
  50924. enteringView = _this._getEnteringView(ti, leavingView);
  50925. if (!leavingView && !enteringView) {
  50926. throw 'no views in the stack to be removed';
  50927. }
  50928. if (enteringView && enteringView._state === __WEBPACK_IMPORTED_MODULE_1__nav_util__["h" /* STATE_NEW */]) {
  50929. _this._viewInit(enteringView);
  50930. }
  50931. // Needs transition?
  50932. ti.requiresTransition = (ti.enteringRequiresTransition || ti.leavingRequiresTransition) && enteringView !== leavingView;
  50933. })
  50934. .then(function () { return _this._viewTest(enteringView, leavingView, ti); })
  50935. .then(function () { return _this._postViewInit(enteringView, leavingView, ti); })
  50936. .then(function () { return _this._transition(enteringView, leavingView, ti); })
  50937. .then(function (result) { return _this._success(result, ti); })
  50938. .catch(function (rejectReason) { return _this._failed(rejectReason, ti); });
  50939. return true;
  50940. };
  50941. NavControllerBase.prototype._startTI = function (ti) {
  50942. var viewsLength = this._views.length;
  50943. if (Object(__WEBPACK_IMPORTED_MODULE_2__util_util__["l" /* isPresent */])(ti.removeView)) {
  50944. (void 0) /* assert */;
  50945. (void 0) /* assert */;
  50946. var index = this.indexOf(ti.removeView);
  50947. if (index < 0) {
  50948. return Promise.reject('removeView was not found');
  50949. }
  50950. ti.removeStart += index;
  50951. }
  50952. if (Object(__WEBPACK_IMPORTED_MODULE_2__util_util__["l" /* isPresent */])(ti.removeStart)) {
  50953. if (ti.removeStart < 0) {
  50954. ti.removeStart = (viewsLength - 1);
  50955. }
  50956. if (ti.removeCount < 0) {
  50957. ti.removeCount = (viewsLength - ti.removeStart);
  50958. }
  50959. ti.leavingRequiresTransition = (ti.removeCount > 0) && ((ti.removeStart + ti.removeCount) === viewsLength);
  50960. }
  50961. if (ti.insertViews) {
  50962. // allow -1 to be passed in to auto push it on the end
  50963. // and clean up the index if it's larger then the size of the stack
  50964. if (ti.insertStart < 0 || ti.insertStart > viewsLength) {
  50965. ti.insertStart = viewsLength;
  50966. }
  50967. ti.enteringRequiresTransition = (ti.insertStart === viewsLength);
  50968. }
  50969. this.setTransitioning(true);
  50970. return Promise.resolve();
  50971. };
  50972. NavControllerBase.prototype._loadLazyLoading = function (ti) {
  50973. var _this = this;
  50974. var insertViews = ti.insertViews;
  50975. if (insertViews) {
  50976. (void 0) /* assert */;
  50977. return Object(__WEBPACK_IMPORTED_MODULE_1__nav_util__["i" /* convertToViews */])(this._linker, insertViews).then(function (viewControllers) {
  50978. (void 0) /* assert */;
  50979. viewControllers = viewControllers.filter(function (v) { return v !== null; });
  50980. if (viewControllers.length === 0) {
  50981. throw 'invalid views to insert';
  50982. }
  50983. // Check all the inserted view are correct
  50984. for (var i = 0; i < viewControllers.length; i++) {
  50985. var view = viewControllers[i];
  50986. var nav = view._nav;
  50987. if (nav && nav !== _this) {
  50988. throw 'inserted view was already inserted';
  50989. }
  50990. if (view._state === __WEBPACK_IMPORTED_MODULE_1__nav_util__["f" /* STATE_DESTROYED */]) {
  50991. throw 'inserted view was already destroyed';
  50992. }
  50993. }
  50994. ti.insertViews = viewControllers;
  50995. });
  50996. }
  50997. return Promise.resolve();
  50998. };
  50999. NavControllerBase.prototype._getEnteringView = function (ti, leavingView) {
  51000. var insertViews = ti.insertViews;
  51001. if (insertViews) {
  51002. // grab the very last view of the views to be inserted
  51003. // and initialize it as the new entering view
  51004. return insertViews[insertViews.length - 1];
  51005. }
  51006. var removeStart = ti.removeStart;
  51007. if (Object(__WEBPACK_IMPORTED_MODULE_2__util_util__["l" /* isPresent */])(removeStart)) {
  51008. var views = this._views;
  51009. var removeEnd = removeStart + ti.removeCount;
  51010. var i;
  51011. var view;
  51012. for (i = views.length - 1; i >= 0; i--) {
  51013. view = views[i];
  51014. if ((i < removeStart || i >= removeEnd) && view !== leavingView) {
  51015. return view;
  51016. }
  51017. }
  51018. }
  51019. return null;
  51020. };
  51021. NavControllerBase.prototype._postViewInit = function (enteringView, leavingView, ti) {
  51022. var _this = this;
  51023. (void 0) /* assert */;
  51024. (void 0) /* assert */;
  51025. (void 0) /* assert */;
  51026. var opts = ti.opts || {};
  51027. var insertViews = ti.insertViews;
  51028. var removeStart = ti.removeStart;
  51029. var removeCount = ti.removeCount;
  51030. var view;
  51031. var i;
  51032. var destroyQueue;
  51033. // there are views to remove
  51034. if (Object(__WEBPACK_IMPORTED_MODULE_2__util_util__["l" /* isPresent */])(removeStart)) {
  51035. (void 0) /* assert */;
  51036. (void 0) /* assert */;
  51037. destroyQueue = [];
  51038. for (i = 0; i < removeCount; i++) {
  51039. view = this._views[i + removeStart];
  51040. if (view && view !== enteringView && view !== leavingView) {
  51041. destroyQueue.push(view);
  51042. }
  51043. }
  51044. // default the direction to "back"
  51045. opts.direction = opts.direction || __WEBPACK_IMPORTED_MODULE_1__nav_util__["a" /* DIRECTION_BACK */];
  51046. }
  51047. var finalBalance = this._views.length + (insertViews ? insertViews.length : 0) - (removeCount ? removeCount : 0);
  51048. (void 0) /* assert */;
  51049. if (finalBalance === 0 && !this._isPortal) {
  51050. console.warn("You can't remove all the pages in the navigation stack. nav.pop() is probably called too many times.", this, this.getNativeElement());
  51051. throw 'navigation stack needs at least one root page';
  51052. }
  51053. // At this point the transition can not be rejected, any throw should be an error
  51054. // there are views to insert
  51055. if (insertViews) {
  51056. // manually set the new view's id if an id was passed in the options
  51057. if (Object(__WEBPACK_IMPORTED_MODULE_2__util_util__["l" /* isPresent */])(opts.id)) {
  51058. enteringView.id = opts.id;
  51059. }
  51060. // add the views to the
  51061. for (i = 0; i < insertViews.length; i++) {
  51062. view = insertViews[i];
  51063. this._insertViewAt(view, ti.insertStart + i);
  51064. }
  51065. if (ti.enteringRequiresTransition) {
  51066. // default to forward if not already set
  51067. opts.direction = opts.direction || __WEBPACK_IMPORTED_MODULE_1__nav_util__["b" /* DIRECTION_FORWARD */];
  51068. }
  51069. }
  51070. // if the views to be removed are in the beginning or middle
  51071. // and there is not a view that needs to visually transition out
  51072. // then just destroy them and don't transition anything
  51073. // batch all of lifecycles together
  51074. // let's make sure, callbacks are zoned
  51075. if (destroyQueue && destroyQueue.length > 0) {
  51076. this._zone.run(function () {
  51077. for (i = 0; i < destroyQueue.length; i++) {
  51078. view = destroyQueue[i];
  51079. _this._willLeave(view, true);
  51080. _this._didLeave(view);
  51081. _this._willUnload(view);
  51082. }
  51083. });
  51084. // once all lifecycle events has been delivered, we can safely detroy the views
  51085. for (i = 0; i < destroyQueue.length; i++) {
  51086. this._destroyView(destroyQueue[i]);
  51087. }
  51088. }
  51089. // set which animation it should use if it wasn't set yet
  51090. if (ti.requiresTransition && !opts.animation) {
  51091. if (Object(__WEBPACK_IMPORTED_MODULE_2__util_util__["l" /* isPresent */])(ti.removeStart)) {
  51092. opts.animation = (leavingView || enteringView).getTransitionName(opts.direction);
  51093. }
  51094. else {
  51095. opts.animation = (enteringView || leavingView).getTransitionName(opts.direction);
  51096. }
  51097. }
  51098. ti.opts = opts;
  51099. };
  51100. /**
  51101. * DOM WRITE
  51102. */
  51103. NavControllerBase.prototype._viewInit = function (enteringView) {
  51104. (void 0) /* assert */;
  51105. (void 0) /* assert */;
  51106. // render the entering view, and all child navs and views
  51107. // entering view has not been initialized yet
  51108. var componentProviders = __WEBPACK_IMPORTED_MODULE_0__angular_core__["U" /* ReflectiveInjector */].resolve([
  51109. { provide: __WEBPACK_IMPORTED_MODULE_5__nav_controller__["a" /* NavController */], useValue: this },
  51110. { provide: __WEBPACK_IMPORTED_MODULE_3__view_controller__["a" /* ViewController */], useValue: enteringView },
  51111. { provide: __WEBPACK_IMPORTED_MODULE_6__nav_params__["a" /* NavParams */], useValue: enteringView.getNavParams() }
  51112. ]);
  51113. var componentFactory = this._linker.resolveComponent(enteringView.component);
  51114. var childInjector = __WEBPACK_IMPORTED_MODULE_0__angular_core__["U" /* ReflectiveInjector */].fromResolvedProviders(componentProviders, this._viewport.parentInjector);
  51115. // create ComponentRef and set it to the entering view
  51116. enteringView.init(componentFactory.create(childInjector, []));
  51117. enteringView._state = __WEBPACK_IMPORTED_MODULE_1__nav_util__["g" /* STATE_INITIALIZED */];
  51118. this._preLoad(enteringView);
  51119. };
  51120. NavControllerBase.prototype._viewAttachToDOM = function (view, componentRef, viewport) {
  51121. (void 0) /* assert */;
  51122. (void 0) /* assert */;
  51123. // fire willLoad before change detection runs
  51124. this._willLoad(view);
  51125. // render the component ref instance to the DOM
  51126. // ******** DOM WRITE ****************
  51127. viewport.insert(componentRef.hostView, viewport.length);
  51128. view._state = __WEBPACK_IMPORTED_MODULE_1__nav_util__["e" /* STATE_ATTACHED */];
  51129. if (view._cssClass) {
  51130. // the ElementRef of the actual ion-page created
  51131. var pageElement = componentRef.location.nativeElement;
  51132. // ******** DOM WRITE ****************
  51133. this._renderer.setElementClass(pageElement, view._cssClass, true);
  51134. }
  51135. componentRef.changeDetectorRef.detectChanges();
  51136. // successfully finished loading the entering view
  51137. // fire off the "didLoad" lifecycle events
  51138. this._zone.run(this._didLoad.bind(this, view));
  51139. };
  51140. NavControllerBase.prototype._viewTest = function (enteringView, leavingView, ti) {
  51141. // Only test canLeave/canEnter if there is transition
  51142. if (!ti.requiresTransition) {
  51143. return Promise.resolve();
  51144. }
  51145. var promises = [];
  51146. if (leavingView) {
  51147. promises.push(leavingView._lifecycleTest('Leave'));
  51148. }
  51149. if (enteringView) {
  51150. promises.push(enteringView._lifecycleTest('Enter'));
  51151. }
  51152. if (promises.length === 0) {
  51153. return Promise.resolve();
  51154. }
  51155. // darn, async promises, gotta wait for them to resolve
  51156. return Promise.all(promises).then(function (values) {
  51157. if (values.some(function (result) { return result === false; })) {
  51158. throw 'canEnter/Leave returned false';
  51159. }
  51160. }).catch(function (reason) {
  51161. // Do not
  51162. ti.reject = null;
  51163. throw reason;
  51164. });
  51165. };
  51166. NavControllerBase.prototype._transition = function (enteringView, leavingView, ti) {
  51167. var _this = this;
  51168. if (!ti.requiresTransition) {
  51169. // transition is not required, so we are already done!
  51170. // they're inserting/removing the views somewhere in the middle or
  51171. // beginning, so visually nothing needs to animate/transition
  51172. // resolve immediately because there's no animation that's happening
  51173. return Promise.resolve({
  51174. hasCompleted: true,
  51175. requiresTransition: false
  51176. });
  51177. }
  51178. var opts = ti.opts;
  51179. // figure out if this transition is the root one or a
  51180. // child of a parent nav that has the root transition
  51181. this._trnsId = this._trnsCtrl.getRootTrnsId(this);
  51182. if (this._trnsId === null) {
  51183. // this is the root transition, meaning all child navs and their views
  51184. // should be added as a child transition to this one
  51185. this._trnsId = this._trnsCtrl.nextId();
  51186. }
  51187. // create the transition options
  51188. var animationOpts = {
  51189. animation: opts.animation,
  51190. direction: opts.direction,
  51191. duration: (opts.animate === false ? 0 : opts.duration),
  51192. easing: opts.easing,
  51193. isRTL: this._config.plt.isRTL,
  51194. ev: opts.ev,
  51195. };
  51196. // create the transition animation from the TransitionController
  51197. // this will either create the root transition, or add it as a child transition
  51198. var transition = this._trnsCtrl.get(this._trnsId, enteringView, leavingView, animationOpts);
  51199. // ensure any swipeback transitions are cleared out
  51200. this._sbTrns && this._sbTrns.destroy();
  51201. this._sbTrns = null;
  51202. // swipe to go back root transition
  51203. if (transition.isRoot() && opts.progressAnimation) {
  51204. this._sbTrns = transition;
  51205. }
  51206. // transition start has to be registered before attaching the view to the DOM!
  51207. var promise = new Promise(function (resolve) { return transition.registerStart(resolve); }).then(function () {
  51208. return _this._transitionStart(transition, enteringView, leavingView, opts);
  51209. });
  51210. if (enteringView && (enteringView._state === __WEBPACK_IMPORTED_MODULE_1__nav_util__["g" /* STATE_INITIALIZED */])) {
  51211. // render the entering component in the DOM
  51212. // this would also render new child navs/views
  51213. // which may have their very own async canEnter/Leave tests
  51214. // ******** DOM WRITE ****************
  51215. this._viewAttachToDOM(enteringView, enteringView._cmp, this._viewport);
  51216. }
  51217. if (!transition.hasChildren) {
  51218. // lowest level transition, so kick it off and let it bubble up to start all of them
  51219. transition.start();
  51220. }
  51221. return promise;
  51222. };
  51223. NavControllerBase.prototype._transitionStart = function (transition, enteringView, leavingView, opts) {
  51224. var _this = this;
  51225. (void 0) /* assert */;
  51226. this._trnsId = null;
  51227. // set the correct zIndex for the entering and leaving views
  51228. // ******** DOM WRITE ****************
  51229. Object(__WEBPACK_IMPORTED_MODULE_1__nav_util__["n" /* setZIndex */])(this, enteringView, leavingView, opts.direction, this._renderer);
  51230. // always ensure the entering view is viewable
  51231. // ******** DOM WRITE ****************
  51232. enteringView && enteringView._domShow(true, this._renderer);
  51233. // always ensure the leaving view is viewable
  51234. // ******** DOM WRITE ****************
  51235. leavingView && leavingView._domShow(true, this._renderer);
  51236. // initialize the transition
  51237. transition.init();
  51238. // we should animate (duration > 0) if the pushed page is not the first one (startup)
  51239. // or if it is a portal (modal, actionsheet, etc.)
  51240. var isFirstPage = !this._init && this._views.length === 1;
  51241. var shouldNotAnimate = isFirstPage && !this._isPortal;
  51242. var canNotAnimate = this._config.get('animate') === false;
  51243. if (shouldNotAnimate || canNotAnimate) {
  51244. opts.animate = false;
  51245. }
  51246. if (opts.animate === false) {
  51247. // if it was somehow set to not animation, then make the duration zero
  51248. transition.duration(0);
  51249. }
  51250. // create a callback that needs to run within zone
  51251. // that will fire off the willEnter/Leave lifecycle events at the right time
  51252. transition.beforeAddRead(this._viewsWillLifecycles.bind(this, enteringView, leavingView));
  51253. // get the set duration of this transition
  51254. var duration = transition.getDuration();
  51255. // create a callback for when the animation is done
  51256. var promise = new Promise(function (resolve) {
  51257. transition.onFinish(resolve);
  51258. });
  51259. if (transition.isRoot()) {
  51260. // this is the top most, or only active transition, so disable the app
  51261. // add XXms to the duration the app is disabled when the keyboard is open
  51262. if (duration > DISABLE_APP_MINIMUM_DURATION && opts.disableApp !== false) {
  51263. // if this transition has a duration and this is the root transition
  51264. // then set that the app is actively disabled
  51265. this._app.setEnabled(false, duration + ACTIVE_TRANSITION_OFFSET, opts.minClickBlockDuration);
  51266. }
  51267. else {
  51268. (void 0) /* console.debug */;
  51269. }
  51270. // cool, let's do this, start the transition
  51271. if (opts.progressAnimation) {
  51272. // this is a swipe to go back, just get the transition progress ready
  51273. // kick off the swipe animation start
  51274. transition.progressStart();
  51275. }
  51276. else {
  51277. // only the top level transition should actually start "play"
  51278. // kick it off and let it play through
  51279. // ******** DOM WRITE ****************
  51280. transition.play();
  51281. }
  51282. }
  51283. return promise.then(function () { return _this._zone.run(function () {
  51284. return _this._transitionFinish(transition, opts);
  51285. }); });
  51286. };
  51287. NavControllerBase.prototype._transitionFinish = function (transition, opts) {
  51288. var hasCompleted = transition.hasCompleted;
  51289. var enteringView = transition.enteringView;
  51290. var leavingView = transition.leavingView;
  51291. // mainly for testing
  51292. var enteringName;
  51293. var leavingName;
  51294. if (hasCompleted) {
  51295. // transition has completed (went from 0 to 1)
  51296. if (enteringView) {
  51297. enteringName = enteringView.name;
  51298. this._didEnter(enteringView);
  51299. }
  51300. if (leavingView) {
  51301. leavingName = leavingView.name;
  51302. this._didLeave(leavingView);
  51303. }
  51304. this._cleanup(enteringView);
  51305. }
  51306. else {
  51307. // If transition does not complete, we have to cleanup anyway, because
  51308. // previous pages in the stack are not hidden probably.
  51309. this._cleanup(leavingView);
  51310. }
  51311. if (transition.isRoot()) {
  51312. // this is the root transition
  51313. // it's safe to destroy this transition
  51314. this._trnsCtrl.destroy(transition.trnsId);
  51315. // it's safe to enable the app again
  51316. this._app.setEnabled(true);
  51317. // mark ourselves as not transitioning - `deepLinker navchange` requires this
  51318. // TODO - probably could be resolved in a better way
  51319. this.setTransitioning(false);
  51320. if (!this.hasChildren() && opts.updateUrl !== false) {
  51321. // notify deep linker of the nav change
  51322. // if a direction was provided and should update url
  51323. this._linker.navChange(opts.direction);
  51324. }
  51325. if (opts.keyboardClose !== false) {
  51326. // the keyboard is still open!
  51327. // no problem, let's just close for them
  51328. this.plt.focusOutActiveElement();
  51329. }
  51330. }
  51331. return {
  51332. hasCompleted: hasCompleted,
  51333. requiresTransition: true,
  51334. enteringName: enteringName,
  51335. leavingName: leavingName,
  51336. direction: opts.direction
  51337. };
  51338. };
  51339. NavControllerBase.prototype._viewsWillLifecycles = function (enteringView, leavingView) {
  51340. var _this = this;
  51341. if (enteringView || leavingView) {
  51342. this._zone.run(function () {
  51343. // Here, the order is important. WillLeave must be called before WillEnter.
  51344. if (leavingView) {
  51345. var willUnload = enteringView ? leavingView.index > enteringView.index : true;
  51346. _this._willLeave(leavingView, willUnload);
  51347. }
  51348. enteringView && _this._willEnter(enteringView);
  51349. });
  51350. }
  51351. };
  51352. NavControllerBase.prototype._insertViewAt = function (view, index) {
  51353. var existingIndex = this._views.indexOf(view);
  51354. if (existingIndex > -1) {
  51355. // this view is already in the stack!!
  51356. // move it to its new location
  51357. (void 0) /* assert */;
  51358. this._views.splice(index, 0, this._views.splice(existingIndex, 1)[0]);
  51359. }
  51360. else {
  51361. (void 0) /* assert */;
  51362. // this is a new view to add to the stack
  51363. // create the new entering view
  51364. view._setNav(this);
  51365. // give this inserted view an ID
  51366. this._ids++;
  51367. if (!view.id) {
  51368. view.id = this.id + "-" + this._ids;
  51369. }
  51370. // insert the entering view into the correct index in the stack
  51371. this._views.splice(index, 0, view);
  51372. }
  51373. };
  51374. NavControllerBase.prototype._removeView = function (view) {
  51375. (void 0) /* assert */;
  51376. var views = this._views;
  51377. var index = views.indexOf(view);
  51378. (void 0) /* assert */;
  51379. if (index >= 0) {
  51380. views.splice(index, 1);
  51381. }
  51382. };
  51383. NavControllerBase.prototype._destroyView = function (view) {
  51384. view._destroy(this._renderer);
  51385. this._removeView(view);
  51386. };
  51387. /**
  51388. * DOM WRITE
  51389. */
  51390. NavControllerBase.prototype._cleanup = function (activeView) {
  51391. // ok, cleanup time!! Destroy all of the views that are
  51392. // INACTIVE and come after the active view
  51393. // only do this if the views exist, though
  51394. if (!this._destroyed) {
  51395. var activeViewIndex = this._views.indexOf(activeView);
  51396. var views = this._views;
  51397. var reorderZIndexes = false;
  51398. var view = void 0;
  51399. var i = void 0;
  51400. for (i = views.length - 1; i >= 0; i--) {
  51401. view = views[i];
  51402. if (i > activeViewIndex) {
  51403. // this view comes after the active view
  51404. // let's unload it
  51405. this._willUnload(view);
  51406. this._destroyView(view);
  51407. }
  51408. else if (i < activeViewIndex && !this._isPortal) {
  51409. // this view comes before the active view
  51410. // and it is not a portal then ensure it is hidden
  51411. view._domShow(false, this._renderer);
  51412. }
  51413. if (view._zIndex <= 0) {
  51414. reorderZIndexes = true;
  51415. }
  51416. }
  51417. if (!this._isPortal && reorderZIndexes) {
  51418. for (i = 0; i < views.length; i++) {
  51419. view = views[i];
  51420. // ******** DOM WRITE ****************
  51421. view._setZIndex(view._zIndex + __WEBPACK_IMPORTED_MODULE_1__nav_util__["d" /* INIT_ZINDEX */] + 1, this._renderer);
  51422. }
  51423. }
  51424. }
  51425. };
  51426. NavControllerBase.prototype._preLoad = function (view) {
  51427. (void 0) /* assert */;
  51428. view._preLoad();
  51429. };
  51430. NavControllerBase.prototype._willLoad = function (view) {
  51431. (void 0) /* assert */;
  51432. try {
  51433. view._willLoad();
  51434. }
  51435. catch (e) {
  51436. this._errHandler && this._errHandler.handleError(e);
  51437. }
  51438. };
  51439. NavControllerBase.prototype._didLoad = function (view) {
  51440. (void 0) /* assert */;
  51441. (void 0) /* assert */;
  51442. try {
  51443. view._didLoad();
  51444. this.viewDidLoad.emit(view);
  51445. this._app.viewDidLoad.emit(view);
  51446. }
  51447. catch (e) {
  51448. this._errHandler && this._errHandler.handleError(e);
  51449. }
  51450. };
  51451. NavControllerBase.prototype._willEnter = function (view) {
  51452. (void 0) /* assert */;
  51453. (void 0) /* assert */;
  51454. try {
  51455. view._willEnter();
  51456. this.viewWillEnter.emit(view);
  51457. this._app.viewWillEnter.emit(view);
  51458. }
  51459. catch (e) {
  51460. this._errHandler && this._errHandler.handleError(e);
  51461. }
  51462. };
  51463. NavControllerBase.prototype._didEnter = function (view) {
  51464. (void 0) /* assert */;
  51465. (void 0) /* assert */;
  51466. try {
  51467. view._didEnter();
  51468. this.viewDidEnter.emit(view);
  51469. this._app.viewDidEnter.emit(view);
  51470. }
  51471. catch (e) {
  51472. this._errHandler && this._errHandler.handleError(e);
  51473. }
  51474. };
  51475. NavControllerBase.prototype._willLeave = function (view, willUnload) {
  51476. (void 0) /* assert */;
  51477. (void 0) /* assert */;
  51478. try {
  51479. view._willLeave(willUnload);
  51480. this.viewWillLeave.emit(view);
  51481. this._app.viewWillLeave.emit(view);
  51482. }
  51483. catch (e) {
  51484. this._errHandler && this._errHandler.handleError(e);
  51485. }
  51486. };
  51487. NavControllerBase.prototype._didLeave = function (view) {
  51488. (void 0) /* assert */;
  51489. (void 0) /* assert */;
  51490. try {
  51491. view._didLeave();
  51492. this.viewDidLeave.emit(view);
  51493. this._app.viewDidLeave.emit(view);
  51494. }
  51495. catch (e) {
  51496. this._errHandler && this._errHandler.handleError(e);
  51497. }
  51498. };
  51499. NavControllerBase.prototype._willUnload = function (view) {
  51500. (void 0) /* assert */;
  51501. (void 0) /* assert */;
  51502. try {
  51503. view._willUnload();
  51504. this.viewWillUnload.emit(view);
  51505. this._app.viewWillUnload.emit(view);
  51506. }
  51507. catch (e) {
  51508. this._errHandler && this._errHandler.handleError(e);
  51509. }
  51510. };
  51511. NavControllerBase.prototype.hasChildren = function () {
  51512. return this._children && this._children.length > 0;
  51513. };
  51514. NavControllerBase.prototype.getActiveChildNavs = function () {
  51515. return this._children;
  51516. };
  51517. NavControllerBase.prototype.getAllChildNavs = function () {
  51518. return this._children;
  51519. };
  51520. NavControllerBase.prototype.registerChildNav = function (container) {
  51521. this._children.push(container);
  51522. };
  51523. NavControllerBase.prototype.unregisterChildNav = function (nav) {
  51524. this._children = this._children.filter(function (child) { return child !== nav; });
  51525. };
  51526. NavControllerBase.prototype.destroy = function () {
  51527. var views = this._views;
  51528. var view;
  51529. for (var i = 0; i < views.length; i++) {
  51530. view = views[i];
  51531. view._willUnload();
  51532. view._destroy(this._renderer);
  51533. }
  51534. // release swipe back gesture and transition
  51535. this._sbGesture && this._sbGesture.destroy();
  51536. this._sbTrns && this._sbTrns.destroy();
  51537. this._queue = this._views = this._sbGesture = this._sbTrns = null;
  51538. // Unregister navcontroller
  51539. if (this.parent && this.parent.unregisterChildNav) {
  51540. this.parent.unregisterChildNav(this);
  51541. }
  51542. else if (this._app) {
  51543. this._app.unregisterRootNav(this);
  51544. }
  51545. this._destroyed = true;
  51546. };
  51547. NavControllerBase.prototype.swipeBackStart = function () {
  51548. if (this.isTransitioning() || this._queue.length > 0) {
  51549. return;
  51550. }
  51551. // default the direction to "back";
  51552. var opts = {
  51553. direction: __WEBPACK_IMPORTED_MODULE_1__nav_util__["a" /* DIRECTION_BACK */],
  51554. progressAnimation: true
  51555. };
  51556. this._queueTrns({
  51557. removeStart: -1,
  51558. removeCount: 1,
  51559. opts: opts,
  51560. }, null);
  51561. };
  51562. NavControllerBase.prototype.swipeBackProgress = function (stepValue) {
  51563. if (this._sbTrns && this._sbGesture) {
  51564. // continue to disable the app while actively dragging
  51565. this._app.setEnabled(false, ACTIVE_TRANSITION_DEFAULT);
  51566. this.setTransitioning(true);
  51567. // set the transition animation's progress
  51568. this._sbTrns.progressStep(stepValue);
  51569. }
  51570. };
  51571. NavControllerBase.prototype.swipeBackEnd = function (shouldComplete, currentStepValue, velocity) {
  51572. if (this._sbTrns && this._sbGesture) {
  51573. // the swipe back gesture has ended
  51574. var dur = this._sbTrns.getDuration() / (Math.abs(velocity) + 1);
  51575. this._sbTrns.progressEnd(shouldComplete, currentStepValue, dur);
  51576. }
  51577. };
  51578. NavControllerBase.prototype._swipeBackCheck = function () {
  51579. if (this.canSwipeBack()) {
  51580. if (!this._sbGesture) {
  51581. this._sbGesture = new __WEBPACK_IMPORTED_MODULE_7__swipe_back__["a" /* SwipeBackGesture */](this.plt, this, this._gestureCtrl, this._domCtrl);
  51582. }
  51583. this._sbGesture.listen();
  51584. }
  51585. else if (this._sbGesture) {
  51586. this._sbGesture.unlisten();
  51587. }
  51588. };
  51589. NavControllerBase.prototype.canSwipeBack = function () {
  51590. return (this._sbEnabled &&
  51591. !this._isPortal &&
  51592. !this._children.length &&
  51593. !this.isTransitioning() &&
  51594. this._app.isEnabled() &&
  51595. this.canGoBack());
  51596. };
  51597. NavControllerBase.prototype.canGoBack = function () {
  51598. var activeView = this.getActive();
  51599. return !!(activeView && activeView.enableBack());
  51600. };
  51601. NavControllerBase.prototype.isTransitioning = function () {
  51602. return this._trnsTm;
  51603. };
  51604. NavControllerBase.prototype.setTransitioning = function (isTransitioning) {
  51605. this._trnsTm = isTransitioning;
  51606. };
  51607. NavControllerBase.prototype.getActive = function () {
  51608. return this._views[this._views.length - 1];
  51609. };
  51610. NavControllerBase.prototype.isActive = function (view) {
  51611. return (view === this.getActive());
  51612. };
  51613. NavControllerBase.prototype.getByIndex = function (index) {
  51614. return this._views[index];
  51615. };
  51616. NavControllerBase.prototype.getPrevious = function (view) {
  51617. // returns the view controller which is before the given view controller.
  51618. if (!view) {
  51619. view = this.getActive();
  51620. }
  51621. var views = this._views;
  51622. var index = views.indexOf(view);
  51623. return (index > 0) ? views[index - 1] : null;
  51624. };
  51625. NavControllerBase.prototype.first = function () {
  51626. // returns the first view controller in this nav controller's stack.
  51627. return this._views[0];
  51628. };
  51629. NavControllerBase.prototype.last = function () {
  51630. // returns the last page in this nav controller's stack.
  51631. var views = this._views;
  51632. return views[views.length - 1];
  51633. };
  51634. NavControllerBase.prototype.indexOf = function (view) {
  51635. // returns the index number of the given view controller.
  51636. return this._views.indexOf(view);
  51637. };
  51638. NavControllerBase.prototype.length = function () {
  51639. return this._views.length;
  51640. };
  51641. NavControllerBase.prototype.getViews = function () {
  51642. return this._views;
  51643. };
  51644. /**
  51645. * Return a view controller
  51646. */
  51647. NavControllerBase.prototype.getViewById = function (id) {
  51648. for (var _i = 0, _a = this._views; _i < _a.length; _i++) {
  51649. var vc = _a[_i];
  51650. if (vc && vc.id === id) {
  51651. return vc;
  51652. }
  51653. }
  51654. return null;
  51655. };
  51656. NavControllerBase.prototype.isSwipeBackEnabled = function () {
  51657. return this._sbEnabled;
  51658. };
  51659. NavControllerBase.prototype.dismissPageChangeViews = function () {
  51660. for (var _i = 0, _a = this._views; _i < _a.length; _i++) {
  51661. var view = _a[_i];
  51662. if (view.data && view.data.dismissOnPageChange) {
  51663. view.dismiss().catch(function () { });
  51664. }
  51665. }
  51666. };
  51667. NavControllerBase.prototype.setViewport = function (val) {
  51668. this._viewport = val;
  51669. };
  51670. NavControllerBase.prototype.resize = function () {
  51671. var active = this.getActive();
  51672. if (!active) {
  51673. return;
  51674. }
  51675. var content = active.getIONContent();
  51676. content && content.resize();
  51677. };
  51678. NavControllerBase.prototype.goToRoot = function (_opts) {
  51679. return Promise.reject(new Error('goToRoot needs to be implemented by child class'));
  51680. };
  51681. /*
  51682. * @private
  51683. */
  51684. NavControllerBase.prototype.getType = function () {
  51685. return 'nav';
  51686. };
  51687. /*
  51688. * @private
  51689. */
  51690. NavControllerBase.prototype.getSecondaryIdentifier = function () {
  51691. return null;
  51692. };
  51693. /**
  51694. * Returns the active child navigation.
  51695. */
  51696. NavControllerBase.prototype.getActiveChildNav = function () {
  51697. console.warn('(getActiveChildNav) is deprecated and will be removed in the next major release. Use getActiveChildNavs instead.');
  51698. return this._children[this._children.length - 1];
  51699. };
  51700. NavControllerBase.propDecorators = {
  51701. 'swipeBackEnabled': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  51702. };
  51703. return NavControllerBase;
  51704. }(__WEBPACK_IMPORTED_MODULE_4__components_ion__["a" /* Ion */]));
  51705. var ctrlIds = -1;
  51706. var DISABLE_APP_MINIMUM_DURATION = 64;
  51707. var ACTIVE_TRANSITION_DEFAULT = 5000;
  51708. var ACTIVE_TRANSITION_OFFSET = 2000;
  51709. //# sourceMappingURL=nav-controller-base.js.map
  51710. /***/ }),
  51711. /* 43 */
  51712. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51713. "use strict";
  51714. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PanGesture; });
  51715. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_util__ = __webpack_require__(2);
  51716. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__recognizers__ = __webpack_require__(230);
  51717. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_dom__ = __webpack_require__(10);
  51718. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ui_event_manager__ = __webpack_require__(23);
  51719. /**
  51720. * @hidden
  51721. */
  51722. var PanGesture = (function () {
  51723. function PanGesture(plt, element, opts) {
  51724. if (opts === void 0) { opts = {}; }
  51725. this.plt = plt;
  51726. this.element = element;
  51727. Object(__WEBPACK_IMPORTED_MODULE_0__util_util__["d" /* defaults */])(opts, {
  51728. threshold: 20,
  51729. maxAngle: 40,
  51730. direction: 'x',
  51731. zone: true,
  51732. capture: false,
  51733. passive: false,
  51734. });
  51735. this.events = new __WEBPACK_IMPORTED_MODULE_3__ui_event_manager__["a" /* UIEventManager */](plt);
  51736. if (opts.domController) {
  51737. this.debouncer = opts.domController.debouncer();
  51738. }
  51739. this.gestute = opts.gesture;
  51740. this.direction = opts.direction;
  51741. this.eventsConfig = {
  51742. element: this.element,
  51743. pointerDown: this.pointerDown.bind(this),
  51744. pointerMove: this.pointerMove.bind(this),
  51745. pointerUp: this.pointerUp.bind(this),
  51746. zone: opts.zone,
  51747. capture: opts.capture,
  51748. passive: opts.passive
  51749. };
  51750. if (opts.threshold > 0) {
  51751. this.detector = new __WEBPACK_IMPORTED_MODULE_1__recognizers__["a" /* PanRecognizer */](opts.direction, opts.threshold, opts.maxAngle);
  51752. }
  51753. }
  51754. PanGesture.prototype.listen = function () {
  51755. if (!this.isListening) {
  51756. this.pointerEvents = this.events.pointerEvents(this.eventsConfig);
  51757. this.isListening = true;
  51758. }
  51759. };
  51760. PanGesture.prototype.unlisten = function () {
  51761. if (this.isListening) {
  51762. this.gestute && this.gestute.release();
  51763. this.events.unlistenAll();
  51764. this.isListening = false;
  51765. }
  51766. };
  51767. PanGesture.prototype.destroy = function () {
  51768. this.gestute && this.gestute.destroy();
  51769. this.gestute = null;
  51770. this.unlisten();
  51771. this.events.destroy();
  51772. this.events = this.element = this.gestute = null;
  51773. };
  51774. PanGesture.prototype.pointerDown = function (ev) {
  51775. if (this.started) {
  51776. return;
  51777. }
  51778. if (!this.canStart(ev)) {
  51779. return false;
  51780. }
  51781. if (this.gestute) {
  51782. // Release fallback
  51783. this.gestute.release();
  51784. // Start gesture
  51785. if (!this.gestute.start()) {
  51786. return false;
  51787. }
  51788. }
  51789. this.started = true;
  51790. this.captured = false;
  51791. var coord = Object(__WEBPACK_IMPORTED_MODULE_2__util_dom__["f" /* pointerCoord */])(ev);
  51792. if (this.detector) {
  51793. this.detector.start(coord);
  51794. }
  51795. else {
  51796. if (!this.tryToCapture(ev)) {
  51797. this.started = false;
  51798. this.captured = false;
  51799. this.gestute.release();
  51800. return false;
  51801. }
  51802. }
  51803. return true;
  51804. };
  51805. PanGesture.prototype.pointerMove = function (ev) {
  51806. var _this = this;
  51807. (void 0) /* assert */;
  51808. if (this.captured) {
  51809. this.debouncer.write(function () {
  51810. _this.onDragMove(ev);
  51811. });
  51812. return;
  51813. }
  51814. (void 0) /* assert */;
  51815. var coord = Object(__WEBPACK_IMPORTED_MODULE_2__util_dom__["f" /* pointerCoord */])(ev);
  51816. if (this.detector.detect(coord)) {
  51817. if (this.detector.pan() !== 0) {
  51818. if (!this.tryToCapture(ev)) {
  51819. this.abort(ev);
  51820. }
  51821. }
  51822. }
  51823. };
  51824. PanGesture.prototype.pointerUp = function (ev) {
  51825. (void 0) /* assert */;
  51826. this.debouncer.cancel();
  51827. this.gestute && this.gestute.release();
  51828. if (this.captured) {
  51829. this.onDragEnd(ev);
  51830. }
  51831. else {
  51832. this.notCaptured(ev);
  51833. }
  51834. this.captured = false;
  51835. this.started = false;
  51836. };
  51837. PanGesture.prototype.tryToCapture = function (ev) {
  51838. (void 0) /* assert */;
  51839. (void 0) /* assert */;
  51840. if (this.gestute && !this.gestute.capture()) {
  51841. return false;
  51842. }
  51843. this.onDragStart(ev);
  51844. this.captured = true;
  51845. return true;
  51846. };
  51847. PanGesture.prototype.abort = function (ev) {
  51848. this.started = false;
  51849. this.captured = false;
  51850. this.gestute.release();
  51851. this.pointerEvents.stop();
  51852. this.notCaptured(ev);
  51853. };
  51854. PanGesture.prototype.getNativeElement = function () {
  51855. return this.element;
  51856. };
  51857. // Implemented in a subclass
  51858. PanGesture.prototype.canStart = function (_ev) { return true; };
  51859. PanGesture.prototype.onDragStart = function (_ev) { };
  51860. PanGesture.prototype.onDragMove = function (_ev) { };
  51861. PanGesture.prototype.onDragEnd = function (_ev) { };
  51862. PanGesture.prototype.notCaptured = function (_ev) { };
  51863. return PanGesture;
  51864. }());
  51865. //# sourceMappingURL=pan-gesture.js.map
  51866. /***/ }),
  51867. /* 44 */
  51868. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51869. "use strict";
  51870. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TransitionController; });
  51871. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  51872. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__config_config__ = __webpack_require__(1);
  51873. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_util__ = __webpack_require__(2);
  51874. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__platform_platform__ = __webpack_require__(3);
  51875. /**
  51876. * @hidden
  51877. */
  51878. var TransitionController = (function () {
  51879. function TransitionController(plt, _config) {
  51880. this.plt = plt;
  51881. this._config = _config;
  51882. this._ids = 0;
  51883. this._trns = {};
  51884. }
  51885. TransitionController.prototype.getRootTrnsId = function (nav) {
  51886. nav = nav.parent;
  51887. while (nav) {
  51888. if (Object(__WEBPACK_IMPORTED_MODULE_2__util_util__["l" /* isPresent */])(nav._trnsId)) {
  51889. return nav._trnsId;
  51890. }
  51891. nav = nav.parent;
  51892. }
  51893. return null;
  51894. };
  51895. TransitionController.prototype.nextId = function () {
  51896. return this._ids++;
  51897. };
  51898. TransitionController.prototype.get = function (trnsId, enteringView, leavingView, opts) {
  51899. var TransitionClass = this._config.getTransition(opts.animation);
  51900. if (!TransitionClass) {
  51901. // didn't find a transition animation, default to ios-transition
  51902. TransitionClass = this._config.getTransition('ios-transition');
  51903. }
  51904. var trns = new TransitionClass(this.plt, enteringView, leavingView, opts);
  51905. trns.trnsId = trnsId;
  51906. if (!this._trns[trnsId]) {
  51907. // we haven't created the root transition yet
  51908. this._trns[trnsId] = trns;
  51909. }
  51910. else {
  51911. // we already have a root transition created
  51912. // add this new transition as a child to the root
  51913. this._trns[trnsId].add(trns);
  51914. }
  51915. return trns;
  51916. };
  51917. TransitionController.prototype.destroy = function (trnsId) {
  51918. var trans = this._trns[trnsId];
  51919. if (trans) {
  51920. trans.destroy();
  51921. delete this._trns[trnsId];
  51922. }
  51923. };
  51924. TransitionController.decorators = [
  51925. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */] },
  51926. ];
  51927. /** @nocollapse */
  51928. TransitionController.ctorParameters = function () { return [
  51929. { type: __WEBPACK_IMPORTED_MODULE_3__platform_platform__["a" /* Platform */], },
  51930. { type: __WEBPACK_IMPORTED_MODULE_1__config_config__["a" /* Config */], },
  51931. ]; };
  51932. return TransitionController;
  51933. }());
  51934. //# sourceMappingURL=transition-controller.js.map
  51935. /***/ }),
  51936. /* 45 */
  51937. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51938. "use strict";
  51939. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FabButton; });
  51940. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  51941. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__config_config__ = __webpack_require__(1);
  51942. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ion__ = __webpack_require__(4);
  51943. var __extends = (this && this.__extends) || (function () {
  51944. var extendStatics = Object.setPrototypeOf ||
  51945. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  51946. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  51947. return function (d, b) {
  51948. extendStatics(d, b);
  51949. function __() { this.constructor = d; }
  51950. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  51951. };
  51952. })();
  51953. /**
  51954. * @name FabButton
  51955. * @module ionic
  51956. *
  51957. * @description
  51958. * FABs (Floating Action Buttons) are standard material design components. They are shaped as a circle that represents a promoted action. When pressed, it may contain more related actions.
  51959. * FABs as its name suggests are floating over the content in a fixed position. This is not achieved exclusively with `<button ion-fab>Button</button>` but it has to wrapped with the `<ion-fab>` component, like this:
  51960. *
  51961. * ```html
  51962. * <ion-content>
  51963. * <!-- Real floating action button, fixed. It will not scroll with the content -->
  51964. * <ion-fab>
  51965. * <button ion-fab>Button</button>
  51966. * </ion-fab>
  51967. *
  51968. * <!-- Button shaped as a circle that just like a normal button scrolls with the content -->
  51969. * <button ion-fab>Button</button>
  51970. * </ion-content>
  51971. *
  51972. * ```
  51973. *
  51974. * In case the button is not wrapped with `<ion-fab>`, the fab button will behave like a normal button, scrolling with the content.
  51975. *
  51976. * See [ion-fab] to learn more information about how to position the fab button.
  51977. *
  51978. * @property [mini] - Makes a fab button with a reduced size.
  51979. *
  51980. * @usage
  51981. *
  51982. * ```html
  51983. *
  51984. * <!-- Colors -->
  51985. * <ion-fab>
  51986. * <button ion-fab color="primary">Button</button>
  51987. * </ion-fab>
  51988. *
  51989. * <!-- Mini -->
  51990. * <ion-fab>
  51991. * <button ion-fab mini>Small</button>
  51992. * </ion-fab>
  51993. * ```
  51994. *
  51995. * @demo /docs/demos/src/fab/
  51996. * @see {@link /docs/components#fabs FAB Component Docs}
  51997. */
  51998. var FabButton = (function (_super) {
  51999. __extends(FabButton, _super);
  52000. function FabButton(config, elementRef, renderer) {
  52001. return _super.call(this, config, elementRef, renderer, 'fab') || this;
  52002. }
  52003. /**
  52004. * @hidden
  52005. */
  52006. FabButton.prototype.setActiveClose = function (closeVisible) {
  52007. this.setElementClass('fab-close-active', closeVisible);
  52008. };
  52009. FabButton.decorators = [
  52010. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  52011. selector: '[ion-fab]',
  52012. template: '<ion-icon name="close" class="fab-close-icon"></ion-icon>' +
  52013. '<span class="button-inner">' +
  52014. '<ng-content></ng-content>' +
  52015. '</span>' +
  52016. '<div class="button-effect"></div>',
  52017. changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["i" /* ChangeDetectionStrategy */].OnPush,
  52018. encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_11" /* ViewEncapsulation */].None,
  52019. },] },
  52020. ];
  52021. /** @nocollapse */
  52022. FabButton.ctorParameters = function () { return [
  52023. { type: __WEBPACK_IMPORTED_MODULE_1__config_config__["a" /* Config */], },
  52024. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  52025. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  52026. ]; };
  52027. return FabButton;
  52028. }(__WEBPACK_IMPORTED_MODULE_2__ion__["a" /* Ion */]));
  52029. //# sourceMappingURL=fab.js.map
  52030. /***/ }),
  52031. /* 46 */
  52032. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  52033. "use strict";
  52034. /* harmony export (immutable) */ __webpack_exports__["d"] = initSwiper;
  52035. /* harmony export (immutable) */ __webpack_exports__["l"] = startAutoplay;
  52036. /* harmony export (immutable) */ __webpack_exports__["m"] = stopAutoplay;
  52037. /* harmony export (immutable) */ __webpack_exports__["g"] = pauseAutoplay;
  52038. /* harmony export (immutable) */ __webpack_exports__["o"] = updateAutoHeight;
  52039. /* harmony export (immutable) */ __webpack_exports__["p"] = updateContainerSize;
  52040. /* harmony export (immutable) */ __webpack_exports__["q"] = updateSlidesSize;
  52041. /* harmony export (immutable) */ __webpack_exports__["a"] = currentSlidesPerView;
  52042. /* harmony export (immutable) */ __webpack_exports__["n"] = update;
  52043. /* harmony export (immutable) */ __webpack_exports__["c"] = fixLoop;
  52044. /* harmony export (immutable) */ __webpack_exports__["k"] = slideTo;
  52045. /* harmony export (immutable) */ __webpack_exports__["f"] = onTransitionStart;
  52046. /* harmony export (immutable) */ __webpack_exports__["e"] = onTransitionEnd;
  52047. /* harmony export (immutable) */ __webpack_exports__["h"] = slideNext;
  52048. /* harmony export (immutable) */ __webpack_exports__["i"] = slidePrev;
  52049. /* harmony export (immutable) */ __webpack_exports__["j"] = slideReset;
  52050. /* unused harmony export disableTouchControl */
  52051. /* unused harmony export enableTouchControl */
  52052. /* harmony export (immutable) */ __webpack_exports__["b"] = destroySwiper;
  52053. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__swiper_utils__ = __webpack_require__(12);
  52054. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__swiper_transition__ = __webpack_require__(88);
  52055. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__swiper_progress__ = __webpack_require__(47);
  52056. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__swiper_classes__ = __webpack_require__(89);
  52057. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__swiper_parallax__ = __webpack_require__(176);
  52058. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__swiper_index__ = __webpack_require__(48);
  52059. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__swiper_effects__ = __webpack_require__(91);
  52060. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__swiper_pagination__ = __webpack_require__(90);
  52061. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__swiper_zoom__ = __webpack_require__(178);
  52062. /**
  52063. * Adopted from Swiper
  52064. * Most modern mobile touch slider and framework with hardware
  52065. * accelerated transitions.
  52066. *
  52067. * http://www.idangero.us/swiper/
  52068. *
  52069. * Copyright 2016, Vladimir Kharlampidi
  52070. * The iDangero.us
  52071. * http://www.idangero.us/
  52072. *
  52073. * Licensed under MIT
  52074. */
  52075. function initSwiper(s, plt) {
  52076. // Classname
  52077. s._classNames = [];
  52078. /*=========================
  52079. Preparation - Define Container, Wrapper and Pagination
  52080. ===========================*/
  52081. if (!s.container) {
  52082. return;
  52083. }
  52084. // Save instance in container HTML Element and in data
  52085. s.container.swiper = s;
  52086. var containerModifierClass = __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].containerModifier;
  52087. s._classNames.push(containerModifierClass + s.direction);
  52088. if (s.freeMode) {
  52089. s._classNames.push(containerModifierClass + 'free-mode');
  52090. }
  52091. if (s.autoHeight) {
  52092. s._classNames.push(containerModifierClass + 'autoheight');
  52093. }
  52094. // Enable slides progress when required
  52095. if (s.parallax || s.watchSlidesVisibility) {
  52096. s.watchSlidesProgress = true;
  52097. }
  52098. // Max resistance when touchReleaseOnEdges
  52099. if (s.touchReleaseOnEdges) {
  52100. s.resistanceRatio = 0;
  52101. }
  52102. var effect = s.effect;
  52103. // Coverflow / 3D
  52104. if (['cube', 'coverflow', 'flip'].indexOf(effect) >= 0) {
  52105. s.watchSlidesProgress = true;
  52106. s._classNames.push(containerModifierClass + '3d');
  52107. }
  52108. if (effect !== 'slide') {
  52109. s._classNames.push(containerModifierClass + effect);
  52110. }
  52111. if (effect === 'cube') {
  52112. s.resistanceRatio = 0;
  52113. s.slidesPerView = 1;
  52114. s.slidesPerColumn = 1;
  52115. s.slidesPerGroup = 1;
  52116. s.centeredSlides = false;
  52117. s.spaceBetween = 0;
  52118. s.virtualTranslate = true;
  52119. s.setWrapperSize = false;
  52120. }
  52121. if (effect === 'fade' || effect === 'flip') {
  52122. s.slidesPerView = 1;
  52123. s.slidesPerColumn = 1;
  52124. s.slidesPerGroup = 1;
  52125. s.watchSlidesProgress = true;
  52126. s.spaceBetween = 0;
  52127. s.setWrapperSize = false;
  52128. s.virtualTranslate = true;
  52129. }
  52130. // Wrapper
  52131. s._wrapper = s.container.querySelector('.' + __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].wrapper);
  52132. // Pagination
  52133. if (s.paginationType) {
  52134. s._paginationContainer = s.container.querySelector('.swiper-pagination');
  52135. if (s.paginationType === 'bullets') {
  52136. s._paginationContainer.classList.add(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].paginationModifier + 'clickable');
  52137. }
  52138. s._paginationContainer.classList.add(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].paginationModifier + s.paginationType);
  52139. }
  52140. // Next/Prev Buttons
  52141. // if (s.nextButton || s.prevButton) {
  52142. // if (s.nextButton) {
  52143. // s.nextButton = <any>s.container.closest('ion-content').querySelector(s.nextButton);
  52144. // }
  52145. // if (s.prevButton) {
  52146. // s.prevButton = <any>s.container.closest('ion-content').querySelector(s.prevButton);
  52147. // }
  52148. // }
  52149. // RTL
  52150. s._rtl = Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) && (s.container.dir.toLowerCase() === 'rtl' || s.container.style.direction === 'rtl');
  52151. if (s._rtl) {
  52152. s._classNames.push(containerModifierClass + 'rtl');
  52153. }
  52154. // Columns
  52155. if (s.slidesPerColumn > 1) {
  52156. s._classNames.push(containerModifierClass + 'multirow');
  52157. }
  52158. // Check for Android
  52159. if (plt.is('android')) {
  52160. s._classNames.push(containerModifierClass + 'android');
  52161. }
  52162. // Add classes
  52163. s._classNames.forEach(function (clsName) {
  52164. s.container.classList.add(clsName);
  52165. });
  52166. // Translate
  52167. s._translate = 0;
  52168. // Progress
  52169. s.progress = 0;
  52170. // Velocity
  52171. s.velocity = 0;
  52172. /*=========================
  52173. Autoplay
  52174. ===========================*/
  52175. s._autoplayTimeoutId = undefined;
  52176. s._autoplaying = false;
  52177. s._autoplayPaused = false;
  52178. s._allowClick = true;
  52179. // Animating Flag
  52180. s._animating = false;
  52181. // Touches information
  52182. s._touches = {
  52183. startX: 0,
  52184. startY: 0,
  52185. currentX: 0,
  52186. currentY: 0,
  52187. diff: 0
  52188. };
  52189. if (s.loop) {
  52190. createLoop(s);
  52191. }
  52192. updateContainerSize(s, plt);
  52193. updateSlidesSize(s, plt);
  52194. Object(__WEBPACK_IMPORTED_MODULE_7__swiper_pagination__["a" /* updatePagination */])(s);
  52195. if (effect !== 'slide' && __WEBPACK_IMPORTED_MODULE_6__swiper_effects__["a" /* SWIPER_EFFECTS */][effect]) {
  52196. if (!s.loop) {
  52197. Object(__WEBPACK_IMPORTED_MODULE_2__swiper_progress__["a" /* updateProgress */])(s);
  52198. }
  52199. __WEBPACK_IMPORTED_MODULE_6__swiper_effects__["a" /* SWIPER_EFFECTS */][effect].setTranslate(s, plt);
  52200. }
  52201. if (s.loop) {
  52202. slideTo(s, plt, s.initialSlide + s.loopedSlides, 0, s.runCallbacksOnInit);
  52203. }
  52204. else {
  52205. slideTo(s, plt, s.initialSlide, 0, s.runCallbacksOnInit);
  52206. if (s.initialSlide === 0) {
  52207. Object(__WEBPACK_IMPORTED_MODULE_4__swiper_parallax__["b" /* parallaxSetTranslate */])(s);
  52208. }
  52209. }
  52210. if (s.autoplay) {
  52211. startAutoplay(s, plt);
  52212. }
  52213. }
  52214. /*=========================
  52215. Autoplay
  52216. ===========================*/
  52217. function autoplay(s, plt) {
  52218. var autoplayDelay = s.autoplay;
  52219. var activeSlide = s._slides[s._activeIndex];
  52220. if (activeSlide.hasAttribute('data-swiper-autoplay')) {
  52221. autoplayDelay = (activeSlide.getAttribute('data-swiper-autoplay') || s.autoplay);
  52222. }
  52223. s._autoplayTimeoutId = plt.timeout(function () {
  52224. s._zone.run(function () {
  52225. if (s.loop) {
  52226. fixLoop(s, plt);
  52227. slideNext(s, plt, true, undefined, true);
  52228. s.ionSlideAutoplay.emit(s);
  52229. }
  52230. else {
  52231. if (!s._isEnd) {
  52232. slideNext(s, plt, true, undefined, true);
  52233. s.ionSlideAutoplay.emit(s);
  52234. }
  52235. else {
  52236. if (!s.autoplayStopOnLast) {
  52237. slideTo(s, plt, 0);
  52238. s.ionSlideAutoplay.emit(s);
  52239. }
  52240. else {
  52241. stopAutoplay(s);
  52242. }
  52243. }
  52244. }
  52245. });
  52246. }, autoplayDelay);
  52247. }
  52248. function startAutoplay(s, plt) {
  52249. if (typeof s._autoplayTimeoutId !== 'undefined')
  52250. return false;
  52251. if (!s.autoplay || s._autoplaying) {
  52252. return false;
  52253. }
  52254. s._autoplaying = true;
  52255. s._zone.run(function () {
  52256. s.ionSlideAutoplayStart.emit(s);
  52257. });
  52258. autoplay(s, plt);
  52259. }
  52260. function stopAutoplay(s) {
  52261. if (!s._autoplayTimeoutId)
  52262. return;
  52263. if (s._autoplayTimeoutId)
  52264. clearTimeout(s._autoplayTimeoutId);
  52265. s._autoplaying = false;
  52266. s._autoplayTimeoutId = undefined;
  52267. s._zone.run(function () {
  52268. s.ionSlideAutoplayStop.emit(s);
  52269. });
  52270. }
  52271. function pauseAutoplay(s, plt, speed) {
  52272. if (s._autoplayPaused)
  52273. return;
  52274. if (s._autoplayTimeoutId)
  52275. clearTimeout(s._autoplayTimeoutId);
  52276. s._autoplayPaused = true;
  52277. if (speed === 0) {
  52278. s._autoplayPaused = false;
  52279. autoplay(s, plt);
  52280. }
  52281. else {
  52282. plt.transitionEnd(s._wrapper, function () {
  52283. if (!s)
  52284. return;
  52285. s._autoplayPaused = false;
  52286. if (!s._autoplaying) {
  52287. stopAutoplay(s);
  52288. }
  52289. else {
  52290. autoplay(s, plt);
  52291. }
  52292. });
  52293. }
  52294. }
  52295. /*=========================
  52296. Slider/slides sizes
  52297. ===========================*/
  52298. function updateAutoHeight(s) {
  52299. var activeSlides = [];
  52300. var newHeight = 0;
  52301. var i;
  52302. // Find slides currently in view
  52303. if (s.slidesPerView !== 'auto' && s.slidesPerView > 1) {
  52304. for (i = 0; i < Math.ceil(s.slidesPerView); i++) {
  52305. var index = s._activeIndex + i;
  52306. if (index > s._slides.length)
  52307. break;
  52308. activeSlides.push(s._slides[index]);
  52309. }
  52310. }
  52311. else {
  52312. activeSlides.push(s._slides[s._activeIndex]);
  52313. }
  52314. // Find new height from heighest slide in view
  52315. for (i = 0; i < activeSlides.length; i++) {
  52316. if (typeof activeSlides[i] !== 'undefined') {
  52317. var height = activeSlides[i].offsetHeight;
  52318. newHeight = height > newHeight ? height : newHeight;
  52319. }
  52320. }
  52321. // Update Height
  52322. if (newHeight) {
  52323. s._wrapper.style.height = newHeight + 'px';
  52324. }
  52325. }
  52326. function updateContainerSize(s, plt) {
  52327. var container = s.container;
  52328. var width;
  52329. var height;
  52330. if (typeof s.width !== 'undefined') {
  52331. // manually assign user width
  52332. width = s.width;
  52333. }
  52334. else {
  52335. width = container.clientWidth;
  52336. }
  52337. if (typeof s.renderedHeight !== 'undefined') {
  52338. // manually assign user height
  52339. height = s.renderedHeight;
  52340. }
  52341. else {
  52342. height = container.clientHeight;
  52343. }
  52344. if (width === 0 && Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) || height === 0 && !Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s)) {
  52345. return;
  52346. }
  52347. // Subtract paddings
  52348. var containerStyles = plt.getElementComputedStyle(container);
  52349. width = width - parseInt(containerStyles.paddingLeft, 10) - parseInt(containerStyles.paddingRight, 10);
  52350. height = height - parseInt(containerStyles.paddingTop, 10) - parseInt(containerStyles.paddingBottom, 10);
  52351. // Store values
  52352. s.renderedWidth = width;
  52353. s.renderedHeight = height;
  52354. s._renderedSize = Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) ? width : height;
  52355. }
  52356. function updateSlidesSize(s, plt) {
  52357. s._slides = s._wrapper.querySelectorAll('.' + __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].slide);
  52358. s._snapGrid = [];
  52359. s._slidesGrid = [];
  52360. s._slidesSizesGrid = [];
  52361. var spaceBetween = s.spaceBetween;
  52362. var slidePosition = -s.slidesOffsetBefore;
  52363. var i;
  52364. var prevSlideSize = 0;
  52365. var index = 0;
  52366. if (typeof s._renderedSize === 'undefined')
  52367. return;
  52368. if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) {
  52369. spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * s._renderedSize;
  52370. }
  52371. s._virtualSize = -spaceBetween;
  52372. // reset margins
  52373. if (s._rtl) {
  52374. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["e" /* inlineStyle */])(s._slides, { marginLeft: '', marginTop: '' });
  52375. }
  52376. else {
  52377. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["e" /* inlineStyle */])(s._slides, { marginRight: '', marginBottom: '' });
  52378. }
  52379. var slidesNumberEvenToRows;
  52380. if (s.slidesPerColumn > 1) {
  52381. if (Math.floor(s._slides.length / s.slidesPerColumn) === s._slides.length / s.slidesPerColumn) {
  52382. slidesNumberEvenToRows = s._slides.length;
  52383. }
  52384. else {
  52385. slidesNumberEvenToRows = Math.ceil(s._slides.length / s.slidesPerColumn) * s.slidesPerColumn;
  52386. }
  52387. if (s.slidesPerView !== 'auto' && s.slidesPerColumnFill === 'row') {
  52388. slidesNumberEvenToRows = Math.max(slidesNumberEvenToRows, s.slidesPerView * s.slidesPerColumn);
  52389. }
  52390. }
  52391. // Calc slides
  52392. var slideSize;
  52393. var slidesPerColumn = s.slidesPerColumn;
  52394. var slidesPerRow = slidesNumberEvenToRows / slidesPerColumn;
  52395. var numFullColumns = slidesPerRow - (s.slidesPerColumn * slidesPerRow - s._slides.length);
  52396. for (i = 0; i < s._slides.length; i++) {
  52397. slideSize = 0;
  52398. var slide = s._slides[i];
  52399. if (s.slidesPerColumn > 1) {
  52400. // Set slides order
  52401. var newSlideOrderIndex;
  52402. var column;
  52403. var row;
  52404. if (s.slidesPerColumnFill === 'column') {
  52405. column = Math.floor(i / slidesPerColumn);
  52406. row = i - column * slidesPerColumn;
  52407. if (column > numFullColumns || (column === numFullColumns && row === slidesPerColumn - 1)) {
  52408. if (++row >= slidesPerColumn) {
  52409. row = 0;
  52410. column++;
  52411. }
  52412. }
  52413. newSlideOrderIndex = column + row * slidesNumberEvenToRows / slidesPerColumn;
  52414. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["e" /* inlineStyle */])(slide, {
  52415. '-webkit-box-ordinal-group': newSlideOrderIndex,
  52416. '-moz-box-ordinal-group': newSlideOrderIndex,
  52417. '-ms-flex-order': newSlideOrderIndex,
  52418. '-webkit-order': newSlideOrderIndex,
  52419. 'order': newSlideOrderIndex
  52420. });
  52421. }
  52422. else {
  52423. row = Math.floor(i / slidesPerRow);
  52424. column = i - row * slidesPerRow;
  52425. }
  52426. var cssVal = (row !== 0 && s.spaceBetween) && (s.spaceBetween + 'px');
  52427. var cssObj = {};
  52428. if (Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s)) {
  52429. cssObj['marginTop'] = cssVal;
  52430. }
  52431. else {
  52432. cssObj['marginLeft'] = cssVal;
  52433. }
  52434. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["e" /* inlineStyle */])(slide, cssObj);
  52435. slide.setAttribute('data-swiper-column', column);
  52436. slide.setAttribute('data-swiper-row', row);
  52437. }
  52438. if (slide.style.display === 'none') {
  52439. continue;
  52440. }
  52441. if (s.slidesPerView === 'auto') {
  52442. var styles = plt.getElementComputedStyle(slide);
  52443. if (Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s)) {
  52444. slideSize = slide.offsetWidth + parseFloat(styles.marginRight) + parseFloat(styles.marginLeft);
  52445. }
  52446. else {
  52447. slideSize = slide.offsetHeight + parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);
  52448. }
  52449. if (s.roundLengths)
  52450. slideSize = Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["m" /* round */])(slideSize);
  52451. }
  52452. else {
  52453. slideSize = (s._renderedSize - (s.slidesPerView - 1) * spaceBetween) / s.slidesPerView;
  52454. if (s.roundLengths)
  52455. slideSize = Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["m" /* round */])(slideSize);
  52456. if (Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s)) {
  52457. s._slides[i].style.width = slideSize + 'px';
  52458. }
  52459. else {
  52460. s._slides[i].style.height = slideSize + 'px';
  52461. }
  52462. }
  52463. s._slides[i].swiperSlideSize = slideSize;
  52464. s._slidesSizesGrid.push(slideSize);
  52465. if (s.centeredSlides) {
  52466. slidePosition = slidePosition + slideSize / 2 + prevSlideSize / 2 + spaceBetween;
  52467. if (i === 0)
  52468. slidePosition = slidePosition - s._renderedSize / 2 - spaceBetween;
  52469. if (Math.abs(slidePosition) < 1 / 1000)
  52470. slidePosition = 0;
  52471. if ((index) % s.slidesPerGroup === 0)
  52472. s._snapGrid.push(slidePosition);
  52473. s._slidesGrid.push(slidePosition);
  52474. }
  52475. else {
  52476. if ((index) % s.slidesPerGroup === 0)
  52477. s._snapGrid.push(slidePosition);
  52478. s._slidesGrid.push(slidePosition);
  52479. slidePosition = slidePosition + slideSize + spaceBetween;
  52480. }
  52481. s._virtualSize += slideSize + spaceBetween;
  52482. prevSlideSize = slideSize;
  52483. index++;
  52484. }
  52485. s._virtualSize = Math.max(s._virtualSize, s._renderedSize) + s.slidesOffsetAfter;
  52486. var newSlidesGrid;
  52487. if (s._rtl && (s.effect === 'slide' || s.effect === 'coverflow')) {
  52488. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["e" /* inlineStyle */])(s._wrapper, { width: s._virtualSize + s.spaceBetween + 'px' });
  52489. }
  52490. if (s.setWrapperSize) {
  52491. if (Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s)) {
  52492. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["e" /* inlineStyle */])(s._wrapper, { width: s._virtualSize + s.spaceBetween + 'px' });
  52493. }
  52494. else {
  52495. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["e" /* inlineStyle */])(s._wrapper, { height: s._virtualSize + s.spaceBetween + 'px' });
  52496. }
  52497. }
  52498. if (s.slidesPerColumn > 1) {
  52499. s._virtualSize = (slideSize + s.spaceBetween) * slidesNumberEvenToRows;
  52500. s._virtualSize = Math.ceil(s._virtualSize / s.slidesPerColumn) - s.spaceBetween;
  52501. if (Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s)) {
  52502. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["e" /* inlineStyle */])(s._wrapper, { width: s._virtualSize + s.spaceBetween + 'px' });
  52503. }
  52504. else {
  52505. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["e" /* inlineStyle */])(s._wrapper, { height: s._virtualSize + s.spaceBetween + 'px' });
  52506. }
  52507. if (s.centeredSlides) {
  52508. newSlidesGrid = [];
  52509. for (i = 0; i < s._snapGrid.length; i++) {
  52510. if (s._snapGrid[i] < s._virtualSize + s._snapGrid[0])
  52511. newSlidesGrid.push(s._snapGrid[i]);
  52512. }
  52513. s._snapGrid = newSlidesGrid;
  52514. }
  52515. }
  52516. // Remove last grid elements depending on width
  52517. if (!s.centeredSlides) {
  52518. newSlidesGrid = [];
  52519. for (i = 0; i < s._snapGrid.length; i++) {
  52520. if (s._snapGrid[i] <= s._virtualSize - s._renderedSize) {
  52521. newSlidesGrid.push(s._snapGrid[i]);
  52522. }
  52523. }
  52524. s._snapGrid = newSlidesGrid;
  52525. if (Math.floor(s._virtualSize - s._renderedSize) - Math.floor(s._snapGrid[s._snapGrid.length - 1]) > 1) {
  52526. s._snapGrid.push(s._virtualSize - s._renderedSize);
  52527. }
  52528. }
  52529. if (s._snapGrid.length === 0)
  52530. s._snapGrid = [0];
  52531. if (s.spaceBetween !== 0) {
  52532. if (Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s)) {
  52533. if (s._rtl) {
  52534. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["e" /* inlineStyle */])(s._slides, { marginLeft: spaceBetween + 'px' });
  52535. }
  52536. else {
  52537. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["e" /* inlineStyle */])(s._slides, { marginRight: spaceBetween + 'px' });
  52538. }
  52539. }
  52540. else {
  52541. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["e" /* inlineStyle */])(s._slides, { marginBottom: spaceBetween + 'px' });
  52542. }
  52543. }
  52544. if (s.watchSlidesProgress) {
  52545. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["q" /* updateSlidesOffset */])(s);
  52546. }
  52547. }
  52548. /*=========================
  52549. Dynamic Slides Per View
  52550. ===========================*/
  52551. function currentSlidesPerView(s) {
  52552. var spv = 1;
  52553. var i;
  52554. var j;
  52555. if (s.centeredSlides) {
  52556. var size = s._slides[s._activeIndex].swiperSlideSize;
  52557. var breakLoop;
  52558. for (i = s._activeIndex + 1; i < s._slides.length; i++) {
  52559. if (s._slides[i] && !breakLoop) {
  52560. size += s._slides[i].swiperSlideSize;
  52561. spv++;
  52562. if (size > s._renderedSize)
  52563. breakLoop = true;
  52564. }
  52565. }
  52566. for (j = s._activeIndex - 1; j >= 0; j--) {
  52567. if (s._slides[j] && !breakLoop) {
  52568. size += s._slides[j].swiperSlideSize;
  52569. spv++;
  52570. if (size > s._renderedSize)
  52571. breakLoop = true;
  52572. }
  52573. }
  52574. }
  52575. else {
  52576. for (i = s._activeIndex + 1; i < s._slides.length; i++) {
  52577. if (s._slidesGrid[i] - s._slidesGrid[s._activeIndex] < s._renderedSize) {
  52578. spv++;
  52579. }
  52580. }
  52581. }
  52582. return spv;
  52583. }
  52584. /*=========================
  52585. Common update method
  52586. ===========================*/
  52587. function update(s, plt, updateTranslate) {
  52588. if (!s)
  52589. return;
  52590. updateContainerSize(s, plt);
  52591. updateSlidesSize(s, plt);
  52592. Object(__WEBPACK_IMPORTED_MODULE_2__swiper_progress__["a" /* updateProgress */])(s);
  52593. Object(__WEBPACK_IMPORTED_MODULE_7__swiper_pagination__["a" /* updatePagination */])(s);
  52594. Object(__WEBPACK_IMPORTED_MODULE_3__swiper_classes__["a" /* updateClasses */])(s);
  52595. if (s.zoom) {
  52596. Object(__WEBPACK_IMPORTED_MODULE_8__swiper_zoom__["b" /* resetZoomEvents */])(s, plt);
  52597. }
  52598. var translated;
  52599. var newTranslate;
  52600. function forceSetTranslate() {
  52601. newTranslate = Math.min(Math.max(s._translate, Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["h" /* maxTranslate */])(s)), Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["i" /* minTranslate */])(s));
  52602. Object(__WEBPACK_IMPORTED_MODULE_1__swiper_transition__["d" /* setWrapperTranslate */])(s, plt, newTranslate);
  52603. Object(__WEBPACK_IMPORTED_MODULE_5__swiper_index__["a" /* updateActiveIndex */])(s);
  52604. Object(__WEBPACK_IMPORTED_MODULE_3__swiper_classes__["a" /* updateClasses */])(s);
  52605. }
  52606. if (updateTranslate) {
  52607. if (s._spline) {
  52608. s._spline = undefined;
  52609. }
  52610. if (s.freeMode) {
  52611. forceSetTranslate();
  52612. if (s.autoHeight) {
  52613. updateAutoHeight(s);
  52614. }
  52615. }
  52616. else {
  52617. if ((s.slidesPerView === 'auto' || s.slidesPerView > 1) && s._isEnd && !s.centeredSlides) {
  52618. translated = slideTo(s, plt, s._slides.length - 1, 0, false, true);
  52619. }
  52620. else {
  52621. translated = slideTo(s, plt, s._activeIndex, 0, false, true);
  52622. }
  52623. if (!translated) {
  52624. forceSetTranslate();
  52625. }
  52626. }
  52627. }
  52628. else if (s.autoHeight) {
  52629. updateAutoHeight(s);
  52630. }
  52631. }
  52632. /*=========================
  52633. Loop
  52634. ===========================*/
  52635. // Create looped slides
  52636. function createLoop(s) {
  52637. // Remove duplicated slides
  52638. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["c" /* eachChild */])(s._wrapper, '.' + __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].slide + '.' + __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].slideDuplicate, function (ele) {
  52639. ele.parentElement.removeChild(ele);
  52640. });
  52641. var slides = s._wrapper.querySelectorAll('.' + __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].slide);
  52642. if (s.slidesPerView === 'auto' && !s.loopedSlides) {
  52643. s.loopedSlides = slides.length;
  52644. }
  52645. s.loopedSlides = parseInt((s.loopedSlides || s.slidesPerView), 10);
  52646. s.loopedSlides = s.loopedSlides + s.loopAdditionalSlides;
  52647. if (s.loopedSlides > slides.length) {
  52648. s.loopedSlides = slides.length;
  52649. }
  52650. var prependSlides = [];
  52651. var appendSlides = [];
  52652. for (var i = 0; i < slides.length; i++) {
  52653. var slide = slides[i];
  52654. if (i < s.loopedSlides)
  52655. appendSlides.push(slide);
  52656. if (i < slides.length && i >= slides.length - s.loopedSlides)
  52657. prependSlides.push(slide);
  52658. slide.setAttribute('data-swiper-slide-index', i);
  52659. }
  52660. for (i = 0; i < appendSlides.length; i++) {
  52661. var appendClone = appendSlides[i].cloneNode(true);
  52662. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["b" /* addClass */])(appendClone, __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].slideDuplicate);
  52663. s._wrapper.appendChild(appendClone);
  52664. }
  52665. for (i = prependSlides.length - 1; i >= 0; i--) {
  52666. var prependClone = prependSlides[i].cloneNode(true);
  52667. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["b" /* addClass */])(prependClone, __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].slideDuplicate);
  52668. s._wrapper.insertBefore(prependClone, s._wrapper.firstElementChild);
  52669. }
  52670. }
  52671. function destroyLoop(s) {
  52672. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["c" /* eachChild */])(s._wrapper, '.' + __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].slide + '.' + __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].slideDuplicate, function (ele) {
  52673. ele.parentElement.removeChild(ele);
  52674. });
  52675. if (s._slides) {
  52676. for (var i = 0; i < s._slides.length; i++) {
  52677. s._slides[i].removeAttribute('data-swiper-slide-index');
  52678. }
  52679. }
  52680. }
  52681. function fixLoop(s, plt) {
  52682. var newIndex;
  52683. if (s._activeIndex < s.loopedSlides) {
  52684. // Fix For Negative Oversliding
  52685. newIndex = s._slides.length - s.loopedSlides * 3 + s._activeIndex;
  52686. newIndex = newIndex + s.loopedSlides;
  52687. slideTo(s, plt, newIndex, 0, false, true);
  52688. }
  52689. else if ((s.slidesPerView === 'auto' && s._activeIndex >= s.loopedSlides * 2) || (s._activeIndex > s._slides.length - s.slidesPerView * 2)) {
  52690. // Fix For Positive Oversliding
  52691. newIndex = -s._slides.length + s._activeIndex + s.loopedSlides;
  52692. newIndex = newIndex + s.loopedSlides;
  52693. slideTo(s, plt, newIndex, 0, false, true);
  52694. }
  52695. }
  52696. /*=========================
  52697. Transitions
  52698. ===========================*/
  52699. function slideTo(s, plt, slideIndex, speed, runCallbacks, internal) {
  52700. if (runCallbacks === void 0) { runCallbacks = true; }
  52701. if (typeof slideIndex === 'undefined')
  52702. slideIndex = 0;
  52703. if (slideIndex < 0)
  52704. slideIndex = 0;
  52705. s._snapIndex = Math.floor(slideIndex / s.slidesPerGroup);
  52706. if (s._snapIndex >= s._snapGrid.length)
  52707. s._snapIndex = s._snapGrid.length - 1;
  52708. var translate = -s._snapGrid[s._snapIndex];
  52709. // Stop autoplay
  52710. if (s.autoplay && s._autoplaying) {
  52711. if (internal || !s.autoplayDisableOnInteraction) {
  52712. pauseAutoplay(s, plt, speed);
  52713. }
  52714. else {
  52715. stopAutoplay(s);
  52716. }
  52717. }
  52718. // Update progress
  52719. Object(__WEBPACK_IMPORTED_MODULE_2__swiper_progress__["a" /* updateProgress */])(s, translate);
  52720. // Directions locks
  52721. if (!s._allowSwipeToNext && translate < s._translate && translate < Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["i" /* minTranslate */])(s)) {
  52722. return false;
  52723. }
  52724. if (!s._allowSwipeToPrev && translate > s._translate && translate > Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["h" /* maxTranslate */])(s)) {
  52725. if ((s._activeIndex || 0) !== slideIndex)
  52726. return false;
  52727. }
  52728. // Update Index
  52729. if (typeof speed === 'undefined')
  52730. speed = s.speed;
  52731. s._previousIndex = s._activeIndex || 0;
  52732. s._activeIndex = slideIndex;
  52733. Object(__WEBPACK_IMPORTED_MODULE_5__swiper_index__["b" /* updateRealIndex */])(s);
  52734. if ((s._rtl && -translate === s._translate) || (!s._rtl && translate === s._translate)) {
  52735. // Update Height
  52736. if (s.autoHeight) {
  52737. updateAutoHeight(s);
  52738. }
  52739. Object(__WEBPACK_IMPORTED_MODULE_3__swiper_classes__["a" /* updateClasses */])(s);
  52740. if (s.effect !== 'slide') {
  52741. Object(__WEBPACK_IMPORTED_MODULE_1__swiper_transition__["d" /* setWrapperTranslate */])(s, plt, translate);
  52742. }
  52743. return false;
  52744. }
  52745. Object(__WEBPACK_IMPORTED_MODULE_3__swiper_classes__["a" /* updateClasses */])(s);
  52746. onTransitionStart(s, runCallbacks);
  52747. if (speed === 0) {
  52748. Object(__WEBPACK_IMPORTED_MODULE_1__swiper_transition__["d" /* setWrapperTranslate */])(s, plt, translate);
  52749. Object(__WEBPACK_IMPORTED_MODULE_1__swiper_transition__["c" /* setWrapperTransition */])(s, plt, 0);
  52750. onTransitionEnd(s, plt, runCallbacks);
  52751. }
  52752. else {
  52753. Object(__WEBPACK_IMPORTED_MODULE_1__swiper_transition__["d" /* setWrapperTranslate */])(s, plt, translate);
  52754. Object(__WEBPACK_IMPORTED_MODULE_1__swiper_transition__["c" /* setWrapperTransition */])(s, plt, speed);
  52755. if (!s._animating) {
  52756. s._animating = true;
  52757. plt.transitionEnd(s._wrapper, function () {
  52758. if (!s)
  52759. return;
  52760. onTransitionEnd(s, plt, runCallbacks);
  52761. });
  52762. }
  52763. }
  52764. return true;
  52765. }
  52766. function onTransitionStart(s, runCallbacks) {
  52767. if (runCallbacks === void 0) { runCallbacks = true; }
  52768. if (s.autoHeight) {
  52769. updateAutoHeight(s);
  52770. }
  52771. if (runCallbacks) {
  52772. s._zone.run(function () {
  52773. s.ionSlideTransitionStart.emit(s);
  52774. if (s._activeIndex !== s._previousIndex) {
  52775. s.ionSlideWillChange.emit(s);
  52776. if (s._activeIndex > s._previousIndex) {
  52777. s.ionSlideNextStart.emit(s);
  52778. }
  52779. else {
  52780. s.ionSlidePrevStart.emit(s);
  52781. }
  52782. }
  52783. });
  52784. }
  52785. }
  52786. function onTransitionEnd(s, plt, runCallbacks) {
  52787. if (runCallbacks === void 0) { runCallbacks = true; }
  52788. s._animating = false;
  52789. Object(__WEBPACK_IMPORTED_MODULE_1__swiper_transition__["c" /* setWrapperTransition */])(s, plt, 0);
  52790. if (runCallbacks) {
  52791. s._zone.run(function () {
  52792. s.ionSlideTransitionEnd.emit(s);
  52793. if (s._activeIndex !== s._previousIndex) {
  52794. s.ionSlideDidChange.emit(s);
  52795. if (s._activeIndex > s._previousIndex) {
  52796. s.ionSlideNextEnd.emit(s);
  52797. }
  52798. else {
  52799. s.ionSlidePrevEnd.emit(s);
  52800. }
  52801. }
  52802. });
  52803. }
  52804. }
  52805. function slideNext(s, plt, runCallbacks, speed, internal) {
  52806. if (s.loop) {
  52807. if (s._animating)
  52808. return false;
  52809. fixLoop(s, plt);
  52810. s.container.clientLeft;
  52811. return slideTo(s, plt, s._activeIndex + s.slidesPerGroup, speed, runCallbacks, internal);
  52812. }
  52813. var nextSlide = s._activeIndex + s.slidesPerGroup;
  52814. if (nextSlide < s._slides.length) {
  52815. return slideTo(s, plt, nextSlide, speed, runCallbacks, internal);
  52816. }
  52817. return false;
  52818. }
  52819. function slidePrev(s, plt, runCallbacks, speed, internal) {
  52820. if (s.loop) {
  52821. if (s._animating)
  52822. return false;
  52823. fixLoop(s, plt);
  52824. s.container.clientLeft;
  52825. return slideTo(s, plt, s._activeIndex - 1, speed, runCallbacks, internal);
  52826. }
  52827. var previousSlide = s._activeIndex - 1;
  52828. if (previousSlide >= 0) {
  52829. return slideTo(s, plt, s._activeIndex - 1, speed, runCallbacks, internal);
  52830. }
  52831. return false;
  52832. }
  52833. function slideReset(s, plt, runCallbacks, speed) {
  52834. return slideTo(s, plt, s._activeIndex, speed, runCallbacks, true);
  52835. }
  52836. function disableTouchControl(s) {
  52837. s.onlyExternal = true;
  52838. return true;
  52839. }
  52840. function enableTouchControl(s) {
  52841. s.onlyExternal = false;
  52842. return true;
  52843. }
  52844. /*=========================
  52845. Translate/transition helpers
  52846. ===========================*/
  52847. // Cleanup dynamic styles
  52848. function cleanupStyles(s) {
  52849. if (!s.container || !s._wrapper) {
  52850. // fix #10830
  52851. return;
  52852. }
  52853. // Container
  52854. if (s.container) {
  52855. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["l" /* removeClass */])(s.container, s._classNames);
  52856. s.container.removeAttribute('style');
  52857. }
  52858. // Wrapper
  52859. s._wrapper.removeAttribute('style');
  52860. // Slides
  52861. if (s._slides && s._slides.length) {
  52862. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["l" /* removeClass */])(s._slides, [
  52863. __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].slideVisible,
  52864. __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].slideActive,
  52865. __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].slideNext,
  52866. __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].slidePrev
  52867. ]);
  52868. for (var i = 0; i < s._slides.length; i++) {
  52869. var slide = s._slides[i];
  52870. slide.removeAttribute('style');
  52871. slide.removeAttribute('data-swiper-column');
  52872. slide.removeAttribute('data-swiper-row');
  52873. }
  52874. }
  52875. // Pagination/Bullets
  52876. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["l" /* removeClass */])(s._bullets, __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].bulletActive);
  52877. // Buttons
  52878. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["l" /* removeClass */])(s.prevButton, __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].buttonDisabled);
  52879. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["l" /* removeClass */])(s.nextButton, __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].buttonDisabled);
  52880. }
  52881. // Destroy
  52882. function destroySwiper(s) {
  52883. // Stop autoplay
  52884. stopAutoplay(s);
  52885. // Destroy loop
  52886. if (s.loop) {
  52887. destroyLoop(s);
  52888. }
  52889. // Cleanup styles
  52890. cleanupStyles(s);
  52891. }
  52892. //# sourceMappingURL=swiper.js.map
  52893. /***/ }),
  52894. /* 47 */
  52895. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  52896. "use strict";
  52897. /* harmony export (immutable) */ __webpack_exports__["a"] = updateProgress;
  52898. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__swiper_utils__ = __webpack_require__(12);
  52899. function updateProgress(s, translate) {
  52900. if (typeof translate === 'undefined') {
  52901. translate = s._translate || 0;
  52902. }
  52903. var translatesDiff = Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["h" /* maxTranslate */])(s) - Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["i" /* minTranslate */])(s);
  52904. var wasBeginning = s._isBeginning;
  52905. var wasEnd = s._isEnd;
  52906. if (translatesDiff === 0) {
  52907. s.progress = 0;
  52908. s._isBeginning = s._isEnd = true;
  52909. }
  52910. else {
  52911. s.progress = (translate - Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["i" /* minTranslate */])(s)) / (translatesDiff);
  52912. s._isBeginning = s.progress <= 0;
  52913. s._isEnd = s.progress >= 1;
  52914. }
  52915. s._zone.run(function () {
  52916. if (s._isBeginning && !wasBeginning) {
  52917. s.ionSlideReachStart.emit();
  52918. }
  52919. if (s._isEnd && !wasEnd) {
  52920. s.ionSlideReachEnd.emit();
  52921. }
  52922. if (s.watchSlidesProgress) {
  52923. updateSlidesProgress(s, translate);
  52924. }
  52925. s.ionSlideProgress.emit(s.progress);
  52926. });
  52927. }
  52928. function updateSlidesProgress(s, translate) {
  52929. if (typeof translate === 'undefined') {
  52930. translate = s._translate || 0;
  52931. }
  52932. if (s._slides.length === 0)
  52933. return;
  52934. if (typeof s._slides[0].swiperSlideOffset === 'undefined') {
  52935. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["q" /* updateSlidesOffset */])(s);
  52936. }
  52937. var offsetCenter = -translate;
  52938. if (s._rtl)
  52939. offsetCenter = translate;
  52940. // Visible Slides
  52941. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["l" /* removeClass */])(s._slides, __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].slideVisible);
  52942. for (var i = 0; i < s._slides.length; i++) {
  52943. var slide = s._slides[i];
  52944. var slideProgress = (offsetCenter + (s.centeredSlides ? Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["i" /* minTranslate */])(s) : 0) - slide.swiperSlideOffset) / (slide.swiperSlideSize + s.spaceBetween);
  52945. if (s.watchSlidesVisibility) {
  52946. var slideBefore = -(offsetCenter - slide.swiperSlideOffset);
  52947. var slideAfter = slideBefore + s._slidesSizesGrid[i];
  52948. var isVisible = (slideBefore >= 0 && slideBefore < s._renderedSize) ||
  52949. (slideAfter > 0 && slideAfter <= s._renderedSize) ||
  52950. (slideBefore <= 0 && slideAfter >= s._renderedSize);
  52951. if (isVisible) {
  52952. s._slides[i].classList.add(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].slideVisible);
  52953. }
  52954. }
  52955. slide.progress = s._rtl ? -slideProgress : slideProgress;
  52956. }
  52957. }
  52958. //# sourceMappingURL=swiper-progress.js.map
  52959. /***/ }),
  52960. /* 48 */
  52961. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  52962. "use strict";
  52963. /* harmony export (immutable) */ __webpack_exports__["a"] = updateActiveIndex;
  52964. /* harmony export (immutable) */ __webpack_exports__["b"] = updateRealIndex;
  52965. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__swiper_classes__ = __webpack_require__(89);
  52966. function updateActiveIndex(s) {
  52967. var translate = s._rtl ? s._translate : -s._translate;
  52968. var newActiveIndex;
  52969. var i;
  52970. var snapIndex;
  52971. for (i = 0; i < s._slidesGrid.length; i++) {
  52972. if (typeof s._slidesGrid[i + 1] !== 'undefined') {
  52973. if (translate >= s._slidesGrid[i] && translate < s._slidesGrid[i + 1] - (s._slidesGrid[i + 1] - s._slidesGrid[i]) / 2) {
  52974. newActiveIndex = i;
  52975. }
  52976. else if (translate >= s._slidesGrid[i] && translate < s._slidesGrid[i + 1]) {
  52977. newActiveIndex = i + 1;
  52978. }
  52979. }
  52980. else {
  52981. if (translate >= s._slidesGrid[i]) {
  52982. newActiveIndex = i;
  52983. }
  52984. }
  52985. }
  52986. snapIndex = Math.floor(newActiveIndex / s.slidesPerGroup);
  52987. if (snapIndex >= s._snapGrid.length)
  52988. snapIndex = s._snapGrid.length - 1;
  52989. if (newActiveIndex === s._activeIndex) {
  52990. return;
  52991. }
  52992. s._snapIndex = snapIndex;
  52993. s._previousIndex = s._activeIndex;
  52994. s._activeIndex = newActiveIndex;
  52995. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_classes__["a" /* updateClasses */])(s);
  52996. updateRealIndex(s);
  52997. }
  52998. function updateRealIndex(s) {
  52999. var activeSlide = s._slides[s._activeIndex];
  53000. if (activeSlide) {
  53001. s.realIndex = parseInt(activeSlide.getAttribute('data-swiper-slide-index') || s._activeIndex, 10);
  53002. }
  53003. }
  53004. //# sourceMappingURL=swiper-index.js.map
  53005. /***/ }),
  53006. /* 49 */
  53007. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53008. "use strict";
  53009. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Toolbar; });
  53010. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  53011. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__config_config__ = __webpack_require__(1);
  53012. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__toolbar_base__ = __webpack_require__(152);
  53013. var __extends = (this && this.__extends) || (function () {
  53014. var extendStatics = Object.setPrototypeOf ||
  53015. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  53016. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  53017. return function (d, b) {
  53018. extendStatics(d, b);
  53019. function __() { this.constructor = d; }
  53020. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  53021. };
  53022. })();
  53023. /**
  53024. * @name Toolbar
  53025. * @description
  53026. * A Toolbar is a generic bar that is positioned above or below content.
  53027. * Unlike a [Navbar](../Navbar/), a toolbar can be used as a subheader.
  53028. * When toolbars are placed within an `<ion-header>` or `<ion-footer>`,
  53029. * the toolbars stay fixed in their respective location. When placed within
  53030. * `<ion-content>`, toolbars will scroll with the content.
  53031. *
  53032. *
  53033. * ### Buttons in a Toolbar
  53034. * Buttons placed in a toolbar should be placed inside of the `<ion-buttons>`
  53035. * element. An exception to this is a [menuToggle](../../menu/MenuToggle) button.
  53036. * It should not be placed inside of the `<ion-buttons>` element. Both the
  53037. * `<ion-buttons>` element and the `menuToggle` can be positioned inside of the
  53038. * toolbar using different properties. The below chart has a description of each
  53039. * property.
  53040. *
  53041. * | Property | Description |
  53042. * |-------------|-----------------------------------------------------------------------------------------------------------------------|
  53043. * | `start` | Positions element to the left of the content in `ios` mode, and directly to the right in `md` and `wp` mode. |
  53044. * | `end` | Positions element to the right of the content in `ios` mode, and to the far right in `md` and `wp` mode. |
  53045. * | `left` | Positions element to the left of all other elements. |
  53046. * | `right` | Positions element to the right of all other elements. |
  53047. *
  53048. *
  53049. * ### Header / Footer Box Shadow and Border
  53050. * In `md` mode, the `<ion-header>` will receive a box-shadow on the bottom, and the
  53051. * `<ion-footer>` will receive a box-shadow on the top. In `ios` mode, the `<ion-header>`
  53052. * will receive a border on the bottom, and the `<ion-footer>` will receive a border on the
  53053. * top. Both the `md` box-shadow and the `ios` border can be removed by adding the `no-border`
  53054. * attribute to the element.
  53055. *
  53056. * ```html
  53057. * <ion-header no-border>
  53058. * <ion-toolbar>
  53059. * <ion-title>Header</ion-title>
  53060. * </ion-toolbar>
  53061. * </ion-header>
  53062. *
  53063. * <ion-content>
  53064. * </ion-content>
  53065. *
  53066. * <ion-footer no-border>
  53067. * <ion-toolbar>
  53068. * <ion-title>Footer</ion-title>
  53069. * </ion-toolbar>
  53070. * </ion-footer>
  53071. * ```
  53072. *
  53073. * @usage
  53074. *
  53075. * ```html
  53076. *
  53077. * <ion-header no-border>
  53078. *
  53079. * <ion-toolbar>
  53080. * <ion-title>My Toolbar Title</ion-title>
  53081. * </ion-toolbar>
  53082. *
  53083. * <ion-toolbar>
  53084. * <ion-title>I'm a subheader</ion-title>
  53085. * </ion-toolbar>
  53086. *
  53087. * <ion-header>
  53088. *
  53089. *
  53090. * <ion-content>
  53091. *
  53092. * <ion-toolbar>
  53093. * <ion-title>Scrolls with the content</ion-title>
  53094. * </ion-toolbar>
  53095. *
  53096. * </ion-content>
  53097. *
  53098. *
  53099. * <ion-footer no-border>
  53100. *
  53101. * <ion-toolbar>
  53102. * <ion-title>I'm a footer</ion-title>
  53103. * </ion-toolbar>
  53104. *
  53105. * </ion-footer>
  53106. * ```
  53107. *
  53108. * @demo /docs/demos/src/toolbar/
  53109. * @see {@link ../Navbar/ Navbar API Docs}
  53110. */
  53111. var Toolbar = (function (_super) {
  53112. __extends(Toolbar, _super);
  53113. function Toolbar(config, elementRef, renderer) {
  53114. var _this = _super.call(this, config, elementRef, renderer) || this;
  53115. _this._sbPadding = config.getBoolean('statusbarPadding');
  53116. return _this;
  53117. }
  53118. Toolbar.decorators = [
  53119. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  53120. selector: 'ion-toolbar',
  53121. template: '<div class="toolbar-background" [ngClass]="\'toolbar-background-\' + _mode"></div>' +
  53122. '<ng-content select="[menuToggle],ion-buttons[left]"></ng-content>' +
  53123. '<ng-content select="ion-buttons[start]"></ng-content>' +
  53124. '<ng-content select="ion-buttons[end],ion-buttons[right]"></ng-content>' +
  53125. '<div class="toolbar-content" [ngClass]="\'toolbar-content-\' + _mode">' +
  53126. '<ng-content></ng-content>' +
  53127. '</div>',
  53128. host: {
  53129. 'class': 'toolbar',
  53130. '[class.statusbar-padding]': '_sbPadding'
  53131. },
  53132. changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["i" /* ChangeDetectionStrategy */].OnPush,
  53133. },] },
  53134. ];
  53135. /** @nocollapse */
  53136. Toolbar.ctorParameters = function () { return [
  53137. { type: __WEBPACK_IMPORTED_MODULE_1__config_config__["a" /* Config */], },
  53138. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  53139. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  53140. ]; };
  53141. return Toolbar;
  53142. }(__WEBPACK_IMPORTED_MODULE_2__toolbar_base__["a" /* ToolbarBase */]));
  53143. //# sourceMappingURL=toolbar.js.map
  53144. /***/ }),
  53145. /* 50 */
  53146. /***/ (function(module, exports, __webpack_require__) {
  53147. "use strict";
  53148. function isFunction(x) {
  53149. return typeof x === 'function';
  53150. }
  53151. exports.isFunction = isFunction;
  53152. //# sourceMappingURL=isFunction.js.map
  53153. /***/ }),
  53154. /* 51 */
  53155. /***/ (function(module, exports, __webpack_require__) {
  53156. "use strict";
  53157. // typeof any so that it we don't have to cast when comparing a result to the error object
  53158. exports.errorObject = { e: {} };
  53159. //# sourceMappingURL=errorObject.js.map
  53160. /***/ }),
  53161. /* 52 */
  53162. /***/ (function(module, exports, __webpack_require__) {
  53163. "use strict";
  53164. var root_1 = __webpack_require__(29);
  53165. var Symbol = root_1.root.Symbol;
  53166. exports.rxSubscriber = (typeof Symbol === 'function' && typeof Symbol.for === 'function') ?
  53167. Symbol.for('rxSubscriber') : '@@rxSubscriber';
  53168. /**
  53169. * @deprecated use rxSubscriber instead
  53170. */
  53171. exports.$$rxSubscriber = exports.rxSubscriber;
  53172. //# sourceMappingURL=rxSubscriber.js.map
  53173. /***/ }),
  53174. /* 53 */
  53175. /***/ (function(module, exports, __webpack_require__) {
  53176. "use strict";
  53177. var root_1 = __webpack_require__(29);
  53178. var isArrayLike_1 = __webpack_require__(213);
  53179. var isPromise_1 = __webpack_require__(214);
  53180. var isObject_1 = __webpack_require__(105);
  53181. var Observable_1 = __webpack_require__(9);
  53182. var iterator_1 = __webpack_require__(215);
  53183. var InnerSubscriber_1 = __webpack_require__(216);
  53184. var observable_1 = __webpack_require__(108);
  53185. function subscribeToResult(outerSubscriber, result, outerValue, outerIndex) {
  53186. var destination = new InnerSubscriber_1.InnerSubscriber(outerSubscriber, outerValue, outerIndex);
  53187. if (destination.closed) {
  53188. return null;
  53189. }
  53190. if (result instanceof Observable_1.Observable) {
  53191. if (result._isScalar) {
  53192. destination.next(result.value);
  53193. destination.complete();
  53194. return null;
  53195. }
  53196. else {
  53197. destination.syncErrorThrowable = true;
  53198. return result.subscribe(destination);
  53199. }
  53200. }
  53201. else if (isArrayLike_1.isArrayLike(result)) {
  53202. for (var i = 0, len = result.length; i < len && !destination.closed; i++) {
  53203. destination.next(result[i]);
  53204. }
  53205. if (!destination.closed) {
  53206. destination.complete();
  53207. }
  53208. }
  53209. else if (isPromise_1.isPromise(result)) {
  53210. result.then(function (value) {
  53211. if (!destination.closed) {
  53212. destination.next(value);
  53213. destination.complete();
  53214. }
  53215. }, function (err) { return destination.error(err); })
  53216. .then(null, function (err) {
  53217. // Escaping the Promise trap: globally throw unhandled errors
  53218. root_1.root.setTimeout(function () { throw err; });
  53219. });
  53220. return destination;
  53221. }
  53222. else if (result && typeof result[iterator_1.iterator] === 'function') {
  53223. var iterator = result[iterator_1.iterator]();
  53224. do {
  53225. var item = iterator.next();
  53226. if (item.done) {
  53227. destination.complete();
  53228. break;
  53229. }
  53230. destination.next(item.value);
  53231. if (destination.closed) {
  53232. break;
  53233. }
  53234. } while (true);
  53235. }
  53236. else if (result && typeof result[observable_1.observable] === 'function') {
  53237. var obs = result[observable_1.observable]();
  53238. if (typeof obs.subscribe !== 'function') {
  53239. destination.error(new TypeError('Provided object does not correctly implement Symbol.observable'));
  53240. }
  53241. else {
  53242. return obs.subscribe(new InnerSubscriber_1.InnerSubscriber(outerSubscriber, outerValue, outerIndex));
  53243. }
  53244. }
  53245. else {
  53246. var value = isObject_1.isObject(result) ? 'an invalid object' : "'" + result + "'";
  53247. var msg = ("You provided " + value + " where a stream was expected.")
  53248. + ' You can provide an Observable, Promise, Array, or Iterable.';
  53249. destination.error(new TypeError(msg));
  53250. }
  53251. return null;
  53252. }
  53253. exports.subscribeToResult = subscribeToResult;
  53254. //# sourceMappingURL=subscribeToResult.js.map
  53255. /***/ }),
  53256. /* 54 */
  53257. /***/ (function(module, exports, __webpack_require__) {
  53258. "use strict";
  53259. var __extends = (this && this.__extends) || function (d, b) {
  53260. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  53261. function __() { this.constructor = d; }
  53262. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  53263. };
  53264. var Subscriber_1 = __webpack_require__(20);
  53265. /**
  53266. * We need this JSDoc comment for affecting ESDoc.
  53267. * @ignore
  53268. * @extends {Ignored}
  53269. */
  53270. var OuterSubscriber = (function (_super) {
  53271. __extends(OuterSubscriber, _super);
  53272. function OuterSubscriber() {
  53273. _super.apply(this, arguments);
  53274. }
  53275. OuterSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  53276. this.destination.next(innerValue);
  53277. };
  53278. OuterSubscriber.prototype.notifyError = function (error, innerSub) {
  53279. this.destination.error(error);
  53280. };
  53281. OuterSubscriber.prototype.notifyComplete = function (innerSub) {
  53282. this.destination.complete();
  53283. };
  53284. return OuterSubscriber;
  53285. }(Subscriber_1.Subscriber));
  53286. exports.OuterSubscriber = OuterSubscriber;
  53287. //# sourceMappingURL=OuterSubscriber.js.map
  53288. /***/ }),
  53289. /* 55 */
  53290. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53291. "use strict";
  53292. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AppRootToken; });
  53293. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return IonicApp; });
  53294. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  53295. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__app__ = __webpack_require__(6);
  53296. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__config_config__ = __webpack_require__(1);
  53297. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ion__ = __webpack_require__(4);
  53298. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__overlay_portal__ = __webpack_require__(115);
  53299. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__platform_platform__ = __webpack_require__(3);
  53300. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__app_constants__ = __webpack_require__(35);
  53301. var __extends = (this && this.__extends) || (function () {
  53302. var extendStatics = Object.setPrototypeOf ||
  53303. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  53304. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  53305. return function (d, b) {
  53306. extendStatics(d, b);
  53307. function __() { this.constructor = d; }
  53308. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  53309. };
  53310. })();
  53311. var AppRootToken = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["B" /* InjectionToken */]('USERROOT');
  53312. /**
  53313. * @hidden
  53314. */
  53315. var IonicApp = (function (_super) {
  53316. __extends(IonicApp, _super);
  53317. function IonicApp(_userCmp, _cfr, elementRef, renderer, config, _plt, app) {
  53318. var _this = _super.call(this, config, elementRef, renderer, 'app-root') || this;
  53319. _this._userCmp = _userCmp;
  53320. _this._cfr = _cfr;
  53321. _this._plt = _plt;
  53322. // register with App that this is Ionic's appRoot component. tada!
  53323. app._appRoot = _this;
  53324. _this._stopScrollPlugin = window['IonicStopScroll'];
  53325. return _this;
  53326. }
  53327. IonicApp.prototype.ngOnInit = function () {
  53328. var _this = this;
  53329. // load the user root component
  53330. // into Ionic's root component
  53331. var factory = this._cfr.resolveComponentFactory(this._userCmp);
  53332. var componentRef = this._viewport.createComponent(factory);
  53333. this._renderer.setElementClass(componentRef.location.nativeElement, 'app-root', true);
  53334. componentRef.changeDetectorRef.detectChanges();
  53335. // set the mode class name
  53336. // ios/md/wp
  53337. this.setElementClass(this._config.get('mode'), true);
  53338. var versions = this._plt.versions();
  53339. this._plt.platforms().forEach(function (platformName) {
  53340. // platform-ios
  53341. var platformClass = 'platform-' + platformName;
  53342. _this.setElementClass(platformClass, true);
  53343. var platformVersion = versions[platformName];
  53344. if (platformVersion) {
  53345. // platform-ios9
  53346. platformClass += platformVersion.major;
  53347. _this.setElementClass(platformClass, true);
  53348. // platform-ios9_3
  53349. _this.setElementClass(platformClass + '_' + platformVersion.minor, true);
  53350. }
  53351. });
  53352. // touch devices should not use :hover CSS pseudo
  53353. // enable :hover CSS when the "hoverCSS" setting is not false
  53354. if (this._config.getBoolean('hoverCSS', true)) {
  53355. this.setElementClass('enable-hover', true);
  53356. }
  53357. // sweet, the app root has loaded!
  53358. // which means angular and ionic has fully loaded!
  53359. // fire off the platform prepare ready, which could
  53360. // have been switched out by any of the platform engines
  53361. this._plt.prepareReady();
  53362. };
  53363. /**
  53364. * @hidden
  53365. */
  53366. IonicApp.prototype._getPortal = function (portal) {
  53367. if (portal === __WEBPACK_IMPORTED_MODULE_6__app_constants__["b" /* PORTAL_LOADING */]) {
  53368. return this._loadingPortal;
  53369. }
  53370. if (portal === __WEBPACK_IMPORTED_MODULE_6__app_constants__["d" /* PORTAL_TOAST */]) {
  53371. return this._toastPortal;
  53372. }
  53373. // Modals need their own overlay becuase we don't want an ActionSheet
  53374. // or Alert to trigger lifecycle events inside a modal
  53375. if (portal === __WEBPACK_IMPORTED_MODULE_6__app_constants__["c" /* PORTAL_MODAL */]) {
  53376. return this._modalPortal;
  53377. }
  53378. return this._overlayPortal;
  53379. };
  53380. IonicApp.prototype._getActivePortal = function () {
  53381. var defaultPortal = this._overlayPortal;
  53382. var modalPortal = this._modalPortal;
  53383. var hasModal = modalPortal.length() > 0;
  53384. var hasDefault = defaultPortal.length() > 0;
  53385. if (!hasModal && !hasDefault) {
  53386. return null;
  53387. }
  53388. else if (hasModal && hasDefault) {
  53389. var defaultIndex = defaultPortal.getActive().getZIndex();
  53390. var modalIndex = modalPortal.getActive().getZIndex();
  53391. if (defaultIndex > modalIndex) {
  53392. return defaultPortal;
  53393. }
  53394. else {
  53395. (void 0) /* assert */;
  53396. return modalPortal;
  53397. }
  53398. }
  53399. if (hasModal) {
  53400. return modalPortal;
  53401. }
  53402. else if (hasDefault) {
  53403. return defaultPortal;
  53404. }
  53405. };
  53406. IonicApp.prototype._disableScroll = function (shouldDisableScroll) {
  53407. var _this = this;
  53408. if (shouldDisableScroll) {
  53409. this.stopScroll().then(function () {
  53410. _this._tmr = _this._plt.timeout(function () {
  53411. (void 0) /* console.debug */;
  53412. _this.setElementClass('disable-scroll', true);
  53413. }, 32);
  53414. });
  53415. }
  53416. else {
  53417. var plugin = this._stopScrollPlugin;
  53418. if (plugin && plugin.cancel) {
  53419. plugin.cancel();
  53420. }
  53421. clearTimeout(this._tmr);
  53422. (void 0) /* console.debug */;
  53423. this.setElementClass('disable-scroll', false);
  53424. }
  53425. };
  53426. IonicApp.prototype.stopScroll = function () {
  53427. var _this = this;
  53428. if (this._stopScrollPlugin) {
  53429. return new Promise(function (resolve) {
  53430. _this._stopScrollPlugin.stop(function () { return resolve(true); });
  53431. });
  53432. }
  53433. else {
  53434. return Promise.resolve(false);
  53435. }
  53436. };
  53437. IonicApp.decorators = [
  53438. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  53439. selector: 'ion-app',
  53440. template: '<div #viewport app-viewport></div>' +
  53441. '<div #modalPortal overlay-portal></div>' +
  53442. '<div #overlayPortal overlay-portal></div>' +
  53443. '<div #loadingPortal class="loading-portal" overlay-portal></div>' +
  53444. '<div #toastPortal class="toast-portal" [overlay-portal]="10000"></div>' +
  53445. '<div class="click-block"></div>'
  53446. },] },
  53447. ];
  53448. /** @nocollapse */
  53449. IonicApp.ctorParameters = function () { return [
  53450. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["z" /* Inject */], args: [AppRootToken,] },] },
  53451. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["o" /* ComponentFactoryResolver */], },
  53452. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  53453. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  53454. { type: __WEBPACK_IMPORTED_MODULE_2__config_config__["a" /* Config */], },
  53455. { type: __WEBPACK_IMPORTED_MODULE_5__platform_platform__["a" /* Platform */], },
  53456. { type: __WEBPACK_IMPORTED_MODULE_1__app__["a" /* App */], },
  53457. ]; };
  53458. IonicApp.propDecorators = {
  53459. '_viewport': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_8" /* ViewChild */], args: ['viewport', { read: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_10" /* ViewContainerRef */] },] },],
  53460. '_modalPortal': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_8" /* ViewChild */], args: ['modalPortal', { read: __WEBPACK_IMPORTED_MODULE_4__overlay_portal__["a" /* OverlayPortal */] },] },],
  53461. '_overlayPortal': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_8" /* ViewChild */], args: ['overlayPortal', { read: __WEBPACK_IMPORTED_MODULE_4__overlay_portal__["a" /* OverlayPortal */] },] },],
  53462. '_loadingPortal': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_8" /* ViewChild */], args: ['loadingPortal', { read: __WEBPACK_IMPORTED_MODULE_4__overlay_portal__["a" /* OverlayPortal */] },] },],
  53463. '_toastPortal': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_8" /* ViewChild */], args: ['toastPortal', { read: __WEBPACK_IMPORTED_MODULE_4__overlay_portal__["a" /* OverlayPortal */] },] },],
  53464. };
  53465. return IonicApp;
  53466. }(__WEBPACK_IMPORTED_MODULE_3__ion__["a" /* Ion */]));
  53467. //# sourceMappingURL=app-root.js.map
  53468. /***/ }),
  53469. /* 56 */
  53470. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53471. "use strict";
  53472. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SlideEdgeGesture; });
  53473. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__slide_gesture__ = __webpack_require__(116);
  53474. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_util__ = __webpack_require__(2);
  53475. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_dom__ = __webpack_require__(10);
  53476. var __extends = (this && this.__extends) || (function () {
  53477. var extendStatics = Object.setPrototypeOf ||
  53478. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  53479. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  53480. return function (d, b) {
  53481. extendStatics(d, b);
  53482. function __() { this.constructor = d; }
  53483. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  53484. };
  53485. })();
  53486. /**
  53487. * @hidden
  53488. */
  53489. var SlideEdgeGesture = (function (_super) {
  53490. __extends(SlideEdgeGesture, _super);
  53491. function SlideEdgeGesture(plt, element, opts) {
  53492. if (opts === void 0) { opts = {}; }
  53493. var _this = this;
  53494. Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["d" /* defaults */])(opts, {
  53495. edge: 'start',
  53496. maxEdgeStart: 50
  53497. });
  53498. _this = _super.call(this, plt, element, opts) || this;
  53499. // Can check corners through use of eg 'left top'
  53500. _this.setEdges(opts.edge);
  53501. _this.maxEdgeStart = opts.maxEdgeStart;
  53502. return _this;
  53503. }
  53504. SlideEdgeGesture.prototype.setEdges = function (edges) {
  53505. var isRTL = this.plt.isRTL;
  53506. this.edges = edges.split(' ').map(function (value) {
  53507. switch (value) {
  53508. case 'start': return isRTL ? 'right' : 'left';
  53509. case 'end': return isRTL ? 'left' : 'right';
  53510. default: return value;
  53511. }
  53512. });
  53513. };
  53514. SlideEdgeGesture.prototype.canStart = function (ev) {
  53515. var _this = this;
  53516. var coord = Object(__WEBPACK_IMPORTED_MODULE_2__util_dom__["f" /* pointerCoord */])(ev);
  53517. this._d = this.getContainerDimensions();
  53518. return this.edges.every(function (edge) { return _this._checkEdge(edge, coord); });
  53519. };
  53520. SlideEdgeGesture.prototype.getContainerDimensions = function () {
  53521. var plt = this.plt;
  53522. return {
  53523. left: 0,
  53524. top: 0,
  53525. width: plt.width(),
  53526. height: plt.height()
  53527. };
  53528. };
  53529. SlideEdgeGesture.prototype._checkEdge = function (edge, pos) {
  53530. var data = this._d;
  53531. var maxEdgeStart = this.maxEdgeStart;
  53532. switch (edge) {
  53533. case 'left': return pos.x <= data.left + maxEdgeStart;
  53534. case 'right': return pos.x >= data.width - maxEdgeStart;
  53535. case 'top': return pos.y <= data.top + maxEdgeStart;
  53536. case 'bottom': return pos.y >= data.height - maxEdgeStart;
  53537. }
  53538. return false;
  53539. };
  53540. return SlideEdgeGesture;
  53541. }(__WEBPACK_IMPORTED_MODULE_0__slide_gesture__["a" /* SlideGesture */]));
  53542. //# sourceMappingURL=slide-edge-gesture.js.map
  53543. /***/ }),
  53544. /* 57 */
  53545. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53546. "use strict";
  53547. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ActionSheet; });
  53548. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__action_sheet_component__ = __webpack_require__(58);
  53549. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__action_sheet_transitions__ = __webpack_require__(231);
  53550. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_util__ = __webpack_require__(2);
  53551. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__navigation_view_controller__ = __webpack_require__(5);
  53552. var __extends = (this && this.__extends) || (function () {
  53553. var extendStatics = Object.setPrototypeOf ||
  53554. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  53555. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  53556. return function (d, b) {
  53557. extendStatics(d, b);
  53558. function __() { this.constructor = d; }
  53559. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  53560. };
  53561. })();
  53562. /**
  53563. * @hidden
  53564. */
  53565. var ActionSheet = (function (_super) {
  53566. __extends(ActionSheet, _super);
  53567. function ActionSheet(app, opts, config) {
  53568. var _this = this;
  53569. opts.buttons = opts.buttons || [];
  53570. opts.enableBackdropDismiss = Object(__WEBPACK_IMPORTED_MODULE_2__util_util__["l" /* isPresent */])(opts.enableBackdropDismiss) ? !!opts.enableBackdropDismiss : true;
  53571. _this = _super.call(this, __WEBPACK_IMPORTED_MODULE_0__action_sheet_component__["a" /* ActionSheetCmp */], opts, null) || this;
  53572. _this._app = app;
  53573. _this.isOverlay = true;
  53574. config.setTransition('action-sheet-slide-in', __WEBPACK_IMPORTED_MODULE_1__action_sheet_transitions__["c" /* ActionSheetSlideIn */]);
  53575. config.setTransition('action-sheet-slide-out', __WEBPACK_IMPORTED_MODULE_1__action_sheet_transitions__["d" /* ActionSheetSlideOut */]);
  53576. config.setTransition('action-sheet-md-slide-in', __WEBPACK_IMPORTED_MODULE_1__action_sheet_transitions__["a" /* ActionSheetMdSlideIn */]);
  53577. config.setTransition('action-sheet-md-slide-out', __WEBPACK_IMPORTED_MODULE_1__action_sheet_transitions__["b" /* ActionSheetMdSlideOut */]);
  53578. config.setTransition('action-sheet-wp-slide-in', __WEBPACK_IMPORTED_MODULE_1__action_sheet_transitions__["e" /* ActionSheetWpSlideIn */]);
  53579. config.setTransition('action-sheet-wp-slide-out', __WEBPACK_IMPORTED_MODULE_1__action_sheet_transitions__["f" /* ActionSheetWpSlideOut */]);
  53580. return _this;
  53581. }
  53582. /**
  53583. * @hidden
  53584. */
  53585. ActionSheet.prototype.getTransitionName = function (direction) {
  53586. var key = 'actionSheet' + (direction === 'back' ? 'Leave' : 'Enter');
  53587. return this._nav && this._nav.config.get(key);
  53588. };
  53589. /**
  53590. * @param {string} title Action sheet title
  53591. */
  53592. ActionSheet.prototype.setTitle = function (title) {
  53593. this.data.title = title;
  53594. return this;
  53595. };
  53596. /**
  53597. * @param {string} subTitle Action sheet subtitle
  53598. */
  53599. ActionSheet.prototype.setSubTitle = function (subTitle) {
  53600. this.data.subTitle = subTitle;
  53601. return this;
  53602. };
  53603. /**
  53604. * @param {object} button Action sheet button
  53605. */
  53606. ActionSheet.prototype.addButton = function (button) {
  53607. this.data.buttons.push(button);
  53608. return this;
  53609. };
  53610. /**
  53611. * Present the action sheet instance.
  53612. *
  53613. * @param {NavOptions} [navOptions={}] Nav options to go with this transition.
  53614. * @returns {Promise} Returns a promise which is resolved when the transition has completed.
  53615. */
  53616. ActionSheet.prototype.present = function (navOptions) {
  53617. if (navOptions === void 0) { navOptions = {}; }
  53618. navOptions.minClickBlockDuration = navOptions.minClickBlockDuration || 400;
  53619. return this._app.present(this, navOptions);
  53620. };
  53621. return ActionSheet;
  53622. }(__WEBPACK_IMPORTED_MODULE_3__navigation_view_controller__["a" /* ViewController */]));
  53623. //# sourceMappingURL=action-sheet.js.map
  53624. /***/ }),
  53625. /* 58 */
  53626. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53627. "use strict";
  53628. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ActionSheetCmp; });
  53629. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  53630. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__gestures_gesture_controller__ = __webpack_require__(7);
  53631. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__config_config__ = __webpack_require__(1);
  53632. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__platform_key__ = __webpack_require__(18);
  53633. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__navigation_nav_params__ = __webpack_require__(13);
  53634. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__navigation_view_controller__ = __webpack_require__(5);
  53635. /**
  53636. * @hidden
  53637. */
  53638. var ActionSheetCmp = (function () {
  53639. function ActionSheetCmp(_viewCtrl, config, _elementRef, gestureCtrl, params, renderer) {
  53640. this._viewCtrl = _viewCtrl;
  53641. this._elementRef = _elementRef;
  53642. this.gestureBlocker = gestureCtrl.createBlocker(__WEBPACK_IMPORTED_MODULE_1__gestures_gesture_controller__["a" /* BLOCK_ALL */]);
  53643. this.d = params.data;
  53644. this.mode = config.get('mode');
  53645. renderer.setElementClass(_elementRef.nativeElement, "action-sheet-" + this.mode, true);
  53646. if (this.d.cssClass) {
  53647. this.d.cssClass.split(' ').forEach(function (cssClass) {
  53648. // Make sure the class isn't whitespace, otherwise it throws exceptions
  53649. if (cssClass.trim() !== '')
  53650. renderer.setElementClass(_elementRef.nativeElement, cssClass, true);
  53651. });
  53652. }
  53653. this.id = (++actionSheetIds);
  53654. if (this.d.title) {
  53655. this.hdrId = 'acst-hdr-' + this.id;
  53656. }
  53657. if (this.d.subTitle) {
  53658. this.descId = 'acst-subhdr-' + this.id;
  53659. }
  53660. }
  53661. ActionSheetCmp.prototype.ionViewDidLoad = function () {
  53662. var _this = this;
  53663. // normalize the data
  53664. this.d.buttons = this.d.buttons.map(function (button) {
  53665. if (typeof button === 'string') {
  53666. button = { text: button };
  53667. }
  53668. if (!button.cssClass) {
  53669. button.cssClass = '';
  53670. }
  53671. switch (button.role) {
  53672. case 'cancel':
  53673. _this.cancelButton = button;
  53674. return null;
  53675. case 'destructive':
  53676. button.cssClass = (button.cssClass + ' ' || '') + 'action-sheet-destructive';
  53677. break;
  53678. case 'selected':
  53679. button.cssClass = (button.cssClass + ' ' || '') + 'action-sheet-selected';
  53680. break;
  53681. }
  53682. return button;
  53683. }).filter(function (button) { return button !== null; });
  53684. };
  53685. ActionSheetCmp.prototype.ionViewWillEnter = function () {
  53686. this.gestureBlocker.block();
  53687. };
  53688. ActionSheetCmp.prototype.ionViewDidLeave = function () {
  53689. this.gestureBlocker.unblock();
  53690. };
  53691. ActionSheetCmp.prototype.ionViewDidEnter = function () {
  53692. var focusableEle = this._elementRef.nativeElement.querySelector('button');
  53693. if (focusableEle) {
  53694. focusableEle.focus();
  53695. }
  53696. this.enabled = true;
  53697. };
  53698. ActionSheetCmp.prototype.keyUp = function (ev) {
  53699. if (this.enabled && ev.keyCode === __WEBPACK_IMPORTED_MODULE_3__platform_key__["c" /* KEY_ESCAPE */] && this._viewCtrl.isLast()) {
  53700. (void 0) /* console.debug */;
  53701. this.bdClick();
  53702. }
  53703. };
  53704. ActionSheetCmp.prototype.click = function (button) {
  53705. if (!this.enabled) {
  53706. return;
  53707. }
  53708. var shouldDismiss = true;
  53709. if (button.handler) {
  53710. // a handler has been provided, execute it
  53711. if (button.handler() === false) {
  53712. // if the return value of the handler is false then do not dismiss
  53713. shouldDismiss = false;
  53714. }
  53715. }
  53716. if (shouldDismiss) {
  53717. this.dismiss(button.role);
  53718. }
  53719. };
  53720. ActionSheetCmp.prototype.bdClick = function () {
  53721. if (this.enabled && this.d.enableBackdropDismiss) {
  53722. if (this.cancelButton) {
  53723. this.click(this.cancelButton);
  53724. }
  53725. else {
  53726. this.dismiss('backdrop');
  53727. }
  53728. }
  53729. };
  53730. ActionSheetCmp.prototype.dismiss = function (role) {
  53731. var opts = {
  53732. minClickBlockDuration: 400
  53733. };
  53734. return this._viewCtrl.dismiss(null, role, opts);
  53735. };
  53736. ActionSheetCmp.prototype.ngOnDestroy = function () {
  53737. (void 0) /* assert */;
  53738. this.d = this.cancelButton = null;
  53739. this.gestureBlocker.destroy();
  53740. };
  53741. ActionSheetCmp.decorators = [
  53742. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  53743. selector: 'ion-action-sheet',
  53744. template: '<ion-backdrop (click)="bdClick()" [class.backdrop-no-tappable]="!d.enableBackdropDismiss"></ion-backdrop>' +
  53745. '<div class="action-sheet-wrapper">' +
  53746. '<div class="action-sheet-container">' +
  53747. '<div class="action-sheet-group">' +
  53748. '<div class="action-sheet-title" id="{{hdrId}}" *ngIf="d.title">{{d.title}}</div>' +
  53749. '<div class="action-sheet-sub-title" id="{{descId}}" *ngIf="d.subTitle">{{d.subTitle}}</div>' +
  53750. '<button ion-button="action-sheet-button" (click)="click(b)" *ngFor="let b of d.buttons" class="disable-hover" [attr.icon-start]="b.icon ? \'\' : null" [ngClass]="b.cssClass">' +
  53751. '<ion-icon [name]="b.icon" *ngIf="b.icon" class="action-sheet-icon"></ion-icon>' +
  53752. '{{b.text}}' +
  53753. '</button>' +
  53754. '</div>' +
  53755. '<div class="action-sheet-group action-sheet-group-cancel" *ngIf="cancelButton">' +
  53756. '<button ion-button="action-sheet-button" (click)="click(cancelButton)" class="action-sheet-cancel disable-hover" [attr.icon-start]="cancelButton.icon ? \'\' : null" [ngClass]="cancelButton.cssClass">' +
  53757. '<ion-icon [name]="cancelButton.icon" *ngIf="cancelButton.icon" class="action-sheet-icon"></ion-icon>' +
  53758. '{{cancelButton.text}}' +
  53759. '</button>' +
  53760. '</div>' +
  53761. '</div>' +
  53762. '</div>',
  53763. host: {
  53764. 'role': 'dialog',
  53765. '[attr.aria-labelledby]': 'hdrId',
  53766. '[attr.aria-describedby]': 'descId'
  53767. },
  53768. encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_11" /* ViewEncapsulation */].None,
  53769. },] },
  53770. ];
  53771. /** @nocollapse */
  53772. ActionSheetCmp.ctorParameters = function () { return [
  53773. { type: __WEBPACK_IMPORTED_MODULE_5__navigation_view_controller__["a" /* ViewController */], },
  53774. { type: __WEBPACK_IMPORTED_MODULE_2__config_config__["a" /* Config */], },
  53775. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  53776. { type: __WEBPACK_IMPORTED_MODULE_1__gestures_gesture_controller__["l" /* GestureController */], },
  53777. { type: __WEBPACK_IMPORTED_MODULE_4__navigation_nav_params__["a" /* NavParams */], },
  53778. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  53779. ]; };
  53780. ActionSheetCmp.propDecorators = {
  53781. 'keyUp': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["y" /* HostListener */], args: ['body:keyup', ['$event'],] },],
  53782. };
  53783. return ActionSheetCmp;
  53784. }());
  53785. var actionSheetIds = -1;
  53786. //# sourceMappingURL=action-sheet-component.js.map
  53787. /***/ }),
  53788. /* 59 */
  53789. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53790. "use strict";
  53791. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Alert; });
  53792. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__alert_component__ = __webpack_require__(60);
  53793. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__alert_transitions__ = __webpack_require__(232);
  53794. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_util__ = __webpack_require__(2);
  53795. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__navigation_view_controller__ = __webpack_require__(5);
  53796. var __extends = (this && this.__extends) || (function () {
  53797. var extendStatics = Object.setPrototypeOf ||
  53798. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  53799. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  53800. return function (d, b) {
  53801. extendStatics(d, b);
  53802. function __() { this.constructor = d; }
  53803. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  53804. };
  53805. })();
  53806. /**
  53807. * @hidden
  53808. */
  53809. var Alert = (function (_super) {
  53810. __extends(Alert, _super);
  53811. function Alert(app, opts, config) {
  53812. if (opts === void 0) { opts = {}; }
  53813. var _this = this;
  53814. opts.inputs = opts.inputs || [];
  53815. opts.buttons = opts.buttons || [];
  53816. opts.enableBackdropDismiss = Object(__WEBPACK_IMPORTED_MODULE_2__util_util__["l" /* isPresent */])(opts.enableBackdropDismiss) ? !!opts.enableBackdropDismiss : true;
  53817. _this = _super.call(this, __WEBPACK_IMPORTED_MODULE_0__alert_component__["a" /* AlertCmp */], opts, null) || this;
  53818. _this._app = app;
  53819. _this.isOverlay = true;
  53820. config.setTransition('alert-pop-in', __WEBPACK_IMPORTED_MODULE_1__alert_transitions__["c" /* AlertPopIn */]);
  53821. config.setTransition('alert-pop-out', __WEBPACK_IMPORTED_MODULE_1__alert_transitions__["d" /* AlertPopOut */]);
  53822. config.setTransition('alert-md-pop-in', __WEBPACK_IMPORTED_MODULE_1__alert_transitions__["a" /* AlertMdPopIn */]);
  53823. config.setTransition('alert-md-pop-out', __WEBPACK_IMPORTED_MODULE_1__alert_transitions__["b" /* AlertMdPopOut */]);
  53824. config.setTransition('alert-wp-pop-in', __WEBPACK_IMPORTED_MODULE_1__alert_transitions__["e" /* AlertWpPopIn */]);
  53825. config.setTransition('alert-wp-pop-out', __WEBPACK_IMPORTED_MODULE_1__alert_transitions__["f" /* AlertWpPopOut */]);
  53826. return _this;
  53827. }
  53828. /**
  53829. * @hidden
  53830. */
  53831. Alert.prototype.getTransitionName = function (direction) {
  53832. var key = (direction === 'back' ? 'alertLeave' : 'alertEnter');
  53833. return this._nav && this._nav.config.get(key);
  53834. };
  53835. /**
  53836. * @param {string} title Alert title
  53837. */
  53838. Alert.prototype.setTitle = function (title) {
  53839. this.data.title = title;
  53840. return this;
  53841. };
  53842. /**
  53843. * @param {string} subTitle Alert subtitle
  53844. */
  53845. Alert.prototype.setSubTitle = function (subTitle) {
  53846. this.data.subTitle = subTitle;
  53847. return this;
  53848. };
  53849. /**
  53850. * @param {string} message Alert message content
  53851. */
  53852. Alert.prototype.setMessage = function (message) {
  53853. this.data.message = message;
  53854. return this;
  53855. };
  53856. /**
  53857. * @param {object} input Alert input
  53858. */
  53859. Alert.prototype.addInput = function (input) {
  53860. this.data.inputs.push(input);
  53861. return this;
  53862. };
  53863. /**
  53864. * @param {any} button Alert button
  53865. */
  53866. Alert.prototype.addButton = function (button) {
  53867. this.data.buttons.push(button);
  53868. return this;
  53869. };
  53870. /**
  53871. * @param {string} cssClass Set the CSS class names on the alert's outer wrapper.
  53872. */
  53873. Alert.prototype.setCssClass = function (cssClass) {
  53874. this.data.cssClass = cssClass;
  53875. return this;
  53876. };
  53877. /**
  53878. * @param {string} mode Set the mode of the alert (ios, md, wp).
  53879. */
  53880. Alert.prototype.setMode = function (mode) {
  53881. this.data.mode = mode;
  53882. };
  53883. /**
  53884. * Present the alert instance.
  53885. *
  53886. * @param {NavOptions} [navOptions={}] Nav options to go with this transition.
  53887. * @returns {Promise} Returns a promise which is resolved when the transition has completed.
  53888. */
  53889. Alert.prototype.present = function (navOptions) {
  53890. if (navOptions === void 0) { navOptions = {}; }
  53891. navOptions.minClickBlockDuration = navOptions.minClickBlockDuration || 400;
  53892. return this._app.present(this, navOptions);
  53893. };
  53894. return Alert;
  53895. }(__WEBPACK_IMPORTED_MODULE_3__navigation_view_controller__["a" /* ViewController */]));
  53896. //# sourceMappingURL=alert.js.map
  53897. /***/ }),
  53898. /* 60 */
  53899. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53900. "use strict";
  53901. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AlertCmp; });
  53902. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  53903. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__config_config__ = __webpack_require__(1);
  53904. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_dom__ = __webpack_require__(10);
  53905. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__gestures_gesture_controller__ = __webpack_require__(7);
  53906. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_util__ = __webpack_require__(2);
  53907. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__platform_key__ = __webpack_require__(18);
  53908. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__navigation_nav_params__ = __webpack_require__(13);
  53909. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__platform_platform__ = __webpack_require__(3);
  53910. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__navigation_view_controller__ = __webpack_require__(5);
  53911. /**
  53912. * @hidden
  53913. */
  53914. var AlertCmp = (function () {
  53915. function AlertCmp(_viewCtrl, _elementRef, config, gestureCtrl, params, _renderer, _plt) {
  53916. this._viewCtrl = _viewCtrl;
  53917. this._elementRef = _elementRef;
  53918. this._renderer = _renderer;
  53919. this._plt = _plt;
  53920. // gesture blocker is used to disable gestures dynamically
  53921. this.gestureBlocker = gestureCtrl.createBlocker(__WEBPACK_IMPORTED_MODULE_3__gestures_gesture_controller__["a" /* BLOCK_ALL */]);
  53922. this.d = params.data;
  53923. this.mode = this.d.mode || config.get('mode');
  53924. this.keyboardResizes = config.getBoolean('keyboardResizes', false);
  53925. _renderer.setElementClass(_elementRef.nativeElement, "alert-" + this.mode, true);
  53926. if (this.d.cssClass) {
  53927. this.d.cssClass.split(' ').forEach(function (cssClass) {
  53928. // Make sure the class isn't whitespace, otherwise it throws exceptions
  53929. if (cssClass.trim() !== '')
  53930. _renderer.setElementClass(_elementRef.nativeElement, cssClass, true);
  53931. });
  53932. }
  53933. this.id = (++alertIds);
  53934. this.descId = '';
  53935. this.hdrId = 'alert-hdr-' + this.id;
  53936. this.subHdrId = 'alert-subhdr-' + this.id;
  53937. this.msgId = 'alert-msg-' + this.id;
  53938. this.activeId = '';
  53939. this.lastClick = 0;
  53940. if (this.d.message) {
  53941. this.descId = this.msgId;
  53942. }
  53943. else if (this.d.subTitle) {
  53944. this.descId = this.subHdrId;
  53945. }
  53946. if (!this.d.message) {
  53947. this.d.message = '';
  53948. }
  53949. }
  53950. AlertCmp.prototype.ionViewDidLoad = function () {
  53951. var _this = this;
  53952. // normalize the data
  53953. var data = this.d;
  53954. data.buttons = data.buttons.map(function (button) {
  53955. if (typeof button === 'string') {
  53956. return { text: button };
  53957. }
  53958. return button;
  53959. });
  53960. data.inputs = data.inputs.map(function (input, index) {
  53961. var r = {
  53962. type: input.type || 'text',
  53963. name: Object(__WEBPACK_IMPORTED_MODULE_4__util_util__["l" /* isPresent */])(input.name) ? input.name : index + '',
  53964. placeholder: Object(__WEBPACK_IMPORTED_MODULE_4__util_util__["l" /* isPresent */])(input.placeholder) ? input.placeholder : '',
  53965. value: Object(__WEBPACK_IMPORTED_MODULE_4__util_util__["l" /* isPresent */])(input.value) ? input.value : '',
  53966. label: input.label,
  53967. checked: !!input.checked,
  53968. disabled: !!input.disabled,
  53969. id: Object(__WEBPACK_IMPORTED_MODULE_4__util_util__["l" /* isPresent */])(input.id) ? input.id : "alert-input-" + _this.id + "-" + index,
  53970. handler: Object(__WEBPACK_IMPORTED_MODULE_4__util_util__["l" /* isPresent */])(input.handler) ? input.handler : null,
  53971. min: Object(__WEBPACK_IMPORTED_MODULE_4__util_util__["l" /* isPresent */])(input.min) ? input.min : null,
  53972. max: Object(__WEBPACK_IMPORTED_MODULE_4__util_util__["l" /* isPresent */])(input.max) ? input.max : null
  53973. };
  53974. return r;
  53975. });
  53976. // An alert can be created with several different inputs. Radios,
  53977. // checkboxes and inputs are all accepted, but they cannot be mixed.
  53978. var inputTypes = [];
  53979. data.inputs.forEach(function (input) {
  53980. if (inputTypes.indexOf(input.type) < 0) {
  53981. inputTypes.push(input.type);
  53982. }
  53983. });
  53984. if (inputTypes.length > 1 && (inputTypes.indexOf('checkbox') > -1 || inputTypes.indexOf('radio') > -1)) {
  53985. console.warn("Alert cannot mix input types: " + (inputTypes.join('/')) + ". Please see alert docs for more info.");
  53986. }
  53987. this.inputType = inputTypes.length ? inputTypes[0] : null;
  53988. var checkedInput = this.d.inputs.find(function (input) { return input.checked; });
  53989. if (checkedInput) {
  53990. this.activeId = checkedInput.id;
  53991. }
  53992. var hasTextInput = (this.d.inputs.length && this.d.inputs.some(function (i) { return !(__WEBPACK_IMPORTED_MODULE_2__util_dom__["a" /* NON_TEXT_INPUT_REGEX */].test(i.type)); }));
  53993. if (!this.keyboardResizes && hasTextInput && this._plt.is('mobile')) {
  53994. // this alert has a text input and it's on a mobile device so we should align
  53995. // the alert up high because we need to leave space for the virtual keboard
  53996. // this also helps prevent the layout getting all messed up from
  53997. // the browser trying to scroll the input into a safe area
  53998. this._renderer.setElementClass(this._elementRef.nativeElement, 'alert-top', true);
  53999. }
  54000. };
  54001. AlertCmp.prototype.ionViewWillEnter = function () {
  54002. this.gestureBlocker.block();
  54003. };
  54004. AlertCmp.prototype.ionViewDidLeave = function () {
  54005. this.gestureBlocker.unblock();
  54006. };
  54007. AlertCmp.prototype.ionViewDidEnter = function () {
  54008. // set focus on the first input or button in the alert
  54009. // note that this does not always work and bring up the keyboard on
  54010. // devices since the focus command must come from the user's touch event
  54011. // and ionViewDidEnter is not in the same callstack as the touch event :(
  54012. var focusableEle = this._elementRef.nativeElement.querySelector('input,button');
  54013. if (focusableEle) {
  54014. setTimeout(function () { return focusableEle.focus(); });
  54015. }
  54016. this.enabled = true;
  54017. };
  54018. AlertCmp.prototype.keyUp = function (ev) {
  54019. if (this.enabled && this._viewCtrl.isLast()) {
  54020. if (ev.keyCode === __WEBPACK_IMPORTED_MODULE_5__platform_key__["b" /* KEY_ENTER */]) {
  54021. if (this.lastClick + 1000 < Date.now()) {
  54022. // do not fire this click if there recently was already a click
  54023. // this can happen when the button has focus and used the enter
  54024. // key to click the button. However, both the click handler and
  54025. // this keyup event will fire, so only allow one of them to go.
  54026. (void 0) /* console.debug */;
  54027. var button = this.d.buttons[this.d.buttons.length - 1];
  54028. this.btnClick(button);
  54029. }
  54030. }
  54031. else if (ev.keyCode === __WEBPACK_IMPORTED_MODULE_5__platform_key__["c" /* KEY_ESCAPE */]) {
  54032. (void 0) /* console.debug */;
  54033. this.bdClick();
  54034. }
  54035. }
  54036. };
  54037. AlertCmp.prototype.btnClick = function (button) {
  54038. if (!this.enabled) {
  54039. return;
  54040. }
  54041. // keep the time of the most recent button click
  54042. this.lastClick = Date.now();
  54043. var shouldDismiss = true;
  54044. if (button.handler) {
  54045. // a handler has been provided, execute it
  54046. // pass the handler the values from the inputs
  54047. if (button.handler(this.getValues()) === false) {
  54048. // if the return value of the handler is false then do not dismiss
  54049. shouldDismiss = false;
  54050. }
  54051. }
  54052. if (shouldDismiss) {
  54053. this.dismiss(button.role);
  54054. }
  54055. };
  54056. AlertCmp.prototype.rbClick = function (checkedInput) {
  54057. if (this.enabled) {
  54058. this.d.inputs.forEach(function (input) {
  54059. input.checked = (checkedInput === input);
  54060. });
  54061. this.activeId = checkedInput.id;
  54062. if (checkedInput.handler) {
  54063. checkedInput.handler(checkedInput);
  54064. }
  54065. }
  54066. };
  54067. AlertCmp.prototype.cbClick = function (checkedInput) {
  54068. if (this.enabled) {
  54069. checkedInput.checked = !checkedInput.checked;
  54070. if (checkedInput.handler) {
  54071. checkedInput.handler(checkedInput);
  54072. }
  54073. }
  54074. };
  54075. AlertCmp.prototype.bdClick = function () {
  54076. if (this.enabled && this.d.enableBackdropDismiss) {
  54077. var cancelBtn = this.d.buttons.find(function (b) { return b.role === 'cancel'; });
  54078. if (cancelBtn) {
  54079. this.btnClick(cancelBtn);
  54080. }
  54081. else {
  54082. this.dismiss('backdrop');
  54083. }
  54084. }
  54085. };
  54086. AlertCmp.prototype.dismiss = function (role) {
  54087. var opts = {
  54088. minClickBlockDuration: 400
  54089. };
  54090. return this._viewCtrl.dismiss(this.getValues(), role, opts);
  54091. };
  54092. AlertCmp.prototype.getValues = function () {
  54093. if (this.inputType === 'radio') {
  54094. // this is an alert with radio buttons (single value select)
  54095. // return the one value which is checked, otherwise undefined
  54096. var checkedInput = this.d.inputs.find(function (i) { return i.checked; });
  54097. return checkedInput ? checkedInput.value : undefined;
  54098. }
  54099. if (this.inputType === 'checkbox') {
  54100. // this is an alert with checkboxes (multiple value select)
  54101. // return an array of all the checked values
  54102. return this.d.inputs.filter(function (i) { return i.checked; }).map(function (i) { return i.value; });
  54103. }
  54104. if (this.d.inputs.length === 0) {
  54105. // this is an alert without any options/inputs at all
  54106. return undefined;
  54107. }
  54108. // this is an alert with text inputs
  54109. // return an object of all the values with the input name as the key
  54110. var values = {};
  54111. this.d.inputs.forEach(function (i) {
  54112. values[i.name] = i.value;
  54113. });
  54114. return values;
  54115. };
  54116. AlertCmp.prototype.ngOnDestroy = function () {
  54117. (void 0) /* assert */;
  54118. this.gestureBlocker.destroy();
  54119. };
  54120. AlertCmp.decorators = [
  54121. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  54122. selector: 'ion-alert',
  54123. template: '<ion-backdrop (click)="bdClick()" [class.backdrop-no-tappable]="!d.enableBackdropDismiss"></ion-backdrop>' +
  54124. '<div class="alert-wrapper">' +
  54125. '<div class="alert-head">' +
  54126. '<h2 id="{{hdrId}}" class="alert-title" *ngIf="d.title" [innerHTML]="d.title"></h2>' +
  54127. '<h3 id="{{subHdrId}}" class="alert-sub-title" *ngIf="d.subTitle" [innerHTML]="d.subTitle"></h3>' +
  54128. '</div>' +
  54129. '<div id="{{msgId}}" class="alert-message" [innerHTML]="d.message"></div>' +
  54130. '<div *ngIf="d.inputs.length" [ngSwitch]="inputType">' +
  54131. '<ng-template ngSwitchCase="radio">' +
  54132. '<div class="alert-radio-group" role="radiogroup" [attr.aria-labelledby]="hdrId" [attr.aria-activedescendant]="activeId">' +
  54133. '<button ion-button="alert-radio-button" *ngFor="let i of d.inputs" (click)="rbClick(i)" [attr.aria-checked]="i.checked" [disabled]="i.disabled" [attr.id]="i.id" class="alert-tappable alert-radio" role="radio">' +
  54134. '<div class="alert-radio-icon"><div class="alert-radio-inner"></div></div>' +
  54135. '<div class="alert-radio-label">' +
  54136. '{{i.label}}' +
  54137. '</div>' +
  54138. '</button>' +
  54139. '</div>' +
  54140. '</ng-template>' +
  54141. '<ng-template ngSwitchCase="checkbox">' +
  54142. '<div class="alert-checkbox-group">' +
  54143. '<button ion-button="alert-checkbox-button" *ngFor="let i of d.inputs" (click)="cbClick(i)" [attr.aria-checked]="i.checked" [attr.id]="i.id" [disabled]="i.disabled" class="alert-tappable alert-checkbox" role="checkbox">' +
  54144. '<div class="alert-checkbox-icon"><div class="alert-checkbox-inner"></div></div>' +
  54145. '<div class="alert-checkbox-label">' +
  54146. '{{i.label}}' +
  54147. '</div>' +
  54148. '</button>' +
  54149. '</div>' +
  54150. '</ng-template>' +
  54151. '<ng-template ngSwitchDefault>' +
  54152. '<div class="alert-input-group">' +
  54153. '<div *ngFor="let i of d.inputs" class="alert-input-wrapper">' +
  54154. '<input [placeholder]="i.placeholder" [(ngModel)]="i.value" [type]="i.type" dir="auto" [min]="i.min" [max]="i.max" [attr.id]="i.id" class="alert-input">' +
  54155. '</div>' +
  54156. '</div>' +
  54157. '</ng-template>' +
  54158. '</div>' +
  54159. '<div class="alert-button-group" [ngClass]="{\'alert-button-group-vertical\':d.buttons.length>2}">' +
  54160. '<button ion-button="alert-button" *ngFor="let b of d.buttons" (click)="btnClick(b)" [ngClass]="b.cssClass">' +
  54161. '{{b.text}}' +
  54162. '</button>' +
  54163. '</div>' +
  54164. '</div>',
  54165. host: {
  54166. 'role': 'dialog',
  54167. '[attr.aria-labelledby]': 'hdrId',
  54168. '[attr.aria-describedby]': 'descId'
  54169. },
  54170. encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_11" /* ViewEncapsulation */].None,
  54171. },] },
  54172. ];
  54173. /** @nocollapse */
  54174. AlertCmp.ctorParameters = function () { return [
  54175. { type: __WEBPACK_IMPORTED_MODULE_8__navigation_view_controller__["a" /* ViewController */], },
  54176. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  54177. { type: __WEBPACK_IMPORTED_MODULE_1__config_config__["a" /* Config */], },
  54178. { type: __WEBPACK_IMPORTED_MODULE_3__gestures_gesture_controller__["l" /* GestureController */], },
  54179. { type: __WEBPACK_IMPORTED_MODULE_6__navigation_nav_params__["a" /* NavParams */], },
  54180. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  54181. { type: __WEBPACK_IMPORTED_MODULE_7__platform_platform__["a" /* Platform */], },
  54182. ]; };
  54183. AlertCmp.propDecorators = {
  54184. 'keyUp': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["y" /* HostListener */], args: ['body:keyup', ['$event'],] },],
  54185. };
  54186. return AlertCmp;
  54187. }());
  54188. var alertIds = -1;
  54189. //# sourceMappingURL=alert-component.js.map
  54190. /***/ }),
  54191. /* 61 */
  54192. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  54193. "use strict";
  54194. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Backdrop; });
  54195. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  54196. /**
  54197. * @hidden
  54198. */
  54199. var Backdrop = (function () {
  54200. function Backdrop(_elementRef, _renderer) {
  54201. this._elementRef = _elementRef;
  54202. this._renderer = _renderer;
  54203. }
  54204. Backdrop.prototype.getNativeElement = function () {
  54205. return this._elementRef.nativeElement;
  54206. };
  54207. Backdrop.prototype.setElementClass = function (className, add) {
  54208. this._renderer.setElementClass(this._elementRef.nativeElement, className, add);
  54209. };
  54210. Backdrop.decorators = [
  54211. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  54212. selector: 'ion-backdrop',
  54213. host: {
  54214. 'role': 'presentation',
  54215. 'tappable': '',
  54216. 'disable-activated': ''
  54217. },
  54218. },] },
  54219. ];
  54220. /** @nocollapse */
  54221. Backdrop.ctorParameters = function () { return [
  54222. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  54223. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  54224. ]; };
  54225. return Backdrop;
  54226. }());
  54227. //# sourceMappingURL=backdrop.js.map
  54228. /***/ }),
  54229. /* 62 */
  54230. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  54231. "use strict";
  54232. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Icon; });
  54233. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  54234. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_util__ = __webpack_require__(2);
  54235. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__config_config__ = __webpack_require__(1);
  54236. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ion__ = __webpack_require__(4);
  54237. var __extends = (this && this.__extends) || (function () {
  54238. var extendStatics = Object.setPrototypeOf ||
  54239. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  54240. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  54241. return function (d, b) {
  54242. extendStatics(d, b);
  54243. function __() { this.constructor = d; }
  54244. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  54245. };
  54246. })();
  54247. /**
  54248. * @name Icon
  54249. * @description
  54250. * Icons can be used on their own, or inside of a number of Ionic components.
  54251. * For a full list of available icons, check out the
  54252. * [Ionicons docs](../../../../ionicons).
  54253. *
  54254. * One feature of Ionicons in Ionic is when icon names are set, the actual icon
  54255. * which is rendered can change slightly depending on the mode the app is
  54256. * running from. For example, by setting the icon name of `alarm`, on iOS the
  54257. * icon will automatically apply `ios-alarm`, and on Material Design it will
  54258. * automatically apply `md-alarm`. This allows the developer to write the
  54259. * markup once while Ionic applies the appropriate icon based on the mode.
  54260. *
  54261. * @usage
  54262. * ```html
  54263. * <!-- automatically uses the correct "star" icon depending on the mode -->
  54264. * <ion-icon name="star"></ion-icon>
  54265. *
  54266. * <!-- explicity set the icon for each mode -->
  54267. * <ion-icon ios="ios-home" md="md-home"></ion-icon>
  54268. *
  54269. * <!-- always use the same icon, no matter what the mode -->
  54270. * <ion-icon name="ios-clock"></ion-icon>
  54271. * <ion-icon name="logo-twitter"></ion-icon>
  54272. * ```
  54273. *
  54274. * @demo /docs/demos/src/icon/
  54275. * @see {@link /docs/components#icons Icon Component Docs}
  54276. *
  54277. */
  54278. var Icon = (function (_super) {
  54279. __extends(Icon, _super);
  54280. function Icon(config, elementRef, renderer) {
  54281. var _this = _super.call(this, config, elementRef, renderer, 'icon') || this;
  54282. /** @hidden */
  54283. _this._isActive = true;
  54284. /** @hidden */
  54285. _this._name = '';
  54286. /** @hidden */
  54287. _this._ios = '';
  54288. /** @hidden */
  54289. _this._md = '';
  54290. /** @hidden */
  54291. _this._css = '';
  54292. /**
  54293. * @hidden
  54294. */
  54295. _this._hidden = false;
  54296. _this._iconMode = config.get('iconMode');
  54297. return _this;
  54298. }
  54299. /**
  54300. * @hidden
  54301. */
  54302. Icon.prototype.ngOnDestroy = function () {
  54303. if (this._css) {
  54304. this.setElementClass(this._css, false);
  54305. }
  54306. };
  54307. Object.defineProperty(Icon.prototype, "name", {
  54308. /**
  54309. * @input {string} Specifies which icon to use. The appropriate icon will be used based on the mode.
  54310. * For more information, see [Ionicons](/docs/ionicons/).
  54311. */
  54312. get: function () {
  54313. return this._name;
  54314. },
  54315. set: function (val) {
  54316. if (!(/^md-|^ios-|^logo-/.test(val))) {
  54317. // this does not have one of the defaults
  54318. // so lets auto add in the mode prefix for them
  54319. this._name = this._iconMode + '-' + val;
  54320. }
  54321. else {
  54322. this._name = val;
  54323. }
  54324. this.update();
  54325. },
  54326. enumerable: true,
  54327. configurable: true
  54328. });
  54329. Object.defineProperty(Icon.prototype, "ios", {
  54330. /**
  54331. * @input {string} Specifies which icon to use on `ios` mode.
  54332. */
  54333. get: function () {
  54334. return this._ios;
  54335. },
  54336. set: function (val) {
  54337. this._ios = val;
  54338. this.update();
  54339. },
  54340. enumerable: true,
  54341. configurable: true
  54342. });
  54343. Object.defineProperty(Icon.prototype, "md", {
  54344. /**
  54345. * @input {string} Specifies which icon to use on `md` mode.
  54346. */
  54347. get: function () {
  54348. return this._md;
  54349. },
  54350. set: function (val) {
  54351. this._md = val;
  54352. this.update();
  54353. },
  54354. enumerable: true,
  54355. configurable: true
  54356. });
  54357. Object.defineProperty(Icon.prototype, "isActive", {
  54358. /**
  54359. * @input {boolean} If true, the icon is styled with an "active" appearance.
  54360. * An active icon is filled in, and an inactive icon is the outline of the icon.
  54361. * The `isActive` property is largely used by the tabbar. Only affects `ios` icons.
  54362. */
  54363. get: function () {
  54364. return this._isActive;
  54365. },
  54366. set: function (val) {
  54367. this._isActive = Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["o" /* isTrueProperty */])(val);
  54368. this.update();
  54369. },
  54370. enumerable: true,
  54371. configurable: true
  54372. });
  54373. /**
  54374. * @hidden
  54375. */
  54376. Icon.prototype.update = function () {
  54377. var iconName;
  54378. if (this._ios && this._iconMode === 'ios') {
  54379. iconName = this._ios;
  54380. }
  54381. else if (this._md && this._iconMode === 'md') {
  54382. iconName = this._md;
  54383. }
  54384. else {
  54385. iconName = this._name;
  54386. }
  54387. var hidden = this._hidden = (iconName === null);
  54388. if (hidden) {
  54389. return;
  54390. }
  54391. var iconMode = iconName.split('-', 2)[0];
  54392. if (iconMode === 'ios' &&
  54393. !this._isActive &&
  54394. iconName.indexOf('logo-') < 0 &&
  54395. iconName.indexOf('-outline') < 0) {
  54396. iconName += '-outline';
  54397. }
  54398. var css = 'ion-' + iconName;
  54399. if (this._css === css) {
  54400. return;
  54401. }
  54402. if (this._css) {
  54403. this.setElementClass(this._css, false);
  54404. }
  54405. this._css = css;
  54406. this.setElementClass(css, true);
  54407. var label = iconName
  54408. .replace('ios-', '')
  54409. .replace('md-', '')
  54410. .replace('-', ' ');
  54411. this.setElementAttribute('aria-label', label);
  54412. };
  54413. Icon.decorators = [
  54414. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  54415. selector: 'ion-icon',
  54416. host: {
  54417. 'role': 'img'
  54418. }
  54419. },] },
  54420. ];
  54421. /** @nocollapse */
  54422. Icon.ctorParameters = function () { return [
  54423. { type: __WEBPACK_IMPORTED_MODULE_2__config_config__["a" /* Config */], },
  54424. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  54425. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  54426. ]; };
  54427. Icon.propDecorators = {
  54428. 'name': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  54429. 'ios': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  54430. 'md': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  54431. 'isActive': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  54432. '_hidden': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["x" /* HostBinding */], args: ['class.hide',] },],
  54433. };
  54434. return Icon;
  54435. }(__WEBPACK_IMPORTED_MODULE_3__ion__["a" /* Ion */]));
  54436. //# sourceMappingURL=icon.js.map
  54437. /***/ }),
  54438. /* 63 */
  54439. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  54440. "use strict";
  54441. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Label; });
  54442. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  54443. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__config_config__ = __webpack_require__(1);
  54444. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ion__ = __webpack_require__(4);
  54445. var __extends = (this && this.__extends) || (function () {
  54446. var extendStatics = Object.setPrototypeOf ||
  54447. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  54448. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  54449. return function (d, b) {
  54450. extendStatics(d, b);
  54451. function __() { this.constructor = d; }
  54452. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  54453. };
  54454. })();
  54455. /**
  54456. * @name Label
  54457. * @description
  54458. * Labels are placed inside of an `ion-item` element and can be used
  54459. * to describe an `ion-input`, `ion-toggle`, `ion-checkbox`, and more.
  54460. *
  54461. * @property [fixed] - A persistent label that sits next the input.
  54462. * @property [floating] - A label that will float above the input if the input is empty or loses focus.
  54463. * @property [stacked] - A stacked label will always appear on top of the input.
  54464. *
  54465. * @usage
  54466. * ```html
  54467. * <ion-item>
  54468. * <ion-label>Username</ion-label>
  54469. * <ion-input></ion-input>
  54470. * </ion-item>
  54471. *
  54472. * <ion-item>
  54473. * <ion-label fixed>Website</ion-label>
  54474. * <ion-input type="url"></ion-input>
  54475. * </ion-item>
  54476. *
  54477. * <ion-item>
  54478. * <ion-label floating>Email</ion-label>
  54479. * <ion-input type="email"></ion-input>
  54480. * </ion-item>
  54481. *
  54482. * <ion-item>
  54483. * <ion-label stacked>Phone</ion-label>
  54484. * <ion-input type="tel"></ion-input>
  54485. * </ion-item>
  54486. *
  54487. * <ion-item>
  54488. * <ion-label>Toggle</ion-label>
  54489. * <ion-toggle></ion-toggle>
  54490. * </ion-item>
  54491. *
  54492. * <ion-item>
  54493. * <ion-label>Checkbox</ion-label>
  54494. * <ion-checkbox></ion-checkbox>
  54495. * </ion-item>
  54496. * ```
  54497. *
  54498. * @demo /docs/demos/src/label/
  54499. * @see {@link ../../../../components#inputs Input Component Docs}
  54500. * @see {@link ../../input/Input Input API Docs}
  54501. *
  54502. */
  54503. var Label = (function (_super) {
  54504. __extends(Label, _super);
  54505. function Label(config, elementRef, renderer, isFloating, isStacked, isFixed, isInset) {
  54506. var _this = _super.call(this, config, elementRef, renderer, 'label') || this;
  54507. _this.type = (isFloating === '' ? 'floating' : (isStacked === '' ? 'stacked' : (isFixed === '' ? 'fixed' : (isInset === '' ? 'inset' : null))));
  54508. return _this;
  54509. }
  54510. Object.defineProperty(Label.prototype, "id", {
  54511. /**
  54512. * @hidden
  54513. */
  54514. get: function () {
  54515. return this._id;
  54516. },
  54517. set: function (val) {
  54518. this._id = val;
  54519. if (val) {
  54520. this.setElementAttribute('id', val);
  54521. }
  54522. },
  54523. enumerable: true,
  54524. configurable: true
  54525. });
  54526. Object.defineProperty(Label.prototype, "text", {
  54527. /**
  54528. * @hidden
  54529. */
  54530. get: function () {
  54531. return this.getNativeElement().textContent || '';
  54532. },
  54533. enumerable: true,
  54534. configurable: true
  54535. });
  54536. Label.decorators = [
  54537. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  54538. selector: 'ion-label'
  54539. },] },
  54540. ];
  54541. /** @nocollapse */
  54542. Label.ctorParameters = function () { return [
  54543. { type: __WEBPACK_IMPORTED_MODULE_1__config_config__["a" /* Config */], },
  54544. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  54545. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  54546. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["g" /* Attribute */], args: ['floating',] },] },
  54547. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["g" /* Attribute */], args: ['stacked',] },] },
  54548. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["g" /* Attribute */], args: ['fixed',] },] },
  54549. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["g" /* Attribute */], args: ['inset',] },] },
  54550. ]; };
  54551. Label.propDecorators = {
  54552. 'id': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  54553. };
  54554. return Label;
  54555. }(__WEBPACK_IMPORTED_MODULE_2__ion__["a" /* Ion */]));
  54556. //# sourceMappingURL=label.js.map
  54557. /***/ }),
  54558. /* 64 */
  54559. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  54560. "use strict";
  54561. /* unused harmony export ReorderIndexes */
  54562. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ItemReorder; });
  54563. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  54564. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__content_content__ = __webpack_require__(19);
  54565. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__platform_dom_controller__ = __webpack_require__(8);
  54566. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_util__ = __webpack_require__(2);
  54567. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__item_reorder_gesture__ = __webpack_require__(238);
  54568. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__platform_platform__ = __webpack_require__(3);
  54569. var ReorderIndexes = (function () {
  54570. function ReorderIndexes(from, to) {
  54571. this.from = from;
  54572. this.to = to;
  54573. }
  54574. ReorderIndexes.prototype.applyTo = function (array) {
  54575. Object(__WEBPACK_IMPORTED_MODULE_3__util_util__["r" /* reorderArray */])(array, this);
  54576. };
  54577. return ReorderIndexes;
  54578. }());
  54579. /**
  54580. * @name ItemReorder
  54581. * @description
  54582. * Item reorder adds the ability to change an item's order in a group.
  54583. * It can be used within an `ion-list` or `ion-item-group` to provide a
  54584. * visual drag and drop interface.
  54585. *
  54586. * ## Grouping Items
  54587. *
  54588. * All reorderable items must be grouped in the same element. If an item
  54589. * should not be reordered, it shouldn't be included in this group. For
  54590. * example, the following code works because the items are grouped in the
  54591. * `<ion-list>`:
  54592. *
  54593. * ```html
  54594. * <ion-list reorder="true">
  54595. * <ion-item *ngFor="let item of items">{% raw %}{{ item }}{% endraw %}</ion-item>
  54596. * </ion-list>
  54597. * ```
  54598. *
  54599. * However, the below list includes a header that shouldn't be reordered:
  54600. *
  54601. * ```html
  54602. * <ion-list reorder="true">
  54603. * <ion-list-header>Header</ion-list-header>
  54604. * <ion-item *ngFor="let item of items">{% raw %}{{ item }}{% endraw %}</ion-item>
  54605. * </ion-list>
  54606. * ```
  54607. *
  54608. * In order to mix different sets of items, `ion-item-group` should be used to
  54609. * group the reorderable items:
  54610. *
  54611. * ```html
  54612. * <ion-list>
  54613. * <ion-list-header>Header</ion-list-header>
  54614. * <ion-item-group reorder="true">
  54615. * <ion-item *ngFor="let item of items">{% raw %}{{ item }}{% endraw %}</ion-item>
  54616. * </ion-item-group>
  54617. * </ion-list>
  54618. * ```
  54619. *
  54620. * It's important to note that in this example, the `[reorder]` directive is applied to
  54621. * the `<ion-item-group>` instead of the `<ion-list>`. This way makes it possible to
  54622. * mix items that should and shouldn't be reordered.
  54623. *
  54624. *
  54625. * ## Implementing the Reorder Function
  54626. *
  54627. * When the item is dragged and dropped into the new position, the `(ionItemReorder)` event is
  54628. * emitted. This event provides the initial index (from) and the new index (to) of the reordered
  54629. * item. For example, if the first item is dragged to the fifth position, the event will emit
  54630. * `{from: 0, to: 4}`. Note that the index starts at zero.
  54631. *
  54632. * A function should be called when the event is emitted that handles the reordering of the items.
  54633. * See [usage](#usage) below for some examples.
  54634. *
  54635. *
  54636. * @usage
  54637. *
  54638. * ```html
  54639. * <ion-list>
  54640. * <ion-list-header>Header</ion-list-header>
  54641. * <ion-item-group reorder="true" (ionItemReorder)="reorderItems($event)">
  54642. * <ion-item *ngFor="let item of items">{% raw %}{{ item }}{% endraw %}</ion-item>
  54643. * </ion-item-group>
  54644. * </ion-list>
  54645. * ```
  54646. *
  54647. * ```ts
  54648. * class MyComponent {
  54649. * items = [];
  54650. *
  54651. * constructor() {
  54652. * for (let x = 0; x < 5; x++) {
  54653. * this.items.push(x);
  54654. * }
  54655. * }
  54656. *
  54657. * reorderItems(indexes) {
  54658. * let element = this.items[indexes.from];
  54659. * this.items.splice(indexes.from, 1);
  54660. * this.items.splice(indexes.to, 0, element);
  54661. * }
  54662. * }
  54663. * ```
  54664. *
  54665. * Ionic also provides a helper function called `reorderArray` to
  54666. * reorder the array of items. This can be used instead:
  54667. *
  54668. * ```ts
  54669. * import { reorderArray } from 'ionic-angular';
  54670. *
  54671. * class MyComponent {
  54672. * items = [];
  54673. *
  54674. * constructor() {
  54675. * for (let x = 0; x < 5; x++) {
  54676. * this.items.push(x);
  54677. * }
  54678. * }
  54679. *
  54680. * reorderItems(indexes) {
  54681. * this.items = reorderArray(this.items, indexes);
  54682. * }
  54683. * }
  54684. * ```
  54685. * Alternatevely you can execute helper function inside template:
  54686. *
  54687. * ```html
  54688. * <ion-list>
  54689. * <ion-list-header>Header</ion-list-header>
  54690. * <ion-item-group reorder="true" (ionItemReorder)="$event.applyTo(items)">
  54691. * <ion-item *ngFor="let item of items">{% raw %}{{ item }}{% endraw %}</ion-item>
  54692. * </ion-item-group>
  54693. * </ion-list>
  54694. * ```
  54695. *
  54696. * @demo /docs/demos/src/item-reorder/
  54697. * @see {@link /docs/components#lists List Component Docs}
  54698. * @see {@link ../../list/List List API Docs}
  54699. * @see {@link ../Item Item API Docs}
  54700. */
  54701. var ItemReorder = (function () {
  54702. function ItemReorder(_plt, _dom, elementRef, _rendered, _zone, _content) {
  54703. this._plt = _plt;
  54704. this._dom = _dom;
  54705. this._rendered = _rendered;
  54706. this._zone = _zone;
  54707. this._content = _content;
  54708. this._enableReorder = false;
  54709. this._visibleReorder = false;
  54710. this._isStart = false;
  54711. this._lastToIndex = -1;
  54712. /**
  54713. * @output {object} Emitted when the item is reordered. Emits an object
  54714. * with `from` and `to` properties.
  54715. */
  54716. this.ionItemReorder = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  54717. this._element = elementRef.nativeElement;
  54718. }
  54719. Object.defineProperty(ItemReorder.prototype, "side", {
  54720. /**
  54721. * @input {string} Which side of the view the ion-reorder should be placed. Default `"end"`.
  54722. */
  54723. set: function (side) {
  54724. this._isStart = side === 'start';
  54725. },
  54726. enumerable: true,
  54727. configurable: true
  54728. });
  54729. /**
  54730. * @hidden
  54731. */
  54732. ItemReorder.prototype.ngOnDestroy = function () {
  54733. this._element = null;
  54734. this._reorderGesture && this._reorderGesture.destroy();
  54735. };
  54736. Object.defineProperty(ItemReorder.prototype, "reorder", {
  54737. /**
  54738. * @hidden
  54739. */
  54740. get: function () {
  54741. return this._enableReorder;
  54742. },
  54743. set: function (val) {
  54744. var _this = this;
  54745. var enabled = Object(__WEBPACK_IMPORTED_MODULE_3__util_util__["o" /* isTrueProperty */])(val);
  54746. if (!enabled && this._reorderGesture) {
  54747. this._reorderGesture.destroy();
  54748. this._reorderGesture = null;
  54749. this._visibleReorder = false;
  54750. setTimeout(function () { return _this._enableReorder = false; }, 400);
  54751. }
  54752. else if (enabled && !this._reorderGesture) {
  54753. (void 0) /* console.debug */;
  54754. this._reorderGesture = new __WEBPACK_IMPORTED_MODULE_4__item_reorder_gesture__["a" /* ItemReorderGesture */](this._plt, this);
  54755. this._enableReorder = true;
  54756. this._dom.write(function () {
  54757. _this._zone.run(function () {
  54758. _this._visibleReorder = true;
  54759. });
  54760. }, 16);
  54761. }
  54762. },
  54763. enumerable: true,
  54764. configurable: true
  54765. });
  54766. ItemReorder.prototype._reorderPrepare = function () {
  54767. var ele = this._element;
  54768. var children = ele.children;
  54769. for (var i = 0, ilen = children.length; i < ilen; i++) {
  54770. var child = children[i];
  54771. child.$ionIndex = i;
  54772. child.$ionReorderList = ele;
  54773. }
  54774. };
  54775. ItemReorder.prototype._reorderStart = function () {
  54776. this.setElementClass('reorder-list-active', true);
  54777. };
  54778. ItemReorder.prototype._reorderEmit = function (fromIndex, toIndex) {
  54779. var _this = this;
  54780. this._reorderReset();
  54781. if (fromIndex !== toIndex) {
  54782. this._zone.run(function () {
  54783. var indexes = new ReorderIndexes(fromIndex, toIndex);
  54784. _this.ionItemReorder.emit(indexes);
  54785. });
  54786. }
  54787. };
  54788. ItemReorder.prototype._scrollContent = function (scroll) {
  54789. var scrollTop = this._content.scrollTop + scroll;
  54790. if (scroll !== 0) {
  54791. this._content.scrollTo(0, scrollTop, 0);
  54792. }
  54793. return scrollTop;
  54794. };
  54795. ItemReorder.prototype._reorderReset = function () {
  54796. var children = this._element.children;
  54797. var len = children.length;
  54798. this.setElementClass('reorder-list-active', false);
  54799. var transform = this._plt.Css.transform;
  54800. for (var i = 0; i < len; i++) {
  54801. children[i].style[transform] = '';
  54802. }
  54803. this._lastToIndex = -1;
  54804. };
  54805. ItemReorder.prototype._reorderMove = function (fromIndex, toIndex, itemHeight) {
  54806. if (this._lastToIndex === -1) {
  54807. this._lastToIndex = fromIndex;
  54808. }
  54809. var lastToIndex = this._lastToIndex;
  54810. this._lastToIndex = toIndex;
  54811. // TODO: I think both loops can be merged into a single one
  54812. // but I had no luck last time I tried
  54813. /********* DOM READ ********** */
  54814. var children = this._element.children;
  54815. /********* DOM WRITE ********* */
  54816. var transform = this._plt.Css.transform;
  54817. if (toIndex >= lastToIndex) {
  54818. for (var i = lastToIndex; i <= toIndex; i++) {
  54819. if (i !== fromIndex) {
  54820. children[i].style[transform] = (i > fromIndex)
  54821. ? "translateY(" + -itemHeight + "px)" : '';
  54822. }
  54823. }
  54824. }
  54825. if (toIndex <= lastToIndex) {
  54826. for (var i = toIndex; i <= lastToIndex; i++) {
  54827. if (i !== fromIndex) {
  54828. children[i].style[transform] = (i < fromIndex)
  54829. ? "translateY(" + itemHeight + "px)" : '';
  54830. }
  54831. }
  54832. }
  54833. };
  54834. /**
  54835. * @hidden
  54836. */
  54837. ItemReorder.prototype.setElementClass = function (classname, add) {
  54838. this._rendered.setElementClass(this._element, classname, add);
  54839. };
  54840. /**
  54841. * @hidden
  54842. */
  54843. ItemReorder.prototype.getNativeElement = function () {
  54844. return this._element;
  54845. };
  54846. ItemReorder.decorators = [
  54847. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  54848. selector: 'ion-list[reorder],ion-item-group[reorder]',
  54849. host: {
  54850. '[class.reorder-enabled]': '_enableReorder',
  54851. '[class.reorder-visible]': '_visibleReorder',
  54852. '[class.reorder-side-start]': '_isStart'
  54853. }
  54854. },] },
  54855. ];
  54856. /** @nocollapse */
  54857. ItemReorder.ctorParameters = function () { return [
  54858. { type: __WEBPACK_IMPORTED_MODULE_5__platform_platform__["a" /* Platform */], },
  54859. { type: __WEBPACK_IMPORTED_MODULE_2__platform_dom_controller__["a" /* DomController */], },
  54860. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  54861. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  54862. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["M" /* NgZone */], },
  54863. { type: __WEBPACK_IMPORTED_MODULE_1__content_content__["a" /* Content */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  54864. ]; };
  54865. ItemReorder.propDecorators = {
  54866. 'ionItemReorder': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  54867. 'side': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */], args: ['side',] },],
  54868. 'reorder': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  54869. };
  54870. return ItemReorder;
  54871. }());
  54872. //# sourceMappingURL=item-reorder.js.map
  54873. /***/ }),
  54874. /* 65 */
  54875. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  54876. "use strict";
  54877. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PickerController; });
  54878. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  54879. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__app_app__ = __webpack_require__(6);
  54880. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__config_config__ = __webpack_require__(1);
  54881. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__picker__ = __webpack_require__(133);
  54882. /**
  54883. * @hidden
  54884. * @name PickerController
  54885. * @description
  54886. *
  54887. */
  54888. var PickerController = (function () {
  54889. function PickerController(_app, config) {
  54890. this._app = _app;
  54891. this.config = config;
  54892. }
  54893. /**
  54894. * Open a picker.
  54895. */
  54896. PickerController.prototype.create = function (opts) {
  54897. if (opts === void 0) { opts = {}; }
  54898. return new __WEBPACK_IMPORTED_MODULE_3__picker__["a" /* Picker */](this._app, opts, this.config);
  54899. };
  54900. PickerController.decorators = [
  54901. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */] },
  54902. ];
  54903. /** @nocollapse */
  54904. PickerController.ctorParameters = function () { return [
  54905. { type: __WEBPACK_IMPORTED_MODULE_1__app_app__["a" /* App */], },
  54906. { type: __WEBPACK_IMPORTED_MODULE_2__config_config__["a" /* Config */], },
  54907. ]; };
  54908. return PickerController;
  54909. }());
  54910. //# sourceMappingURL=picker-controller.js.map
  54911. /***/ }),
  54912. /* 66 */
  54913. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  54914. "use strict";
  54915. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PickerCmp; });
  54916. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  54917. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_util__ = __webpack_require__(2);
  54918. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__config_config__ = __webpack_require__(1);
  54919. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__gestures_gesture_controller__ = __webpack_require__(7);
  54920. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__platform_key__ = __webpack_require__(18);
  54921. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__navigation_nav_params__ = __webpack_require__(13);
  54922. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__navigation_view_controller__ = __webpack_require__(5);
  54923. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__picker_column__ = __webpack_require__(67);
  54924. /**
  54925. * @hidden
  54926. */
  54927. var PickerCmp = (function () {
  54928. function PickerCmp(_viewCtrl, _elementRef, config, gestureCtrl, params, renderer) {
  54929. this._viewCtrl = _viewCtrl;
  54930. this._elementRef = _elementRef;
  54931. this._gestureBlocker = gestureCtrl.createBlocker(__WEBPACK_IMPORTED_MODULE_3__gestures_gesture_controller__["a" /* BLOCK_ALL */]);
  54932. this.d = params.data;
  54933. this.mode = config.get('mode');
  54934. renderer.setElementClass(_elementRef.nativeElement, "picker-" + this.mode, true);
  54935. if (this.d.cssClass) {
  54936. this.d.cssClass.split(' ').forEach(function (cssClass) {
  54937. renderer.setElementClass(_elementRef.nativeElement, cssClass, true);
  54938. });
  54939. }
  54940. this.id = (++pickerIds);
  54941. this.lastClick = 0;
  54942. }
  54943. PickerCmp.prototype.ionViewWillLoad = function () {
  54944. // normalize the data
  54945. var data = this.d;
  54946. data.buttons = data.buttons.map(function (button) {
  54947. if (Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["n" /* isString */])(button)) {
  54948. return { text: button };
  54949. }
  54950. if (button.role) {
  54951. button.cssRole = "picker-toolbar-" + button.role;
  54952. }
  54953. return button;
  54954. });
  54955. // clean up dat data
  54956. data.columns = data.columns.map(function (column) {
  54957. if (!Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["l" /* isPresent */])(column.options)) {
  54958. column.options = [];
  54959. }
  54960. column.selectedIndex = column.selectedIndex || 0;
  54961. column.options = column.options.map(function (inputOpt) {
  54962. var opt = {
  54963. text: '',
  54964. value: '',
  54965. disabled: inputOpt.disabled,
  54966. };
  54967. if (Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["l" /* isPresent */])(inputOpt)) {
  54968. if (Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["n" /* isString */])(inputOpt) || Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["j" /* isNumber */])(inputOpt)) {
  54969. opt.text = inputOpt.toString();
  54970. opt.value = inputOpt;
  54971. }
  54972. else {
  54973. opt.text = Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["l" /* isPresent */])(inputOpt.text) ? inputOpt.text : inputOpt.value;
  54974. opt.value = Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["l" /* isPresent */])(inputOpt.value) ? inputOpt.value : inputOpt.text;
  54975. }
  54976. }
  54977. return opt;
  54978. });
  54979. return column;
  54980. });
  54981. };
  54982. PickerCmp.prototype.ionViewDidLoad = function () {
  54983. this.refresh();
  54984. };
  54985. PickerCmp.prototype.ionViewWillEnter = function () {
  54986. this._gestureBlocker.block();
  54987. };
  54988. PickerCmp.prototype.ionViewDidLeave = function () {
  54989. this._gestureBlocker.unblock();
  54990. };
  54991. PickerCmp.prototype.refresh = function () {
  54992. this._cols.forEach(function (column) { return column.refresh(); });
  54993. };
  54994. PickerCmp.prototype._colChange = function () {
  54995. // one of the columns has changed its selected index
  54996. var picker = this._viewCtrl;
  54997. picker.ionChange.emit(this.getSelected());
  54998. };
  54999. PickerCmp.prototype._keyUp = function (ev) {
  55000. if (this.enabled && this._viewCtrl.isLast()) {
  55001. if (ev.keyCode === __WEBPACK_IMPORTED_MODULE_4__platform_key__["b" /* KEY_ENTER */]) {
  55002. if (this.lastClick + 1000 < Date.now()) {
  55003. // do not fire this click if there recently was already a click
  55004. // this can happen when the button has focus and used the enter
  55005. // key to click the button. However, both the click handler and
  55006. // this keyup event will fire, so only allow one of them to go.
  55007. (void 0) /* console.debug */;
  55008. var button = this.d.buttons[this.d.buttons.length - 1];
  55009. this.btnClick(button);
  55010. }
  55011. }
  55012. else if (ev.keyCode === __WEBPACK_IMPORTED_MODULE_4__platform_key__["c" /* KEY_ESCAPE */]) {
  55013. (void 0) /* console.debug */;
  55014. this.bdClick();
  55015. }
  55016. }
  55017. };
  55018. PickerCmp.prototype.ionViewDidEnter = function () {
  55019. var focusableEle = this._elementRef.nativeElement.querySelector('button');
  55020. if (focusableEle) {
  55021. focusableEle.focus();
  55022. }
  55023. this.enabled = true;
  55024. };
  55025. PickerCmp.prototype.btnClick = function (button) {
  55026. if (!this.enabled) {
  55027. return;
  55028. }
  55029. // keep the time of the most recent button click
  55030. this.lastClick = Date.now();
  55031. var shouldDismiss = true;
  55032. if (button.handler) {
  55033. // a handler has been provided, execute it
  55034. // pass the handler the values from the inputs
  55035. if (button.handler(this.getSelected()) === false) {
  55036. // if the return value of the handler is false then do not dismiss
  55037. shouldDismiss = false;
  55038. }
  55039. }
  55040. if (shouldDismiss) {
  55041. this.dismiss(button.role);
  55042. }
  55043. };
  55044. PickerCmp.prototype.bdClick = function () {
  55045. if (this.enabled && this.d.enableBackdropDismiss) {
  55046. var cancelBtn = this.d.buttons.find(function (b) { return b.role === 'cancel'; });
  55047. if (cancelBtn) {
  55048. this.btnClick(cancelBtn);
  55049. }
  55050. else {
  55051. this.dismiss('backdrop');
  55052. }
  55053. }
  55054. };
  55055. PickerCmp.prototype.dismiss = function (role) {
  55056. return this._viewCtrl.dismiss(this.getSelected(), role);
  55057. };
  55058. PickerCmp.prototype.getSelected = function () {
  55059. var selected = {};
  55060. this.d.columns.forEach(function (col, index) {
  55061. var selectedColumn = col.options[col.selectedIndex];
  55062. selected[col.name] = {
  55063. text: selectedColumn ? selectedColumn.text : null,
  55064. value: selectedColumn ? selectedColumn.value : null,
  55065. columnIndex: index,
  55066. };
  55067. });
  55068. return selected;
  55069. };
  55070. PickerCmp.prototype.ngOnDestroy = function () {
  55071. (void 0) /* assert */;
  55072. this._gestureBlocker.destroy();
  55073. };
  55074. PickerCmp.decorators = [
  55075. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  55076. selector: 'ion-picker-cmp',
  55077. template: "\n <ion-backdrop (click)=\"bdClick()\"></ion-backdrop>\n <div class=\"picker-wrapper\">\n <div class=\"picker-toolbar\">\n <div *ngFor=\"let b of d.buttons\" class=\"picker-toolbar-button\" [ngClass]=\"b.cssRole\">\n <button ion-button (click)=\"btnClick(b)\" [ngClass]=\"b.cssClass\" class=\"picker-button\" clear>\n {{b.text}}\n </button>\n </div>\n </div>\n <div class=\"picker-columns\">\n <div class=\"picker-above-highlight\"></div>\n <div *ngFor=\"let c of d.columns\" [col]=\"c\" class=\"picker-col\" (ionChange)=\"_colChange($event)\"></div>\n <div class=\"picker-below-highlight\"></div>\n </div>\n </div>\n ",
  55078. host: {
  55079. 'role': 'dialog'
  55080. },
  55081. encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_11" /* ViewEncapsulation */].None,
  55082. },] },
  55083. ];
  55084. /** @nocollapse */
  55085. PickerCmp.ctorParameters = function () { return [
  55086. { type: __WEBPACK_IMPORTED_MODULE_6__navigation_view_controller__["a" /* ViewController */], },
  55087. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  55088. { type: __WEBPACK_IMPORTED_MODULE_2__config_config__["a" /* Config */], },
  55089. { type: __WEBPACK_IMPORTED_MODULE_3__gestures_gesture_controller__["l" /* GestureController */], },
  55090. { type: __WEBPACK_IMPORTED_MODULE_5__navigation_nav_params__["a" /* NavParams */], },
  55091. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  55092. ]; };
  55093. PickerCmp.propDecorators = {
  55094. '_cols': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_9" /* ViewChildren */], args: [__WEBPACK_IMPORTED_MODULE_7__picker_column__["a" /* PickerColumnCmp */],] },],
  55095. '_keyUp': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["y" /* HostListener */], args: ['body:keyup', ['$event'],] },],
  55096. };
  55097. return PickerCmp;
  55098. }());
  55099. var pickerIds = -1;
  55100. //# sourceMappingURL=picker-component.js.map
  55101. /***/ }),
  55102. /* 67 */
  55103. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  55104. "use strict";
  55105. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PickerColumnCmp; });
  55106. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  55107. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_util__ = __webpack_require__(2);
  55108. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__config_config__ = __webpack_require__(1);
  55109. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__platform_dom_controller__ = __webpack_require__(8);
  55110. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__tap_click_haptic__ = __webpack_require__(38);
  55111. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__picker_options__ = __webpack_require__(239);
  55112. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__platform_platform__ = __webpack_require__(3);
  55113. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__util_dom__ = __webpack_require__(10);
  55114. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__gestures_ui_event_manager__ = __webpack_require__(23);
  55115. /**
  55116. * @hidden
  55117. */
  55118. var PickerColumnCmp = (function () {
  55119. function PickerColumnCmp(config, _plt, elementRef, _zone, _haptic, plt, domCtrl) {
  55120. this._plt = _plt;
  55121. this.elementRef = elementRef;
  55122. this._zone = _zone;
  55123. this._haptic = _haptic;
  55124. this.y = 0;
  55125. this.pos = [];
  55126. this.startY = null;
  55127. this.ionChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  55128. this.events = new __WEBPACK_IMPORTED_MODULE_8__gestures_ui_event_manager__["a" /* UIEventManager */](plt);
  55129. this.rotateFactor = config.getNumber('pickerRotateFactor', 0);
  55130. this.scaleFactor = config.getNumber('pickerScaleFactor', 1);
  55131. this.decelerateFunc = this.decelerate.bind(this);
  55132. this.debouncer = domCtrl.debouncer();
  55133. }
  55134. PickerColumnCmp.prototype.ngAfterViewInit = function () {
  55135. // get the scrollable element within the column
  55136. var colEle = this.colEle.nativeElement;
  55137. this.colHeight = colEle.clientHeight;
  55138. // get the height of one option
  55139. this.optHeight = (colEle.firstElementChild ? colEle.firstElementChild.clientHeight : 0);
  55140. // Listening for pointer events
  55141. this.events.pointerEvents({
  55142. element: this.elementRef.nativeElement,
  55143. pointerDown: this.pointerStart.bind(this),
  55144. pointerMove: this.pointerMove.bind(this),
  55145. pointerUp: this.pointerEnd.bind(this),
  55146. capture: true,
  55147. zone: false
  55148. });
  55149. };
  55150. PickerColumnCmp.prototype.ngOnDestroy = function () {
  55151. this._plt.cancelRaf(this.rafId);
  55152. this.events.destroy();
  55153. };
  55154. PickerColumnCmp.prototype.pointerStart = function (ev) {
  55155. (void 0) /* console.debug */;
  55156. this._haptic.gestureSelectionStart();
  55157. // We have to prevent default in order to block scrolling under the picker
  55158. // but we DO NOT have to stop propagation, since we still want
  55159. // some "click" events to capture
  55160. ev.preventDefault();
  55161. // cancel any previous raf's that haven't fired yet
  55162. this._plt.cancelRaf(this.rafId);
  55163. // remember where the pointer started from`
  55164. this.startY = Object(__WEBPACK_IMPORTED_MODULE_7__util_dom__["f" /* pointerCoord */])(ev).y;
  55165. // reset everything
  55166. this.velocity = 0;
  55167. this.pos.length = 0;
  55168. this.pos.push(this.startY, Date.now());
  55169. var options = this.col.options;
  55170. var minY = (options.length - 1);
  55171. var maxY = 0;
  55172. for (var i = 0; i < options.length; i++) {
  55173. if (!options[i].disabled) {
  55174. minY = Math.min(minY, i);
  55175. maxY = Math.max(maxY, i);
  55176. }
  55177. }
  55178. this.minY = (minY * this.optHeight * -1);
  55179. this.maxY = (maxY * this.optHeight * -1);
  55180. return true;
  55181. };
  55182. PickerColumnCmp.prototype.pointerMove = function (ev) {
  55183. var _this = this;
  55184. ev.preventDefault();
  55185. ev.stopPropagation();
  55186. var currentY = Object(__WEBPACK_IMPORTED_MODULE_7__util_dom__["f" /* pointerCoord */])(ev).y;
  55187. this.pos.push(currentY, Date.now());
  55188. this.debouncer.write(function () {
  55189. if (_this.startY === null) {
  55190. return;
  55191. }
  55192. // update the scroll position relative to pointer start position
  55193. var y = _this.y + (currentY - _this.startY);
  55194. if (y > _this.minY) {
  55195. // scrolling up higher than scroll area
  55196. y = Math.pow(y, 0.8);
  55197. _this.bounceFrom = y;
  55198. }
  55199. else if (y < _this.maxY) {
  55200. // scrolling down below scroll area
  55201. y += Math.pow(_this.maxY - y, 0.9);
  55202. _this.bounceFrom = y;
  55203. }
  55204. else {
  55205. _this.bounceFrom = 0;
  55206. }
  55207. _this.update(y, 0, false, false);
  55208. var currentIndex = Math.max(Math.abs(Math.round(y / _this.optHeight)), 0);
  55209. if (currentIndex !== _this.lastTempIndex) {
  55210. // Trigger a haptic event for physical feedback that the index has changed
  55211. _this._haptic.gestureSelectionChanged();
  55212. _this.lastTempIndex = currentIndex;
  55213. }
  55214. });
  55215. };
  55216. PickerColumnCmp.prototype.pointerEnd = function (ev) {
  55217. ev.preventDefault();
  55218. this.debouncer.cancel();
  55219. if (this.startY === null) {
  55220. return;
  55221. }
  55222. (void 0) /* console.debug */;
  55223. this.velocity = 0;
  55224. if (this.bounceFrom > 0) {
  55225. // bounce back up
  55226. this.update(this.minY, 100, true, true);
  55227. return;
  55228. }
  55229. else if (this.bounceFrom < 0) {
  55230. // bounce back down
  55231. this.update(this.maxY, 100, true, true);
  55232. return;
  55233. }
  55234. var endY = Object(__WEBPACK_IMPORTED_MODULE_7__util_dom__["f" /* pointerCoord */])(ev).y;
  55235. this.pos.push(endY, Date.now());
  55236. var endPos = (this.pos.length - 1);
  55237. var startPos = endPos;
  55238. var timeRange = (Date.now() - 100);
  55239. // move pointer to position measured 100ms ago
  55240. for (var i = endPos; i > 0 && this.pos[i] > timeRange; i -= 2) {
  55241. startPos = i;
  55242. }
  55243. if (startPos !== endPos) {
  55244. // compute relative movement between these two points
  55245. var timeOffset = (this.pos[endPos] - this.pos[startPos]);
  55246. var movedTop = (this.pos[startPos - 1] - this.pos[endPos - 1]);
  55247. // based on XXms compute the movement to apply for each render step
  55248. var velocity = ((movedTop / timeOffset) * __WEBPACK_IMPORTED_MODULE_5__picker_options__["b" /* FRAME_MS */]);
  55249. this.velocity = Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["a" /* clamp */])(-__WEBPACK_IMPORTED_MODULE_5__picker_options__["c" /* MAX_PICKER_SPEED */], velocity, __WEBPACK_IMPORTED_MODULE_5__picker_options__["c" /* MAX_PICKER_SPEED */]);
  55250. }
  55251. if (Math.abs(endY - this.startY) > 3) {
  55252. var y = this.y + (endY - this.startY);
  55253. this.update(y, 0, true, true);
  55254. }
  55255. this.startY = null;
  55256. this.decelerate();
  55257. };
  55258. PickerColumnCmp.prototype.decelerate = function () {
  55259. var y = 0;
  55260. if (isNaN(this.y) || !this.optHeight) {
  55261. // fallback in case numbers get outta wack
  55262. this.update(y, 0, true, true);
  55263. this._haptic.gestureSelectionEnd();
  55264. }
  55265. else if (Math.abs(this.velocity) > 0) {
  55266. // still decelerating
  55267. this.velocity *= __WEBPACK_IMPORTED_MODULE_5__picker_options__["a" /* DECELERATION_FRICTION */];
  55268. // do not let it go slower than a velocity of 1
  55269. this.velocity = (this.velocity > 0)
  55270. ? Math.max(this.velocity, 1)
  55271. : Math.min(this.velocity, -1);
  55272. y = Math.round(this.y - this.velocity);
  55273. if (y > this.minY) {
  55274. // whoops, it's trying to scroll up farther than the options we have!
  55275. y = this.minY;
  55276. this.velocity = 0;
  55277. }
  55278. else if (y < this.maxY) {
  55279. // gahh, it's trying to scroll down farther than we can!
  55280. y = this.maxY;
  55281. this.velocity = 0;
  55282. }
  55283. var notLockedIn = (y % this.optHeight !== 0 || Math.abs(this.velocity) > 1);
  55284. this.update(y, 0, true, !notLockedIn);
  55285. if (notLockedIn) {
  55286. // isn't locked in yet, keep decelerating until it is
  55287. this.rafId = this._plt.raf(this.decelerateFunc);
  55288. }
  55289. }
  55290. else if (this.y % this.optHeight !== 0) {
  55291. // needs to still get locked into a position so options line up
  55292. var currentPos = Math.abs(this.y % this.optHeight);
  55293. // create a velocity in the direction it needs to scroll
  55294. this.velocity = (currentPos > (this.optHeight / 2) ? 1 : -1);
  55295. this._haptic.gestureSelectionEnd();
  55296. this.decelerate();
  55297. }
  55298. var currentIndex = Math.max(Math.abs(Math.round(y / this.optHeight)), 0);
  55299. if (currentIndex !== this.lastTempIndex) {
  55300. // Trigger a haptic event for physical feedback that the index has changed
  55301. this._haptic.gestureSelectionChanged();
  55302. }
  55303. this.lastTempIndex = currentIndex;
  55304. };
  55305. PickerColumnCmp.prototype.optClick = function (ev, index) {
  55306. if (!this.velocity) {
  55307. ev.preventDefault();
  55308. ev.stopPropagation();
  55309. this.setSelected(index, 150);
  55310. }
  55311. };
  55312. PickerColumnCmp.prototype.setSelected = function (selectedIndex, duration) {
  55313. // if there is a selected index, then figure out it's y position
  55314. // if there isn't a selected index, then just use the top y position
  55315. var y = (selectedIndex > -1) ? ((selectedIndex * this.optHeight) * -1) : 0;
  55316. this._plt.cancelRaf(this.rafId);
  55317. this.velocity = 0;
  55318. // so what y position we're at
  55319. this.update(y, duration, true, true);
  55320. };
  55321. PickerColumnCmp.prototype.update = function (y, duration, saveY, emitChange) {
  55322. // ensure we've got a good round number :)
  55323. y = Math.round(y);
  55324. var i;
  55325. var button;
  55326. var opt;
  55327. var optOffset;
  55328. var visible;
  55329. var translateX;
  55330. var translateY;
  55331. var translateZ;
  55332. var rotateX;
  55333. var transform;
  55334. var selected;
  55335. var parent = this.colEle.nativeElement;
  55336. var children = parent.children;
  55337. var length = children.length;
  55338. var selectedIndex = this.col.selectedIndex = Math.min(Math.max(Math.round(-y / this.optHeight), 0), length - 1);
  55339. var durationStr = (duration === 0) ? null : duration + 'ms';
  55340. var scaleStr = "scale(" + this.scaleFactor + ")";
  55341. for (i = 0; i < length; i++) {
  55342. button = children[i];
  55343. opt = this.col.options[i];
  55344. optOffset = (i * this.optHeight) + y;
  55345. visible = true;
  55346. transform = '';
  55347. if (this.rotateFactor !== 0) {
  55348. rotateX = optOffset * this.rotateFactor;
  55349. if (Math.abs(rotateX) > 90) {
  55350. visible = false;
  55351. }
  55352. else {
  55353. translateX = 0;
  55354. translateY = 0;
  55355. translateZ = 90;
  55356. transform = "rotateX(" + rotateX + "deg) ";
  55357. }
  55358. }
  55359. else {
  55360. translateX = 0;
  55361. translateZ = 0;
  55362. translateY = optOffset;
  55363. if (Math.abs(translateY) > 170) {
  55364. visible = false;
  55365. }
  55366. }
  55367. selected = selectedIndex === i;
  55368. if (visible) {
  55369. transform += "translate3d(0px," + translateY + "px," + translateZ + "px) ";
  55370. if (this.scaleFactor !== 1 && !selected) {
  55371. transform += scaleStr;
  55372. }
  55373. }
  55374. else {
  55375. transform = 'translate3d(-9999px,0px,0px)';
  55376. }
  55377. // Update transition duration
  55378. if (duration !== opt._dur) {
  55379. opt._dur = duration;
  55380. button.style[this._plt.Css.transitionDuration] = durationStr;
  55381. }
  55382. // Update transform
  55383. if (transform !== opt._trans) {
  55384. opt._trans = transform;
  55385. button.style[this._plt.Css.transform] = transform;
  55386. }
  55387. // Update selected item
  55388. if (selected !== opt._selected) {
  55389. opt._selected = selected;
  55390. if (selected) {
  55391. button.classList.add(__WEBPACK_IMPORTED_MODULE_5__picker_options__["d" /* PICKER_OPT_SELECTED */]);
  55392. }
  55393. else {
  55394. button.classList.remove(__WEBPACK_IMPORTED_MODULE_5__picker_options__["d" /* PICKER_OPT_SELECTED */]);
  55395. }
  55396. }
  55397. }
  55398. this.col.prevSelected = selectedIndex;
  55399. if (saveY) {
  55400. this.y = y;
  55401. }
  55402. if (emitChange) {
  55403. if (this.lastIndex === undefined) {
  55404. // have not set a last index yet
  55405. this.lastIndex = this.col.selectedIndex;
  55406. }
  55407. else if (this.lastIndex !== this.col.selectedIndex) {
  55408. // new selected index has changed from the last index
  55409. // update the lastIndex and emit that it has changed
  55410. this.lastIndex = this.col.selectedIndex;
  55411. var ionChange = this.ionChange;
  55412. if (ionChange.observers.length > 0) {
  55413. this._zone.run(ionChange.emit.bind(ionChange, this.col.options[this.col.selectedIndex]));
  55414. }
  55415. }
  55416. }
  55417. };
  55418. PickerColumnCmp.prototype.refresh = function () {
  55419. var min = this.col.options.length - 1;
  55420. var max = 0;
  55421. var options = this.col.options;
  55422. for (var i = 0; i < options.length; i++) {
  55423. if (!options[i].disabled) {
  55424. min = Math.min(min, i);
  55425. max = Math.max(max, i);
  55426. }
  55427. }
  55428. var selectedIndex = Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["a" /* clamp */])(min, this.col.selectedIndex, max);
  55429. if (this.col.prevSelected !== selectedIndex) {
  55430. var y = (selectedIndex * this.optHeight) * -1;
  55431. this._plt.cancelRaf(this.rafId);
  55432. this.velocity = 0;
  55433. this.update(y, 150, true, false);
  55434. }
  55435. };
  55436. PickerColumnCmp.decorators = [
  55437. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  55438. selector: '.picker-col',
  55439. template: '<div *ngIf="col.prefix" class="picker-prefix" [style.width]="col.prefixWidth">{{col.prefix}}</div>' +
  55440. '<div class="picker-opts" #colEle [style.max-width]="col.optionsWidth">' +
  55441. '<button *ngFor="let o of col.options; let i=index"' +
  55442. '[class.picker-opt-disabled]="o.disabled" ' +
  55443. 'class="picker-opt" disable-activated (click)="optClick($event, i)">' +
  55444. '{{o.text}}' +
  55445. '</button>' +
  55446. '</div>' +
  55447. '<div *ngIf="col.suffix" class="picker-suffix" [style.width]="col.suffixWidth">{{col.suffix}}</div>',
  55448. host: {
  55449. '[style.max-width]': 'col.columnWidth',
  55450. '[class.picker-opts-left]': 'col.align=="left"',
  55451. '[class.picker-opts-right]': 'col.align=="right"',
  55452. }
  55453. },] },
  55454. ];
  55455. /** @nocollapse */
  55456. PickerColumnCmp.ctorParameters = function () { return [
  55457. { type: __WEBPACK_IMPORTED_MODULE_2__config_config__["a" /* Config */], },
  55458. { type: __WEBPACK_IMPORTED_MODULE_6__platform_platform__["a" /* Platform */], },
  55459. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  55460. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["M" /* NgZone */], },
  55461. { type: __WEBPACK_IMPORTED_MODULE_4__tap_click_haptic__["a" /* Haptic */], },
  55462. { type: __WEBPACK_IMPORTED_MODULE_6__platform_platform__["a" /* Platform */], },
  55463. { type: __WEBPACK_IMPORTED_MODULE_3__platform_dom_controller__["a" /* DomController */], },
  55464. ]; };
  55465. PickerColumnCmp.propDecorators = {
  55466. 'colEle': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_8" /* ViewChild */], args: ['colEle',] },],
  55467. 'col': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  55468. 'ionChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  55469. };
  55470. return PickerColumnCmp;
  55471. }());
  55472. //# sourceMappingURL=picker-column.js.map
  55473. /***/ }),
  55474. /* 68 */
  55475. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  55476. "use strict";
  55477. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FabList; });
  55478. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  55479. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__config_config__ = __webpack_require__(1);
  55480. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_util__ = __webpack_require__(2);
  55481. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__platform_platform__ = __webpack_require__(3);
  55482. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__fab__ = __webpack_require__(45);
  55483. /**
  55484. * @name FabList
  55485. * @description
  55486. * `ion-fab-list` is a container for multiple FAB buttons. They are components of `ion-fab` and allow you to specificy the buttons position, left, right, top, bottom.
  55487. * @usage
  55488. *
  55489. * ```html
  55490. * <ion-fab bottom right >
  55491. * <button ion-fab>Share</button>
  55492. * <ion-fab-list side="top">
  55493. * <button ion-fab>Facebook</button>
  55494. * <button ion-fab>Twitter</button>
  55495. * <button ion-fab>Youtube</button>
  55496. * </ion-fab-list>
  55497. * <ion-fab-list side="left">
  55498. * <button ion-fab>Vimeo</button>
  55499. * </ion-fab-list>
  55500. * </ion-fab>
  55501. * ```
  55502. * @module ionic
  55503. *
  55504. * @demo /docs/demos/src/fab/
  55505. * @see {@link /docs/components#fab Fab Component Docs}
  55506. */
  55507. var FabList = (function () {
  55508. function FabList(_elementRef, _renderer, config, _plt) {
  55509. this._elementRef = _elementRef;
  55510. this._renderer = _renderer;
  55511. this._plt = _plt;
  55512. this._visible = false;
  55513. this._fabs = [];
  55514. this._mode = config.get('mode');
  55515. }
  55516. Object.defineProperty(FabList.prototype, "_setbuttons", {
  55517. set: function (query) {
  55518. var fabs = this._fabs = query.toArray();
  55519. var className = "fab-" + this._mode + "-in-list";
  55520. for (var _i = 0, fabs_1 = fabs; _i < fabs_1.length; _i++) {
  55521. var fab = fabs_1[_i];
  55522. fab.setElementClass('fab-in-list', true);
  55523. fab.setElementClass(className, true);
  55524. }
  55525. },
  55526. enumerable: true,
  55527. configurable: true
  55528. });
  55529. /**
  55530. * @hidden
  55531. */
  55532. FabList.prototype.setVisible = function (val) {
  55533. var _this = this;
  55534. var visible = Object(__WEBPACK_IMPORTED_MODULE_2__util_util__["o" /* isTrueProperty */])(val);
  55535. if (visible === this._visible) {
  55536. return;
  55537. }
  55538. this._visible = visible;
  55539. var fabs = this._fabs;
  55540. var i = 1;
  55541. if (visible) {
  55542. fabs.forEach(function (fab) {
  55543. _this._plt.timeout(function () { return fab.setElementClass('show', true); }, i * 30);
  55544. i++;
  55545. });
  55546. }
  55547. else {
  55548. fabs.forEach(function (fab) { return fab.setElementClass('show', false); });
  55549. }
  55550. this.setElementClass('fab-list-active', visible);
  55551. };
  55552. /**
  55553. * @internal
  55554. */
  55555. FabList.prototype.setElementClass = function (className, add) {
  55556. this._renderer.setElementClass(this._elementRef.nativeElement, className, add);
  55557. };
  55558. FabList.decorators = [
  55559. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  55560. selector: 'ion-fab-list',
  55561. },] },
  55562. ];
  55563. /** @nocollapse */
  55564. FabList.ctorParameters = function () { return [
  55565. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  55566. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  55567. { type: __WEBPACK_IMPORTED_MODULE_1__config_config__["a" /* Config */], },
  55568. { type: __WEBPACK_IMPORTED_MODULE_3__platform_platform__["a" /* Platform */], },
  55569. ]; };
  55570. FabList.propDecorators = {
  55571. '_setbuttons': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["r" /* ContentChildren */], args: [__WEBPACK_IMPORTED_MODULE_4__fab__["a" /* FabButton */],] },],
  55572. };
  55573. return FabList;
  55574. }());
  55575. //# sourceMappingURL=fab-list.js.map
  55576. /***/ }),
  55577. /* 69 */
  55578. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  55579. "use strict";
  55580. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return InfiniteScroll; });
  55581. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  55582. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__content_content__ = __webpack_require__(19);
  55583. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__platform_dom_controller__ = __webpack_require__(8);
  55584. /**
  55585. * @name InfiniteScroll
  55586. * @description
  55587. * The Infinite Scroll allows you to perform an action when the user
  55588. * scrolls a specified distance from the bottom or top of the page.
  55589. *
  55590. * The expression assigned to the `infinite` event is called when
  55591. * the user scrolls to the specified distance. When this expression
  55592. * has finished its tasks, it should call the `complete()` method
  55593. * on the infinite scroll instance.
  55594. *
  55595. * @usage
  55596. * ```html
  55597. * <ion-content>
  55598. *
  55599. * <ion-list>
  55600. * <ion-item *ngFor="let i of items">{% raw %}{{i}}{% endraw %}</ion-item>
  55601. * </ion-list>
  55602. *
  55603. * <ion-infinite-scroll (ionInfinite)="doInfinite($event)">
  55604. * <ion-infinite-scroll-content></ion-infinite-scroll-content>
  55605. * </ion-infinite-scroll>
  55606. *
  55607. * </ion-content>
  55608. * ```
  55609. *
  55610. * ```ts
  55611. * @Component({...})
  55612. * export class NewsFeedPage {
  55613. * items = [];
  55614. *
  55615. * constructor() {
  55616. * for (let i = 0; i < 30; i++) {
  55617. * this.items.push( this.items.length );
  55618. * }
  55619. * }
  55620. *
  55621. * doInfinite(infiniteScroll) {
  55622. * console.log('Begin async operation');
  55623. *
  55624. * setTimeout(() => {
  55625. * for (let i = 0; i < 30; i++) {
  55626. * this.items.push( this.items.length );
  55627. * }
  55628. *
  55629. * console.log('Async operation has ended');
  55630. * infiniteScroll.complete();
  55631. * }, 500);
  55632. * }
  55633. *
  55634. * }
  55635. * ```
  55636. *
  55637. * ## `waitFor` method of InfiniteScroll
  55638. *
  55639. * In case if your async operation returns promise you can utilize
  55640. * `waitFor` method inside your template.
  55641. *
  55642. * ```html
  55643. * <ion-content>
  55644. *
  55645. * <ion-list>
  55646. * <ion-item *ngFor="let item of items">{{item}}</ion-item>
  55647. * </ion-list>
  55648. *
  55649. * <ion-infinite-scroll (ionInfinite)="$event.waitFor(doInfinite())">
  55650. * <ion-infinite-scroll-content></ion-infinite-scroll-content>
  55651. * </ion-infinite-scroll>
  55652. *
  55653. * </ion-content>
  55654. * ```
  55655. *
  55656. * ```ts
  55657. * @Component({...})
  55658. * export class NewsFeedPage {
  55659. * items = [];
  55660. *
  55661. * constructor() {
  55662. * for (var i = 0; i < 30; i++) {
  55663. * this.items.push( this.items.length );
  55664. * }
  55665. * }
  55666. *
  55667. * doInfinite(): Promise<any> {
  55668. * console.log('Begin async operation');
  55669. *
  55670. * return new Promise((resolve) => {
  55671. * setTimeout(() => {
  55672. * for (var i = 0; i < 30; i++) {
  55673. * this.items.push( this.items.length );
  55674. * }
  55675. *
  55676. * console.log('Async operation has ended');
  55677. * resolve();
  55678. * }, 500);
  55679. * })
  55680. * }
  55681. * }
  55682. * ```
  55683. *
  55684. * ## Infinite Scroll Content
  55685. *
  55686. * By default, Ionic uses the infinite scroll spinner that looks
  55687. * best for the platform the user is on. However, you can change the
  55688. * default spinner or add text by adding properties to the
  55689. * `ion-infinite-scroll-content` component.
  55690. *
  55691. * ```html
  55692. * <ion-content>
  55693. *
  55694. * <ion-infinite-scroll (ionInfinite)="doInfinite($event)">
  55695. * <ion-infinite-scroll-content
  55696. * loadingSpinner="bubbles"
  55697. * loadingText="Loading more data...">
  55698. * </ion-infinite-scroll-content>
  55699. * </ion-infinite-scroll>
  55700. *
  55701. * </ion-content>
  55702. * ```
  55703. *
  55704. *
  55705. * ## Further Customizing Infinite Scroll Content
  55706. *
  55707. * The `ion-infinite-scroll` component holds the infinite scroll logic.
  55708. * It requires a child component in order to display the content.
  55709. * Ionic uses `ion-infinite-scroll-content` by default. This component
  55710. * displays the infinite scroll and changes the look depending
  55711. * on the infinite scroll's state. Separating these components allows
  55712. * developers to create their own infinite scroll content components.
  55713. * You could replace our default content with custom SVG or CSS animations.
  55714. *
  55715. * @demo /docs/demos/src/infinite-scroll/
  55716. *
  55717. */
  55718. var InfiniteScroll = (function () {
  55719. function InfiniteScroll(_content, _zone, _elementRef, _dom) {
  55720. this._content = _content;
  55721. this._zone = _zone;
  55722. this._elementRef = _elementRef;
  55723. this._dom = _dom;
  55724. this._lastCheck = 0;
  55725. this._highestY = 0;
  55726. this._thr = '15%';
  55727. this._thrPx = 0;
  55728. this._thrPc = 0.15;
  55729. this._position = POSITION_BOTTOM;
  55730. this._init = false;
  55731. /**
  55732. * @internal
  55733. */
  55734. this.state = STATE_ENABLED;
  55735. /**
  55736. * @output {event} Emitted when the scroll reaches
  55737. * the threshold distance. From within your infinite handler,
  55738. * you must call the infinite scroll's `complete()` method when
  55739. * your async operation has completed.
  55740. */
  55741. this.ionInfinite = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  55742. _content.setElementClass('has-infinite-scroll', true);
  55743. }
  55744. Object.defineProperty(InfiniteScroll.prototype, "threshold", {
  55745. /**
  55746. * @input {string} The threshold distance from the bottom
  55747. * of the content to call the `infinite` output event when scrolled.
  55748. * The threshold value can be either a percent, or
  55749. * in pixels. For example, use the value of `10%` for the `infinite`
  55750. * output event to get called when the user has scrolled 10%
  55751. * from the bottom of the page. Use the value `100px` when the
  55752. * scroll is within 100 pixels from the bottom of the page.
  55753. * Default is `15%`.
  55754. */
  55755. get: function () {
  55756. return this._thr;
  55757. },
  55758. set: function (val) {
  55759. this._thr = val;
  55760. if (val.indexOf('%') > -1) {
  55761. this._thrPx = 0;
  55762. this._thrPc = (parseFloat(val) / 100);
  55763. }
  55764. else {
  55765. this._thrPx = parseFloat(val);
  55766. this._thrPc = 0;
  55767. }
  55768. },
  55769. enumerable: true,
  55770. configurable: true
  55771. });
  55772. Object.defineProperty(InfiniteScroll.prototype, "enabled", {
  55773. /**
  55774. * @input {boolean} If true, Whether or not the infinite scroll should be
  55775. * enabled or not. Setting to `false` will remove scroll event listeners
  55776. * and hide the display.
  55777. */
  55778. set: function (shouldEnable) {
  55779. this.enable(shouldEnable);
  55780. },
  55781. enumerable: true,
  55782. configurable: true
  55783. });
  55784. Object.defineProperty(InfiniteScroll.prototype, "position", {
  55785. /**
  55786. * @input {string} The position of the infinite scroll element.
  55787. * The value can be either `top` or `bottom`.
  55788. * Default is `bottom`.
  55789. */
  55790. get: function () {
  55791. return this._position;
  55792. },
  55793. set: function (val) {
  55794. if (val === POSITION_TOP || val === POSITION_BOTTOM) {
  55795. this._position = val;
  55796. }
  55797. else {
  55798. console.error("Invalid value for ion-infinite-scroll's position input. Its value should be '" + POSITION_BOTTOM + "' or '" + POSITION_TOP + "'.");
  55799. }
  55800. },
  55801. enumerable: true,
  55802. configurable: true
  55803. });
  55804. InfiniteScroll.prototype._onScroll = function (ev) {
  55805. var _this = this;
  55806. if (this.state === STATE_LOADING || this.state === STATE_DISABLED) {
  55807. return 1;
  55808. }
  55809. if (this._lastCheck + 32 > ev.timeStamp) {
  55810. // no need to check less than every XXms
  55811. return 2;
  55812. }
  55813. this._lastCheck = ev.timeStamp;
  55814. // ******** DOM READ ****************
  55815. var infiniteHeight = this._elementRef.nativeElement.scrollHeight;
  55816. if (!infiniteHeight) {
  55817. // if there is no height of this element then do nothing
  55818. return 3;
  55819. }
  55820. // ******** DOM READ ****************
  55821. var d = this._content.getContentDimensions();
  55822. var height = d.contentHeight;
  55823. var threshold = this._thrPc ? (height * this._thrPc) : this._thrPx;
  55824. // ******** DOM READS ABOVE / DOM WRITES BELOW ****************
  55825. var distanceFromInfinite;
  55826. if (this._position === POSITION_BOTTOM) {
  55827. distanceFromInfinite = d.scrollHeight - infiniteHeight - d.scrollTop - height - threshold;
  55828. }
  55829. else {
  55830. (void 0) /* assert */;
  55831. distanceFromInfinite = d.scrollTop - infiniteHeight - threshold;
  55832. }
  55833. if (distanceFromInfinite < 0) {
  55834. // ******** DOM WRITE ****************
  55835. this._dom.write(function () {
  55836. _this._zone.run(function () {
  55837. if (_this.state !== STATE_LOADING && _this.state !== STATE_DISABLED) {
  55838. _this.state = STATE_LOADING;
  55839. _this.ionInfinite.emit(_this);
  55840. }
  55841. });
  55842. });
  55843. return 5;
  55844. }
  55845. return 6;
  55846. };
  55847. /**
  55848. * Call `complete()` within the `infinite` output event handler when
  55849. * your async operation has completed. For example, the `loading`
  55850. * state is while the app is performing an asynchronous operation,
  55851. * such as receiving more data from an AJAX request to add more items
  55852. * to a data list. Once the data has been received and UI updated, you
  55853. * then call this method to signify that the loading has completed.
  55854. * This method will change the infinite scroll's state from `loading`
  55855. * to `enabled`.
  55856. */
  55857. InfiniteScroll.prototype.complete = function () {
  55858. var _this = this;
  55859. if (this.state !== STATE_LOADING) {
  55860. return;
  55861. }
  55862. if (this._position === POSITION_BOTTOM) {
  55863. this.state = STATE_ENABLED;
  55864. return;
  55865. }
  55866. (void 0) /* assert */;
  55867. /* New content is being added at the top, but the scrollTop position stays the same,
  55868. which causes a scroll jump visually. This algorithm makes sure to prevent this.
  55869. (Frame 1)
  55870. complete() is called, but the UI hasn't had time to update yet.
  55871. Save the current content dimensions.
  55872. Wait for the next frame using _dom.read, so the UI will be updated.
  55873. (Frame 2)
  55874. Read the new content dimensions.
  55875. Calculate the height difference and the new scroll position.
  55876. Delay the scroll position change until other possible dom reads are done using _dom.write to be performant.
  55877. (Still frame 2, if I'm correct)
  55878. Change the scroll position (= visually maintain the scroll position).
  55879. Change the state to re-enable the InfiniteScroll. This should be after changing the scroll position, or it could cause the InfiniteScroll to be triggered again immediately.
  55880. (Frame 3)
  55881. Done.
  55882. */
  55883. // ******** DOM READ ****************
  55884. // Save the current content dimensions before the UI updates
  55885. var prevDim = this._content.getContentDimensions();
  55886. // ******** DOM READ ****************
  55887. this._dom.read(function () {
  55888. // UI has updated, save the new content dimensions
  55889. var newDim = _this._content.getContentDimensions();
  55890. // New content was added on top, so the scroll position should be changed immediately to prevent it from jumping around
  55891. var newScrollTop = newDim.scrollHeight - (prevDim.scrollHeight - prevDim.scrollTop);
  55892. // ******** DOM WRITE ****************
  55893. _this._dom.write(function () {
  55894. _this._content.scrollTop = newScrollTop;
  55895. _this.state = STATE_ENABLED;
  55896. });
  55897. });
  55898. };
  55899. /**
  55900. * Pass a promise inside `waitFor()` within the `infinite` output event handler in order to
  55901. * change state of infiniteScroll to "complete"
  55902. */
  55903. InfiniteScroll.prototype.waitFor = function (action) {
  55904. var enable = this.complete.bind(this);
  55905. action.then(enable, enable);
  55906. };
  55907. /**
  55908. * Call `enable(false)` to disable the infinite scroll from actively
  55909. * trying to receive new data while scrolling. This method is useful
  55910. * when it is known that there is no more data that can be added, and
  55911. * the infinite scroll is no longer needed.
  55912. * @param {boolean} shouldEnable If the infinite scroll should be
  55913. * enabled or not. Setting to `false` will remove scroll event listeners
  55914. * and hide the display.
  55915. */
  55916. InfiniteScroll.prototype.enable = function (shouldEnable) {
  55917. this.state = (shouldEnable ? STATE_ENABLED : STATE_DISABLED);
  55918. this._setListeners(shouldEnable);
  55919. };
  55920. /**
  55921. * @hidden
  55922. */
  55923. InfiniteScroll.prototype._setListeners = function (shouldListen) {
  55924. if (this._init) {
  55925. if (shouldListen) {
  55926. if (!this._scLsn) {
  55927. this._scLsn = this._content.ionScroll.subscribe(this._onScroll.bind(this));
  55928. }
  55929. }
  55930. else {
  55931. this._scLsn && this._scLsn.unsubscribe();
  55932. this._scLsn = null;
  55933. }
  55934. }
  55935. };
  55936. /**
  55937. * @hidden
  55938. */
  55939. InfiniteScroll.prototype.ngAfterContentInit = function () {
  55940. this._init = true;
  55941. this._setListeners(this.state !== STATE_DISABLED);
  55942. if (this._position === POSITION_TOP) {
  55943. this._content.scrollDownOnLoad = true;
  55944. }
  55945. };
  55946. /**
  55947. * @hidden
  55948. */
  55949. InfiniteScroll.prototype.ngOnDestroy = function () {
  55950. this._setListeners(false);
  55951. };
  55952. InfiniteScroll.decorators = [
  55953. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  55954. selector: 'ion-infinite-scroll'
  55955. },] },
  55956. ];
  55957. /** @nocollapse */
  55958. InfiniteScroll.ctorParameters = function () { return [
  55959. { type: __WEBPACK_IMPORTED_MODULE_1__content_content__["a" /* Content */], },
  55960. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["M" /* NgZone */], },
  55961. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  55962. { type: __WEBPACK_IMPORTED_MODULE_2__platform_dom_controller__["a" /* DomController */], },
  55963. ]; };
  55964. InfiniteScroll.propDecorators = {
  55965. 'threshold': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  55966. 'enabled': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  55967. 'position': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  55968. 'ionInfinite': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  55969. };
  55970. return InfiniteScroll;
  55971. }());
  55972. var STATE_ENABLED = 'enabled';
  55973. var STATE_DISABLED = 'disabled';
  55974. var STATE_LOADING = 'loading';
  55975. var POSITION_TOP = 'top';
  55976. var POSITION_BOTTOM = 'bottom';
  55977. //# sourceMappingURL=infinite-scroll.js.map
  55978. /***/ }),
  55979. /* 70 */
  55980. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  55981. "use strict";
  55982. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ItemOptions; });
  55983. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  55984. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__platform_platform__ = __webpack_require__(3);
  55985. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_util__ = __webpack_require__(2);
  55986. /**
  55987. * @name ItemOptions
  55988. * @description
  55989. * The option buttons for an `ion-item-sliding`. These buttons can be placed either on the left or right side.
  55990. * You can combine the `(ionSwipe)` event plus the `expandable` directive to create a full swipe action for the item.
  55991. *
  55992. * @usage
  55993. *
  55994. * ```html
  55995. * <ion-item-sliding>
  55996. * <ion-item>
  55997. * Item 1
  55998. * </ion-item>
  55999. * <ion-item-options side="right" (ionSwipe)="saveItem(item)">
  56000. * <button ion-button expandable (click)="saveItem(item)">
  56001. * <ion-icon name="star"></ion-icon>
  56002. * </button>
  56003. * </ion-item-options>
  56004. * </ion-item-sliding>
  56005. *```
  56006. */
  56007. var ItemOptions = (function () {
  56008. function ItemOptions(_elementRef, _plt) {
  56009. this._elementRef = _elementRef;
  56010. this._plt = _plt;
  56011. /**
  56012. * @output {event} Emitted when the item has been fully swiped.
  56013. */
  56014. this.ionSwipe = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  56015. }
  56016. /**
  56017. * @hidden
  56018. */
  56019. ItemOptions.prototype.isRightSide = function () {
  56020. return Object(__WEBPACK_IMPORTED_MODULE_2__util_util__["m" /* isRightSide */])(this.side, this._plt.isRTL, true);
  56021. };
  56022. /**
  56023. * @hidden
  56024. */
  56025. ItemOptions.prototype.width = function () {
  56026. return this._elementRef.nativeElement.offsetWidth;
  56027. };
  56028. ItemOptions.decorators = [
  56029. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  56030. selector: 'ion-item-options',
  56031. },] },
  56032. ];
  56033. /** @nocollapse */
  56034. ItemOptions.ctorParameters = function () { return [
  56035. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  56036. { type: __WEBPACK_IMPORTED_MODULE_1__platform_platform__["a" /* Platform */], },
  56037. ]; };
  56038. ItemOptions.propDecorators = {
  56039. 'side': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  56040. 'ionSwipe': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  56041. };
  56042. return ItemOptions;
  56043. }());
  56044. //# sourceMappingURL=item-options.js.map
  56045. /***/ }),
  56046. /* 71 */
  56047. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  56048. "use strict";
  56049. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return List; });
  56050. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  56051. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__config_config__ = __webpack_require__(1);
  56052. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__platform_dom_controller__ = __webpack_require__(8);
  56053. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__gestures_gesture_controller__ = __webpack_require__(7);
  56054. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__ion__ = __webpack_require__(4);
  56055. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_util__ = __webpack_require__(2);
  56056. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__item_item_sliding_gesture__ = __webpack_require__(244);
  56057. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__platform_platform__ = __webpack_require__(3);
  56058. var __extends = (this && this.__extends) || (function () {
  56059. var extendStatics = Object.setPrototypeOf ||
  56060. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  56061. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  56062. return function (d, b) {
  56063. extendStatics(d, b);
  56064. function __() { this.constructor = d; }
  56065. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  56066. };
  56067. })();
  56068. /**
  56069. * The List is a widely used interface element in almost any mobile app,
  56070. * and can include content ranging from basic text all the way to
  56071. * buttons, toggles, icons, and thumbnails.
  56072. *
  56073. * Both the list, which contains items, and the list items themselves
  56074. * can be any HTML element.
  56075. *
  56076. * Using the List and Item components make it easy to support various
  56077. * interaction modes such as swipe to edit, drag to reorder, and
  56078. * removing items.
  56079. *
  56080. * @demo /docs/demos/src/list/
  56081. * @see {@link /docs/components#lists List Component Docs}
  56082. * @advanced
  56083. *
  56084. * Enable the sliding items.
  56085. *
  56086. * ```ts
  56087. * import { Component, ViewChild } from '@angular/core';
  56088. * import { List } from 'ionic-angular';
  56089. *
  56090. * @Component({...})
  56091. * export class MyClass {
  56092. * @ViewChild(List) list: List;
  56093. *
  56094. * constructor() { }
  56095. *
  56096. * stopSliding() {
  56097. * this.list.enableSlidingItems(false);
  56098. * }
  56099. * }
  56100. * ```
  56101. *
  56102. */
  56103. var List = (function (_super) {
  56104. __extends(List, _super);
  56105. function List(config, elementRef, renderer, _plt, _gestureCtrl, _domCtrl) {
  56106. var _this = _super.call(this, config, elementRef, renderer, 'list') || this;
  56107. _this._plt = _plt;
  56108. _this._gestureCtrl = _gestureCtrl;
  56109. _this._domCtrl = _domCtrl;
  56110. _this._enableSliding = true;
  56111. _this._containsSlidingItems = false;
  56112. return _this;
  56113. }
  56114. Object.defineProperty(List.prototype, "sliding", {
  56115. /**
  56116. * @input {boolean} If true, the sliding items will be enabled.
  56117. */
  56118. get: function () {
  56119. return this._enableSliding;
  56120. },
  56121. set: function (val) {
  56122. this._enableSliding = Object(__WEBPACK_IMPORTED_MODULE_5__util_util__["o" /* isTrueProperty */])(val);
  56123. this._updateSlidingState();
  56124. },
  56125. enumerable: true,
  56126. configurable: true
  56127. });
  56128. /**
  56129. * @hidden
  56130. */
  56131. List.prototype.containsSlidingItem = function (contains) {
  56132. this._containsSlidingItems = contains;
  56133. this._updateSlidingState();
  56134. };
  56135. List.prototype._updateSlidingState = function () {
  56136. var shouldSlide = this._enableSliding && this._containsSlidingItems;
  56137. if (!shouldSlide) {
  56138. this._slidingGesture && this._slidingGesture.destroy();
  56139. this._slidingGesture = null;
  56140. }
  56141. else if (!this._slidingGesture) {
  56142. (void 0) /* console.debug */;
  56143. this._slidingGesture = new __WEBPACK_IMPORTED_MODULE_6__item_item_sliding_gesture__["a" /* ItemSlidingGesture */](this._plt, this, this._gestureCtrl, this._domCtrl);
  56144. this._slidingGesture.listen();
  56145. }
  56146. };
  56147. /**
  56148. * Close any sliding items that are open.
  56149. */
  56150. List.prototype.closeSlidingItems = function () {
  56151. this._slidingGesture && this._slidingGesture.closeOpened();
  56152. };
  56153. /**
  56154. * @hidden
  56155. */
  56156. List.prototype.destroy = function () {
  56157. this._slidingGesture && this._slidingGesture.destroy();
  56158. };
  56159. List.decorators = [
  56160. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  56161. selector: 'ion-list',
  56162. },] },
  56163. ];
  56164. /** @nocollapse */
  56165. List.ctorParameters = function () { return [
  56166. { type: __WEBPACK_IMPORTED_MODULE_1__config_config__["a" /* Config */], },
  56167. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  56168. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  56169. { type: __WEBPACK_IMPORTED_MODULE_7__platform_platform__["a" /* Platform */], },
  56170. { type: __WEBPACK_IMPORTED_MODULE_3__gestures_gesture_controller__["l" /* GestureController */], },
  56171. { type: __WEBPACK_IMPORTED_MODULE_2__platform_dom_controller__["a" /* DomController */], },
  56172. ]; };
  56173. List.propDecorators = {
  56174. 'sliding': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  56175. };
  56176. return List;
  56177. }(__WEBPACK_IMPORTED_MODULE_4__ion__["a" /* Ion */]));
  56178. //# sourceMappingURL=list.js.map
  56179. /***/ }),
  56180. /* 72 */
  56181. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  56182. "use strict";
  56183. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ListHeader; });
  56184. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  56185. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__config_config__ = __webpack_require__(1);
  56186. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ion__ = __webpack_require__(4);
  56187. var __extends = (this && this.__extends) || (function () {
  56188. var extendStatics = Object.setPrototypeOf ||
  56189. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  56190. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  56191. return function (d, b) {
  56192. extendStatics(d, b);
  56193. function __() { this.constructor = d; }
  56194. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  56195. };
  56196. })();
  56197. /**
  56198. * @hidden
  56199. */
  56200. var ListHeader = (function (_super) {
  56201. __extends(ListHeader, _super);
  56202. function ListHeader(config, renderer, elementRef, _id) {
  56203. var _this = _super.call(this, config, elementRef, renderer, 'list-header') || this;
  56204. _this._id = _id;
  56205. return _this;
  56206. }
  56207. Object.defineProperty(ListHeader.prototype, "id", {
  56208. get: function () {
  56209. return this._id;
  56210. },
  56211. set: function (val) {
  56212. this._id = val;
  56213. this.setElementAttribute('id', val);
  56214. },
  56215. enumerable: true,
  56216. configurable: true
  56217. });
  56218. ListHeader.decorators = [
  56219. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  56220. selector: 'ion-list-header'
  56221. },] },
  56222. ];
  56223. /** @nocollapse */
  56224. ListHeader.ctorParameters = function () { return [
  56225. { type: __WEBPACK_IMPORTED_MODULE_1__config_config__["a" /* Config */], },
  56226. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  56227. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  56228. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["g" /* Attribute */], args: ['id',] },] },
  56229. ]; };
  56230. return ListHeader;
  56231. }(__WEBPACK_IMPORTED_MODULE_2__ion__["a" /* Ion */]));
  56232. //# sourceMappingURL=list-header.js.map
  56233. /***/ }),
  56234. /* 73 */
  56235. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  56236. "use strict";
  56237. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return LoadingCmp; });
  56238. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  56239. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__config_config__ = __webpack_require__(1);
  56240. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__gestures_gesture_controller__ = __webpack_require__(7);
  56241. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_util__ = __webpack_require__(2);
  56242. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__platform_key__ = __webpack_require__(18);
  56243. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__navigation_nav_params__ = __webpack_require__(13);
  56244. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__navigation_view_controller__ = __webpack_require__(5);
  56245. /**
  56246. * @hidden
  56247. */
  56248. var LoadingCmp = (function () {
  56249. function LoadingCmp(_viewCtrl, _config, _elementRef, gestureCtrl, params, renderer) {
  56250. this._viewCtrl = _viewCtrl;
  56251. this._config = _config;
  56252. (void 0) /* assert */;
  56253. this.gestureBlocker = gestureCtrl.createBlocker(__WEBPACK_IMPORTED_MODULE_2__gestures_gesture_controller__["a" /* BLOCK_ALL */]);
  56254. this.d = params.data;
  56255. renderer.setElementClass(_elementRef.nativeElement, "loading-" + _config.get('mode'), true);
  56256. if (this.d.cssClass) {
  56257. this.d.cssClass.split(' ').forEach(function (cssClass) {
  56258. // Make sure the class isn't whitespace, otherwise it throws exceptions
  56259. if (cssClass.trim() !== '')
  56260. renderer.setElementClass(_elementRef.nativeElement, cssClass, true);
  56261. });
  56262. }
  56263. this.id = (++loadingIds);
  56264. }
  56265. LoadingCmp.prototype.ngOnInit = function () {
  56266. // If no spinner was passed in loading options we need to fall back
  56267. // to the loadingSpinner in the app's config, then the mode spinner
  56268. if (Object(__WEBPACK_IMPORTED_MODULE_3__util_util__["p" /* isUndefined */])(this.d.spinner)) {
  56269. this.d.spinner = this._config.get('loadingSpinner', this._config.get('spinner', 'ios'));
  56270. }
  56271. // If the user passed hide to the spinner we don't want to show it
  56272. this.showSpinner = Object(__WEBPACK_IMPORTED_MODULE_3__util_util__["h" /* isDefined */])(this.d.spinner) && this.d.spinner !== 'hide';
  56273. };
  56274. LoadingCmp.prototype.ionViewWillEnter = function () {
  56275. this.gestureBlocker.block();
  56276. };
  56277. LoadingCmp.prototype.ionViewDidLeave = function () {
  56278. this.gestureBlocker.unblock();
  56279. };
  56280. LoadingCmp.prototype.ionViewDidEnter = function () {
  56281. var _this = this;
  56282. // If there is a duration, dismiss after that amount of time
  56283. if (this.d && this.d.duration) {
  56284. this.durationTimeout = setTimeout(function () { return _this.dismiss('backdrop'); }, this.d.duration);
  56285. }
  56286. };
  56287. LoadingCmp.prototype.keyUp = function (ev) {
  56288. if (this._viewCtrl.isLast() && ev.keyCode === __WEBPACK_IMPORTED_MODULE_4__platform_key__["c" /* KEY_ESCAPE */]) {
  56289. this.bdClick();
  56290. }
  56291. };
  56292. LoadingCmp.prototype.bdClick = function () {
  56293. if (this.d.enableBackdropDismiss) {
  56294. this.dismiss('backdrop');
  56295. }
  56296. };
  56297. LoadingCmp.prototype.dismiss = function (role) {
  56298. if (this.durationTimeout) {
  56299. clearTimeout(this.durationTimeout);
  56300. }
  56301. return this._viewCtrl.dismiss(null, role);
  56302. };
  56303. LoadingCmp.prototype.ngOnDestroy = function () {
  56304. (void 0) /* assert */;
  56305. this.gestureBlocker.destroy();
  56306. };
  56307. LoadingCmp.decorators = [
  56308. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  56309. selector: 'ion-loading',
  56310. template: '<ion-backdrop [hidden]="!d.showBackdrop" (click)="bdClick()" [class.backdrop-no-tappable]="!d.enableBackdropDismiss"></ion-backdrop>' +
  56311. '<div class="loading-wrapper">' +
  56312. '<div *ngIf="showSpinner" class="loading-spinner">' +
  56313. '<ion-spinner [name]="d.spinner"></ion-spinner>' +
  56314. '</div>' +
  56315. '<div *ngIf="d.content" [innerHTML]="d.content" class="loading-content"></div>' +
  56316. '</div>',
  56317. host: {
  56318. 'role': 'dialog'
  56319. },
  56320. encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_11" /* ViewEncapsulation */].None,
  56321. },] },
  56322. ];
  56323. /** @nocollapse */
  56324. LoadingCmp.ctorParameters = function () { return [
  56325. { type: __WEBPACK_IMPORTED_MODULE_6__navigation_view_controller__["a" /* ViewController */], },
  56326. { type: __WEBPACK_IMPORTED_MODULE_1__config_config__["a" /* Config */], },
  56327. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  56328. { type: __WEBPACK_IMPORTED_MODULE_2__gestures_gesture_controller__["l" /* GestureController */], },
  56329. { type: __WEBPACK_IMPORTED_MODULE_5__navigation_nav_params__["a" /* NavParams */], },
  56330. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  56331. ]; };
  56332. LoadingCmp.propDecorators = {
  56333. 'keyUp': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["y" /* HostListener */], args: ['body:keyup', ['$event'],] },],
  56334. };
  56335. return LoadingCmp;
  56336. }());
  56337. var loadingIds = -1;
  56338. //# sourceMappingURL=loading-component.js.map
  56339. /***/ }),
  56340. /* 74 */
  56341. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  56342. "use strict";
  56343. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Nav; });
  56344. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  56345. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__app_app__ = __webpack_require__(6);
  56346. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__config_config__ = __webpack_require__(1);
  56347. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__navigation_deep_linker__ = __webpack_require__(14);
  56348. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__platform_dom_controller__ = __webpack_require__(8);
  56349. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__gestures_gesture_controller__ = __webpack_require__(7);
  56350. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__navigation_nav_controller__ = __webpack_require__(22);
  56351. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__navigation_nav_controller_base__ = __webpack_require__(42);
  56352. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__platform_platform__ = __webpack_require__(3);
  56353. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__transitions_transition_controller__ = __webpack_require__(44);
  56354. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__navigation_view_controller__ = __webpack_require__(5);
  56355. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__split_pane_split_pane__ = __webpack_require__(39);
  56356. var __extends = (this && this.__extends) || (function () {
  56357. var extendStatics = Object.setPrototypeOf ||
  56358. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  56359. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  56360. return function (d, b) {
  56361. extendStatics(d, b);
  56362. function __() { this.constructor = d; }
  56363. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  56364. };
  56365. })();
  56366. /**
  56367. * @name Nav
  56368. * @description
  56369. *
  56370. * `ion-nav` is the declarative component for a [NavController](../../../navigation/NavController/).
  56371. *
  56372. * For more information on using nav controllers like Nav or [Tab](../../Tabs/Tab/),
  56373. * take a look at the [NavController API Docs](../../../navigation/NavController/).
  56374. *
  56375. *
  56376. * @usage
  56377. * You must set a root page to be loaded initially by any Nav you create, using
  56378. * the 'root' property:
  56379. *
  56380. * ```ts
  56381. * import { Component } from '@angular/core';
  56382. * import { GettingStartedPage } from './getting-started';
  56383. *
  56384. * @Component({
  56385. * template: `<ion-nav [root]="root"></ion-nav>`
  56386. * })
  56387. * class MyApp {
  56388. * root = GettingStartedPage;
  56389. *
  56390. * constructor(){
  56391. * }
  56392. * }
  56393. * ```
  56394. *
  56395. * @demo /docs/demos/src/navigation/
  56396. * @see {@link /docs/components#navigation Navigation Component Docs}
  56397. */
  56398. var Nav = (function (_super) {
  56399. __extends(Nav, _super);
  56400. function Nav(viewCtrl, parent, app, config, plt, elementRef, zone, renderer, cfr, gestureCtrl, transCtrl, linker, domCtrl, errHandler) {
  56401. var _this = _super.call(this, parent, app, config, plt, elementRef, zone, renderer, cfr, gestureCtrl, transCtrl, linker, domCtrl, errHandler) || this;
  56402. _this._hasInit = false;
  56403. if (viewCtrl) {
  56404. // an ion-nav can also act as an ion-page within a parent ion-nav
  56405. // this would happen when an ion-nav nests a child ion-nav.
  56406. viewCtrl._setContent(_this);
  56407. }
  56408. if (parent) {
  56409. // this Nav has a parent Nav
  56410. parent.registerChildNav(_this);
  56411. }
  56412. else if (viewCtrl && viewCtrl.getNav()) {
  56413. // this Nav was opened from a modal
  56414. _this.parent = viewCtrl.getNav();
  56415. _this.parent.registerChildNav(_this);
  56416. }
  56417. else if (app && !app.getRootNavById(_this.id)) {
  56418. // a root nav has not been registered yet with the app
  56419. // this is the root navcontroller for the entire app
  56420. app.registerRootNav(_this);
  56421. }
  56422. return _this;
  56423. }
  56424. Object.defineProperty(Nav.prototype, "_vp", {
  56425. /**
  56426. * @hidden
  56427. */
  56428. set: function (val) {
  56429. this.setViewport(val);
  56430. },
  56431. enumerable: true,
  56432. configurable: true
  56433. });
  56434. Nav.prototype.ngAfterViewInit = function () {
  56435. var _this = this;
  56436. this._hasInit = true;
  56437. var segment = this._linker.getSegmentByNavIdOrName(this.id, this.name);
  56438. if (segment && (segment.component || segment.loadChildren)) {
  56439. return this._linker.initViews(segment).then(function (views) {
  56440. return _this.setPages(views, null, null);
  56441. });
  56442. }
  56443. else if (this._root) {
  56444. // no segment match, so use the root property but don't set the url I guess
  56445. var setUrl = segment ? false : true;
  56446. return this.push(this._root, this.rootParams, {
  56447. isNavRoot: (this._app.getRootNavById(this.id) === this),
  56448. updateUrl: setUrl
  56449. }, null);
  56450. }
  56451. };
  56452. Object.defineProperty(Nav.prototype, "root", {
  56453. /**
  56454. * @input {Page} The Page component to load as the root page within this nav.
  56455. */
  56456. get: function () {
  56457. return this._root;
  56458. },
  56459. set: function (page) {
  56460. this._root = page;
  56461. if (this._hasInit) {
  56462. this.setRoot(page);
  56463. }
  56464. },
  56465. enumerable: true,
  56466. configurable: true
  56467. });
  56468. /**
  56469. * @hidden
  56470. */
  56471. Nav.prototype.ngOnDestroy = function () {
  56472. this.destroy();
  56473. };
  56474. Nav.prototype.initPane = function () {
  56475. var isMain = this._elementRef.nativeElement.hasAttribute('main');
  56476. return isMain;
  56477. };
  56478. Nav.prototype.paneChanged = function (isPane) {
  56479. if (isPane) {
  56480. this.resize();
  56481. }
  56482. };
  56483. Nav.prototype.goToRoot = function (opts) {
  56484. return this.setRoot(this._root, this.rootParams, opts, null);
  56485. };
  56486. /*
  56487. * @private
  56488. */
  56489. Nav.prototype.getType = function () {
  56490. return 'nav';
  56491. };
  56492. /*
  56493. * @private
  56494. */
  56495. Nav.prototype.getSecondaryIdentifier = function () {
  56496. return null;
  56497. };
  56498. Nav.decorators = [
  56499. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  56500. selector: 'ion-nav',
  56501. template: '<div #viewport nav-viewport></div>' +
  56502. '<div class="nav-decor"></div>',
  56503. encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_11" /* ViewEncapsulation */].None,
  56504. providers: [{ provide: __WEBPACK_IMPORTED_MODULE_11__split_pane_split_pane__["a" /* RootNode */], useExisting: Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_14" /* forwardRef */])(function () { return Nav; }) }]
  56505. },] },
  56506. ];
  56507. /** @nocollapse */
  56508. Nav.ctorParameters = function () { return [
  56509. { type: __WEBPACK_IMPORTED_MODULE_10__navigation_view_controller__["a" /* ViewController */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  56510. { type: __WEBPACK_IMPORTED_MODULE_6__navigation_nav_controller__["a" /* NavController */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  56511. { type: __WEBPACK_IMPORTED_MODULE_1__app_app__["a" /* App */], },
  56512. { type: __WEBPACK_IMPORTED_MODULE_2__config_config__["a" /* Config */], },
  56513. { type: __WEBPACK_IMPORTED_MODULE_8__platform_platform__["a" /* Platform */], },
  56514. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  56515. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["M" /* NgZone */], },
  56516. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  56517. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["o" /* ComponentFactoryResolver */], },
  56518. { type: __WEBPACK_IMPORTED_MODULE_5__gestures_gesture_controller__["l" /* GestureController */], },
  56519. { type: __WEBPACK_IMPORTED_MODULE_9__transitions_transition_controller__["a" /* TransitionController */], },
  56520. { type: __WEBPACK_IMPORTED_MODULE_3__navigation_deep_linker__["a" /* DeepLinker */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  56521. { type: __WEBPACK_IMPORTED_MODULE_4__platform_dom_controller__["a" /* DomController */], },
  56522. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["u" /* ErrorHandler */], },
  56523. ]; };
  56524. Nav.propDecorators = {
  56525. '_vp': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_8" /* ViewChild */], args: ['viewport', { read: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_10" /* ViewContainerRef */] },] },],
  56526. 'root': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  56527. 'rootParams': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  56528. 'name': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  56529. };
  56530. return Nav;
  56531. }(__WEBPACK_IMPORTED_MODULE_7__navigation_nav_controller_base__["a" /* NavControllerBase */]));
  56532. //# sourceMappingURL=nav.js.map
  56533. /***/ }),
  56534. /* 75 */
  56535. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  56536. "use strict";
  56537. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ModalCmp; });
  56538. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  56539. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__platform_key__ = __webpack_require__(18);
  56540. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__navigation_nav_params__ = __webpack_require__(13);
  56541. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__navigation_view_controller__ = __webpack_require__(5);
  56542. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__gestures_gesture_controller__ = __webpack_require__(7);
  56543. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_module_loader__ = __webpack_require__(76);
  56544. /**
  56545. * @hidden
  56546. */
  56547. var ModalCmp = (function () {
  56548. function ModalCmp(_cfr, _renderer, _elementRef, _navParams, _viewCtrl, gestureCtrl, moduleLoader) {
  56549. this._cfr = _cfr;
  56550. this._renderer = _renderer;
  56551. this._elementRef = _elementRef;
  56552. this._navParams = _navParams;
  56553. this._viewCtrl = _viewCtrl;
  56554. this.moduleLoader = moduleLoader;
  56555. var opts = _navParams.get('opts');
  56556. (void 0) /* assert */;
  56557. this._gestureBlocker = gestureCtrl.createBlocker({
  56558. disable: [__WEBPACK_IMPORTED_MODULE_4__gestures_gesture_controller__["d" /* GESTURE_MENU_SWIPE */], __WEBPACK_IMPORTED_MODULE_4__gestures_gesture_controller__["b" /* GESTURE_GO_BACK_SWIPE */]]
  56559. });
  56560. this._bdDismiss = opts.enableBackdropDismiss;
  56561. if (opts.cssClass) {
  56562. opts.cssClass.split(' ').forEach(function (cssClass) {
  56563. // Make sure the class isn't whitespace, otherwise it throws exceptions
  56564. if (cssClass.trim() !== '')
  56565. _renderer.setElementClass(_elementRef.nativeElement, cssClass, true);
  56566. });
  56567. }
  56568. }
  56569. ModalCmp.prototype.ionViewPreLoad = function () {
  56570. var component = this._navParams.data.component;
  56571. if (!component) {
  56572. console.warn('modal\'s page was not defined');
  56573. return;
  56574. }
  56575. var cfr = this.moduleLoader.getComponentFactoryResolver(component);
  56576. if (!cfr) {
  56577. cfr = this._cfr;
  56578. }
  56579. var componentFactory = cfr.resolveComponentFactory(component);
  56580. // ******** DOM WRITE ****************
  56581. var componentRef = this._viewport.createComponent(componentFactory, this._viewport.length, this._viewport.parentInjector, []);
  56582. this._setCssClass(componentRef, 'ion-page');
  56583. this._setCssClass(componentRef, 'show-page');
  56584. // Change the viewcontroller's instance to point the user provided page
  56585. // Lifecycle events will be sent to the new instance, instead of the modal's component
  56586. // we need to manually subscribe to them
  56587. this._viewCtrl._setInstance(componentRef.instance);
  56588. this._viewCtrl.willEnter.subscribe(this._viewWillEnter.bind(this));
  56589. this._viewCtrl.didLeave.subscribe(this._viewDidLeave.bind(this));
  56590. this._enabled = true;
  56591. };
  56592. ModalCmp.prototype._viewWillEnter = function () {
  56593. this._gestureBlocker.block();
  56594. };
  56595. ModalCmp.prototype._viewDidLeave = function () {
  56596. this._gestureBlocker.unblock();
  56597. };
  56598. ModalCmp.prototype._setCssClass = function (componentRef, className) {
  56599. this._renderer.setElementClass(componentRef.location.nativeElement, className, true);
  56600. };
  56601. ModalCmp.prototype._bdClick = function () {
  56602. if (this._enabled && this._bdDismiss) {
  56603. var opts = {
  56604. minClickBlockDuration: 400
  56605. };
  56606. return this._viewCtrl.dismiss(null, 'backdrop', opts);
  56607. }
  56608. };
  56609. ModalCmp.prototype._keyUp = function (ev) {
  56610. if (this._enabled && this._viewCtrl.isLast() && ev.keyCode === __WEBPACK_IMPORTED_MODULE_1__platform_key__["c" /* KEY_ESCAPE */]) {
  56611. this._bdClick();
  56612. }
  56613. };
  56614. ModalCmp.prototype.ngOnDestroy = function () {
  56615. (void 0) /* assert */;
  56616. this._gestureBlocker.destroy();
  56617. };
  56618. ModalCmp.decorators = [
  56619. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  56620. selector: 'ion-modal',
  56621. template: '<ion-backdrop (click)="_bdClick()" [class.backdrop-no-tappable]="!_bdDismiss"></ion-backdrop>' +
  56622. '<div class="modal-wrapper">' +
  56623. '<div #viewport nav-viewport></div>' +
  56624. '</div>'
  56625. },] },
  56626. ];
  56627. /** @nocollapse */
  56628. ModalCmp.ctorParameters = function () { return [
  56629. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["o" /* ComponentFactoryResolver */], },
  56630. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  56631. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  56632. { type: __WEBPACK_IMPORTED_MODULE_2__navigation_nav_params__["a" /* NavParams */], },
  56633. { type: __WEBPACK_IMPORTED_MODULE_3__navigation_view_controller__["a" /* ViewController */], },
  56634. { type: __WEBPACK_IMPORTED_MODULE_4__gestures_gesture_controller__["l" /* GestureController */], },
  56635. { type: __WEBPACK_IMPORTED_MODULE_5__util_module_loader__["b" /* ModuleLoader */], },
  56636. ]; };
  56637. ModalCmp.propDecorators = {
  56638. '_viewport': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_8" /* ViewChild */], args: ['viewport', { read: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_10" /* ViewContainerRef */] },] },],
  56639. '_keyUp': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["y" /* HostListener */], args: ['body:keyup', ['$event'],] },],
  56640. };
  56641. return ModalCmp;
  56642. }());
  56643. //# sourceMappingURL=modal-component.js.map
  56644. /***/ }),
  56645. /* 76 */
  56646. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  56647. "use strict";
  56648. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return LAZY_LOADED_TOKEN; });
  56649. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return ModuleLoader; });
  56650. /* harmony export (immutable) */ __webpack_exports__["c"] = provideModuleLoader;
  56651. /* unused harmony export setupPreloadingImplementation */
  56652. /* harmony export (immutable) */ __webpack_exports__["d"] = setupPreloading;
  56653. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  56654. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__ng_module_loader__ = __webpack_require__(155);
  56655. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util__ = __webpack_require__(2);
  56656. var LAZY_LOADED_TOKEN = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["B" /* InjectionToken */]('LZYCMP');
  56657. /**
  56658. * @hidden
  56659. */
  56660. var ModuleLoader = (function () {
  56661. function ModuleLoader(_ngModuleLoader, _injector) {
  56662. this._ngModuleLoader = _ngModuleLoader;
  56663. this._injector = _injector;
  56664. /** @internal */
  56665. this._cfrMap = new Map();
  56666. this._promiseMap = new Map();
  56667. }
  56668. ModuleLoader.prototype.load = function (modulePath) {
  56669. var _this = this;
  56670. (void 0) /* console.time */;
  56671. var splitString = modulePath.split(SPLITTER);
  56672. var promise = this._promiseMap.get(modulePath);
  56673. if (!promise) {
  56674. promise = this._ngModuleLoader.load(splitString[0], splitString[1]);
  56675. this._promiseMap.set(modulePath, promise);
  56676. }
  56677. return promise.then(function (loadedModule) {
  56678. (void 0) /* console.timeEnd */;
  56679. var ref = loadedModule.create(_this._injector);
  56680. var component = ref.injector.get(LAZY_LOADED_TOKEN);
  56681. _this._cfrMap.set(component, ref.componentFactoryResolver);
  56682. return {
  56683. componentFactoryResolver: ref.componentFactoryResolver,
  56684. component: component
  56685. };
  56686. });
  56687. };
  56688. ModuleLoader.prototype.getComponentFactoryResolver = function (component) {
  56689. return this._cfrMap.get(component);
  56690. };
  56691. ModuleLoader.decorators = [
  56692. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */] },
  56693. ];
  56694. /** @nocollapse */
  56695. ModuleLoader.ctorParameters = function () { return [
  56696. { type: __WEBPACK_IMPORTED_MODULE_1__ng_module_loader__["a" /* NgModuleLoader */], },
  56697. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["C" /* Injector */], },
  56698. ]; };
  56699. return ModuleLoader;
  56700. }());
  56701. var SPLITTER = '#';
  56702. /**
  56703. * @hidden
  56704. */
  56705. function provideModuleLoader(ngModuleLoader, injector) {
  56706. return new ModuleLoader(ngModuleLoader, injector);
  56707. }
  56708. /**
  56709. * @hidden
  56710. */
  56711. function setupPreloadingImplementation(config, deepLinkConfig, moduleLoader) {
  56712. if (!deepLinkConfig || !deepLinkConfig.links || !config.getBoolean('preloadModules')) {
  56713. return Promise.resolve();
  56714. }
  56715. var linksToLoad = deepLinkConfig.links.filter(function (link) { return !!link.loadChildren && link.priority !== 'off'; });
  56716. // Load the high priority modules first
  56717. var highPriorityPromises = linksToLoad
  56718. .filter(function (link) { return link.priority === 'high'; })
  56719. .map(function (link) { return moduleLoader.load(link.loadChildren); });
  56720. return Promise.all(highPriorityPromises).then(function () {
  56721. // Load the low priority modules after the high priority are done
  56722. var lowPriorityPromises = linksToLoad
  56723. .filter(function (link) { return link.priority === 'low'; })
  56724. .map(function (link) { return moduleLoader.load(link.loadChildren); });
  56725. return Promise.all(lowPriorityPromises);
  56726. }).catch(function (err) {
  56727. console.error(err.message);
  56728. });
  56729. }
  56730. /**
  56731. * @hidden
  56732. */
  56733. function setupPreloading(config, deepLinkConfig, moduleLoader, ngZone) {
  56734. return function () {
  56735. Object(__WEBPACK_IMPORTED_MODULE_2__util__["s" /* requestIonicCallback */])(function () {
  56736. ngZone.runOutsideAngular(function () {
  56737. setupPreloadingImplementation(config, deepLinkConfig, moduleLoader);
  56738. });
  56739. });
  56740. };
  56741. }
  56742. //# sourceMappingURL=module-loader.js.map
  56743. /***/ }),
  56744. /* 77 */
  56745. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  56746. "use strict";
  56747. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return NavPop; });
  56748. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  56749. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__navigation_nav_controller__ = __webpack_require__(22);
  56750. /**
  56751. * @name NavPop
  56752. * @description
  56753. * Directive to declaratively pop the current page off from the
  56754. * navigation stack.
  56755. *
  56756. * @usage
  56757. * ```html
  56758. * <ion-content>
  56759. *
  56760. * <button ion-button navPop>Go Back</button>
  56761. *
  56762. * </ion-content>
  56763. * ```
  56764. *
  56765. * Similar to {@link /docs/api/components/nav/NavPush/ `NavPush` }
  56766. * @demo /docs/demos/src/navigation/
  56767. * @see {@link /docs/components#navigation Navigation Component Docs}
  56768. * @see {@link ../NavPush NavPush API Docs}
  56769. */
  56770. var NavPop = (function () {
  56771. function NavPop(_nav) {
  56772. this._nav = _nav;
  56773. if (!_nav) {
  56774. console.error('navPop must be within a NavController');
  56775. }
  56776. }
  56777. /**
  56778. * @hidden
  56779. */
  56780. NavPop.prototype.onClick = function () {
  56781. // If no target, or if target is _self, prevent default browser behavior
  56782. if (this._nav) {
  56783. this._nav.pop().catch(function () {
  56784. (void 0) /* console.debug */;
  56785. });
  56786. return false;
  56787. }
  56788. return true;
  56789. };
  56790. NavPop.decorators = [
  56791. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  56792. selector: '[navPop]'
  56793. },] },
  56794. ];
  56795. /** @nocollapse */
  56796. NavPop.ctorParameters = function () { return [
  56797. { type: __WEBPACK_IMPORTED_MODULE_1__navigation_nav_controller__["a" /* NavController */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  56798. ]; };
  56799. NavPop.propDecorators = {
  56800. 'onClick': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["y" /* HostListener */], args: ['click',] },],
  56801. };
  56802. return NavPop;
  56803. }());
  56804. //# sourceMappingURL=nav-pop.js.map
  56805. /***/ }),
  56806. /* 78 */
  56807. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  56808. "use strict";
  56809. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return NavPush; });
  56810. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  56811. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__navigation_nav_controller__ = __webpack_require__(22);
  56812. /**
  56813. * @name NavPush
  56814. * @description
  56815. * Directive to declaratively push a new page to the current nav
  56816. * stack.
  56817. *
  56818. * @usage
  56819. * ```html
  56820. * <button ion-button [navPush]="pushPage"></button>
  56821. * ```
  56822. *
  56823. * To specify parameters you can use array syntax or the `navParams`
  56824. * property:
  56825. *
  56826. * ```html
  56827. * <button ion-button [navPush]="pushPage" [navParams]="params">Go</button>
  56828. * ```
  56829. *
  56830. * Where `pushPage` and `params` are specified in your component,
  56831. * and `pushPage` contains a reference to a
  56832. * component you would like to push:
  56833. *
  56834. * ```ts
  56835. * import { LoginPage } from './login';
  56836. *
  56837. * @Component({
  56838. * template: `<button ion-button [navPush]="pushPage" [navParams]="params">Go</button>`
  56839. * })
  56840. * class MyPage {
  56841. * pushPage: any;
  56842. * params: Object;
  56843. * constructor(){
  56844. * this.pushPage = LoginPage;
  56845. * this.params = { id: 42 };
  56846. * }
  56847. * }
  56848. * ```
  56849. *
  56850. * @demo /docs/demos/src/navigation/
  56851. * @see {@link /docs/components#navigation Navigation Component Docs}
  56852. * @see {@link ../NavPop NavPop API Docs}
  56853. *
  56854. */
  56855. var NavPush = (function () {
  56856. function NavPush(_nav) {
  56857. this._nav = _nav;
  56858. if (!_nav) {
  56859. console.error('navPush must be within a NavController');
  56860. }
  56861. }
  56862. /**
  56863. * @hidden
  56864. */
  56865. NavPush.prototype.onClick = function () {
  56866. if (this._nav && this.navPush) {
  56867. this._nav.push(this.navPush, this.navParams);
  56868. return false;
  56869. }
  56870. return true;
  56871. };
  56872. NavPush.decorators = [
  56873. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  56874. selector: '[navPush]'
  56875. },] },
  56876. ];
  56877. /** @nocollapse */
  56878. NavPush.ctorParameters = function () { return [
  56879. { type: __WEBPACK_IMPORTED_MODULE_1__navigation_nav_controller__["a" /* NavController */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  56880. ]; };
  56881. NavPush.propDecorators = {
  56882. 'navPush': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  56883. 'navParams': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  56884. 'onClick': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["y" /* HostListener */], args: ['click',] },],
  56885. };
  56886. return NavPush;
  56887. }());
  56888. //# sourceMappingURL=nav-push.js.map
  56889. /***/ }),
  56890. /* 79 */
  56891. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  56892. "use strict";
  56893. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Option; });
  56894. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  56895. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_util__ = __webpack_require__(2);
  56896. /**
  56897. * @name Option
  56898. * @description
  56899. * `ion-option` is a child component of `ion-select`. Similar to the native option element, `ion-option` can take a value and a selected property.
  56900. *
  56901. * @demo /docs/demos/src/select/
  56902. */
  56903. var Option = (function () {
  56904. function Option(_elementRef) {
  56905. this._elementRef = _elementRef;
  56906. this._selected = false;
  56907. this._disabled = false;
  56908. /**
  56909. * @output {any} Event to evaluate when option is selected.
  56910. */
  56911. this.ionSelect = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  56912. }
  56913. Object.defineProperty(Option.prototype, "disabled", {
  56914. /**
  56915. * @input {boolean} If true, the user cannot interact with this element.
  56916. */
  56917. get: function () {
  56918. return this._disabled;
  56919. },
  56920. set: function (val) {
  56921. this._disabled = Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["o" /* isTrueProperty */])(val);
  56922. },
  56923. enumerable: true,
  56924. configurable: true
  56925. });
  56926. Object.defineProperty(Option.prototype, "selected", {
  56927. /**
  56928. * @input {boolean} If true, the element is selected.
  56929. */
  56930. get: function () {
  56931. return this._selected;
  56932. },
  56933. set: function (val) {
  56934. this._selected = Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["o" /* isTrueProperty */])(val);
  56935. },
  56936. enumerable: true,
  56937. configurable: true
  56938. });
  56939. Object.defineProperty(Option.prototype, "value", {
  56940. /**
  56941. * @input {any} The value of the option.
  56942. */
  56943. get: function () {
  56944. if (Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["l" /* isPresent */])(this._value)) {
  56945. return this._value;
  56946. }
  56947. return this.text;
  56948. },
  56949. set: function (val) {
  56950. this._value = val;
  56951. },
  56952. enumerable: true,
  56953. configurable: true
  56954. });
  56955. Object.defineProperty(Option.prototype, "text", {
  56956. /**
  56957. * @hidden
  56958. */
  56959. get: function () {
  56960. return this._elementRef.nativeElement.textContent;
  56961. },
  56962. enumerable: true,
  56963. configurable: true
  56964. });
  56965. Option.decorators = [
  56966. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  56967. selector: 'ion-option'
  56968. },] },
  56969. ];
  56970. /** @nocollapse */
  56971. Option.ctorParameters = function () { return [
  56972. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  56973. ]; };
  56974. Option.propDecorators = {
  56975. 'disabled': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  56976. 'selected': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  56977. 'value': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  56978. 'ionSelect': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  56979. };
  56980. return Option;
  56981. }());
  56982. //# sourceMappingURL=option.js.map
  56983. /***/ }),
  56984. /* 80 */
  56985. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  56986. "use strict";
  56987. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Popover; });
  56988. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__navigation_overlay_proxy__ = __webpack_require__(154);
  56989. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__popover_impl__ = __webpack_require__(255);
  56990. var __extends = (this && this.__extends) || (function () {
  56991. var extendStatics = Object.setPrototypeOf ||
  56992. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  56993. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  56994. return function (d, b) {
  56995. extendStatics(d, b);
  56996. function __() { this.constructor = d; }
  56997. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  56998. };
  56999. })();
  57000. /**
  57001. * @hidden
  57002. */
  57003. var Popover = (function (_super) {
  57004. __extends(Popover, _super);
  57005. function Popover(app, component, data, opts, config, deepLinker) {
  57006. if (opts === void 0) { opts = {}; }
  57007. var _this = _super.call(this, app, component, config, deepLinker) || this;
  57008. _this.data = data;
  57009. _this.opts = opts;
  57010. _this.isOverlay = true;
  57011. return _this;
  57012. }
  57013. Popover.prototype.getImplementation = function () {
  57014. return new __WEBPACK_IMPORTED_MODULE_1__popover_impl__["a" /* PopoverImpl */](this._app, this._component, this.data, this.opts, this._config);
  57015. };
  57016. return Popover;
  57017. }(__WEBPACK_IMPORTED_MODULE_0__navigation_overlay_proxy__["a" /* OverlayProxy */]));
  57018. //# sourceMappingURL=popover.js.map
  57019. /***/ }),
  57020. /* 81 */
  57021. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  57022. "use strict";
  57023. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PopoverCmp; });
  57024. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  57025. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__config_config__ = __webpack_require__(1);
  57026. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__platform_key__ = __webpack_require__(18);
  57027. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__navigation_nav_params__ = __webpack_require__(13);
  57028. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__navigation_view_controller__ = __webpack_require__(5);
  57029. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__gestures_gesture_controller__ = __webpack_require__(7);
  57030. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__util_module_loader__ = __webpack_require__(76);
  57031. /**
  57032. * @hidden
  57033. */
  57034. var PopoverCmp = (function () {
  57035. function PopoverCmp(_cfr, _elementRef, _renderer, _config, _navParams, _viewCtrl, gestureCtrl, moduleLoader) {
  57036. this._cfr = _cfr;
  57037. this._elementRef = _elementRef;
  57038. this._renderer = _renderer;
  57039. this._config = _config;
  57040. this._navParams = _navParams;
  57041. this._viewCtrl = _viewCtrl;
  57042. this.moduleLoader = moduleLoader;
  57043. this._gestureBlocker = gestureCtrl.createBlocker(__WEBPACK_IMPORTED_MODULE_5__gestures_gesture_controller__["a" /* BLOCK_ALL */]);
  57044. this.d = _navParams.data.opts;
  57045. _renderer.setElementClass(_elementRef.nativeElement, "popover-" + _config.get('mode'), true);
  57046. if (this.d.cssClass) {
  57047. this.d.cssClass.split(' ').forEach(function (cssClass) {
  57048. // Make sure the class isn't whitespace, otherwise it throws exceptions
  57049. if (cssClass.trim() !== '')
  57050. _renderer.setElementClass(_elementRef.nativeElement, cssClass, true);
  57051. });
  57052. }
  57053. this.id = (++popoverIds);
  57054. }
  57055. PopoverCmp.prototype.ionViewPreLoad = function () {
  57056. this._load(this._navParams.data.component);
  57057. };
  57058. PopoverCmp.prototype._load = function (component) {
  57059. if (component) {
  57060. var cfr = this.moduleLoader.getComponentFactoryResolver(component);
  57061. if (!cfr) {
  57062. cfr = this._cfr;
  57063. }
  57064. var componentFactory = cfr.resolveComponentFactory(component);
  57065. // ******** DOM WRITE ****************
  57066. var componentRef = this._viewport.createComponent(componentFactory, this._viewport.length, this._viewport.parentInjector, []);
  57067. this._viewCtrl._setInstance(componentRef.instance);
  57068. this._enabled = true;
  57069. // Subscribe to events in order to block gestures
  57070. // TODO, should we unsubscribe? memory leak?
  57071. this._viewCtrl.willEnter.subscribe(this._viewWillEnter.bind(this));
  57072. this._viewCtrl.didLeave.subscribe(this._viewDidLeave.bind(this));
  57073. }
  57074. };
  57075. PopoverCmp.prototype._viewWillEnter = function () {
  57076. this._gestureBlocker.block();
  57077. };
  57078. PopoverCmp.prototype._viewDidLeave = function () {
  57079. this._gestureBlocker.unblock();
  57080. };
  57081. PopoverCmp.prototype._setCssClass = function (componentRef, className) {
  57082. this._renderer.setElementClass(componentRef.location.nativeElement, className, true);
  57083. };
  57084. PopoverCmp.prototype._bdClick = function () {
  57085. if (this._enabled && this.d.enableBackdropDismiss) {
  57086. return this._viewCtrl.dismiss(null, 'backdrop');
  57087. }
  57088. };
  57089. PopoverCmp.prototype._keyUp = function (ev) {
  57090. if (this._enabled && ev.keyCode === __WEBPACK_IMPORTED_MODULE_2__platform_key__["c" /* KEY_ESCAPE */] && this._viewCtrl.isLast()) {
  57091. this._bdClick();
  57092. }
  57093. };
  57094. PopoverCmp.prototype.ngOnDestroy = function () {
  57095. (void 0) /* assert */;
  57096. this._gestureBlocker.destroy();
  57097. };
  57098. PopoverCmp.decorators = [
  57099. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  57100. selector: 'ion-popover',
  57101. template: '<ion-backdrop (click)="_bdClick()" [hidden]="!d.showBackdrop"></ion-backdrop>' +
  57102. '<div class="popover-wrapper">' +
  57103. '<div class="popover-arrow"></div>' +
  57104. '<div class="popover-content">' +
  57105. '<div class="popover-viewport">' +
  57106. '<div #viewport nav-viewport></div>' +
  57107. '</div>' +
  57108. '</div>' +
  57109. '</div>'
  57110. },] },
  57111. ];
  57112. /** @nocollapse */
  57113. PopoverCmp.ctorParameters = function () { return [
  57114. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["o" /* ComponentFactoryResolver */], },
  57115. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  57116. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  57117. { type: __WEBPACK_IMPORTED_MODULE_1__config_config__["a" /* Config */], },
  57118. { type: __WEBPACK_IMPORTED_MODULE_3__navigation_nav_params__["a" /* NavParams */], },
  57119. { type: __WEBPACK_IMPORTED_MODULE_4__navigation_view_controller__["a" /* ViewController */], },
  57120. { type: __WEBPACK_IMPORTED_MODULE_5__gestures_gesture_controller__["l" /* GestureController */], },
  57121. { type: __WEBPACK_IMPORTED_MODULE_6__util_module_loader__["b" /* ModuleLoader */], },
  57122. ]; };
  57123. PopoverCmp.propDecorators = {
  57124. '_viewport': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_8" /* ViewChild */], args: ['viewport', { read: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_10" /* ViewContainerRef */] },] },],
  57125. '_keyUp': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["y" /* HostListener */], args: ['body:keyup', ['$event'],] },],
  57126. };
  57127. return PopoverCmp;
  57128. }());
  57129. var popoverIds = -1;
  57130. //# sourceMappingURL=popover-component.js.map
  57131. /***/ }),
  57132. /* 82 */
  57133. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  57134. "use strict";
  57135. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return RadioGroup; });
  57136. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  57137. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_forms__ = __webpack_require__(15);
  57138. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__list_list_header__ = __webpack_require__(72);
  57139. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_util__ = __webpack_require__(2);
  57140. /**
  57141. * @name RadioGroup
  57142. * @description
  57143. * A radio group is a group of [radio buttons](../RadioButton). It allows
  57144. * a user to select at most one radio button from a set. Checking one radio
  57145. * button that belongs to a radio group unchecks any previous checked
  57146. * radio button within the same group.
  57147. *
  57148. * See the [Angular Forms Docs](https://angular.io/docs/ts/latest/guide/forms.html)
  57149. * for more information on forms and inputs.
  57150. *
  57151. * @usage
  57152. * ```html
  57153. * <ion-list radio-group [(ngModel)]="autoManufacturers">
  57154. *
  57155. * <ion-list-header>
  57156. * Auto Manufacturers
  57157. * </ion-list-header>
  57158. *
  57159. * <ion-item>
  57160. * <ion-label>Cord</ion-label>
  57161. * <ion-radio value="cord"></ion-radio>
  57162. * </ion-item>
  57163. *
  57164. * <ion-item>
  57165. * <ion-label>Duesenberg</ion-label>
  57166. * <ion-radio value="duesenberg"></ion-radio>
  57167. * </ion-item>
  57168. *
  57169. * <ion-item>
  57170. * <ion-label>Hudson</ion-label>
  57171. * <ion-radio value="hudson"></ion-radio>
  57172. * </ion-item>
  57173. *
  57174. * <ion-item>
  57175. * <ion-label>Packard</ion-label>
  57176. * <ion-radio value="packard"></ion-radio>
  57177. * </ion-item>
  57178. *
  57179. * <ion-item>
  57180. * <ion-label>Studebaker</ion-label>
  57181. * <ion-radio value="studebaker"></ion-radio>
  57182. * </ion-item>
  57183. *
  57184. * </ion-list>
  57185. * ```
  57186. *
  57187. * @demo /docs/demos/src/radio/
  57188. * @see {@link /docs/components#radio Radio Component Docs}
  57189. * @see {@link ../RadioButton RadioButton API Docs}
  57190. */
  57191. var RadioGroup = (function () {
  57192. function RadioGroup(_renderer, _elementRef, _cd) {
  57193. this._renderer = _renderer;
  57194. this._elementRef = _elementRef;
  57195. this._cd = _cd;
  57196. /**
  57197. * @internal
  57198. */
  57199. this._disabled = false;
  57200. /**
  57201. * @hidden
  57202. */
  57203. this._btns = [];
  57204. /**
  57205. * @hidden
  57206. */
  57207. this._ids = -1;
  57208. /**
  57209. * @hidden
  57210. */
  57211. this._init = false;
  57212. /**
  57213. * @output {any} Emitted when the selected button has changed.
  57214. */
  57215. this.ionChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  57216. this.id = ++radioGroupIds;
  57217. }
  57218. Object.defineProperty(RadioGroup.prototype, "disabled", {
  57219. /**
  57220. * @input {boolean} If true, the user cannot interact with any of the buttons in the group.
  57221. */
  57222. get: function () {
  57223. return this._disabled;
  57224. },
  57225. set: function (val) {
  57226. this._disabled = Object(__WEBPACK_IMPORTED_MODULE_3__util_util__["o" /* isTrueProperty */])(val);
  57227. },
  57228. enumerable: true,
  57229. configurable: true
  57230. });
  57231. /**
  57232. * @hidden
  57233. */
  57234. RadioGroup.prototype.ngAfterContentInit = function () {
  57235. var activeButton = this._btns.find(function (b) { return b.checked; });
  57236. if (activeButton) {
  57237. this._setActive(activeButton);
  57238. }
  57239. };
  57240. /**
  57241. * @hidden
  57242. */
  57243. RadioGroup.prototype.writeValue = function (val) {
  57244. (void 0) /* console.debug */;
  57245. this.value = val;
  57246. if (this._init) {
  57247. this._update();
  57248. this.onTouched();
  57249. this.ionChange.emit(val);
  57250. }
  57251. this._init = true;
  57252. };
  57253. /**
  57254. * @hidden
  57255. */
  57256. RadioGroup.prototype.registerOnChange = function (fn) {
  57257. var _this = this;
  57258. this._fn = fn;
  57259. this.onChange = function (val) {
  57260. // onChange used when there's an formControlName
  57261. (void 0) /* console.debug */;
  57262. fn(val);
  57263. _this.value = val;
  57264. _this._update();
  57265. _this.onTouched();
  57266. _this.ionChange.emit(val);
  57267. };
  57268. };
  57269. /**
  57270. * @hidden
  57271. */
  57272. RadioGroup.prototype.registerOnTouched = function (fn) { this.onTouched = fn; };
  57273. /**
  57274. * @hidden
  57275. */
  57276. RadioGroup.prototype._update = function () {
  57277. var _this = this;
  57278. // loop through each of the radiobuttons
  57279. var hasChecked = false;
  57280. this._btns.forEach(function (radioButton) {
  57281. // check this radiobutton if its value is
  57282. // the same as the radiogroups value
  57283. radioButton.checked = Object(__WEBPACK_IMPORTED_MODULE_3__util_util__["g" /* isCheckedProperty */])(_this.value, radioButton.value) && !hasChecked;
  57284. if (radioButton.checked) {
  57285. // if this button is checked, then set it as
  57286. // the radiogroup's active descendant
  57287. _this._setActive(radioButton);
  57288. hasChecked = true;
  57289. }
  57290. });
  57291. };
  57292. /**
  57293. * @hidden
  57294. */
  57295. RadioGroup.prototype._setActive = function (radioButton) {
  57296. this._renderer.setElementAttribute(this._elementRef.nativeElement, 'aria-activedescendant', radioButton.id);
  57297. };
  57298. /**
  57299. * @hidden
  57300. */
  57301. RadioGroup.prototype.add = function (button) {
  57302. var _this = this;
  57303. this._btns.push(button);
  57304. // listen for radiobutton select events
  57305. button.ionSelect.subscribe(function (val) {
  57306. // this radiobutton has been selected
  57307. _this.onChange(val);
  57308. });
  57309. return this.id + '-' + (++this._ids);
  57310. };
  57311. /**
  57312. * @hidden
  57313. */
  57314. RadioGroup.prototype.remove = function (button) {
  57315. var index = this._btns.indexOf(button);
  57316. if (index > -1) {
  57317. if (button.value === this.value) {
  57318. this.value = null;
  57319. }
  57320. this._btns.splice(index, 1);
  57321. }
  57322. };
  57323. Object.defineProperty(RadioGroup.prototype, "_header", {
  57324. /**
  57325. * @hidden
  57326. */
  57327. set: function (header) {
  57328. if (header) {
  57329. if (!header.id) {
  57330. header.id = 'rg-hdr-' + this.id;
  57331. }
  57332. this._renderer.setElementAttribute(this._elementRef.nativeElement, 'aria-describedby', header.id);
  57333. }
  57334. },
  57335. enumerable: true,
  57336. configurable: true
  57337. });
  57338. /**
  57339. * @hidden
  57340. */
  57341. RadioGroup.prototype.onChange = function (val) {
  57342. // onChange used when there is not an formControlName
  57343. (void 0) /* console.debug */;
  57344. this.value = val;
  57345. this._update();
  57346. this.onTouched();
  57347. this.ionChange.emit(val);
  57348. this._cd.detectChanges();
  57349. };
  57350. /**
  57351. * @hidden
  57352. */
  57353. RadioGroup.prototype.onTouched = function () { };
  57354. /**
  57355. * @hidden
  57356. */
  57357. RadioGroup.prototype.setDisabledState = function (isDisabled) {
  57358. this.disabled = isDisabled;
  57359. };
  57360. RadioGroup.decorators = [
  57361. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  57362. selector: '[radio-group]',
  57363. host: {
  57364. 'role': 'radiogroup'
  57365. },
  57366. providers: [{ provide: __WEBPACK_IMPORTED_MODULE_1__angular_forms__["b" /* NG_VALUE_ACCESSOR */], useExisting: RadioGroup, multi: true }],
  57367. },] },
  57368. ];
  57369. /** @nocollapse */
  57370. RadioGroup.ctorParameters = function () { return [
  57371. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  57372. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  57373. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["j" /* ChangeDetectorRef */], },
  57374. ]; };
  57375. RadioGroup.propDecorators = {
  57376. 'disabled': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  57377. 'ionChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  57378. '_header': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["q" /* ContentChild */], args: [__WEBPACK_IMPORTED_MODULE_2__list_list_header__["a" /* ListHeader */],] },],
  57379. };
  57380. return RadioGroup;
  57381. }());
  57382. var radioGroupIds = -1;
  57383. //# sourceMappingURL=radio-group.js.map
  57384. /***/ }),
  57385. /* 83 */
  57386. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  57387. "use strict";
  57388. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Refresher; });
  57389. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  57390. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__content_content__ = __webpack_require__(19);
  57391. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__gestures_gesture_controller__ = __webpack_require__(7);
  57392. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_util__ = __webpack_require__(2);
  57393. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__platform_platform__ = __webpack_require__(3);
  57394. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_dom__ = __webpack_require__(10);
  57395. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__gestures_ui_event_manager__ = __webpack_require__(23);
  57396. /**
  57397. * @name Refresher
  57398. * @description
  57399. * The Refresher provides pull-to-refresh functionality on a content component.
  57400. * Place the `ion-refresher` as the first child of your `ion-content` element.
  57401. *
  57402. * Pages can then listen to the refresher's various output events. The
  57403. * `refresh` output event is fired when the user has pulled down far
  57404. * enough to kick off the refreshing process. Once the async operation
  57405. * has completed and the refreshing should end, call `complete()`.
  57406. *
  57407. * Note: Do not wrap the `ion-refresher` in a `*ngIf`. It will not render
  57408. * properly this way. Please use the `enabled` property instead to
  57409. * display or hide the refresher.
  57410. *
  57411. * @usage
  57412. * ```html
  57413. * <ion-content>
  57414. *
  57415. * <ion-refresher (ionRefresh)="doRefresh($event)">
  57416. * <ion-refresher-content></ion-refresher-content>
  57417. * </ion-refresher>
  57418. *
  57419. * </ion-content>
  57420. * ```
  57421. *
  57422. * ```ts
  57423. * @Component({...})
  57424. * export class NewsFeedPage {
  57425. *
  57426. * doRefresh(refresher) {
  57427. * console.log('Begin async operation', refresher);
  57428. *
  57429. * setTimeout(() => {
  57430. * console.log('Async operation has ended');
  57431. * refresher.complete();
  57432. * }, 2000);
  57433. * }
  57434. *
  57435. * }
  57436. * ```
  57437. *
  57438. *
  57439. * ## Refresher Content
  57440. *
  57441. * By default, Ionic provides the pulling icon and refreshing spinner that
  57442. * looks best for the platform the user is on. However, you can change the
  57443. * default icon and spinner, along with adding text for each state by
  57444. * adding properties to the child `ion-refresher-content` component.
  57445. *
  57446. * ```html
  57447. * <ion-content>
  57448. *
  57449. * <ion-refresher (ionRefresh)="doRefresh($event)">
  57450. * <ion-refresher-content
  57451. * pullingIcon="arrow-dropdown"
  57452. * pullingText="Pull to refresh"
  57453. * refreshingSpinner="circles"
  57454. * refreshingText="Refreshing...">
  57455. * </ion-refresher-content>
  57456. * </ion-refresher>
  57457. *
  57458. * </ion-content>
  57459. * ```
  57460. *
  57461. *
  57462. * ## Further Customizing Refresher Content
  57463. *
  57464. * The `ion-refresher` component holds the refresh logic.
  57465. * It requires a child component in order to display the content.
  57466. * Ionic uses `ion-refresher-content` by default. This component
  57467. * displays the refresher and changes the look depending
  57468. * on the refresher's state. Separating these components
  57469. * allows developers to create their own refresher content
  57470. * components. You could replace our default content with
  57471. * custom SVG or CSS animations.
  57472. *
  57473. * @demo /docs/demos/src/refresher/
  57474. *
  57475. */
  57476. var Refresher = (function () {
  57477. function Refresher(_plt, _content, _zone, gestureCtrl) {
  57478. this._plt = _plt;
  57479. this._content = _content;
  57480. this._zone = _zone;
  57481. this._appliedStyles = false;
  57482. this._lastCheck = 0;
  57483. this._isEnabled = true;
  57484. this._top = '';
  57485. /**
  57486. * The current state which the refresher is in. The refresher's states include:
  57487. *
  57488. * - `inactive` - The refresher is not being pulled down or refreshing and is currently hidden.
  57489. * - `pulling` - The user is actively pulling down the refresher, but has not reached the point yet that if the user lets go, it'll refresh.
  57490. * - `cancelling` - The user pulled down the refresher and let go, but did not pull down far enough to kick off the `refreshing` state. After letting go, the refresher is in the `cancelling` state while it is closing, and will go back to the `inactive` state once closed.
  57491. * - `ready` - The user has pulled down the refresher far enough that if they let go, it'll begin the `refreshing` state.
  57492. * - `refreshing` - The refresher is actively waiting on the async operation to end. Once the refresh handler calls `complete()` it will begin the `completing` state.
  57493. * - `completing` - The `refreshing` state has finished and the refresher is in the process of closing itself. Once closed, the refresher will go back to the `inactive` state.
  57494. */
  57495. this.state = STATE_INACTIVE;
  57496. /**
  57497. * The Y coordinate of where the user started to the pull down the content.
  57498. */
  57499. this.startY = null;
  57500. /**
  57501. * The current touch or mouse event's Y coordinate.
  57502. */
  57503. this.currentY = null;
  57504. /**
  57505. * The distance between the start of the pull and the current touch or
  57506. * mouse event's Y coordinate.
  57507. */
  57508. this.deltaY = null;
  57509. /**
  57510. * A number representing how far down the user has pulled.
  57511. * The number `0` represents the user hasn't pulled down at all. The
  57512. * number `1`, and anything greater than `1`, represents that the user
  57513. * has pulled far enough down that when they let go then the refresh will
  57514. * happen. If they let go and the number is less than `1`, then the
  57515. * refresh will not happen, and the content will return to it's original
  57516. * position.
  57517. */
  57518. this.progress = 0;
  57519. /**
  57520. * @input {number} The min distance the user must pull down until the
  57521. * refresher can go into the `refreshing` state. Default is `60`.
  57522. */
  57523. this.pullMin = 60;
  57524. /**
  57525. * @input {number} The maximum distance of the pull until the refresher
  57526. * will automatically go into the `refreshing` state. By default, the pull
  57527. * maximum will be the result of `pullMin + 60`.
  57528. */
  57529. this.pullMax = this.pullMin + 60;
  57530. /**
  57531. * @input {number} How many milliseconds it takes to close the refresher. Default is `280`.
  57532. */
  57533. this.closeDuration = 280;
  57534. /**
  57535. * @input {number} How many milliseconds it takes the refresher to to snap back to the `refreshing` state. Default is `280`.
  57536. */
  57537. this.snapbackDuration = 280;
  57538. /**
  57539. * @output {event} Emitted when the user lets go and has pulled down
  57540. * far enough, which would be farther than the `pullMin`, then your refresh hander if
  57541. * fired and the state is updated to `refreshing`. From within your refresh handler,
  57542. * you must call the `complete()` method when your async operation has completed.
  57543. */
  57544. this.ionRefresh = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  57545. /**
  57546. * @output {event} Emitted while the user is pulling down the content and exposing the refresher.
  57547. */
  57548. this.ionPull = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  57549. /**
  57550. * @output {event} Emitted when the user begins to start pulling down.
  57551. */
  57552. this.ionStart = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  57553. this._events = new __WEBPACK_IMPORTED_MODULE_6__gestures_ui_event_manager__["a" /* UIEventManager */](_plt);
  57554. _content._hasRefresher = true;
  57555. this._gesture = gestureCtrl.createGesture({
  57556. name: __WEBPACK_IMPORTED_MODULE_2__gestures_gesture_controller__["j" /* GESTURE_REFRESHER */],
  57557. priority: __WEBPACK_IMPORTED_MODULE_2__gestures_gesture_controller__["g" /* GESTURE_PRIORITY_REFRESHER */]
  57558. });
  57559. }
  57560. Object.defineProperty(Refresher.prototype, "enabled", {
  57561. /**
  57562. * @input {boolean} If the refresher is enabled or not. This should be used in place of an `ngIf`. Default is `true`.
  57563. */
  57564. get: function () {
  57565. return this._isEnabled;
  57566. },
  57567. set: function (val) {
  57568. this._isEnabled = Object(__WEBPACK_IMPORTED_MODULE_3__util_util__["o" /* isTrueProperty */])(val);
  57569. this._setListeners(this._isEnabled);
  57570. },
  57571. enumerable: true,
  57572. configurable: true
  57573. });
  57574. Refresher.prototype._onStart = function (ev) {
  57575. // if multitouch then get out immediately
  57576. if (ev.touches && ev.touches.length > 1) {
  57577. return false;
  57578. }
  57579. if (this.state !== STATE_INACTIVE) {
  57580. return false;
  57581. }
  57582. var scrollHostScrollTop = this._content.getContentDimensions().scrollTop;
  57583. // if the scrollTop is greater than zero then it's
  57584. // not possible to pull the content down yet
  57585. if (scrollHostScrollTop > 0) {
  57586. return false;
  57587. }
  57588. if (!this._gesture.canStart()) {
  57589. return false;
  57590. }
  57591. var coord = Object(__WEBPACK_IMPORTED_MODULE_5__util_dom__["f" /* pointerCoord */])(ev);
  57592. (void 0) /* console.debug */;
  57593. if (this._content.contentTop > 0) {
  57594. var newTop = this._content.contentTop + 'px';
  57595. if (this._top !== newTop) {
  57596. this._top = newTop;
  57597. }
  57598. }
  57599. this.startY = this.currentY = coord.y;
  57600. this.progress = 0;
  57601. this.state = STATE_INACTIVE;
  57602. return true;
  57603. };
  57604. Refresher.prototype._onMove = function (ev) {
  57605. // this method can get called like a bazillion times per second,
  57606. // so it's built to be as efficient as possible, and does its
  57607. // best to do any DOM read/writes only when absolutely necessary
  57608. var _this = this;
  57609. // if multitouch then get out immediately
  57610. if (ev.touches && ev.touches.length > 1) {
  57611. return 1;
  57612. }
  57613. if (!this._gesture.canStart()) {
  57614. return 0;
  57615. }
  57616. // do nothing if it's actively refreshing
  57617. // or it's in the process of closing
  57618. // or this was never a startY
  57619. if (this.startY === null || this.state === STATE_REFRESHING || this.state === STATE_CANCELLING || this.state === STATE_COMPLETING) {
  57620. return 2;
  57621. }
  57622. // if we just updated stuff less than 16ms ago
  57623. // then don't check again, just chillout plz
  57624. var now = Date.now();
  57625. if (this._lastCheck + 16 > now) {
  57626. return 3;
  57627. }
  57628. // remember the last time we checked all this
  57629. this._lastCheck = now;
  57630. // get the current pointer coordinates
  57631. var coord = Object(__WEBPACK_IMPORTED_MODULE_5__util_dom__["f" /* pointerCoord */])(ev);
  57632. this.currentY = coord.y;
  57633. // it's now possible they could be pulling down the content
  57634. // how far have they pulled so far?
  57635. this.deltaY = (coord.y - this.startY);
  57636. // don't bother if they're scrolling up
  57637. // and have not already started dragging
  57638. if (this.deltaY <= 0) {
  57639. // the current Y is higher than the starting Y
  57640. // so they scrolled up enough to be ignored
  57641. this.progress = 0;
  57642. if (this.state !== STATE_INACTIVE) {
  57643. this._zone.run(function () {
  57644. _this.state = STATE_INACTIVE;
  57645. });
  57646. }
  57647. if (this._appliedStyles) {
  57648. // reset the styles only if they were applied
  57649. this._setCss(0, '', false, '');
  57650. return 5;
  57651. }
  57652. return 6;
  57653. }
  57654. if (this.state === STATE_INACTIVE) {
  57655. // this refresh is not already actively pulling down
  57656. // get the content's scrollTop
  57657. var scrollHostScrollTop = this._content.getContentDimensions().scrollTop;
  57658. // if the scrollTop is greater than zero then it's
  57659. // not possible to pull the content down yet
  57660. if (scrollHostScrollTop > 0) {
  57661. this.progress = 0;
  57662. this.startY = null;
  57663. return 7;
  57664. }
  57665. // content scrolled all the way to the top, and dragging down
  57666. this.state = STATE_PULLING;
  57667. }
  57668. // prevent native scroll events
  57669. ev.preventDefault();
  57670. // the refresher is actively pulling at this point
  57671. // move the scroll element within the content element
  57672. this._setCss(this.deltaY, '0ms', true, '');
  57673. if (!this.deltaY) {
  57674. // don't continue if there's no delta yet
  57675. this.progress = 0;
  57676. return 8;
  57677. }
  57678. // so far so good, let's run this all back within zone now
  57679. this._zone.run(function () {
  57680. _this._onMoveInZone();
  57681. });
  57682. };
  57683. Refresher.prototype._onMoveInZone = function () {
  57684. // set pull progress
  57685. this.progress = (this.deltaY / this.pullMin);
  57686. // emit "start" if it hasn't started yet
  57687. if (!this._didStart) {
  57688. this._didStart = true;
  57689. this.ionStart.emit(this);
  57690. }
  57691. // emit "pulling" on every move
  57692. this.ionPull.emit(this);
  57693. // do nothing if the delta is less than the pull threshold
  57694. if (this.deltaY < this.pullMin) {
  57695. // ensure it stays in the pulling state, cuz its not ready yet
  57696. this.state = STATE_PULLING;
  57697. return 2;
  57698. }
  57699. if (this.deltaY > this.pullMax) {
  57700. // they pulled farther than the max, so kick off the refresh
  57701. this._beginRefresh();
  57702. return 3;
  57703. }
  57704. // pulled farther than the pull min!!
  57705. // it is now in the `ready` state!!
  57706. // if they let go then it'll refresh, kerpow!!
  57707. this.state = STATE_READY;
  57708. return 4;
  57709. };
  57710. Refresher.prototype._onEnd = function () {
  57711. // only run in a zone when absolutely necessary
  57712. var _this = this;
  57713. if (this.state === STATE_READY) {
  57714. this._zone.run(function () {
  57715. // they pulled down far enough, so it's ready to refresh
  57716. _this._beginRefresh();
  57717. });
  57718. }
  57719. else if (this.state === STATE_PULLING) {
  57720. this._zone.run(function () {
  57721. // they were pulling down, but didn't pull down far enough
  57722. // set the content back to it's original location
  57723. // and close the refresher
  57724. // set that the refresh is actively cancelling
  57725. _this.cancel();
  57726. });
  57727. }
  57728. // reset on any touchend/mouseup
  57729. this.startY = null;
  57730. };
  57731. Refresher.prototype._beginRefresh = function () {
  57732. // assumes we're already back in a zone
  57733. // they pulled down far enough, so it's ready to refresh
  57734. this.state = STATE_REFRESHING;
  57735. // place the content in a hangout position while it thinks
  57736. this._setCss(this.pullMin, (this.snapbackDuration + 'ms'), true, '');
  57737. // emit "refresh" because it was pulled down far enough
  57738. // and they let go to begin refreshing
  57739. this.ionRefresh.emit(this);
  57740. };
  57741. /**
  57742. * Call `complete()` when your async operation has completed.
  57743. * For example, the `refreshing` state is while the app is performing
  57744. * an asynchronous operation, such as receiving more data from an
  57745. * AJAX request. Once the data has been received, you then call this
  57746. * method to signify that the refreshing has completed and to close
  57747. * the refresher. This method also changes the refresher's state from
  57748. * `refreshing` to `completing`.
  57749. */
  57750. Refresher.prototype.complete = function () {
  57751. this._close(STATE_COMPLETING, '120ms');
  57752. };
  57753. /**
  57754. * Changes the refresher's state from `refreshing` to `cancelling`.
  57755. */
  57756. Refresher.prototype.cancel = function () {
  57757. this._close(STATE_CANCELLING, '');
  57758. };
  57759. Refresher.prototype._close = function (state, delay) {
  57760. var timer;
  57761. function close(ev) {
  57762. // closing is done, return to inactive state
  57763. if (ev) {
  57764. clearTimeout(timer);
  57765. }
  57766. this.state = STATE_INACTIVE;
  57767. this.progress = 0;
  57768. this._didStart = this.startY = this.currentY = this.deltaY = null;
  57769. this._setCss(0, '0ms', false, '');
  57770. }
  57771. // create fallback timer incase something goes wrong with transitionEnd event
  57772. timer = setTimeout(close.bind(this), 600);
  57773. // create transition end event on the content's scroll element
  57774. this._content.onScrollElementTransitionEnd(close.bind(this));
  57775. // reset set the styles on the scroll element
  57776. // set that the refresh is actively cancelling/completing
  57777. this.state = state;
  57778. this._setCss(0, '', true, delay);
  57779. if (this._pointerEvents) {
  57780. this._pointerEvents.stop();
  57781. }
  57782. };
  57783. Refresher.prototype._setCss = function (y, duration, overflowVisible, delay) {
  57784. this._appliedStyles = (y > 0);
  57785. var content = this._content;
  57786. var Css = this._plt.Css;
  57787. content.setScrollElementStyle(Css.transform, ((y > 0) ? 'translateY(' + y + 'px) translateZ(0px)' : 'translateZ(0px)'));
  57788. content.setScrollElementStyle(Css.transitionDuration, duration);
  57789. content.setScrollElementStyle(Css.transitionDelay, delay);
  57790. content.setScrollElementStyle('overflow', (overflowVisible ? 'hidden' : ''));
  57791. };
  57792. Refresher.prototype._setListeners = function (shouldListen) {
  57793. this._events.unlistenAll();
  57794. this._pointerEvents = null;
  57795. if (shouldListen) {
  57796. this._pointerEvents = this._events.pointerEvents({
  57797. element: this._content.getScrollElement(),
  57798. pointerDown: this._onStart.bind(this),
  57799. pointerMove: this._onMove.bind(this),
  57800. pointerUp: this._onEnd.bind(this),
  57801. zone: false
  57802. });
  57803. }
  57804. };
  57805. /**
  57806. * @hidden
  57807. */
  57808. Refresher.prototype.ngOnInit = function () {
  57809. // bind event listeners
  57810. // save the unregister listener functions to use onDestroy
  57811. this._setListeners(this._isEnabled);
  57812. };
  57813. /**
  57814. * @hidden
  57815. */
  57816. Refresher.prototype.ngOnDestroy = function () {
  57817. this._setListeners(false);
  57818. this._events.destroy();
  57819. this._gesture.destroy();
  57820. };
  57821. Refresher.decorators = [
  57822. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  57823. selector: 'ion-refresher',
  57824. host: {
  57825. '[class.refresher-active]': 'state !== "inactive"',
  57826. '[style.top]': '_top'
  57827. }
  57828. },] },
  57829. ];
  57830. /** @nocollapse */
  57831. Refresher.ctorParameters = function () { return [
  57832. { type: __WEBPACK_IMPORTED_MODULE_4__platform_platform__["a" /* Platform */], },
  57833. { type: __WEBPACK_IMPORTED_MODULE_1__content_content__["a" /* Content */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["w" /* Host */] },] },
  57834. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["M" /* NgZone */], },
  57835. { type: __WEBPACK_IMPORTED_MODULE_2__gestures_gesture_controller__["l" /* GestureController */], },
  57836. ]; };
  57837. Refresher.propDecorators = {
  57838. 'pullMin': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  57839. 'pullMax': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  57840. 'closeDuration': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  57841. 'snapbackDuration': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  57842. 'enabled': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  57843. 'ionRefresh': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  57844. 'ionPull': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  57845. 'ionStart': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  57846. };
  57847. return Refresher;
  57848. }());
  57849. var STATE_INACTIVE = 'inactive';
  57850. var STATE_PULLING = 'pulling';
  57851. var STATE_READY = 'ready';
  57852. var STATE_REFRESHING = 'refreshing';
  57853. var STATE_CANCELLING = 'cancelling';
  57854. var STATE_COMPLETING = 'completing';
  57855. //# sourceMappingURL=refresher.js.map
  57856. /***/ }),
  57857. /* 84 */
  57858. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  57859. "use strict";
  57860. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SegmentButton; });
  57861. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  57862. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_util__ = __webpack_require__(2);
  57863. /**
  57864. * @name SegmentButton
  57865. * @description
  57866. * The child buttons of the `ion-segment` component. Each `ion-segment-button` must have a value.
  57867. *
  57868. * @usage
  57869. *
  57870. * ```html
  57871. * <ion-content>
  57872. * <!-- Segment buttons with icons -->
  57873. * <ion-segment [(ngModel)]="icons" color="secondary">
  57874. * <ion-segment-button value="camera">
  57875. * <ion-icon name="camera"></ion-icon>
  57876. * </ion-segment-button>
  57877. * <ion-segment-button value="bookmark">
  57878. * <ion-icon name="bookmark"></ion-icon>
  57879. * </ion-segment-button>
  57880. * </ion-segment>
  57881. *
  57882. * <!-- Segment buttons with text -->
  57883. * <ion-segment [(ngModel)]="relationship" color="primary">
  57884. * <ion-segment-button value="friends" (ionSelect)="selectedFriends()">
  57885. * Friends
  57886. * </ion-segment-button>
  57887. * <ion-segment-button value="enemies" (ionSelect)="selectedEnemies()">
  57888. * Enemies
  57889. * </ion-segment-button>
  57890. * </ion-segment>
  57891. * </ion-content>
  57892. * ```
  57893. *
  57894. *
  57895. * @demo /docs/demos/src/segment/
  57896. * @see {@link /docs/components#segment Segment Component Docs}
  57897. * @see {@link /docs/api/components/segment/Segment/ Segment API Docs}
  57898. */
  57899. var SegmentButton = (function () {
  57900. function SegmentButton() {
  57901. this.isActive = false;
  57902. this._disabled = false;
  57903. /**
  57904. * @output {SegmentButton} Emitted when a segment button has been clicked.
  57905. */
  57906. this.ionSelect = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  57907. }
  57908. Object.defineProperty(SegmentButton.prototype, "disabled", {
  57909. /**
  57910. * @input {boolean} If true, the user cannot interact with this element.
  57911. */
  57912. get: function () {
  57913. return this._disabled;
  57914. },
  57915. set: function (val) {
  57916. this._disabled = Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["o" /* isTrueProperty */])(val);
  57917. },
  57918. enumerable: true,
  57919. configurable: true
  57920. });
  57921. /**
  57922. * @hidden
  57923. * On click of a SegmentButton
  57924. */
  57925. SegmentButton.prototype.onClick = function () {
  57926. (void 0) /* console.debug */;
  57927. this.ionSelect.emit(this);
  57928. };
  57929. /**
  57930. * @hidden
  57931. */
  57932. SegmentButton.prototype.ngOnInit = function () {
  57933. if (!Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["l" /* isPresent */])(this.value)) {
  57934. console.warn('<ion-segment-button> requires a "value" attribute');
  57935. }
  57936. };
  57937. SegmentButton.decorators = [
  57938. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  57939. selector: 'ion-segment-button',
  57940. template: '<ng-content></ng-content>' +
  57941. '<div class="button-effect"></div>',
  57942. host: {
  57943. 'tappable': '',
  57944. 'class': 'segment-button',
  57945. 'role': 'button',
  57946. '[class.segment-button-disabled]': '_disabled',
  57947. '[class.segment-activated]': 'isActive',
  57948. '[attr.aria-pressed]': 'isActive'
  57949. },
  57950. encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_11" /* ViewEncapsulation */].None,
  57951. },] },
  57952. ];
  57953. /** @nocollapse */
  57954. SegmentButton.ctorParameters = function () { return []; };
  57955. SegmentButton.propDecorators = {
  57956. 'value': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  57957. 'ionSelect': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  57958. 'disabled': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  57959. 'onClick': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["y" /* HostListener */], args: ['click',] },],
  57960. };
  57961. return SegmentButton;
  57962. }());
  57963. //# sourceMappingURL=segment-button.js.map
  57964. /***/ }),
  57965. /* 85 */
  57966. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  57967. "use strict";
  57968. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SelectPopover; });
  57969. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  57970. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__navigation_nav_params__ = __webpack_require__(13);
  57971. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__navigation_view_controller__ = __webpack_require__(5);
  57972. /** @hidden */
  57973. var SelectPopover = (function () {
  57974. function SelectPopover(navParams, viewController) {
  57975. this.navParams = navParams;
  57976. this.viewController = viewController;
  57977. }
  57978. Object.defineProperty(SelectPopover.prototype, "value", {
  57979. get: function () {
  57980. var checkedOption = this.options.find(function (option) { return option.checked; });
  57981. return checkedOption ? checkedOption.value : undefined;
  57982. },
  57983. set: function (value) {
  57984. var checkedOption = this.options.find(function (option) { return option.value === value; });
  57985. if (checkedOption && checkedOption.handler) {
  57986. checkedOption.handler();
  57987. }
  57988. this.viewController.dismiss(value);
  57989. },
  57990. enumerable: true,
  57991. configurable: true
  57992. });
  57993. SelectPopover.prototype.ngOnInit = function () {
  57994. this.options = this.navParams.data.options;
  57995. };
  57996. SelectPopover.decorators = [
  57997. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  57998. template: "\n <ion-list radio-group [(ngModel)]=\"value\">\n <ion-item *ngFor=\"let option of options\">\n <ion-label>{{option.text}}</ion-label>\n <ion-radio [checked]=\"option.checked\" [value]=\"option.value\" [disabled]=\"option.disabled\"></ion-radio>\n </ion-item>\n </ion-list>\n "
  57999. },] },
  58000. ];
  58001. /** @nocollapse */
  58002. SelectPopover.ctorParameters = function () { return [
  58003. { type: __WEBPACK_IMPORTED_MODULE_1__navigation_nav_params__["a" /* NavParams */], },
  58004. { type: __WEBPACK_IMPORTED_MODULE_2__navigation_view_controller__["a" /* ViewController */], },
  58005. ]; };
  58006. return SelectPopover;
  58007. }());
  58008. //# sourceMappingURL=select-popover-component.js.map
  58009. /***/ }),
  58010. /* 86 */
  58011. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  58012. "use strict";
  58013. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DisplayWhen; });
  58014. /**
  58015. * @hidden
  58016. */
  58017. var DisplayWhen = (function () {
  58018. function DisplayWhen(conditions, _plt, zone) {
  58019. this._plt = _plt;
  58020. this.zone = zone;
  58021. this.isMatch = false;
  58022. if (!conditions)
  58023. return;
  58024. this.conditions = conditions.replace(/\s/g, '').split(',');
  58025. // check if its one of the matching platforms first
  58026. // a platform does not change during the life of an app
  58027. for (var i = 0; i < this.conditions.length; i++) {
  58028. if (this.conditions[i] && _plt.is(this.conditions[i])) {
  58029. this.isMatch = true;
  58030. return;
  58031. }
  58032. }
  58033. if (this.orientation()) {
  58034. // add window resize listener
  58035. this.resizeObs = _plt.resize.subscribe(this.orientation.bind(this));
  58036. }
  58037. }
  58038. DisplayWhen.prototype.orientation = function () {
  58039. for (var i = 0; i < this.conditions.length; i++) {
  58040. if (this.conditions[i] === 'portrait') {
  58041. this.isMatch = this._plt.isPortrait();
  58042. return true;
  58043. }
  58044. if (this.conditions[i] === 'landscape') {
  58045. this.isMatch = this._plt.isLandscape();
  58046. return true;
  58047. }
  58048. }
  58049. return false;
  58050. };
  58051. DisplayWhen.prototype.ngOnDestroy = function () {
  58052. this.resizeObs && this.resizeObs.unsubscribe();
  58053. this.resizeObs = null;
  58054. };
  58055. return DisplayWhen;
  58056. }());
  58057. //# sourceMappingURL=display-when.js.map
  58058. /***/ }),
  58059. /* 87 */
  58060. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  58061. "use strict";
  58062. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Slides; });
  58063. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  58064. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__config_config__ = __webpack_require__(1);
  58065. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__swiper_swiper_keyboard__ = __webpack_require__(257);
  58066. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ion__ = __webpack_require__(4);
  58067. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_util__ = __webpack_require__(2);
  58068. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__swiper_swiper_events__ = __webpack_require__(260);
  58069. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__swiper_swiper_zoom__ = __webpack_require__(178);
  58070. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__platform_platform__ = __webpack_require__(3);
  58071. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__swiper_swiper__ = __webpack_require__(46);
  58072. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__swiper_swiper_effects__ = __webpack_require__(91);
  58073. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__navigation_view_controller__ = __webpack_require__(5);
  58074. var __extends = (this && this.__extends) || (function () {
  58075. var extendStatics = Object.setPrototypeOf ||
  58076. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  58077. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  58078. return function (d, b) {
  58079. extendStatics(d, b);
  58080. function __() { this.constructor = d; }
  58081. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  58082. };
  58083. })();
  58084. /**
  58085. * @name Slides
  58086. * @description
  58087. * The Slides component is a multi-section container. Each section can be swiped
  58088. * or dragged between. It contains any number of [Slide](../Slide) components.
  58089. *
  58090. *
  58091. * ### Creating
  58092. * You should use a template to create slides and listen to slide events. The template
  58093. * should contain the slide container, an `<ion-slides>` element, and any number of
  58094. * [Slide](../Slide) components, written as `<ion-slide>`. Basic configuration
  58095. * values can be set as input properties, which are listed below. Slides events
  58096. * can also be listened to such as the slide changing by placing the event on the
  58097. * `<ion-slides>` element. See [Usage](#usage) below for more information.
  58098. *
  58099. *
  58100. * ### Navigating
  58101. * After creating and configuring the slides, you can navigate between them
  58102. * by swiping or calling methods on the `Slides` instance. You can call `slideTo()` to
  58103. * navigate to a specific slide, or `slideNext()` to change to the slide that follows
  58104. * the active slide. All of the [methods](#instance-members) provided by the `Slides`
  58105. * instance are listed below. See [Usage](#usage) below for more information on
  58106. * navigating between slides.
  58107. *
  58108. *
  58109. * @usage
  58110. *
  58111. * You can add slides to a `@Component` using the following template:
  58112. *
  58113. * ```html
  58114. * <ion-slides>
  58115. * <ion-slide>
  58116. * <h1>Slide 1</h1>
  58117. * </ion-slide>
  58118. * <ion-slide>
  58119. * <h1>Slide 2</h1>
  58120. * </ion-slide>
  58121. * <ion-slide>
  58122. * <h1>Slide 3</h1>
  58123. * </ion-slide>
  58124. * </ion-slides>
  58125. * ```
  58126. *
  58127. * Next, we can use `ViewChild` to assign the Slides instance to
  58128. * your `slides` property. Now we can call any of the `Slides`
  58129. * [methods](#instance-members), for example we can use the Slide's
  58130. * `slideTo()` method in order to navigate to a specific slide on
  58131. * a button click. Below we call the `goToSlide()` method and it
  58132. * navigates to the 3rd slide:
  58133. *
  58134. * ```ts
  58135. * import { ViewChild } from '@angular/core';
  58136. * import { Slides } from 'ionic-angular';
  58137. *
  58138. * class MyPage {
  58139. * @ViewChild(Slides) slides: Slides;
  58140. *
  58141. * goToSlide() {
  58142. * this.slides.slideTo(2, 500);
  58143. * }
  58144. * }
  58145. * ```
  58146. *
  58147. * We can also add events to listen to on the `<ion-slides>` element.
  58148. * Let's add the `ionSlideDidChange` event and call a method when the slide changes:
  58149. *
  58150. * ```html
  58151. * <ion-slides (ionSlideDidChange)="slideChanged()">
  58152. * ```
  58153. *
  58154. * In our class, we add the `slideChanged()` method which gets the active
  58155. * index and prints it:
  58156. *
  58157. * ```ts
  58158. * class MyPage {
  58159. * ...
  58160. *
  58161. * slideChanged() {
  58162. * let currentIndex = this.slides.getActiveIndex();
  58163. * console.log('Current index is', currentIndex);
  58164. * }
  58165. * }
  58166. * ```
  58167. *
  58168. * ### Zooming
  58169. * If your slides contain images, you can enable zooming on them by setting `zoom="true" and
  58170. * wrapping each image in a `div` with the class `swiper-zoom-container`. Zoom supports
  58171. * `img`, `svg`, `canvas`, and `ion-img`.
  58172. *
  58173. * ```html
  58174. * <ion-slides zoom="true">
  58175. * <ion-slide>
  58176. * <div class="swiper-zoom-container">
  58177. * <img src="assets/img/dog.jpg">
  58178. * </div>
  58179. * <ion-label>Woof</ion-label>
  58180. * </ion-slide>
  58181. * <ion-slide>
  58182. * <div class="swiper-zoom-container">
  58183. * <img src="assets/img/cat.jpg">
  58184. * </div>
  58185. * <ion-label>Meow</ion-label>
  58186. * </ion-slide>
  58187. * <ion-slide>
  58188. * <div class="swiper-zoom-container">
  58189. * <img src="assets/img/fish.jpg">
  58190. * </div>
  58191. * <ion-label>Just keep swimming</ion-label>
  58192. * </ion-slide>
  58193. * </ion-slides>
  58194. * ```
  58195. *
  58196. * @advanced
  58197. *
  58198. * There are several options available to create customized slides. Ionic exposes
  58199. * the most commonly used options as [inputs](http://learnangular2.com/inputs/).
  58200. * In order to use an option that isn't exposed as an input the following code
  58201. * should be used, where `freeMode` is the option to change:
  58202. *
  58203. * ```ts
  58204. * import { ViewChild } from '@angular/core';
  58205. * import { Slides } from 'ionic-angular';
  58206. * class MyPage {
  58207. * @ViewChild(Slides) slides: Slides;
  58208. *
  58209. * ngAfterViewInit() {
  58210. * this.slides.freeMode = true;
  58211. * }
  58212. * }
  58213. *
  58214. * ```
  58215. *
  58216. * To see all of the available options, take a look at the
  58217. * [source for slides](https://github.com/ionic-team/ionic/blob/master/src/components/slides/slides.ts).
  58218. *
  58219. * @demo /docs/demos/src/slides/
  58220. * @see {@link /docs/components#slides Slides Component Docs}
  58221. *
  58222. * Adopted from Swiper.js:
  58223. * The most modern mobile touch slider and framework with
  58224. * hardware accelerated transitions.
  58225. *
  58226. * http://www.idangero.us/swiper/
  58227. *
  58228. * Copyright 2016, Vladimir Kharlampidi
  58229. * The iDangero.us
  58230. * http://www.idangero.us/
  58231. *
  58232. * Licensed under MIT
  58233. */
  58234. var Slides = (function (_super) {
  58235. __extends(Slides, _super);
  58236. function Slides(config, _plt, zone, viewCtrl, elementRef, renderer) {
  58237. var _this = _super.call(this, config, elementRef, renderer, 'slides') || this;
  58238. _this._plt = _plt;
  58239. _this._control = null;
  58240. _this._effectName = 'slide';
  58241. _this._direction = 'horizontal';
  58242. _this._initialSlide = 0;
  58243. _this._isLoop = false;
  58244. _this._pager = false;
  58245. _this._paginationType = 'bullets';
  58246. /** @hidden */
  58247. _this.paginationBulletRender = null;
  58248. _this._isParallax = false;
  58249. _this._speedMs = 300;
  58250. _this._isZoom = false;
  58251. /**
  58252. * @hidden
  58253. * Enabled this option and swiper will be operated as usual except it will
  58254. * not move, real translate values on wrapper will not be set. Useful when
  58255. * you may need to create custom slide transition.
  58256. */
  58257. _this.virtualTranslate = false;
  58258. /**
  58259. * @hidden
  58260. * Set to true to round values of slides width and height to prevent blurry
  58261. * texts on usual resolution screens (if you have such)
  58262. */
  58263. _this.roundLengths = false;
  58264. _this._spaceBetween = 0;
  58265. _this._slidesPerView = 1;
  58266. _this._centeredSlides = false;
  58267. /**
  58268. * @hidden
  58269. */
  58270. _this.slidesPerColumn = 1;
  58271. /**
  58272. * @hidden
  58273. */
  58274. _this.slidesPerColumnFill = 'column';
  58275. /**
  58276. * @hidden
  58277. */
  58278. _this.slidesPerGroup = 1;
  58279. /**
  58280. * @hidden
  58281. */
  58282. _this.slidesOffsetBefore = 0;
  58283. /**
  58284. * @hidden
  58285. */
  58286. _this.slidesOffsetAfter = 0;
  58287. // autoplay
  58288. /**
  58289. * @hidden
  58290. */
  58291. _this.autoplayDisableOnInteraction = true;
  58292. /**
  58293. * @hidden
  58294. */
  58295. _this.autoplayStopOnLast = false;
  58296. // Free mode
  58297. /**
  58298. * @hidden
  58299. */
  58300. _this.freeMode = false;
  58301. /**
  58302. * @hidden
  58303. */
  58304. _this.freeModeMomentum = true;
  58305. /**
  58306. * @hidden
  58307. */
  58308. _this.freeModeMomentumRatio = 1;
  58309. /**
  58310. * @hidden
  58311. */
  58312. _this.freeModeMomentumBounce = true;
  58313. /**
  58314. * @hidden
  58315. */
  58316. _this.freeModeMomentumBounceRatio = 1;
  58317. /**
  58318. * @hidden
  58319. */
  58320. _this.freeModeMomentumVelocityRatio = 1;
  58321. /**
  58322. * @hidden
  58323. */
  58324. _this.freeModeSticky = false;
  58325. /**
  58326. * @hidden
  58327. */
  58328. _this.freeModeMinimumVelocity = 0.02;
  58329. // Autoheight
  58330. /**
  58331. * @hidden
  58332. */
  58333. _this.autoHeight = false;
  58334. // Set wrapper width
  58335. /**
  58336. * @hidden
  58337. */
  58338. _this.setWrapperSize = false;
  58339. // Zoom
  58340. /**
  58341. * @hidden
  58342. */
  58343. _this.zoomMax = 3;
  58344. /**
  58345. * @hidden
  58346. */
  58347. _this.zoomMin = 1;
  58348. /**
  58349. * @hidden
  58350. */
  58351. _this.zoomToggle = true;
  58352. // Touches
  58353. /**
  58354. * @hidden
  58355. */
  58356. _this.touchRatio = 1;
  58357. /**
  58358. * @hidden
  58359. */
  58360. _this.touchAngle = 45;
  58361. /**
  58362. * @hidden
  58363. */
  58364. _this.simulateTouch = true;
  58365. /**
  58366. * @hidden
  58367. */
  58368. _this.shortSwipes = true;
  58369. /**
  58370. * @hidden
  58371. */
  58372. _this.longSwipes = true;
  58373. /**
  58374. * @hidden
  58375. */
  58376. _this.longSwipesRatio = 0.5;
  58377. /**
  58378. * @hidden
  58379. */
  58380. _this.longSwipesMs = 300;
  58381. /**
  58382. * @hidden
  58383. */
  58384. _this.followFinger = true;
  58385. /**
  58386. * @hidden
  58387. */
  58388. _this.onlyExternal = false;
  58389. /**
  58390. * @hidden
  58391. */
  58392. _this.threshold = 0;
  58393. /**
  58394. * @hidden
  58395. */
  58396. _this.touchMoveStopPropagation = true;
  58397. /**
  58398. * @hidden
  58399. */
  58400. _this.touchReleaseOnEdges = false;
  58401. // To support iOS's swipe-to-go-back gesture (when being used in-app, with UIWebView).
  58402. /**
  58403. * @hidden
  58404. */
  58405. _this.iOSEdgeSwipeDetection = false;
  58406. /**
  58407. * @hidden
  58408. */
  58409. _this.iOSEdgeSwipeThreshold = 20;
  58410. // Pagination
  58411. /**
  58412. * @hidden
  58413. */
  58414. _this.paginationClickable = false;
  58415. /**
  58416. * @hidden
  58417. */
  58418. _this.paginationHide = false;
  58419. // Resistance
  58420. /** @hidden */
  58421. _this.resistance = true;
  58422. /** @hidden */
  58423. _this.resistanceRatio = 0.85;
  58424. // Progress
  58425. /** @hidden */
  58426. _this.watchSlidesProgress = false;
  58427. /** @hidden */
  58428. _this.watchSlidesVisibility = false;
  58429. // Clicks
  58430. /**
  58431. * @hidden
  58432. */
  58433. _this.preventClicks = true;
  58434. /**
  58435. * @hidden
  58436. */
  58437. _this.preventClicksPropagation = true;
  58438. /**
  58439. * @hidden
  58440. */
  58441. _this.slideToClickedSlide = false;
  58442. // loop
  58443. /**
  58444. * @hidden
  58445. */
  58446. _this.loopAdditionalSlides = 0;
  58447. /**
  58448. * @hidden
  58449. */
  58450. _this.loopedSlides = null;
  58451. // Swiping/no swiping
  58452. /**
  58453. * @hidden
  58454. */
  58455. _this.swipeHandler = null;
  58456. /**
  58457. * @hidden
  58458. */
  58459. _this.noSwiping = true;
  58460. // Callbacks
  58461. /** @hidden */
  58462. _this.runCallbacksOnInit = true;
  58463. // Controller
  58464. _this.controlBy = 'slide';
  58465. _this.controlInverse = false;
  58466. // Keyboard
  58467. /**
  58468. * @hidden
  58469. */
  58470. _this.keyboardControl = true;
  58471. // Effects
  58472. /**
  58473. * @hidden
  58474. */
  58475. _this.coverflow = {
  58476. rotate: 50,
  58477. stretch: 0,
  58478. depth: 100,
  58479. modifier: 1,
  58480. slideShadows: true
  58481. };
  58482. /**
  58483. * @hidden
  58484. */
  58485. _this.flip = {
  58486. slideShadows: true,
  58487. limitRotation: true
  58488. };
  58489. /**
  58490. * @hidden
  58491. */
  58492. _this.cube = {
  58493. slideShadows: true,
  58494. shadow: true,
  58495. shadowOffset: 20,
  58496. shadowScale: 0.94
  58497. };
  58498. /**
  58499. * @hidden
  58500. */
  58501. _this.fade = {
  58502. crossFade: false
  58503. };
  58504. // Accessibility
  58505. /**
  58506. * @hidden
  58507. */
  58508. _this.prevSlideMessage = 'Previous slide';
  58509. /**
  58510. * @hidden
  58511. */
  58512. _this.nextSlideMessage = 'Next slide';
  58513. /**
  58514. * @hidden
  58515. */
  58516. _this.firstSlideMessage = 'This is the first slide';
  58517. /**
  58518. * @hidden
  58519. */
  58520. _this.lastSlideMessage = 'This is the last slide';
  58521. /**
  58522. * @output {Slides} Emitted when a slide change starts.
  58523. */
  58524. _this.ionSlideWillChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  58525. /**
  58526. * @output {Slides} Emitted when a slide change ends.
  58527. */
  58528. _this.ionSlideDidChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  58529. /**
  58530. * @output {Slides} Emitted when a slide moves.
  58531. */
  58532. _this.ionSlideDrag = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  58533. /**
  58534. * @output {Slides} Emitted when slides reaches its beginning (initial position).
  58535. */
  58536. _this.ionSlideReachStart = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  58537. /**
  58538. * @output {Slides} Emitted when slides reaches its last slide.
  58539. */
  58540. _this.ionSlideReachEnd = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  58541. /**
  58542. * @output {Slides} Emitted when a slide moves.
  58543. */
  58544. _this.ionSlideAutoplay = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  58545. /**
  58546. * @output {Slides} Emitted when a autoplay starts.
  58547. */
  58548. _this.ionSlideAutoplayStart = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  58549. /**
  58550. * @output {Slides} Emitted when a autoplay stops.
  58551. */
  58552. _this.ionSlideAutoplayStop = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  58553. /**
  58554. * @output {Slides} Emitted when a slide change starts with the "forward" direction.
  58555. */
  58556. _this.ionSlideNextStart = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  58557. /**
  58558. * @output {Slides} Emitted when a slide change starts with the "backward" direction.
  58559. */
  58560. _this.ionSlidePrevStart = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  58561. /**
  58562. * @output {Slides} Emitted when a slide change ends with the "forward" direction.
  58563. */
  58564. _this.ionSlideNextEnd = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  58565. /**
  58566. * @output {Slides} Emitted when a slide change ends with the "backward" direction.
  58567. */
  58568. _this.ionSlidePrevEnd = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  58569. /**
  58570. * @output {Slides} Emitted when the user taps/clicks on the slide's container.
  58571. */
  58572. _this.ionSlideTap = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  58573. /**
  58574. * @output {Slides} Emitted when the user double taps on the slide's container.
  58575. */
  58576. _this.ionSlideDoubleTap = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  58577. /** @hidden */
  58578. _this.ionSlideProgress = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  58579. /** @hidden */
  58580. _this.ionSlideTransitionStart = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  58581. /** @hidden */
  58582. _this.ionSlideTransitionEnd = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  58583. /** @hidden */
  58584. _this.ionSlideTouchStart = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  58585. /** @hidden */
  58586. _this.ionSlideTouchEnd = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  58587. _this._unregs = [];
  58588. /** @internal */
  58589. _this._allowSwipeToNext = true;
  58590. /** @internal */
  58591. _this._allowSwipeToPrev = true;
  58592. _this._zone = zone;
  58593. _this.id = ++slidesId;
  58594. _this.slideId = 'slides-' + _this.id;
  58595. _this.setElementClass(_this.slideId, true);
  58596. // only initialize the slides whent the content is ready
  58597. if (viewCtrl) {
  58598. var subscription = viewCtrl.readReady.subscribe(function () {
  58599. subscription.unsubscribe();
  58600. _this._initSlides();
  58601. });
  58602. }
  58603. return _this;
  58604. }
  58605. Object.defineProperty(Slides.prototype, "autoplay", {
  58606. /**
  58607. * @input {number} Delay between transitions (in milliseconds). If this
  58608. * parameter is not passed, autoplay is disabled. Default does
  58609. * not have a value and does not autoplay.
  58610. * Default: `null`.
  58611. */
  58612. get: function () {
  58613. return this._autoplayMs;
  58614. },
  58615. set: function (val) {
  58616. this._autoplayMs = parseInt(val, 10);
  58617. },
  58618. enumerable: true,
  58619. configurable: true
  58620. });
  58621. Object.defineProperty(Slides.prototype, "control", {
  58622. /**
  58623. * @input {Slides} Pass another Slides instance or array of Slides instances
  58624. * that should be controlled by this Slides instance.
  58625. * Default: `null`.
  58626. */
  58627. get: function () {
  58628. return this._control;
  58629. },
  58630. set: function (val) {
  58631. if (val instanceof Slides || Array.isArray(val)) {
  58632. this._control = val;
  58633. }
  58634. },
  58635. enumerable: true,
  58636. configurable: true
  58637. });
  58638. Object.defineProperty(Slides.prototype, "effect", {
  58639. /**
  58640. * @input {string} The animation effect of the slides.
  58641. * Possible values are: `slide`, `fade`, `cube`, `coverflow` or `flip`.
  58642. * Default: `slide`.
  58643. */
  58644. get: function () {
  58645. return this._effectName;
  58646. },
  58647. set: function (effectName) {
  58648. if (__WEBPACK_IMPORTED_MODULE_9__swiper_swiper_effects__["a" /* SWIPER_EFFECTS */][effectName]) {
  58649. this._effectName = effectName;
  58650. }
  58651. },
  58652. enumerable: true,
  58653. configurable: true
  58654. });
  58655. Object.defineProperty(Slides.prototype, "direction", {
  58656. /**
  58657. * @input {string} Swipe direction: 'horizontal' or 'vertical'.
  58658. * Default: `horizontal`.
  58659. */
  58660. get: function () {
  58661. return this._direction;
  58662. },
  58663. set: function (val) {
  58664. if (val === 'horizontal' || val === 'vertical') {
  58665. this._direction = val;
  58666. }
  58667. },
  58668. enumerable: true,
  58669. configurable: true
  58670. });
  58671. Object.defineProperty(Slides.prototype, "initialSlide", {
  58672. /**
  58673. * @input {number} Index number of initial slide. Default: `0`.
  58674. */
  58675. get: function () {
  58676. return this._initialSlide;
  58677. },
  58678. set: function (val) {
  58679. this._initialSlide = parseInt(val, 10);
  58680. },
  58681. enumerable: true,
  58682. configurable: true
  58683. });
  58684. Object.defineProperty(Slides.prototype, "loop", {
  58685. /**
  58686. * @input {boolean} If true, continuously loop from the last slide to the
  58687. * first slide.
  58688. */
  58689. get: function () {
  58690. return this._isLoop;
  58691. },
  58692. set: function (val) {
  58693. this._isLoop = Object(__WEBPACK_IMPORTED_MODULE_4__util_util__["o" /* isTrueProperty */])(val);
  58694. },
  58695. enumerable: true,
  58696. configurable: true
  58697. });
  58698. Object.defineProperty(Slides.prototype, "pager", {
  58699. /**
  58700. * @input {boolean} If true, show the pager.
  58701. */
  58702. get: function () {
  58703. return this._pager;
  58704. },
  58705. set: function (val) {
  58706. this._pager = Object(__WEBPACK_IMPORTED_MODULE_4__util_util__["o" /* isTrueProperty */])(val);
  58707. },
  58708. enumerable: true,
  58709. configurable: true
  58710. });
  58711. Object.defineProperty(Slides.prototype, "dir", {
  58712. /**
  58713. * @input {string} If dir attribute is equal to rtl, set interal _rtl to true;
  58714. */
  58715. set: function (val) {
  58716. this._rtl = (val.toLowerCase() === 'rtl');
  58717. },
  58718. enumerable: true,
  58719. configurable: true
  58720. });
  58721. Object.defineProperty(Slides.prototype, "paginationType", {
  58722. /**
  58723. * @input {string} Type of pagination. Possible values are:
  58724. * `bullets`, `fraction`, `progress`. Default: `bullets`.
  58725. * (Note that the pager will not show unless `pager` input
  58726. * is set to true).
  58727. */
  58728. get: function () {
  58729. return this._paginationType;
  58730. },
  58731. set: function (val) {
  58732. if (val === 'bullets' || val === 'fraction' || val === 'progress') {
  58733. this._paginationType = val;
  58734. }
  58735. },
  58736. enumerable: true,
  58737. configurable: true
  58738. });
  58739. Object.defineProperty(Slides.prototype, "parallax", {
  58740. /**
  58741. * @input {boolean} If true, allows you to use "parallaxed" elements inside of
  58742. * slider.
  58743. */
  58744. get: function () {
  58745. return this._isParallax;
  58746. },
  58747. set: function (val) {
  58748. this._isParallax = Object(__WEBPACK_IMPORTED_MODULE_4__util_util__["o" /* isTrueProperty */])(val);
  58749. },
  58750. enumerable: true,
  58751. configurable: true
  58752. });
  58753. Object.defineProperty(Slides.prototype, "speed", {
  58754. /**
  58755. * @input {number} Duration of transition between slides
  58756. * (in milliseconds). Default: `300`.
  58757. */
  58758. get: function () {
  58759. return this._speedMs;
  58760. },
  58761. set: function (val) {
  58762. this._speedMs = parseInt(val, 10);
  58763. },
  58764. enumerable: true,
  58765. configurable: true
  58766. });
  58767. Object.defineProperty(Slides.prototype, "zoom", {
  58768. /**
  58769. * @input {boolean} If true, enables zooming functionality.
  58770. */
  58771. get: function () {
  58772. return this._isZoom;
  58773. },
  58774. set: function (val) {
  58775. this._isZoom = Object(__WEBPACK_IMPORTED_MODULE_4__util_util__["o" /* isTrueProperty */])(val);
  58776. },
  58777. enumerable: true,
  58778. configurable: true
  58779. });
  58780. Object.defineProperty(Slides.prototype, "spaceBetween", {
  58781. // Slides grid
  58782. /**
  58783. * @input {number} Distance between slides in px. Default: `0`.
  58784. */
  58785. get: function () {
  58786. return this._spaceBetween;
  58787. },
  58788. set: function (val) {
  58789. this._spaceBetween = parseInt(val, 10);
  58790. },
  58791. enumerable: true,
  58792. configurable: true
  58793. });
  58794. Object.defineProperty(Slides.prototype, "slidesPerView", {
  58795. /**
  58796. * @input {number} Slides per view. Slides visible at the same time. Default: `1`.
  58797. */
  58798. get: function () {
  58799. return this._slidesPerView;
  58800. },
  58801. set: function (val) {
  58802. this._slidesPerView = val === 'auto' ? 'auto' : parseFloat(val);
  58803. },
  58804. enumerable: true,
  58805. configurable: true
  58806. });
  58807. Object.defineProperty(Slides.prototype, "centeredSlides", {
  58808. /**
  58809. * @input {boolean} Center a slide in the middle of the screen.
  58810. */
  58811. get: function () {
  58812. return this._centeredSlides;
  58813. },
  58814. set: function (val) {
  58815. this._centeredSlides = Object(__WEBPACK_IMPORTED_MODULE_4__util_util__["o" /* isTrueProperty */])(val);
  58816. },
  58817. enumerable: true,
  58818. configurable: true
  58819. });
  58820. Slides.prototype._initSlides = function () {
  58821. if (!this._init) {
  58822. (void 0) /* console.debug */;
  58823. var s = this;
  58824. var plt = s._plt;
  58825. s.container = this.getNativeElement().children[0];
  58826. // init swiper core
  58827. Object(__WEBPACK_IMPORTED_MODULE_8__swiper_swiper__["d" /* initSwiper */])(s, plt);
  58828. // init core event listeners
  58829. this._unregs.push(Object(__WEBPACK_IMPORTED_MODULE_5__swiper_swiper_events__["a" /* initEvents */])(s, plt));
  58830. if (this.zoom) {
  58831. // init zoom event listeners
  58832. this._unregs.push(Object(__WEBPACK_IMPORTED_MODULE_6__swiper_swiper_zoom__["a" /* initZoom */])(s, plt));
  58833. }
  58834. if (this.keyboardControl) {
  58835. // init keyboard event listeners
  58836. s.enableKeyboardControl(true);
  58837. }
  58838. this._init = true;
  58839. }
  58840. };
  58841. /**
  58842. * @hidden
  58843. */
  58844. Slides.prototype.ngAfterContentInit = function () {
  58845. var _this = this;
  58846. this._plt.timeout(function () {
  58847. _this._initSlides();
  58848. }, 300);
  58849. };
  58850. /**
  58851. * Update the underlying slider implementation. Call this if you've added or removed
  58852. * child slides.
  58853. */
  58854. Slides.prototype.update = function (debounce) {
  58855. var _this = this;
  58856. if (debounce === void 0) { debounce = 300; }
  58857. if (this._init) {
  58858. this._plt.cancelTimeout(this._tmr);
  58859. this._tmr = this._plt.timeout(function () {
  58860. Object(__WEBPACK_IMPORTED_MODULE_8__swiper_swiper__["n" /* update */])(_this, _this._plt);
  58861. // Don't allow pager to show with > 10 slides
  58862. if (_this.length() > 10) {
  58863. _this.paginationType = undefined;
  58864. }
  58865. }, debounce);
  58866. }
  58867. };
  58868. Slides.prototype.resize = function () {
  58869. if (this._init) {
  58870. }
  58871. };
  58872. /**
  58873. * Transition to the specified slide.
  58874. *
  58875. * @param {number} index The index number of the slide.
  58876. * @param {number} [speed] Transition duration (in ms).
  58877. * @param {boolean} [runCallbacks] Whether or not to emit the `ionSlideWillChange`/`ionSlideDidChange` events. Default true.
  58878. */
  58879. Slides.prototype.slideTo = function (index, speed, runCallbacks) {
  58880. Object(__WEBPACK_IMPORTED_MODULE_8__swiper_swiper__["k" /* slideTo */])(this, this._plt, index, speed, runCallbacks);
  58881. };
  58882. /**
  58883. * Transition to the next slide.
  58884. *
  58885. * @param {number} [speed] Transition duration (in ms).
  58886. * @param {boolean} [runCallbacks] Whether or not to emit the `ionSlideWillChange`/`ionSlideDidChange` events. Default true.
  58887. */
  58888. Slides.prototype.slideNext = function (speed, runCallbacks) {
  58889. Object(__WEBPACK_IMPORTED_MODULE_8__swiper_swiper__["h" /* slideNext */])(this, this._plt, runCallbacks, speed, true);
  58890. };
  58891. /**
  58892. * Transition to the previous slide.
  58893. *
  58894. * @param {number} [speed] Transition duration (in ms).
  58895. * @param {boolean} [runCallbacks] Whether or not to emit the `ionSlideWillChange`/`ionSlideDidChange` events. Default true.
  58896. */
  58897. Slides.prototype.slidePrev = function (speed, runCallbacks) {
  58898. Object(__WEBPACK_IMPORTED_MODULE_8__swiper_swiper__["i" /* slidePrev */])(this, this._plt, runCallbacks, speed, true);
  58899. };
  58900. /**
  58901. * Get the index of the active slide.
  58902. *
  58903. * @returns {number} The index number of the current slide.
  58904. */
  58905. Slides.prototype.getActiveIndex = function () {
  58906. return this._activeIndex;
  58907. };
  58908. /**
  58909. * Get the index of the previous slide.
  58910. *
  58911. * @returns {number} The index number of the previous slide.
  58912. */
  58913. Slides.prototype.getPreviousIndex = function () {
  58914. return this._previousIndex;
  58915. };
  58916. /**
  58917. * Get the total number of slides.
  58918. *
  58919. * @returns {number} The total number of slides.
  58920. */
  58921. Slides.prototype.length = function () {
  58922. return this._slides.length;
  58923. };
  58924. /**
  58925. * Get whether or not the current slide is the last slide.
  58926. *
  58927. * @returns {boolean} If the slide is the last slide or not.
  58928. */
  58929. Slides.prototype.isEnd = function () {
  58930. return this._isEnd;
  58931. };
  58932. /**
  58933. * Get whether or not the current slide is the first slide.
  58934. *
  58935. * @returns {boolean} If the slide is the first slide or not.
  58936. */
  58937. Slides.prototype.isBeginning = function () {
  58938. return this._isBeginning;
  58939. };
  58940. /**
  58941. * Start auto play.
  58942. */
  58943. Slides.prototype.startAutoplay = function () {
  58944. Object(__WEBPACK_IMPORTED_MODULE_8__swiper_swiper__["l" /* startAutoplay */])(this, this._plt);
  58945. };
  58946. /**
  58947. * Stop auto play.
  58948. */
  58949. Slides.prototype.stopAutoplay = function () {
  58950. Object(__WEBPACK_IMPORTED_MODULE_8__swiper_swiper__["m" /* stopAutoplay */])(this);
  58951. };
  58952. /**
  58953. * Lock or unlock the ability to slide to the next slides.
  58954. * @param {boolean} shouldLockSwipeToNext If set to true the user will not be able to swipe to the next slide.
  58955. * Set to false to unlock this behaviour.
  58956. */
  58957. Slides.prototype.lockSwipeToNext = function (shouldLockSwipeToNext) {
  58958. this._allowSwipeToNext = !shouldLockSwipeToNext;
  58959. };
  58960. /**
  58961. * Lock or unlock the ability to slide to the previous slides.
  58962. * @param {boolean} shouldLockSwipeToPrev If set to true the user will not be able to swipe to the previous slide.
  58963. * Set to false to unlock this behaviour.
  58964. */
  58965. Slides.prototype.lockSwipeToPrev = function (shouldLockSwipeToPrev) {
  58966. this._allowSwipeToPrev = !shouldLockSwipeToPrev;
  58967. };
  58968. /**
  58969. * Lock or unlock the ability to slide to change slides.
  58970. * @param {boolean} shouldLockSwipes If set to true user can not swipe in either direction on slide.
  58971. * False allows swiping in both directions.
  58972. */
  58973. Slides.prototype.lockSwipes = function (shouldLockSwipes) {
  58974. this._allowSwipeToNext = this._allowSwipeToPrev = !shouldLockSwipes;
  58975. };
  58976. /**
  58977. * Enable or disable keyboard control.
  58978. * @param {boolean} shouldEnableKeyboard If set to true the slider can be controled by a keyboard.
  58979. */
  58980. Slides.prototype.enableKeyboardControl = function (shouldEnableKeyboard) {
  58981. Object(__WEBPACK_IMPORTED_MODULE_2__swiper_swiper_keyboard__["a" /* enableKeyboardControl */])(this, this._plt, shouldEnableKeyboard);
  58982. };
  58983. /**
  58984. * @hidden
  58985. */
  58986. Slides.prototype.ngOnDestroy = function () {
  58987. this._init = false;
  58988. this._unregs.forEach(function (unReg) {
  58989. unReg();
  58990. });
  58991. this._unregs.length = 0;
  58992. Object(__WEBPACK_IMPORTED_MODULE_8__swiper_swiper__["b" /* destroySwiper */])(this);
  58993. this.enableKeyboardControl(false);
  58994. };
  58995. Slides.decorators = [
  58996. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  58997. selector: 'ion-slides',
  58998. template: '<div class="swiper-container" [attr.dir]="_rtl? \'rtl\' : null">' +
  58999. '<div class="swiper-wrapper">' +
  59000. '<ng-content></ng-content>' +
  59001. '</div>' +
  59002. '<div [class.hide]="!pager" class="swiper-pagination"></div>' +
  59003. '</div>',
  59004. changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["i" /* ChangeDetectionStrategy */].OnPush,
  59005. encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_11" /* ViewEncapsulation */].None,
  59006. },] },
  59007. ];
  59008. /** @nocollapse */
  59009. Slides.ctorParameters = function () { return [
  59010. { type: __WEBPACK_IMPORTED_MODULE_1__config_config__["a" /* Config */], },
  59011. { type: __WEBPACK_IMPORTED_MODULE_7__platform_platform__["a" /* Platform */], },
  59012. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["M" /* NgZone */], },
  59013. { type: __WEBPACK_IMPORTED_MODULE_10__navigation_view_controller__["a" /* ViewController */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  59014. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  59015. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  59016. ]; };
  59017. Slides.propDecorators = {
  59018. 'autoplay': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  59019. 'control': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  59020. 'effect': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  59021. 'direction': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  59022. 'initialSlide': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  59023. 'loop': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  59024. 'pager': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  59025. 'dir': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  59026. 'paginationType': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  59027. 'parallax': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  59028. 'speed': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  59029. 'zoom': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  59030. 'spaceBetween': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  59031. 'slidesPerView': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  59032. 'centeredSlides': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  59033. 'ionSlideWillChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  59034. 'ionSlideDidChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  59035. 'ionSlideDrag': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  59036. 'ionSlideReachStart': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  59037. 'ionSlideReachEnd': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  59038. 'ionSlideAutoplay': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  59039. 'ionSlideAutoplayStart': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  59040. 'ionSlideAutoplayStop': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  59041. 'ionSlideNextStart': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  59042. 'ionSlidePrevStart': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  59043. 'ionSlideNextEnd': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  59044. 'ionSlidePrevEnd': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  59045. 'ionSlideTap': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  59046. 'ionSlideDoubleTap': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  59047. };
  59048. return Slides;
  59049. }(__WEBPACK_IMPORTED_MODULE_3__ion__["a" /* Ion */]));
  59050. var slidesId = -1;
  59051. //# sourceMappingURL=slides.js.map
  59052. /***/ }),
  59053. /* 88 */
  59054. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59055. "use strict";
  59056. /* harmony export (immutable) */ __webpack_exports__["d"] = setWrapperTranslate;
  59057. /* harmony export (immutable) */ __webpack_exports__["a"] = getTranslate;
  59058. /* harmony export (immutable) */ __webpack_exports__["b"] = getWrapperTranslate;
  59059. /* harmony export (immutable) */ __webpack_exports__["c"] = setWrapperTransition;
  59060. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__swiper_utils__ = __webpack_require__(12);
  59061. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__swiper_parallax__ = __webpack_require__(176);
  59062. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__swiper_progress__ = __webpack_require__(47);
  59063. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__swiper_index__ = __webpack_require__(48);
  59064. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__swiper_controller__ = __webpack_require__(259);
  59065. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__swiper_effects__ = __webpack_require__(91);
  59066. function setWrapperTranslate(s, plt, translate, shouldUpdateActiveIndex, byController) {
  59067. var x = 0, y = 0, z = 0;
  59068. if (Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s)) {
  59069. x = s._rtl ? -translate : translate;
  59070. }
  59071. else {
  59072. y = translate;
  59073. }
  59074. if (s.roundLengths) {
  59075. x = Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["m" /* round */])(x);
  59076. y = Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["m" /* round */])(y);
  59077. }
  59078. if (!s.virtualTranslate) {
  59079. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["n" /* transform */])(s._wrapper, 'translate3d(' + x + 'px, ' + y + 'px, ' + z + 'px)');
  59080. }
  59081. s._translate = Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) ? x : y;
  59082. // Check if we need to update progress
  59083. var progress;
  59084. var translatesDiff = Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["h" /* maxTranslate */])(s) - Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["i" /* minTranslate */])(s);
  59085. if (translatesDiff === 0) {
  59086. progress = 0;
  59087. }
  59088. else {
  59089. progress = (translate - Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["i" /* minTranslate */])(s)) / (translatesDiff);
  59090. }
  59091. if (progress !== s.progress) {
  59092. Object(__WEBPACK_IMPORTED_MODULE_2__swiper_progress__["a" /* updateProgress */])(s, translate);
  59093. }
  59094. if (shouldUpdateActiveIndex) {
  59095. Object(__WEBPACK_IMPORTED_MODULE_3__swiper_index__["a" /* updateActiveIndex */])(s);
  59096. }
  59097. if (s.effect !== 'slide' && __WEBPACK_IMPORTED_MODULE_5__swiper_effects__["a" /* SWIPER_EFFECTS */][s.effect]) {
  59098. __WEBPACK_IMPORTED_MODULE_5__swiper_effects__["a" /* SWIPER_EFFECTS */][s.effect].setTranslate(s, plt);
  59099. }
  59100. if (s.parallax) {
  59101. Object(__WEBPACK_IMPORTED_MODULE_1__swiper_parallax__["b" /* parallaxSetTranslate */])(s);
  59102. }
  59103. if (s.control) {
  59104. __WEBPACK_IMPORTED_MODULE_4__swiper_controller__["a" /* SWIPER_CONTROLLER */].setTranslate(s, plt, s._translate, byController, setWrapperTranslate);
  59105. }
  59106. }
  59107. function getTranslate(s, plt, el, axis) {
  59108. var win = plt.win();
  59109. var matrix;
  59110. var curTransform;
  59111. var curStyle;
  59112. var transformMatrix;
  59113. // automatic axis detection
  59114. if (typeof axis === 'undefined') {
  59115. axis = 'x';
  59116. }
  59117. if (s.virtualTranslate) {
  59118. return s._rtl ? -s._translate : s._translate;
  59119. }
  59120. curStyle = plt.getElementComputedStyle(el);
  59121. if (win.WebKitCSSMatrix) {
  59122. curTransform = curStyle.transform || curStyle.webkitTransform;
  59123. if (curTransform.split(',').length > 6) {
  59124. curTransform = curTransform.split(', ').map(function (a) {
  59125. return a.replace(',', '.');
  59126. }).join(', ');
  59127. }
  59128. // Some old versions of Webkit choke when 'none' is passed; pass
  59129. // empty string instead in this case
  59130. transformMatrix = new win.WebKitCSSMatrix(curTransform === 'none' ? '' : curTransform);
  59131. }
  59132. else {
  59133. transformMatrix = curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform || curStyle.transform || curStyle.getPropertyValue('transform').replace('translate(', 'matrix(1, 0, 0, 1,');
  59134. matrix = transformMatrix.toString().split(',');
  59135. }
  59136. if (axis === 'x') {
  59137. if (win.WebKitCSSMatrix) {
  59138. // Latest Chrome and webkits Fix
  59139. curTransform = transformMatrix.m41;
  59140. }
  59141. else if (matrix.length === 16) {
  59142. // Crazy IE10 Matrix
  59143. curTransform = parseFloat(matrix[12]);
  59144. }
  59145. else {
  59146. // Normal Browsers
  59147. curTransform = parseFloat(matrix[4]);
  59148. }
  59149. }
  59150. if (axis === 'y') {
  59151. if (win.WebKitCSSMatrix) {
  59152. // Latest Chrome and webkits Fix
  59153. curTransform = transformMatrix.m42;
  59154. }
  59155. else if (matrix.length === 16) {
  59156. // Crazy IE10 Matrix
  59157. curTransform = parseFloat(matrix[13]);
  59158. }
  59159. else {
  59160. // Normal Browsers
  59161. curTransform = parseFloat(matrix[5]);
  59162. }
  59163. }
  59164. if (s._rtl && curTransform) {
  59165. curTransform = -curTransform;
  59166. }
  59167. return curTransform || 0;
  59168. }
  59169. function getWrapperTranslate(s, plt, axis) {
  59170. if (typeof axis === 'undefined') {
  59171. axis = Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) ? 'x' : 'y';
  59172. }
  59173. return getTranslate(s, plt, s._wrapper, axis);
  59174. }
  59175. function setWrapperTransition(s, plt, duration, byController) {
  59176. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["o" /* transition */])(s._wrapper, duration);
  59177. if (s.effect !== 'slide' && __WEBPACK_IMPORTED_MODULE_5__swiper_effects__["a" /* SWIPER_EFFECTS */][s.effect]) {
  59178. __WEBPACK_IMPORTED_MODULE_5__swiper_effects__["a" /* SWIPER_EFFECTS */][s.effect].setTransition(s, plt, duration);
  59179. }
  59180. if (s.parallax) {
  59181. Object(__WEBPACK_IMPORTED_MODULE_1__swiper_parallax__["a" /* parallaxSetTransition */])(s, duration);
  59182. }
  59183. if (s.control) {
  59184. __WEBPACK_IMPORTED_MODULE_4__swiper_controller__["a" /* SWIPER_CONTROLLER */].setTransition(s, plt, duration, byController, setWrapperTransition);
  59185. }
  59186. }
  59187. //# sourceMappingURL=swiper-transition.js.map
  59188. /***/ }),
  59189. /* 89 */
  59190. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59191. "use strict";
  59192. /* harmony export (immutable) */ __webpack_exports__["a"] = updateClasses;
  59193. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__swiper_a11y__ = __webpack_require__(258);
  59194. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__swiper_utils__ = __webpack_require__(12);
  59195. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__swiper_pagination__ = __webpack_require__(90);
  59196. /*=========================
  59197. Classes
  59198. ===========================*/
  59199. function updateClasses(s) {
  59200. var childElements;
  59201. Object(__WEBPACK_IMPORTED_MODULE_1__swiper_utils__["l" /* removeClass */])(s._slides, [__WEBPACK_IMPORTED_MODULE_1__swiper_utils__["a" /* CLS */].slideActive, __WEBPACK_IMPORTED_MODULE_1__swiper_utils__["a" /* CLS */].slideNext, __WEBPACK_IMPORTED_MODULE_1__swiper_utils__["a" /* CLS */].slidePrev, __WEBPACK_IMPORTED_MODULE_1__swiper_utils__["a" /* CLS */].slideDuplicateActive, __WEBPACK_IMPORTED_MODULE_1__swiper_utils__["a" /* CLS */].slideDuplicateNext, __WEBPACK_IMPORTED_MODULE_1__swiper_utils__["a" /* CLS */].slideDuplicatePrev]);
  59202. for (var i = 0; i < s._slides.length; i++) {
  59203. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_a11y__["b" /* ariaHidden */])(s._slides[i], true);
  59204. }
  59205. var activeSlide = s._slides[s._activeIndex];
  59206. if (!activeSlide) {
  59207. return;
  59208. }
  59209. // Active classes
  59210. Object(__WEBPACK_IMPORTED_MODULE_1__swiper_utils__["b" /* addClass */])(activeSlide, __WEBPACK_IMPORTED_MODULE_1__swiper_utils__["a" /* CLS */].slideActive);
  59211. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_a11y__["b" /* ariaHidden */])(activeSlide, false);
  59212. if (s.loop) {
  59213. // Duplicate to all looped slides
  59214. if (activeSlide.classList.contains(__WEBPACK_IMPORTED_MODULE_1__swiper_utils__["a" /* CLS */].slideDuplicate)) {
  59215. childElements = Object(__WEBPACK_IMPORTED_MODULE_1__swiper_utils__["k" /* queryChildren */])(s._wrapper, '.' + __WEBPACK_IMPORTED_MODULE_1__swiper_utils__["a" /* CLS */].slide + ':not(.' + __WEBPACK_IMPORTED_MODULE_1__swiper_utils__["a" /* CLS */].slideDuplicate + ')[data-swiper-slide-index="' + s.realIndex + '"]');
  59216. }
  59217. else {
  59218. childElements = Object(__WEBPACK_IMPORTED_MODULE_1__swiper_utils__["k" /* queryChildren */])(s._wrapper, '.' + __WEBPACK_IMPORTED_MODULE_1__swiper_utils__["a" /* CLS */].slide + '.' + __WEBPACK_IMPORTED_MODULE_1__swiper_utils__["a" /* CLS */].slideDuplicate + '[data-swiper-slide-index="' + s.realIndex + '"]');
  59219. }
  59220. Object(__WEBPACK_IMPORTED_MODULE_1__swiper_utils__["b" /* addClass */])(childElements, __WEBPACK_IMPORTED_MODULE_1__swiper_utils__["a" /* CLS */].slideDuplicateActive);
  59221. }
  59222. // Next Slide
  59223. var nextSlide = activeSlide.nextElementSibling;
  59224. if (s.loop && !nextSlide) {
  59225. nextSlide = s._slides[0];
  59226. }
  59227. nextSlide && nextSlide.classList.add(__WEBPACK_IMPORTED_MODULE_1__swiper_utils__["a" /* CLS */].slideNext);
  59228. // Prev Slide
  59229. var prevSlide = activeSlide.previousElementSibling;
  59230. if (s.loop && !prevSlide) {
  59231. prevSlide = s._slides[s._slides.length - 1];
  59232. }
  59233. prevSlide && prevSlide.classList.add(__WEBPACK_IMPORTED_MODULE_1__swiper_utils__["a" /* CLS */].slidePrev);
  59234. if (s.loop) {
  59235. // Duplicate to all looped slides
  59236. if (nextSlide.classList.contains(__WEBPACK_IMPORTED_MODULE_1__swiper_utils__["a" /* CLS */].slideDuplicate)) {
  59237. childElements = Object(__WEBPACK_IMPORTED_MODULE_1__swiper_utils__["k" /* queryChildren */])(s._wrapper, '.' + __WEBPACK_IMPORTED_MODULE_1__swiper_utils__["a" /* CLS */].slide + ':not(.' + __WEBPACK_IMPORTED_MODULE_1__swiper_utils__["a" /* CLS */].slideDuplicate + ')[data-swiper-slide-index="' + nextSlide.getAttribute('data-swiper-slide-index') + '"]');
  59238. }
  59239. else {
  59240. childElements = Object(__WEBPACK_IMPORTED_MODULE_1__swiper_utils__["k" /* queryChildren */])(s._wrapper, '.' + __WEBPACK_IMPORTED_MODULE_1__swiper_utils__["a" /* CLS */].slide + '.' + __WEBPACK_IMPORTED_MODULE_1__swiper_utils__["a" /* CLS */].slideDuplicate + '[data-swiper-slide-index="' + nextSlide.getAttribute('data-swiper-slide-index') + '"]');
  59241. }
  59242. Object(__WEBPACK_IMPORTED_MODULE_1__swiper_utils__["b" /* addClass */])(childElements, __WEBPACK_IMPORTED_MODULE_1__swiper_utils__["a" /* CLS */].slideDuplicateNext);
  59243. if (prevSlide.classList.contains(__WEBPACK_IMPORTED_MODULE_1__swiper_utils__["a" /* CLS */].slideDuplicate)) {
  59244. childElements = Object(__WEBPACK_IMPORTED_MODULE_1__swiper_utils__["k" /* queryChildren */])(s._wrapper, '.' + __WEBPACK_IMPORTED_MODULE_1__swiper_utils__["a" /* CLS */].slide + ':not(.' + __WEBPACK_IMPORTED_MODULE_1__swiper_utils__["a" /* CLS */].slideDuplicate + ')[data-swiper-slide-index="' + prevSlide.getAttribute('data-swiper-slide-index') + '"]');
  59245. }
  59246. else {
  59247. childElements = Object(__WEBPACK_IMPORTED_MODULE_1__swiper_utils__["k" /* queryChildren */])(s._wrapper, '.' + __WEBPACK_IMPORTED_MODULE_1__swiper_utils__["a" /* CLS */].slide + '.' + __WEBPACK_IMPORTED_MODULE_1__swiper_utils__["a" /* CLS */].slideDuplicate + '[data-swiper-slide-index="' + prevSlide.getAttribute('data-swiper-slide-index') + '"]');
  59248. }
  59249. Object(__WEBPACK_IMPORTED_MODULE_1__swiper_utils__["b" /* addClass */])(childElements, __WEBPACK_IMPORTED_MODULE_1__swiper_utils__["a" /* CLS */].slideDuplicatePrev);
  59250. }
  59251. // Pagination
  59252. if (s._paginationContainer) {
  59253. Object(__WEBPACK_IMPORTED_MODULE_2__swiper_pagination__["b" /* updatePaginationClasses */])(s);
  59254. }
  59255. // Next/active buttons
  59256. if (!s.loop) {
  59257. if (s.prevButton) {
  59258. if (s._isBeginning) {
  59259. s.prevButton.classList.add(__WEBPACK_IMPORTED_MODULE_1__swiper_utils__["a" /* CLS */].buttonDisabled);
  59260. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_a11y__["a" /* ariaDisable */])(s.prevButton, true);
  59261. }
  59262. else {
  59263. s.prevButton.classList.remove(__WEBPACK_IMPORTED_MODULE_1__swiper_utils__["a" /* CLS */].buttonDisabled);
  59264. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_a11y__["a" /* ariaDisable */])(s.prevButton, false);
  59265. }
  59266. }
  59267. if (s.nextButton) {
  59268. if (s._isEnd) {
  59269. s.nextButton.classList.add(__WEBPACK_IMPORTED_MODULE_1__swiper_utils__["a" /* CLS */].buttonDisabled);
  59270. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_a11y__["a" /* ariaDisable */])(s.nextButton, true);
  59271. }
  59272. else {
  59273. s.nextButton.classList.remove(__WEBPACK_IMPORTED_MODULE_1__swiper_utils__["a" /* CLS */].buttonDisabled);
  59274. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_a11y__["a" /* ariaDisable */])(s.nextButton, false);
  59275. }
  59276. }
  59277. }
  59278. }
  59279. //# sourceMappingURL=swiper-classes.js.map
  59280. /***/ }),
  59281. /* 90 */
  59282. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59283. "use strict";
  59284. /* harmony export (immutable) */ __webpack_exports__["a"] = updatePagination;
  59285. /* harmony export (immutable) */ __webpack_exports__["b"] = updatePaginationClasses;
  59286. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__swiper_utils__ = __webpack_require__(12);
  59287. /*=========================
  59288. Pagination
  59289. ===========================*/
  59290. function updatePagination(s) {
  59291. if (!s.paginationType || !s._paginationContainer)
  59292. return;
  59293. var paginationHTML = '';
  59294. if (s.paginationType === 'bullets') {
  59295. var numberOfBullets = s.loop ? Math.ceil((s._slides.length - s.loopedSlides * 2) / s.slidesPerGroup) : s._snapGrid.length;
  59296. for (var i = 0; i < numberOfBullets; i++) {
  59297. if (s.paginationBulletRender) {
  59298. paginationHTML += s.paginationBulletRender(i, __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].bullet);
  59299. }
  59300. else {
  59301. paginationHTML += "<button class=\"" + __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].bullet + "\" aria-label=\"Go to slide " + (i + 1) + "\" data-slide-index=\"" + i + "\"></button>";
  59302. }
  59303. }
  59304. }
  59305. else if (s.paginationType === 'fraction') {
  59306. paginationHTML =
  59307. '<span class="' + __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].paginationCurrent + '"></span>' +
  59308. ' / ' +
  59309. '<span class="' + __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].paginationTotal + '"></span>';
  59310. }
  59311. else if (s.paginationType === 'progress') {
  59312. paginationHTML = '<span class="' + __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].paginationProgressbar + '"></span>';
  59313. }
  59314. s._paginationContainer.innerHTML = paginationHTML;
  59315. s._bullets = s._paginationContainer.querySelectorAll('.' + __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].bullet);
  59316. }
  59317. function updatePaginationClasses(s) {
  59318. // Current/Total
  59319. var current;
  59320. var total = s.loop ? Math.ceil((s._slides.length - s.loopedSlides * 2) / s.slidesPerGroup) : s._snapGrid.length;
  59321. if (s.loop) {
  59322. current = Math.ceil((s._activeIndex - s.loopedSlides) / s.slidesPerGroup);
  59323. if (current > s._slides.length - 1 - s.loopedSlides * 2) {
  59324. current = current - (s._slides.length - s.loopedSlides * 2);
  59325. }
  59326. if (current > total - 1) {
  59327. current = current - total;
  59328. }
  59329. if (current < 0 && s.paginationType !== 'bullets') {
  59330. current = total + current;
  59331. }
  59332. }
  59333. else {
  59334. if (typeof s._snapIndex !== 'undefined') {
  59335. current = s._snapIndex;
  59336. }
  59337. else {
  59338. current = s._activeIndex || 0;
  59339. }
  59340. }
  59341. // Types
  59342. if (s.paginationType === 'bullets' && s._bullets) {
  59343. var selector = current + (current < 0 ? s._bullets.length : 0);
  59344. for (var i = 0; i < s._bullets.length; i++) {
  59345. if (i === selector) {
  59346. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["b" /* addClass */])(s._bullets[i], __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].bulletActive);
  59347. }
  59348. else {
  59349. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["l" /* removeClass */])(s._bullets[i], __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].bulletActive);
  59350. }
  59351. }
  59352. }
  59353. if (s.paginationType === 'fraction') {
  59354. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["c" /* eachChild */])(s._paginationContainer, '.' + __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].paginationCurrent, function (ele) {
  59355. ele.textContent = (current + 1);
  59356. });
  59357. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["c" /* eachChild */])(s._paginationContainer, '.' + __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].paginationTotal, function (ele) {
  59358. ele.textContent = total;
  59359. });
  59360. }
  59361. if (s.paginationType === 'progress') {
  59362. var scale = (current + 1) / total, scaleX = scale, scaleY = 1;
  59363. if (!Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s)) {
  59364. scaleY = scale;
  59365. scaleX = 1;
  59366. }
  59367. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["c" /* eachChild */])(s._paginationContainer, '.' + __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].paginationProgressbar, function (ele) {
  59368. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["n" /* transform */])(ele, 'translate3d(0,0,0) scaleX(' + scaleX + ') scaleY(' + scaleY + ')');
  59369. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["o" /* transition */])(ele, s.speed);
  59370. });
  59371. }
  59372. }
  59373. //# sourceMappingURL=swiper-pagination.js.map
  59374. /***/ }),
  59375. /* 91 */
  59376. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59377. "use strict";
  59378. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SWIPER_EFFECTS; });
  59379. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__swiper_utils__ = __webpack_require__(12);
  59380. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__platform_platform_utils__ = __webpack_require__(177);
  59381. /*=========================
  59382. Effects
  59383. ===========================*/
  59384. var SWIPER_EFFECTS = {
  59385. 'fade': {
  59386. setTranslate: function (s) {
  59387. for (var i = 0; i < s._slides.length; i++) {
  59388. var slide = s._slides[i];
  59389. var offset = slide.swiperSlideOffset;
  59390. var tx = -offset;
  59391. if (!s.virtualTranslate) {
  59392. tx = tx - s._translate;
  59393. }
  59394. var ty = 0;
  59395. if (!Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s)) {
  59396. ty = tx;
  59397. tx = 0;
  59398. }
  59399. var slideOpacity = s.fade.crossFade ?
  59400. Math.max(1 - Math.abs(slide.progress), 0) :
  59401. 1 + Math.min(Math.max(slide.progress, -1), 0);
  59402. slide.style.opacity = slideOpacity;
  59403. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["n" /* transform */])(slide, 'translate3d(' + tx + 'px, ' + ty + 'px, 0px)');
  59404. }
  59405. },
  59406. setTransition: function (s, plt, duration) {
  59407. var slides = s._slides;
  59408. for (var i = 0; i < slides.length; i++) {
  59409. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["o" /* transition */])(slides[i], duration);
  59410. }
  59411. if (s.virtualTranslate && duration !== 0) {
  59412. var eventTriggered = false;
  59413. for (var i_1 = 0; i_1 < slides.length; i_1++) {
  59414. plt.transitionEnd(slides[i_1], function () {
  59415. if (eventTriggered || !s)
  59416. return;
  59417. eventTriggered = true;
  59418. s._animating = false;
  59419. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["p" /* triggerTransitionEnd */])(plt, s._wrapper);
  59420. });
  59421. }
  59422. }
  59423. }
  59424. },
  59425. 'flip': {
  59426. setTranslate: function (s, plt) {
  59427. for (var i = 0; i < s._slides.length; i++) {
  59428. var slide = s._slides[i];
  59429. var progress = slide.progress;
  59430. if (s.flip.limitRotation) {
  59431. progress = Math.max(Math.min(slide.progress, 1), -1);
  59432. }
  59433. var offset = slide.swiperSlideOffset;
  59434. var rotate = -180 * progress, rotateY = rotate, rotateX = 0, tx = -offset, ty = 0;
  59435. if (!Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s)) {
  59436. ty = tx;
  59437. tx = 0;
  59438. rotateX = -rotateY;
  59439. rotateY = 0;
  59440. }
  59441. else if (s._rtl) {
  59442. rotateY = -rotateY;
  59443. }
  59444. slide.style.zIndex = -Math.abs(Math.round(progress)) + s._slides.length;
  59445. if (s.flip.slideShadows) {
  59446. // Set shadows
  59447. var shadowBefore = (Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) ? slide.querySelector('.swiper-slide-shadow-left') : slide.querySelector('.swiper-slide-shadow-top'));
  59448. var shadowAfter = (Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) ? slide.querySelector('.swiper-slide-shadow-right') : slide.querySelector('.swiper-slide-shadow-bottom'));
  59449. if (!shadowBefore) {
  59450. shadowBefore = plt.doc().createElement('div');
  59451. shadowBefore.className = 'swiper-slide-shadow-' + (Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) ? 'left' : 'top');
  59452. slide.appendChild(shadowBefore);
  59453. }
  59454. if (!shadowAfter) {
  59455. shadowAfter = plt.doc().createElement('div');
  59456. shadowAfter.className = 'swiper-slide-shadow-' + (Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) ? 'right' : 'bottom');
  59457. slide.appendChild(shadowAfter);
  59458. }
  59459. if (shadowBefore) {
  59460. shadowBefore.style.opacity = Math.max(-progress, 0);
  59461. }
  59462. if (shadowAfter) {
  59463. shadowAfter.style.opacity = Math.max(progress, 0);
  59464. }
  59465. }
  59466. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["n" /* transform */])(slide, 'translate3d(' + tx + 'px, ' + ty + 'px, 0px) rotateX(' + rotateX + 'deg) rotateY(' + rotateY + 'deg)');
  59467. }
  59468. },
  59469. setTransition: function (s, plt, duration) {
  59470. for (var i = 0; i < s._slides.length; i++) {
  59471. var slide = s._slides[i];
  59472. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["o" /* transition */])(slide, duration);
  59473. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["c" /* eachChild */])(slide, '.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left', function (el) {
  59474. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["o" /* transition */])(el, duration);
  59475. });
  59476. }
  59477. if (s.virtualTranslate && duration !== 0) {
  59478. var eventTriggered = false;
  59479. plt.transitionEnd(s._slides[s._activeIndex], function (ev) {
  59480. if (eventTriggered || !s)
  59481. return;
  59482. if (!ev.target.classList.contains(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].slideActive)) {
  59483. return;
  59484. }
  59485. eventTriggered = true;
  59486. s._animating = false;
  59487. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["p" /* triggerTransitionEnd */])(plt, s._wrapper);
  59488. });
  59489. }
  59490. }
  59491. },
  59492. 'cube': {
  59493. setTranslate: function (s, plt) {
  59494. var wrapperRotate = 0;
  59495. var cubeShadow;
  59496. if (s.cube.shadow) {
  59497. if (Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s)) {
  59498. cubeShadow = s._wrapper.querySelector('.swiper-cube-shadow');
  59499. if (!cubeShadow) {
  59500. cubeShadow = plt.doc().createElement('div');
  59501. cubeShadow.className = 'swiper-cube-shadow';
  59502. s._wrapper.appendChild(cubeShadow);
  59503. }
  59504. cubeShadow.style.height = s.renderedWidth + 'px';
  59505. }
  59506. else {
  59507. cubeShadow = s.container.querySelector('.swiper-cube-shadow');
  59508. if (!cubeShadow) {
  59509. cubeShadow = plt.doc().createElement('div');
  59510. cubeShadow.className = 'swiper-cube-shadow';
  59511. s._wrapper.appendChild(cubeShadow);
  59512. }
  59513. }
  59514. }
  59515. for (var i = 0; i < s._slides.length; i++) {
  59516. var slide = s._slides[i];
  59517. var slideAngle = i * 90;
  59518. var round = Math.floor(slideAngle / 360);
  59519. if (s._rtl) {
  59520. slideAngle = -slideAngle;
  59521. round = Math.floor(-slideAngle / 360);
  59522. }
  59523. var progress = Math.max(Math.min(slide.progress, 1), -1);
  59524. var tx = 0, ty = 0, tz = 0;
  59525. if (i % 4 === 0) {
  59526. tx = -round * 4 * s._renderedSize;
  59527. tz = 0;
  59528. }
  59529. else if ((i - 1) % 4 === 0) {
  59530. tx = 0;
  59531. tz = -round * 4 * s._renderedSize;
  59532. }
  59533. else if ((i - 2) % 4 === 0) {
  59534. tx = s._renderedSize + round * 4 * s._renderedSize;
  59535. tz = s._renderedSize;
  59536. }
  59537. else if ((i - 3) % 4 === 0) {
  59538. tx = -s._renderedSize;
  59539. tz = 3 * s._renderedSize + s._renderedSize * 4 * round;
  59540. }
  59541. if (s._rtl) {
  59542. tx = -tx;
  59543. }
  59544. if (!Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s)) {
  59545. ty = tx;
  59546. tx = 0;
  59547. }
  59548. var transformStr = 'rotateX(' + (Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) ? 0 : -slideAngle) + 'deg) rotateY(' + (Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) ? slideAngle : 0) + 'deg) translate3d(' + tx + 'px, ' + ty + 'px, ' + tz + 'px)';
  59549. if (progress <= 1 && progress > -1) {
  59550. wrapperRotate = i * 90 + progress * 90;
  59551. if (s._rtl)
  59552. wrapperRotate = -i * 90 - progress * 90;
  59553. }
  59554. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["n" /* transform */])(slide, transformStr);
  59555. if (s.cube.slideShadows) {
  59556. // Set shadows
  59557. var shadowBefore = (Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) ? slide.querySelector('.swiper-slide-shadow-left') : slide.querySelector('.swiper-slide-shadow-top'));
  59558. var shadowAfter = (Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) ? slide.querySelector('.swiper-slide-shadow-right') : slide.querySelector('.swiper-slide-shadow-bottom'));
  59559. if (!shadowBefore) {
  59560. shadowBefore = plt.doc().createElement('div');
  59561. shadowBefore.className = 'swiper-slide-shadow-' + (Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) ? 'left' : 'top');
  59562. slide.appendChild(shadowBefore);
  59563. }
  59564. if (!shadowAfter) {
  59565. shadowAfter = plt.doc().createElement('div');
  59566. shadowAfter.className = 'swiper-slide-shadow-' + (Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) ? 'right' : 'bottom');
  59567. slide.appendChild(shadowAfter);
  59568. }
  59569. if (shadowBefore)
  59570. shadowBefore.style.opacity = Math.max(-progress, 0);
  59571. if (shadowAfter)
  59572. shadowAfter.style.opacity = Math.max(progress, 0);
  59573. }
  59574. }
  59575. s._wrapper.style.transformOrigin = s._wrapper.style.webkitTransformOrigin = '50% 50% -' + (s._renderedSize / 2) + 'px';
  59576. if (s.cube.shadow) {
  59577. if (Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s)) {
  59578. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["n" /* transform */])(cubeShadow, 'translate3d(0px, ' + (s.renderedWidth / 2 + s.cube.shadowOffset) + 'px, ' + (-s.renderedWidth / 2) + 'px) rotateX(90deg) rotateZ(0deg) scale(' + (s.cube.shadowScale) + ')');
  59579. }
  59580. else {
  59581. var shadowAngle = Math.abs(wrapperRotate) - Math.floor(Math.abs(wrapperRotate) / 90) * 90;
  59582. var multiplier = 1.5 - (Math.sin(shadowAngle * 2 * Math.PI / 360) / 2 + Math.cos(shadowAngle * 2 * Math.PI / 360) / 2);
  59583. var scale1 = s.cube.shadowScale;
  59584. var scale2 = s.cube.shadowScale / multiplier;
  59585. var offset = s.cube.shadowOffset;
  59586. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["n" /* transform */])(cubeShadow, 'scale3d(' + scale1 + ', 1, ' + scale2 + ') translate3d(0px, ' + (s.renderedHeight / 2 + offset) + 'px, ' + (-s.renderedHeight / 2 / scale2) + 'px) rotateX(-90deg)');
  59587. }
  59588. }
  59589. var zFactor = (Object(__WEBPACK_IMPORTED_MODULE_1__platform_platform_utils__["e" /* isSafari */])(plt) || Object(__WEBPACK_IMPORTED_MODULE_1__platform_platform_utils__["d" /* isIosUIWebView */])(plt)) ? (-s._renderedSize / 2) : 0;
  59590. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["n" /* transform */])(s._wrapper, 'translate3d(0px,0,' + zFactor + 'px) rotateX(' + (Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) ? 0 : wrapperRotate) + 'deg) rotateY(' + (Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) ? -wrapperRotate : 0) + 'deg)');
  59591. },
  59592. setTransition: function (s, _plt, duration) {
  59593. for (var i = 0; i < s._slides.length; i++) {
  59594. var slide = s._slides[i];
  59595. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["o" /* transition */])(slide, duration);
  59596. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["c" /* eachChild */])(slide, '.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left', function (el) {
  59597. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["o" /* transition */])(el, duration);
  59598. });
  59599. }
  59600. if (s.cube.shadow && !Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s)) {
  59601. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["c" /* eachChild */])(s.container, '.swiper-cube-shadow', function (el) {
  59602. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["o" /* transition */])(el, duration);
  59603. });
  59604. }
  59605. }
  59606. },
  59607. 'coverflow': {
  59608. setTranslate: function (s, plt) {
  59609. var transformStr = s._translate;
  59610. var center = Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) ? -transformStr + s.renderedWidth / 2 : -transformStr + s.renderedHeight / 2;
  59611. var rotate = Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) ? s.coverflow.rotate : -s.coverflow.rotate;
  59612. var translate = s.coverflow.depth;
  59613. // Each slide offset from center
  59614. for (var i = 0, length = s._slides.length; i < length; i++) {
  59615. var slide = s._slides[i];
  59616. var slideSize = s._slidesSizesGrid[i];
  59617. var slideOffset = slide.swiperSlideOffset;
  59618. var offsetMultiplier = (center - slideOffset - slideSize / 2) / slideSize * s.coverflow.modifier;
  59619. var rotateY = Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) ? rotate * offsetMultiplier : 0;
  59620. var rotateX = Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) ? 0 : rotate * offsetMultiplier;
  59621. // var rotateZ = 0
  59622. var translateZ = -translate * Math.abs(offsetMultiplier);
  59623. var translateY = Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) ? 0 : s.coverflow.stretch * (offsetMultiplier);
  59624. var translateX = Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) ? s.coverflow.stretch * (offsetMultiplier) : 0;
  59625. // Fix for ultra small values
  59626. if (Math.abs(translateX) < 0.001)
  59627. translateX = 0;
  59628. if (Math.abs(translateY) < 0.001)
  59629. translateY = 0;
  59630. if (Math.abs(translateZ) < 0.001)
  59631. translateZ = 0;
  59632. if (Math.abs(rotateY) < 0.001)
  59633. rotateY = 0;
  59634. if (Math.abs(rotateX) < 0.001)
  59635. rotateX = 0;
  59636. var slideTransform = 'translate3d(' + translateX + 'px,' + translateY + 'px,' + translateZ + 'px) rotateX(' + rotateX + 'deg) rotateY(' + rotateY + 'deg)';
  59637. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["n" /* transform */])(slide, slideTransform);
  59638. slide.style.zIndex = -Math.abs(Math.round(offsetMultiplier)) + 1;
  59639. if (s.coverflow.slideShadows) {
  59640. // Set shadows
  59641. var shadowBefore = (Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) ? slide.querySelector('.swiper-slide-shadow-left') : slide.querySelector('.swiper-slide-shadow-top'));
  59642. var shadowAfter = (Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) ? slide.querySelector('.swiper-slide-shadow-right') : slide.querySelector('.swiper-slide-shadow-bottom'));
  59643. if (!shadowBefore) {
  59644. shadowBefore = plt.doc().createElement('div');
  59645. shadowBefore.className = 'swiper-slide-shadow-' + (Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) ? 'left' : 'top');
  59646. slide.appendChild(shadowBefore);
  59647. }
  59648. if (!shadowAfter) {
  59649. shadowAfter = plt.doc().createElement('div');
  59650. shadowAfter.className = 'swiper-slide-shadow-' + (Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) ? 'right' : 'bottom');
  59651. slide.appendChild(shadowAfter);
  59652. }
  59653. if (shadowBefore) {
  59654. shadowBefore.style.opacity = (offsetMultiplier > 0 ? offsetMultiplier : 0);
  59655. }
  59656. if (shadowAfter) {
  59657. shadowAfter.style.opacity = ((-offsetMultiplier) > 0 ? -offsetMultiplier : 0);
  59658. }
  59659. }
  59660. }
  59661. },
  59662. setTransition: function (s, _plt, duration) {
  59663. for (var i = 0; i < s._slides.length; i++) {
  59664. var slide = s._slides[i];
  59665. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["o" /* transition */])(slide, duration);
  59666. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["c" /* eachChild */])(slide, '.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left', function (el) {
  59667. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["o" /* transition */])(el, duration);
  59668. });
  59669. }
  59670. }
  59671. }
  59672. };
  59673. //# sourceMappingURL=swiper-effects.js.map
  59674. /***/ }),
  59675. /* 92 */
  59676. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59677. "use strict";
  59678. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Tabs; });
  59679. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  59680. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_Subject__ = __webpack_require__(33);
  59681. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_Subject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_rxjs_Subject__);
  59682. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_add_operator_takeUntil__ = __webpack_require__(141);
  59683. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_add_operator_takeUntil___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_add_operator_takeUntil__);
  59684. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__app_app__ = __webpack_require__(6);
  59685. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__config_config__ = __webpack_require__(1);
  59686. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__navigation_deep_linker__ = __webpack_require__(14);
  59687. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__ion__ = __webpack_require__(4);
  59688. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__util_util__ = __webpack_require__(2);
  59689. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__platform_keyboard__ = __webpack_require__(37);
  59690. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__navigation_nav_controller__ = __webpack_require__(22);
  59691. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__navigation_nav_util__ = __webpack_require__(21);
  59692. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__navigation_url_serializer__ = __webpack_require__(41);
  59693. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__split_pane_split_pane__ = __webpack_require__(39);
  59694. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__platform_platform__ = __webpack_require__(3);
  59695. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__tab_highlight__ = __webpack_require__(93);
  59696. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__navigation_view_controller__ = __webpack_require__(5);
  59697. var __extends = (this && this.__extends) || (function () {
  59698. var extendStatics = Object.setPrototypeOf ||
  59699. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  59700. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  59701. return function (d, b) {
  59702. extendStatics(d, b);
  59703. function __() { this.constructor = d; }
  59704. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  59705. };
  59706. })();
  59707. /**
  59708. * @name Tabs
  59709. * @description
  59710. * Tabs make it easy to navigate between different pages or functional
  59711. * aspects of an app. The Tabs component, written as `<ion-tabs>`, is
  59712. * a container of individual [Tab](../Tab/) components. Each individual `ion-tab`
  59713. * is a declarative component for a [NavController](../../../navigation/NavController/)
  59714. *
  59715. * For more information on using nav controllers like Tab or [Nav](../../nav/Nav/),
  59716. * take a look at the [NavController API Docs](../../../navigation/NavController/).
  59717. *
  59718. * ### Placement
  59719. *
  59720. * The position of the tabs relative to the content varies based on
  59721. * the mode. The tabs are placed at the bottom of the screen
  59722. * for iOS and Android, and at the top for Windows by default. The position can
  59723. * be configured using the `tabsPlacement` attribute on the `<ion-tabs>` component,
  59724. * or in an app's [config](../../config/Config/).
  59725. * See the [Input Properties](#input-properties) below for the available
  59726. * values of `tabsPlacement`.
  59727. *
  59728. * ### Layout
  59729. *
  59730. * The layout for all of the tabs can be defined using the `tabsLayout`
  59731. * property. If the individual tab has a title and icon, the icons will
  59732. * show on top of the title by default. All tabs can be changed by setting
  59733. * the value of `tabsLayout` on the `<ion-tabs>` element, or in your
  59734. * app's [config](../../config/Config/). For example, this is useful if
  59735. * you want to show tabs with a title only on Android, but show icons
  59736. * and a title for iOS. See the [Input Properties](#input-properties)
  59737. * below for the available values of `tabsLayout`.
  59738. *
  59739. * ### Selecting a Tab
  59740. *
  59741. * There are different ways you can select a specific tab from the tabs
  59742. * component. You can use the `selectedIndex` property to set the index
  59743. * on the `<ion-tabs>` element, or you can call `select()` from the `Tabs`
  59744. * instance after creation. See [usage](#usage) below for more information.
  59745. *
  59746. * @usage
  59747. *
  59748. * You can add a basic tabs template to a `@Component` using the following
  59749. * template:
  59750. *
  59751. * ```html
  59752. * <ion-tabs>
  59753. * <ion-tab [root]="tab1Root"></ion-tab>
  59754. * <ion-tab [root]="tab2Root"></ion-tab>
  59755. * <ion-tab [root]="tab3Root"></ion-tab>
  59756. * </ion-tabs>
  59757. * ```
  59758. *
  59759. * Where `tab1Root`, `tab2Root`, and `tab3Root` are each a page:
  59760. *
  59761. *```ts
  59762. * @Component({
  59763. * templateUrl: 'build/pages/tabs/tabs.html'
  59764. * })
  59765. * export class TabsPage {
  59766. * // this tells the tabs component which Pages
  59767. * // should be each tab's root Page
  59768. * tab1Root = Page1;
  59769. * tab2Root = Page2;
  59770. * tab3Root = Page3;
  59771. *
  59772. * constructor() {
  59773. *
  59774. * }
  59775. * }
  59776. *```
  59777. *
  59778. * By default, the first tab will be selected upon navigation to the
  59779. * Tabs page. We can change the selected tab by using `selectedIndex`
  59780. * on the `<ion-tabs>` element:
  59781. *
  59782. * ```html
  59783. * <ion-tabs selectedIndex="2">
  59784. * <ion-tab [root]="tab1Root"></ion-tab>
  59785. * <ion-tab [root]="tab2Root"></ion-tab>
  59786. * <ion-tab [root]="tab3Root"></ion-tab>
  59787. * </ion-tabs>
  59788. * ```
  59789. *
  59790. * Since the index starts at `0`, this will select the 3rd tab which has
  59791. * root set to `tab3Root`. If you wanted to change it dynamically from
  59792. * your class, you could use [property binding](https://angular.io/docs/ts/latest/guide/template-syntax.html#!#property-binding).
  59793. *
  59794. * Alternatively, you can grab the `Tabs` instance and call the `select()`
  59795. * method. This requires the `<ion-tabs>` element to have an `id`. For
  59796. * example, set the value of `id` to `myTabs`:
  59797. *
  59798. * ```html
  59799. * <ion-tabs #myTabs>
  59800. * <ion-tab [root]="tab1Root"></ion-tab>
  59801. * <ion-tab [root]="tab2Root"></ion-tab>
  59802. * <ion-tab [root]="tab3Root"></ion-tab>
  59803. * </ion-tabs>
  59804. * ```
  59805. *
  59806. * Then in your class you can grab the `Tabs` instance and call `select()`,
  59807. * passing the index of the tab as the argument. Here we're grabbing the tabs
  59808. * by using ViewChild.
  59809. *
  59810. *```ts
  59811. * export class TabsPage {
  59812. *
  59813. * @ViewChild('myTabs') tabRef: Tabs;
  59814. *
  59815. * ionViewDidEnter() {
  59816. * this.tabRef.select(2);
  59817. * }
  59818. *
  59819. * }
  59820. *```
  59821. *
  59822. * You can also switch tabs from a child component by calling `select()` on the
  59823. * parent view using the `NavController` instance. For example, assuming you have
  59824. * a `TabsPage` component, you could call the following from any of the child
  59825. * components to switch to `TabsRoot3`:
  59826. *
  59827. *```ts
  59828. * switchTabs() {
  59829. * this.navCtrl.parent.select(2);
  59830. * }
  59831. *```
  59832. * @demo /docs/demos/src/tabs/
  59833. *
  59834. * @see {@link /docs/components#tabs Tabs Component Docs}
  59835. * @see {@link ../Tab Tab API Docs}
  59836. * @see {@link ../../config/Config Config API Docs}
  59837. *
  59838. */
  59839. var Tabs = (function (_super) {
  59840. __extends(Tabs, _super);
  59841. function Tabs(parent, viewCtrl, _app, config, elementRef, _plt, renderer, _linker, keyboard) {
  59842. var _this = _super.call(this, config, elementRef, renderer, 'tabs') || this;
  59843. _this.viewCtrl = viewCtrl;
  59844. _this._app = _app;
  59845. _this._plt = _plt;
  59846. _this._linker = _linker;
  59847. /** @internal */
  59848. _this._ids = -1;
  59849. /** @internal */
  59850. _this._tabs = [];
  59851. /** @internal */
  59852. _this._selectHistory = [];
  59853. /** @internal */
  59854. _this._onDestroy = new __WEBPACK_IMPORTED_MODULE_1_rxjs_Subject__["Subject"]();
  59855. /**
  59856. * @output {any} Emitted when the tab changes.
  59857. */
  59858. _this.ionChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  59859. _this.parent = parent;
  59860. _this.id = 't' + (++tabIds);
  59861. _this._sbPadding = config.getBoolean('statusbarPadding');
  59862. _this.tabsHighlight = config.getBoolean('tabsHighlight');
  59863. if (_this.parent) {
  59864. // this Tabs has a parent Nav
  59865. _this.parent.registerChildNav(_this);
  59866. }
  59867. else if (viewCtrl && viewCtrl.getNav()) {
  59868. // this Nav was opened from a modal
  59869. _this.parent = viewCtrl.getNav();
  59870. _this.parent.registerChildNav(_this);
  59871. }
  59872. else if (_this._app) {
  59873. // this is the root navcontroller for the entire app
  59874. _this._app.registerRootNav(_this);
  59875. }
  59876. // Tabs may also be an actual ViewController which was navigated to
  59877. // if Tabs is static and not navigated to within a NavController
  59878. // then skip this and don't treat it as it's own ViewController
  59879. if (viewCtrl) {
  59880. viewCtrl._setContent(_this);
  59881. viewCtrl._setContentRef(elementRef);
  59882. }
  59883. var keyboardResizes = config.getBoolean('keyboardResizes', false);
  59884. if (keyboard && keyboardResizes) {
  59885. keyboard.willHide
  59886. .takeUntil(_this._onDestroy)
  59887. .subscribe(function () {
  59888. _this._plt.timeout(function () { return _this.setTabbarHidden(false); }, 50);
  59889. });
  59890. keyboard.willShow
  59891. .takeUntil(_this._onDestroy)
  59892. .subscribe(function () { return _this.setTabbarHidden(true); });
  59893. }
  59894. return _this;
  59895. }
  59896. /**
  59897. * @internal
  59898. */
  59899. Tabs.prototype.setTabbarHidden = function (tabbarHidden) {
  59900. this.setElementClass('tabbar-hidden', tabbarHidden);
  59901. this.resize();
  59902. };
  59903. /**
  59904. * @internal
  59905. */
  59906. Tabs.prototype.ngOnDestroy = function () {
  59907. this._onDestroy.next();
  59908. if (this.parent) {
  59909. this.parent.unregisterChildNav(this);
  59910. }
  59911. else {
  59912. this._app.unregisterRootNav(this);
  59913. }
  59914. };
  59915. /**
  59916. * @internal
  59917. */
  59918. Tabs.prototype.ngAfterViewInit = function () {
  59919. var _this = this;
  59920. this._setConfig('tabsPlacement', 'bottom');
  59921. this._setConfig('tabsLayout', 'icon-top');
  59922. this._setConfig('tabsHighlight', this.tabsHighlight);
  59923. if (this.tabsHighlight) {
  59924. this._plt.resize
  59925. .takeUntil(this._onDestroy)
  59926. .subscribe(function () { return _this._highlight.select(_this.getSelected()); });
  59927. }
  59928. this.initTabs();
  59929. };
  59930. /**
  59931. * @internal
  59932. */
  59933. Tabs.prototype.initTabs = function () {
  59934. var _this = this;
  59935. // get the selected index from the input
  59936. // otherwise default it to use the first index
  59937. var selectedIndex = (Object(__WEBPACK_IMPORTED_MODULE_7__util_util__["f" /* isBlank */])(this.selectedIndex) ? 0 : parseInt(this.selectedIndex, 10));
  59938. // now see if the deep linker can find a tab index
  59939. var tabsSegment = this._linker.getSegmentByNavIdOrName(this.id, this.name);
  59940. if (tabsSegment) {
  59941. // we found a segment which probably represents which tab to select
  59942. selectedIndex = this._getSelectedTabIndex(tabsSegment.secondaryId, selectedIndex);
  59943. }
  59944. // get the selectedIndex and ensure it isn't hidden or disabled
  59945. var selectedTab = this._tabs.find(function (t, i) { return i === selectedIndex && t.enabled && t.show; });
  59946. if (!selectedTab) {
  59947. // wasn't able to select the tab they wanted
  59948. // try to find the first tab that's available
  59949. selectedTab = this._tabs.find(function (t) { return t.enabled && t.show; });
  59950. }
  59951. var promise = Promise.resolve();
  59952. if (selectedTab) {
  59953. selectedTab._segment = tabsSegment;
  59954. promise = this.select(selectedTab);
  59955. }
  59956. return promise.then(function () {
  59957. // set the initial href attribute values for each tab
  59958. _this._tabs.forEach(function (t) {
  59959. t.updateHref(t.root, t.rootParams);
  59960. });
  59961. });
  59962. };
  59963. /**
  59964. * @internal
  59965. */
  59966. Tabs.prototype._setConfig = function (attrKey, fallback) {
  59967. var val = this[attrKey];
  59968. if (Object(__WEBPACK_IMPORTED_MODULE_7__util_util__["f" /* isBlank */])(val)) {
  59969. val = this._config.get(attrKey, fallback);
  59970. }
  59971. this.setElementAttribute(attrKey, val);
  59972. };
  59973. /**
  59974. * @hidden
  59975. */
  59976. Tabs.prototype.add = function (tab) {
  59977. this._tabs.push(tab);
  59978. return this.id + '-' + (++this._ids);
  59979. };
  59980. /**
  59981. * @param {number|Tab} tabOrIndex Index, or the Tab instance, of the tab to select.
  59982. */
  59983. Tabs.prototype.select = function (tabOrIndex, opts, fromUrl) {
  59984. var _this = this;
  59985. if (opts === void 0) { opts = {}; }
  59986. if (fromUrl === void 0) { fromUrl = false; }
  59987. var selectedTab = (typeof tabOrIndex === 'number' ? this.getByIndex(tabOrIndex) : tabOrIndex);
  59988. if (Object(__WEBPACK_IMPORTED_MODULE_7__util_util__["f" /* isBlank */])(selectedTab)) {
  59989. return Promise.resolve();
  59990. }
  59991. // If the selected tab is the current selected tab, we do not switch
  59992. var currentTab = this.getSelected();
  59993. if (selectedTab === currentTab && currentTab.getActive()) {
  59994. return this._updateCurrentTab(selectedTab, fromUrl);
  59995. }
  59996. // If the selected tab does not have a root, we do not switch (#9392)
  59997. // it's possible the tab is only for opening modal's or signing out
  59998. // and doesn't actually have content. In the case there's no content
  59999. // for a tab then do nothing and leave the current view as is
  60000. if (selectedTab.root) {
  60001. // At this point we are going to perform a page switch
  60002. // Let's fire willLeave in the current tab page
  60003. var currentPage;
  60004. if (currentTab) {
  60005. currentPage = currentTab.getActive();
  60006. currentPage && currentPage._willLeave(false);
  60007. }
  60008. // Fire willEnter in the new selected tab
  60009. var selectedPage_1 = selectedTab.getActive();
  60010. selectedPage_1 && selectedPage_1._willEnter();
  60011. // Let's start the transition
  60012. opts.animate = false;
  60013. return selectedTab.load(opts).then(function () {
  60014. _this._tabSwitchEnd(selectedTab, selectedPage_1, currentPage);
  60015. if (opts.updateUrl !== false) {
  60016. _this._linker.navChange(__WEBPACK_IMPORTED_MODULE_10__navigation_nav_util__["c" /* DIRECTION_SWITCH */]);
  60017. }
  60018. (void 0) /* assert */;
  60019. _this._fireChangeEvent(selectedTab);
  60020. });
  60021. }
  60022. else {
  60023. this._fireChangeEvent(selectedTab);
  60024. return Promise.resolve();
  60025. }
  60026. };
  60027. Tabs.prototype._fireChangeEvent = function (selectedTab) {
  60028. selectedTab.ionSelect.emit(selectedTab);
  60029. this.ionChange.emit(selectedTab);
  60030. };
  60031. Tabs.prototype._tabSwitchEnd = function (selectedTab, selectedPage, currentPage) {
  60032. (void 0) /* assert */;
  60033. (void 0) /* assert */;
  60034. // Update tabs selection state
  60035. var tabs = this._tabs;
  60036. var tab;
  60037. for (var i = 0; i < tabs.length; i++) {
  60038. tab = tabs[i];
  60039. tab.setSelected(tab === selectedTab);
  60040. }
  60041. if (this.tabsHighlight) {
  60042. this._highlight.select(selectedTab);
  60043. }
  60044. // Fire didEnter/didLeave lifecycle events
  60045. if (selectedPage) {
  60046. selectedPage._didEnter();
  60047. this._app.viewDidEnter.emit(selectedPage);
  60048. }
  60049. if (currentPage) {
  60050. currentPage && currentPage._didLeave();
  60051. this._app.viewDidLeave.emit(currentPage);
  60052. }
  60053. // track the order of which tabs have been selected, by their index
  60054. // do not track if the tab index is the same as the previous
  60055. if (this._selectHistory[this._selectHistory.length - 1] !== selectedTab.id) {
  60056. this._selectHistory.push(selectedTab.id);
  60057. }
  60058. };
  60059. /**
  60060. * Get the previously selected Tab which is currently not disabled or hidden.
  60061. * @param {boolean} trimHistory If the selection history should be trimmed up to the previous tab selection or not.
  60062. * @returns {Tab}
  60063. */
  60064. Tabs.prototype.previousTab = function (trimHistory) {
  60065. var _this = this;
  60066. if (trimHistory === void 0) { trimHistory = true; }
  60067. // walk backwards through the tab selection history
  60068. // and find the first previous tab that is enabled and shown
  60069. (void 0) /* console.debug */;
  60070. for (var i = this._selectHistory.length - 2; i >= 0; i--) {
  60071. var tab = this._tabs.find(function (t) { return t.id === _this._selectHistory[i]; });
  60072. if (tab && tab.enabled && tab.show) {
  60073. if (trimHistory) {
  60074. this._selectHistory.splice(i + 1);
  60075. }
  60076. return tab;
  60077. }
  60078. }
  60079. return null;
  60080. };
  60081. /**
  60082. * @param {number} index Index of the tab you want to get
  60083. * @returns {Tab} Returns the tab who's index matches the one passed
  60084. */
  60085. Tabs.prototype.getByIndex = function (index) {
  60086. return this._tabs[index];
  60087. };
  60088. /**
  60089. * @return {Tab} Returns the currently selected tab
  60090. */
  60091. Tabs.prototype.getSelected = function () {
  60092. var tabs = this._tabs;
  60093. for (var i = 0; i < tabs.length; i++) {
  60094. if (tabs[i].isSelected) {
  60095. return tabs[i];
  60096. }
  60097. }
  60098. return null;
  60099. };
  60100. /**
  60101. * @internal
  60102. */
  60103. Tabs.prototype.getActiveChildNavs = function () {
  60104. var selected = this.getSelected();
  60105. return selected ? [selected] : [];
  60106. };
  60107. /**
  60108. * @internal
  60109. */
  60110. Tabs.prototype.getAllChildNavs = function () {
  60111. return this._tabs;
  60112. };
  60113. /**
  60114. * @internal
  60115. */
  60116. Tabs.prototype.getIndex = function (tab) {
  60117. return this._tabs.indexOf(tab);
  60118. };
  60119. /**
  60120. * @internal
  60121. */
  60122. Tabs.prototype.length = function () {
  60123. return this._tabs.length;
  60124. };
  60125. /**
  60126. * "Touch" the active tab, going back to the root view of the tab
  60127. * or optionally letting the tab handle the event
  60128. */
  60129. Tabs.prototype._updateCurrentTab = function (tab, fromUrl) {
  60130. var active = tab.getActive();
  60131. if (active) {
  60132. if (fromUrl && tab._segment) {
  60133. // see if the view controller exists
  60134. var vc = tab.getViewById(tab._segment.name);
  60135. if (vc) {
  60136. // the view is already in the stack
  60137. return tab.popTo(vc, {
  60138. animate: false,
  60139. updateUrl: false,
  60140. });
  60141. }
  60142. else if (tab._views.length === 0 && tab._segment.defaultHistory && tab._segment.defaultHistory.length) {
  60143. return this._linker.initViews(tab._segment).then(function (views) {
  60144. return tab.setPages(views, {
  60145. animate: false, updateUrl: false
  60146. });
  60147. }).then(function () {
  60148. tab._segment = null;
  60149. });
  60150. }
  60151. else {
  60152. return tab.setRoot(tab._segment.name, tab._segment.data, {
  60153. animate: false, updateUrl: false
  60154. }).then(function () {
  60155. tab._segment = null;
  60156. });
  60157. }
  60158. }
  60159. else if (active._cmp && active._cmp.instance.ionSelected) {
  60160. // if they have a custom tab selected handler, call it
  60161. active._cmp.instance.ionSelected();
  60162. return Promise.resolve();
  60163. }
  60164. else if (tab.length() > 1) {
  60165. // if we're a few pages deep, pop to root
  60166. return tab.popToRoot();
  60167. }
  60168. else {
  60169. return Object(__WEBPACK_IMPORTED_MODULE_10__navigation_nav_util__["j" /* getComponent */])(this._linker, tab.root).then(function (viewController) {
  60170. if (viewController.component !== active.component) {
  60171. // Otherwise, if the page we're on is not our real root
  60172. // reset it to our default root type
  60173. return tab.setRoot(tab.root);
  60174. }
  60175. }).catch(function () {
  60176. (void 0) /* console.debug */;
  60177. });
  60178. }
  60179. }
  60180. };
  60181. /**
  60182. * @internal
  60183. * DOM WRITE
  60184. */
  60185. Tabs.prototype.setTabbarPosition = function (top, bottom) {
  60186. if (this._top !== top || this._bottom !== bottom) {
  60187. var tabbarEle = this._tabbar.nativeElement;
  60188. tabbarEle.style.top = (top > -1 ? top + 'px' : '');
  60189. tabbarEle.style.bottom = (bottom > -1 ? bottom + 'px' : '');
  60190. tabbarEle.classList.add('show-tabbar');
  60191. this._top = top;
  60192. this._bottom = bottom;
  60193. }
  60194. };
  60195. /**
  60196. * @internal
  60197. */
  60198. Tabs.prototype.resize = function () {
  60199. var tab = this.getSelected();
  60200. tab && tab.resize();
  60201. };
  60202. /**
  60203. * @internal
  60204. */
  60205. Tabs.prototype.initPane = function () {
  60206. var isMain = this._elementRef.nativeElement.hasAttribute('main');
  60207. return isMain;
  60208. };
  60209. /**
  60210. * @internal
  60211. */
  60212. Tabs.prototype.paneChanged = function (isPane) {
  60213. if (isPane) {
  60214. this.resize();
  60215. }
  60216. };
  60217. Tabs.prototype.goToRoot = function (opts) {
  60218. if (this._tabs.length) {
  60219. return this.select(this._tabs[0], opts);
  60220. }
  60221. };
  60222. /*
  60223. * @private
  60224. */
  60225. Tabs.prototype.getType = function () {
  60226. return 'tabs';
  60227. };
  60228. /*
  60229. * @private
  60230. */
  60231. Tabs.prototype.getSecondaryIdentifier = function () {
  60232. var tabs = this.getActiveChildNavs();
  60233. if (tabs && tabs.length) {
  60234. return this._linker._getTabSelector(tabs[0]);
  60235. }
  60236. return '';
  60237. };
  60238. /**
  60239. * @private
  60240. */
  60241. Tabs.prototype._getSelectedTabIndex = function (secondaryId, fallbackIndex) {
  60242. if (secondaryId === void 0) { secondaryId = ''; }
  60243. if (fallbackIndex === void 0) { fallbackIndex = 0; }
  60244. // we found a segment which probably represents which tab to select
  60245. var indexMatch = secondaryId.match(/tab-(\d+)/);
  60246. if (indexMatch) {
  60247. // awesome, the segment name was something "tab-0", and
  60248. // the numbe represents which tab to select
  60249. return parseInt(indexMatch[1], 10);
  60250. }
  60251. // wasn't in the "tab-0" format so maybe it's using a word
  60252. var tab = this._tabs.find(function (t) {
  60253. return (Object(__WEBPACK_IMPORTED_MODULE_7__util_util__["l" /* isPresent */])(t.tabUrlPath) && t.tabUrlPath === secondaryId) ||
  60254. (Object(__WEBPACK_IMPORTED_MODULE_7__util_util__["l" /* isPresent */])(t.tabTitle) && Object(__WEBPACK_IMPORTED_MODULE_11__navigation_url_serializer__["c" /* formatUrlPart */])(t.tabTitle) === secondaryId);
  60255. });
  60256. return Object(__WEBPACK_IMPORTED_MODULE_7__util_util__["l" /* isPresent */])(tab) ? tab.index : fallbackIndex;
  60257. };
  60258. Tabs.decorators = [
  60259. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  60260. selector: 'ion-tabs',
  60261. template: '<div class="tabbar" role="tablist" #tabbar>' +
  60262. '<a *ngFor="let t of _tabs" [tab]="t" class="tab-button" role="tab" href="#" (ionSelect)="select(t)"></a>' +
  60263. '<div class="tab-highlight"></div>' +
  60264. '</div>' +
  60265. '<ng-content></ng-content>' +
  60266. '<div #portal tab-portal></div>',
  60267. encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_11" /* ViewEncapsulation */].None,
  60268. providers: [{ provide: __WEBPACK_IMPORTED_MODULE_12__split_pane_split_pane__["a" /* RootNode */], useExisting: Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_14" /* forwardRef */])(function () { return Tabs; }) }]
  60269. },] },
  60270. ];
  60271. /** @nocollapse */
  60272. Tabs.ctorParameters = function () { return [
  60273. { type: __WEBPACK_IMPORTED_MODULE_9__navigation_nav_controller__["a" /* NavController */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  60274. { type: __WEBPACK_IMPORTED_MODULE_15__navigation_view_controller__["a" /* ViewController */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  60275. { type: __WEBPACK_IMPORTED_MODULE_3__app_app__["a" /* App */], },
  60276. { type: __WEBPACK_IMPORTED_MODULE_4__config_config__["a" /* Config */], },
  60277. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  60278. { type: __WEBPACK_IMPORTED_MODULE_13__platform_platform__["a" /* Platform */], },
  60279. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  60280. { type: __WEBPACK_IMPORTED_MODULE_5__navigation_deep_linker__["a" /* DeepLinker */], },
  60281. { type: __WEBPACK_IMPORTED_MODULE_8__platform_keyboard__["a" /* Keyboard */], },
  60282. ]; };
  60283. Tabs.propDecorators = {
  60284. 'name': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  60285. 'selectedIndex': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  60286. 'tabsLayout': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  60287. 'tabsPlacement': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  60288. 'tabsHighlight': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  60289. 'ionChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  60290. '_highlight': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_8" /* ViewChild */], args: [__WEBPACK_IMPORTED_MODULE_14__tab_highlight__["a" /* TabHighlight */],] },],
  60291. '_tabbar': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_8" /* ViewChild */], args: ['tabbar',] },],
  60292. 'portal': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_8" /* ViewChild */], args: ['portal', { read: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_10" /* ViewContainerRef */] },] },],
  60293. };
  60294. return Tabs;
  60295. }(__WEBPACK_IMPORTED_MODULE_6__ion__["a" /* Ion */]));
  60296. var tabIds = -1;
  60297. //# sourceMappingURL=tabs.js.map
  60298. /***/ }),
  60299. /* 93 */
  60300. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60301. "use strict";
  60302. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TabHighlight; });
  60303. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  60304. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__platform_dom_controller__ = __webpack_require__(8);
  60305. /**
  60306. * @hidden
  60307. */
  60308. var TabHighlight = (function () {
  60309. function TabHighlight(_elementRef, _dom) {
  60310. this._elementRef = _elementRef;
  60311. this._dom = _dom;
  60312. }
  60313. TabHighlight.prototype.select = function (tab) {
  60314. var _this = this;
  60315. if (!tab) {
  60316. return;
  60317. }
  60318. var dom = this._dom;
  60319. dom.read(function () {
  60320. var btnEle = tab.btn.getNativeElement();
  60321. var transform = "translate3d(" + btnEle.offsetLeft + "px,0,0) scaleX(" + btnEle.offsetWidth + ")";
  60322. dom.write(function () {
  60323. var ele = _this._elementRef.nativeElement;
  60324. ele.style[dom.plt.Css.transform] = transform;
  60325. if (!_this._init) {
  60326. _this._init = true;
  60327. dom.write(function () {
  60328. ele.classList.add('animate');
  60329. }, 80);
  60330. }
  60331. });
  60332. }, 32);
  60333. };
  60334. TabHighlight.decorators = [
  60335. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  60336. selector: '.tab-highlight'
  60337. },] },
  60338. ];
  60339. /** @nocollapse */
  60340. TabHighlight.ctorParameters = function () { return [
  60341. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  60342. { type: __WEBPACK_IMPORTED_MODULE_1__platform_dom_controller__["a" /* DomController */], },
  60343. ]; };
  60344. return TabHighlight;
  60345. }());
  60346. //# sourceMappingURL=tab-highlight.js.map
  60347. /***/ }),
  60348. /* 94 */
  60349. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60350. "use strict";
  60351. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ToastCmp; });
  60352. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  60353. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__config_config__ = __webpack_require__(1);
  60354. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__navigation_nav_params__ = __webpack_require__(13);
  60355. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__navigation_view_controller__ = __webpack_require__(5);
  60356. /**
  60357. * @hidden
  60358. */
  60359. var ToastCmp = (function () {
  60360. function ToastCmp(_viewCtrl, _config, _elementRef, params, renderer) {
  60361. this._viewCtrl = _viewCtrl;
  60362. this._config = _config;
  60363. this._elementRef = _elementRef;
  60364. this.dismissTimeout = undefined;
  60365. renderer.setElementClass(_elementRef.nativeElement, "toast-" + _config.get('mode'), true);
  60366. this.d = params.data;
  60367. if (this.d.cssClass) {
  60368. this.d.cssClass.split(' ').forEach(function (cssClass) {
  60369. // Make sure the class isn't whitespace, otherwise it throws exceptions
  60370. if (cssClass.trim() !== '')
  60371. renderer.setElementClass(_elementRef.nativeElement, cssClass, true);
  60372. });
  60373. }
  60374. this.id = (++toastIds);
  60375. if (this.d.message) {
  60376. this.hdrId = 'toast-hdr-' + this.id;
  60377. }
  60378. }
  60379. ToastCmp.prototype.ngAfterViewInit = function () {
  60380. var _this = this;
  60381. // if there's a `duration` set, automatically dismiss.
  60382. if (this.d.duration) {
  60383. this.dismissTimeout = setTimeout(function () {
  60384. _this.dismiss('backdrop');
  60385. }, this.d.duration);
  60386. }
  60387. this.enabled = true;
  60388. };
  60389. ToastCmp.prototype.ionViewDidEnter = function () {
  60390. var activeElement = document.activeElement;
  60391. if (activeElement) {
  60392. activeElement.blur();
  60393. }
  60394. var focusableEle = this._elementRef.nativeElement.querySelector('button');
  60395. if (focusableEle) {
  60396. focusableEle.focus();
  60397. }
  60398. };
  60399. ToastCmp.prototype.cbClick = function () {
  60400. if (this.enabled) {
  60401. this.dismiss('close');
  60402. }
  60403. };
  60404. ToastCmp.prototype.dismiss = function (role) {
  60405. clearTimeout(this.dismissTimeout);
  60406. this.dismissTimeout = undefined;
  60407. return this._viewCtrl.dismiss(null, role, { disableApp: false });
  60408. };
  60409. ToastCmp.decorators = [
  60410. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  60411. selector: 'ion-toast',
  60412. template: '<div class="toast-wrapper" ' +
  60413. '[class.toast-bottom]="d.position === \'bottom\'" ' +
  60414. '[class.toast-middle]="d.position === \'middle\'" ' +
  60415. '[class.toast-top]="d.position === \'top\'"> ' +
  60416. '<div class="toast-container"> ' +
  60417. '<div class="toast-message" id="{{hdrId}}" *ngIf="d.message">{{d.message}}</div> ' +
  60418. '<button ion-button clear class="toast-button" *ngIf="d.showCloseButton" (click)="cbClick()"> ' +
  60419. '{{ d.closeButtonText || \'Close\' }} ' +
  60420. '</button> ' +
  60421. '</div> ' +
  60422. '</div>',
  60423. host: {
  60424. 'role': 'dialog',
  60425. '[attr.aria-labelledby]': 'hdrId',
  60426. '[attr.aria-describedby]': 'descId',
  60427. },
  60428. },] },
  60429. ];
  60430. /** @nocollapse */
  60431. ToastCmp.ctorParameters = function () { return [
  60432. { type: __WEBPACK_IMPORTED_MODULE_3__navigation_view_controller__["a" /* ViewController */], },
  60433. { type: __WEBPACK_IMPORTED_MODULE_1__config_config__["a" /* Config */], },
  60434. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  60435. { type: __WEBPACK_IMPORTED_MODULE_2__navigation_nav_params__["a" /* NavParams */], },
  60436. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  60437. ]; };
  60438. return ToastCmp;
  60439. }());
  60440. var toastIds = -1;
  60441. //# sourceMappingURL=toast-component.js.map
  60442. /***/ }),
  60443. /* 95 */
  60444. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60445. "use strict";
  60446. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VirtualFooter; });
  60447. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  60448. /**
  60449. * @hidden
  60450. */
  60451. var VirtualFooter = (function () {
  60452. function VirtualFooter(templateRef) {
  60453. this.templateRef = templateRef;
  60454. }
  60455. VirtualFooter.decorators = [
  60456. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{ selector: '[virtualFooter]' },] },
  60457. ];
  60458. /** @nocollapse */
  60459. VirtualFooter.ctorParameters = function () { return [
  60460. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_5" /* TemplateRef */], },
  60461. ]; };
  60462. return VirtualFooter;
  60463. }());
  60464. //# sourceMappingURL=virtual-footer.js.map
  60465. /***/ }),
  60466. /* 96 */
  60467. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60468. "use strict";
  60469. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VirtualHeader; });
  60470. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  60471. /**
  60472. * @hidden
  60473. */
  60474. var VirtualHeader = (function () {
  60475. function VirtualHeader(templateRef) {
  60476. this.templateRef = templateRef;
  60477. }
  60478. VirtualHeader.decorators = [
  60479. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{ selector: '[virtualHeader]' },] },
  60480. ];
  60481. /** @nocollapse */
  60482. VirtualHeader.ctorParameters = function () { return [
  60483. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_5" /* TemplateRef */], },
  60484. ]; };
  60485. return VirtualHeader;
  60486. }());
  60487. //# sourceMappingURL=virtual-header.js.map
  60488. /***/ }),
  60489. /* 97 */
  60490. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60491. "use strict";
  60492. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VirtualItem; });
  60493. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  60494. /**
  60495. * @hidden
  60496. */
  60497. var VirtualItem = (function () {
  60498. function VirtualItem(templateRef, viewContainer) {
  60499. this.templateRef = templateRef;
  60500. this.viewContainer = viewContainer;
  60501. }
  60502. VirtualItem.decorators = [
  60503. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{ selector: '[virtualItem]' },] },
  60504. ];
  60505. /** @nocollapse */
  60506. VirtualItem.ctorParameters = function () { return [
  60507. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_5" /* TemplateRef */], },
  60508. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_10" /* ViewContainerRef */], },
  60509. ]; };
  60510. return VirtualItem;
  60511. }());
  60512. //# sourceMappingURL=virtual-item.js.map
  60513. /***/ }),
  60514. /* 98 */
  60515. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60516. "use strict";
  60517. /* unused harmony export get */
  60518. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getPromise; });
  60519. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getPlugin; });
  60520. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return pluginWarn; });
  60521. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cordovaWarn; });
  60522. /**
  60523. * @private
  60524. */
  60525. var get = function (element, path) {
  60526. var paths = path.split('.');
  60527. var obj = element;
  60528. for (var i = 0; i < paths.length; i++) {
  60529. if (!obj) {
  60530. return null;
  60531. }
  60532. obj = obj[paths[i]];
  60533. }
  60534. return obj;
  60535. };
  60536. /**
  60537. * @private
  60538. */
  60539. var getPromise = function (callback) {
  60540. var tryNativePromise = function () {
  60541. if (window.Promise) {
  60542. return new Promise(function (resolve, reject) {
  60543. callback(resolve, reject);
  60544. });
  60545. }
  60546. else {
  60547. console.error('No Promise support or polyfill found. To enable Ionic Native support, please add the es6-promise polyfill before this script, or run with a library like Angular or on a recent browser.');
  60548. }
  60549. };
  60550. return tryNativePromise();
  60551. };
  60552. /**
  60553. * @private
  60554. * @param pluginRef
  60555. * @returns {null|*}
  60556. */
  60557. var getPlugin = function (pluginRef) {
  60558. return get(window, pluginRef);
  60559. };
  60560. /**
  60561. * @private
  60562. */
  60563. var pluginWarn = function (pluginName, plugin, method) {
  60564. if (method) {
  60565. console.warn('Native: tried calling ' +
  60566. pluginName +
  60567. '.' +
  60568. method +
  60569. ', but the ' +
  60570. pluginName +
  60571. ' plugin is not installed.');
  60572. }
  60573. else {
  60574. console.warn("'Native: tried accessing the " + pluginName + " plugin but it's not installed.");
  60575. }
  60576. if (plugin) {
  60577. console.warn("Install the " + pluginName + " plugin: 'ionic cordova plugin add " + plugin + "'");
  60578. }
  60579. };
  60580. /**
  60581. * @private
  60582. * @param pluginName
  60583. * @param method
  60584. */
  60585. var cordovaWarn = function (pluginName, method) {
  60586. if (method) {
  60587. console.warn('Native: tried calling ' +
  60588. pluginName +
  60589. '.' +
  60590. method +
  60591. ', but Cordova is not available. Make sure to include cordova.js or run in a device/simulator');
  60592. }
  60593. else {
  60594. console.warn('Native: tried accessing the ' +
  60595. pluginName +
  60596. ' plugin but Cordova is not available. Make sure to include cordova.js or run in a device/simulator');
  60597. }
  60598. };
  60599. //# sourceMappingURL=util.js.map
  60600. /***/ }),
  60601. /* 99 */,
  60602. /* 100 */,
  60603. /* 101 */,
  60604. /* 102 */,
  60605. /* 103 */
  60606. /***/ (function(module, exports) {
  60607. var g;
  60608. // This works in non-strict mode
  60609. g = (function() {
  60610. return this;
  60611. })();
  60612. try {
  60613. // This works if eval is allowed (see CSP)
  60614. g = g || Function("return this")() || (1,eval)("this");
  60615. } catch(e) {
  60616. // This works if the window reference is available
  60617. if(typeof window === "object")
  60618. g = window;
  60619. }
  60620. // g can still be undefined, but nothing to do about it...
  60621. // We return undefined, instead of nothing here, so it's
  60622. // easier to handle this case. if(!global) { ...}
  60623. module.exports = g;
  60624. /***/ }),
  60625. /* 104 */
  60626. /***/ (function(module, exports, __webpack_require__) {
  60627. "use strict";
  60628. exports.isArray = Array.isArray || (function (x) { return x && typeof x.length === 'number'; });
  60629. //# sourceMappingURL=isArray.js.map
  60630. /***/ }),
  60631. /* 105 */
  60632. /***/ (function(module, exports, __webpack_require__) {
  60633. "use strict";
  60634. function isObject(x) {
  60635. return x != null && typeof x === 'object';
  60636. }
  60637. exports.isObject = isObject;
  60638. //# sourceMappingURL=isObject.js.map
  60639. /***/ }),
  60640. /* 106 */
  60641. /***/ (function(module, exports, __webpack_require__) {
  60642. "use strict";
  60643. var errorObject_1 = __webpack_require__(51);
  60644. var tryCatchTarget;
  60645. function tryCatcher() {
  60646. try {
  60647. return tryCatchTarget.apply(this, arguments);
  60648. }
  60649. catch (e) {
  60650. errorObject_1.errorObject.e = e;
  60651. return errorObject_1.errorObject;
  60652. }
  60653. }
  60654. function tryCatch(fn) {
  60655. tryCatchTarget = fn;
  60656. return tryCatcher;
  60657. }
  60658. exports.tryCatch = tryCatch;
  60659. ;
  60660. //# sourceMappingURL=tryCatch.js.map
  60661. /***/ }),
  60662. /* 107 */
  60663. /***/ (function(module, exports, __webpack_require__) {
  60664. "use strict";
  60665. exports.empty = {
  60666. closed: true,
  60667. next: function (value) { },
  60668. error: function (err) { throw err; },
  60669. complete: function () { }
  60670. };
  60671. //# sourceMappingURL=Observer.js.map
  60672. /***/ }),
  60673. /* 108 */
  60674. /***/ (function(module, exports, __webpack_require__) {
  60675. "use strict";
  60676. var root_1 = __webpack_require__(29);
  60677. function getSymbolObservable(context) {
  60678. var $$observable;
  60679. var Symbol = context.Symbol;
  60680. if (typeof Symbol === 'function') {
  60681. if (Symbol.observable) {
  60682. $$observable = Symbol.observable;
  60683. }
  60684. else {
  60685. $$observable = Symbol('observable');
  60686. Symbol.observable = $$observable;
  60687. }
  60688. }
  60689. else {
  60690. $$observable = '@@observable';
  60691. }
  60692. return $$observable;
  60693. }
  60694. exports.getSymbolObservable = getSymbolObservable;
  60695. exports.observable = getSymbolObservable(root_1.root);
  60696. /**
  60697. * @deprecated use observable instead
  60698. */
  60699. exports.$$observable = exports.observable;
  60700. //# sourceMappingURL=observable.js.map
  60701. /***/ }),
  60702. /* 109 */
  60703. /***/ (function(module, exports, __webpack_require__) {
  60704. "use strict";
  60705. var __extends = (this && this.__extends) || function (d, b) {
  60706. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  60707. function __() { this.constructor = d; }
  60708. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  60709. };
  60710. var Observable_1 = __webpack_require__(9);
  60711. var ScalarObservable_1 = __webpack_require__(211);
  60712. var EmptyObservable_1 = __webpack_require__(110);
  60713. var isScheduler_1 = __webpack_require__(111);
  60714. /**
  60715. * We need this JSDoc comment for affecting ESDoc.
  60716. * @extends {Ignored}
  60717. * @hide true
  60718. */
  60719. var ArrayObservable = (function (_super) {
  60720. __extends(ArrayObservable, _super);
  60721. function ArrayObservable(array, scheduler) {
  60722. _super.call(this);
  60723. this.array = array;
  60724. this.scheduler = scheduler;
  60725. if (!scheduler && array.length === 1) {
  60726. this._isScalar = true;
  60727. this.value = array[0];
  60728. }
  60729. }
  60730. ArrayObservable.create = function (array, scheduler) {
  60731. return new ArrayObservable(array, scheduler);
  60732. };
  60733. /**
  60734. * Creates an Observable that emits some values you specify as arguments,
  60735. * immediately one after the other, and then emits a complete notification.
  60736. *
  60737. * <span class="informal">Emits the arguments you provide, then completes.
  60738. * </span>
  60739. *
  60740. * <img src="./img/of.png" width="100%">
  60741. *
  60742. * This static operator is useful for creating a simple Observable that only
  60743. * emits the arguments given, and the complete notification thereafter. It can
  60744. * be used for composing with other Observables, such as with {@link concat}.
  60745. * By default, it uses a `null` IScheduler, which means the `next`
  60746. * notifications are sent synchronously, although with a different IScheduler
  60747. * it is possible to determine when those notifications will be delivered.
  60748. *
  60749. * @example <caption>Emit 10, 20, 30, then 'a', 'b', 'c', then start ticking every second.</caption>
  60750. * var numbers = Rx.Observable.of(10, 20, 30);
  60751. * var letters = Rx.Observable.of('a', 'b', 'c');
  60752. * var interval = Rx.Observable.interval(1000);
  60753. * var result = numbers.concat(letters).concat(interval);
  60754. * result.subscribe(x => console.log(x));
  60755. *
  60756. * @see {@link create}
  60757. * @see {@link empty}
  60758. * @see {@link never}
  60759. * @see {@link throw}
  60760. *
  60761. * @param {...T} values Arguments that represent `next` values to be emitted.
  60762. * @param {Scheduler} [scheduler] A {@link IScheduler} to use for scheduling
  60763. * the emissions of the `next` notifications.
  60764. * @return {Observable<T>} An Observable that emits each given input value.
  60765. * @static true
  60766. * @name of
  60767. * @owner Observable
  60768. */
  60769. ArrayObservable.of = function () {
  60770. var array = [];
  60771. for (var _i = 0; _i < arguments.length; _i++) {
  60772. array[_i - 0] = arguments[_i];
  60773. }
  60774. var scheduler = array[array.length - 1];
  60775. if (isScheduler_1.isScheduler(scheduler)) {
  60776. array.pop();
  60777. }
  60778. else {
  60779. scheduler = null;
  60780. }
  60781. var len = array.length;
  60782. if (len > 1) {
  60783. return new ArrayObservable(array, scheduler);
  60784. }
  60785. else if (len === 1) {
  60786. return new ScalarObservable_1.ScalarObservable(array[0], scheduler);
  60787. }
  60788. else {
  60789. return new EmptyObservable_1.EmptyObservable(scheduler);
  60790. }
  60791. };
  60792. ArrayObservable.dispatch = function (state) {
  60793. var array = state.array, index = state.index, count = state.count, subscriber = state.subscriber;
  60794. if (index >= count) {
  60795. subscriber.complete();
  60796. return;
  60797. }
  60798. subscriber.next(array[index]);
  60799. if (subscriber.closed) {
  60800. return;
  60801. }
  60802. state.index = index + 1;
  60803. this.schedule(state);
  60804. };
  60805. /** @deprecated internal use only */ ArrayObservable.prototype._subscribe = function (subscriber) {
  60806. var index = 0;
  60807. var array = this.array;
  60808. var count = array.length;
  60809. var scheduler = this.scheduler;
  60810. if (scheduler) {
  60811. return scheduler.schedule(ArrayObservable.dispatch, 0, {
  60812. array: array, index: index, count: count, subscriber: subscriber
  60813. });
  60814. }
  60815. else {
  60816. for (var i = 0; i < count && !subscriber.closed; i++) {
  60817. subscriber.next(array[i]);
  60818. }
  60819. subscriber.complete();
  60820. }
  60821. };
  60822. return ArrayObservable;
  60823. }(Observable_1.Observable));
  60824. exports.ArrayObservable = ArrayObservable;
  60825. //# sourceMappingURL=ArrayObservable.js.map
  60826. /***/ }),
  60827. /* 110 */
  60828. /***/ (function(module, exports, __webpack_require__) {
  60829. "use strict";
  60830. var __extends = (this && this.__extends) || function (d, b) {
  60831. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  60832. function __() { this.constructor = d; }
  60833. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  60834. };
  60835. var Observable_1 = __webpack_require__(9);
  60836. /**
  60837. * We need this JSDoc comment for affecting ESDoc.
  60838. * @extends {Ignored}
  60839. * @hide true
  60840. */
  60841. var EmptyObservable = (function (_super) {
  60842. __extends(EmptyObservable, _super);
  60843. function EmptyObservable(scheduler) {
  60844. _super.call(this);
  60845. this.scheduler = scheduler;
  60846. }
  60847. /**
  60848. * Creates an Observable that emits no items to the Observer and immediately
  60849. * emits a complete notification.
  60850. *
  60851. * <span class="informal">Just emits 'complete', and nothing else.
  60852. * </span>
  60853. *
  60854. * <img src="./img/empty.png" width="100%">
  60855. *
  60856. * This static operator is useful for creating a simple Observable that only
  60857. * emits the complete notification. It can be used for composing with other
  60858. * Observables, such as in a {@link mergeMap}.
  60859. *
  60860. * @example <caption>Emit the number 7, then complete.</caption>
  60861. * var result = Rx.Observable.empty().startWith(7);
  60862. * result.subscribe(x => console.log(x));
  60863. *
  60864. * @example <caption>Map and flatten only odd numbers to the sequence 'a', 'b', 'c'</caption>
  60865. * var interval = Rx.Observable.interval(1000);
  60866. * var result = interval.mergeMap(x =>
  60867. * x % 2 === 1 ? Rx.Observable.of('a', 'b', 'c') : Rx.Observable.empty()
  60868. * );
  60869. * result.subscribe(x => console.log(x));
  60870. *
  60871. * // Results in the following to the console:
  60872. * // x is equal to the count on the interval eg(0,1,2,3,...)
  60873. * // x will occur every 1000ms
  60874. * // if x % 2 is equal to 1 print abc
  60875. * // if x % 2 is not equal to 1 nothing will be output
  60876. *
  60877. * @see {@link create}
  60878. * @see {@link never}
  60879. * @see {@link of}
  60880. * @see {@link throw}
  60881. *
  60882. * @param {Scheduler} [scheduler] A {@link IScheduler} to use for scheduling
  60883. * the emission of the complete notification.
  60884. * @return {Observable} An "empty" Observable: emits only the complete
  60885. * notification.
  60886. * @static true
  60887. * @name empty
  60888. * @owner Observable
  60889. */
  60890. EmptyObservable.create = function (scheduler) {
  60891. return new EmptyObservable(scheduler);
  60892. };
  60893. EmptyObservable.dispatch = function (arg) {
  60894. var subscriber = arg.subscriber;
  60895. subscriber.complete();
  60896. };
  60897. /** @deprecated internal use only */ EmptyObservable.prototype._subscribe = function (subscriber) {
  60898. var scheduler = this.scheduler;
  60899. if (scheduler) {
  60900. return scheduler.schedule(EmptyObservable.dispatch, 0, { subscriber: subscriber });
  60901. }
  60902. else {
  60903. subscriber.complete();
  60904. }
  60905. };
  60906. return EmptyObservable;
  60907. }(Observable_1.Observable));
  60908. exports.EmptyObservable = EmptyObservable;
  60909. //# sourceMappingURL=EmptyObservable.js.map
  60910. /***/ }),
  60911. /* 111 */
  60912. /***/ (function(module, exports, __webpack_require__) {
  60913. "use strict";
  60914. function isScheduler(value) {
  60915. return value && typeof value.schedule === 'function';
  60916. }
  60917. exports.isScheduler = isScheduler;
  60918. //# sourceMappingURL=isScheduler.js.map
  60919. /***/ }),
  60920. /* 112 */
  60921. /***/ (function(module, exports, __webpack_require__) {
  60922. "use strict";
  60923. var __extends = (this && this.__extends) || function (d, b) {
  60924. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  60925. function __() { this.constructor = d; }
  60926. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  60927. };
  60928. var subscribeToResult_1 = __webpack_require__(53);
  60929. var OuterSubscriber_1 = __webpack_require__(54);
  60930. /* tslint:enable:max-line-length */
  60931. /**
  60932. * Projects each source value to an Observable which is merged in the output
  60933. * Observable.
  60934. *
  60935. * <span class="informal">Maps each value to an Observable, then flattens all of
  60936. * these inner Observables using {@link mergeAll}.</span>
  60937. *
  60938. * <img src="./img/mergeMap.png" width="100%">
  60939. *
  60940. * Returns an Observable that emits items based on applying a function that you
  60941. * supply to each item emitted by the source Observable, where that function
  60942. * returns an Observable, and then merging those resulting Observables and
  60943. * emitting the results of this merger.
  60944. *
  60945. * @example <caption>Map and flatten each letter to an Observable ticking every 1 second</caption>
  60946. * var letters = Rx.Observable.of('a', 'b', 'c');
  60947. * var result = letters.mergeMap(x =>
  60948. * Rx.Observable.interval(1000).map(i => x+i)
  60949. * );
  60950. * result.subscribe(x => console.log(x));
  60951. *
  60952. * // Results in the following:
  60953. * // a0
  60954. * // b0
  60955. * // c0
  60956. * // a1
  60957. * // b1
  60958. * // c1
  60959. * // continues to list a,b,c with respective ascending integers
  60960. *
  60961. * @see {@link concatMap}
  60962. * @see {@link exhaustMap}
  60963. * @see {@link merge}
  60964. * @see {@link mergeAll}
  60965. * @see {@link mergeMapTo}
  60966. * @see {@link mergeScan}
  60967. * @see {@link switchMap}
  60968. *
  60969. * @param {function(value: T, ?index: number): ObservableInput} project A function
  60970. * that, when applied to an item emitted by the source Observable, returns an
  60971. * Observable.
  60972. * @param {function(outerValue: T, innerValue: I, outerIndex: number, innerIndex: number): any} [resultSelector]
  60973. * A function to produce the value on the output Observable based on the values
  60974. * and the indices of the source (outer) emission and the inner Observable
  60975. * emission. The arguments passed to this function are:
  60976. * - `outerValue`: the value that came from the source
  60977. * - `innerValue`: the value that came from the projected Observable
  60978. * - `outerIndex`: the "index" of the value that came from the source
  60979. * - `innerIndex`: the "index" of the value from the projected Observable
  60980. * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of input
  60981. * Observables being subscribed to concurrently.
  60982. * @return {Observable} An Observable that emits the result of applying the
  60983. * projection function (and the optional `resultSelector`) to each item emitted
  60984. * by the source Observable and merging the results of the Observables obtained
  60985. * from this transformation.
  60986. * @method mergeMap
  60987. * @owner Observable
  60988. */
  60989. function mergeMap(project, resultSelector, concurrent) {
  60990. if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; }
  60991. return function mergeMapOperatorFunction(source) {
  60992. if (typeof resultSelector === 'number') {
  60993. concurrent = resultSelector;
  60994. resultSelector = null;
  60995. }
  60996. return source.lift(new MergeMapOperator(project, resultSelector, concurrent));
  60997. };
  60998. }
  60999. exports.mergeMap = mergeMap;
  61000. var MergeMapOperator = (function () {
  61001. function MergeMapOperator(project, resultSelector, concurrent) {
  61002. if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; }
  61003. this.project = project;
  61004. this.resultSelector = resultSelector;
  61005. this.concurrent = concurrent;
  61006. }
  61007. MergeMapOperator.prototype.call = function (observer, source) {
  61008. return source.subscribe(new MergeMapSubscriber(observer, this.project, this.resultSelector, this.concurrent));
  61009. };
  61010. return MergeMapOperator;
  61011. }());
  61012. exports.MergeMapOperator = MergeMapOperator;
  61013. /**
  61014. * We need this JSDoc comment for affecting ESDoc.
  61015. * @ignore
  61016. * @extends {Ignored}
  61017. */
  61018. var MergeMapSubscriber = (function (_super) {
  61019. __extends(MergeMapSubscriber, _super);
  61020. function MergeMapSubscriber(destination, project, resultSelector, concurrent) {
  61021. if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; }
  61022. _super.call(this, destination);
  61023. this.project = project;
  61024. this.resultSelector = resultSelector;
  61025. this.concurrent = concurrent;
  61026. this.hasCompleted = false;
  61027. this.buffer = [];
  61028. this.active = 0;
  61029. this.index = 0;
  61030. }
  61031. MergeMapSubscriber.prototype._next = function (value) {
  61032. if (this.active < this.concurrent) {
  61033. this._tryNext(value);
  61034. }
  61035. else {
  61036. this.buffer.push(value);
  61037. }
  61038. };
  61039. MergeMapSubscriber.prototype._tryNext = function (value) {
  61040. var result;
  61041. var index = this.index++;
  61042. try {
  61043. result = this.project(value, index);
  61044. }
  61045. catch (err) {
  61046. this.destination.error(err);
  61047. return;
  61048. }
  61049. this.active++;
  61050. this._innerSub(result, value, index);
  61051. };
  61052. MergeMapSubscriber.prototype._innerSub = function (ish, value, index) {
  61053. this.add(subscribeToResult_1.subscribeToResult(this, ish, value, index));
  61054. };
  61055. MergeMapSubscriber.prototype._complete = function () {
  61056. this.hasCompleted = true;
  61057. if (this.active === 0 && this.buffer.length === 0) {
  61058. this.destination.complete();
  61059. }
  61060. };
  61061. MergeMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  61062. if (this.resultSelector) {
  61063. this._notifyResultSelector(outerValue, innerValue, outerIndex, innerIndex);
  61064. }
  61065. else {
  61066. this.destination.next(innerValue);
  61067. }
  61068. };
  61069. MergeMapSubscriber.prototype._notifyResultSelector = function (outerValue, innerValue, outerIndex, innerIndex) {
  61070. var result;
  61071. try {
  61072. result = this.resultSelector(outerValue, innerValue, outerIndex, innerIndex);
  61073. }
  61074. catch (err) {
  61075. this.destination.error(err);
  61076. return;
  61077. }
  61078. this.destination.next(result);
  61079. };
  61080. MergeMapSubscriber.prototype.notifyComplete = function (innerSub) {
  61081. var buffer = this.buffer;
  61082. this.remove(innerSub);
  61083. this.active--;
  61084. if (buffer.length > 0) {
  61085. this._next(buffer.shift());
  61086. }
  61087. else if (this.active === 0 && this.hasCompleted) {
  61088. this.destination.complete();
  61089. }
  61090. };
  61091. return MergeMapSubscriber;
  61092. }(OuterSubscriber_1.OuterSubscriber));
  61093. exports.MergeMapSubscriber = MergeMapSubscriber;
  61094. //# sourceMappingURL=mergeMap.js.map
  61095. /***/ }),
  61096. /* 113 */
  61097. /***/ (function(module, exports, __webpack_require__) {
  61098. "use strict";
  61099. var __extends = (this && this.__extends) || function (d, b) {
  61100. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  61101. function __() { this.constructor = d; }
  61102. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  61103. };
  61104. var Subscriber_1 = __webpack_require__(20);
  61105. function refCount() {
  61106. return function refCountOperatorFunction(source) {
  61107. return source.lift(new RefCountOperator(source));
  61108. };
  61109. }
  61110. exports.refCount = refCount;
  61111. var RefCountOperator = (function () {
  61112. function RefCountOperator(connectable) {
  61113. this.connectable = connectable;
  61114. }
  61115. RefCountOperator.prototype.call = function (subscriber, source) {
  61116. var connectable = this.connectable;
  61117. connectable._refCount++;
  61118. var refCounter = new RefCountSubscriber(subscriber, connectable);
  61119. var subscription = source.subscribe(refCounter);
  61120. if (!refCounter.closed) {
  61121. refCounter.connection = connectable.connect();
  61122. }
  61123. return subscription;
  61124. };
  61125. return RefCountOperator;
  61126. }());
  61127. var RefCountSubscriber = (function (_super) {
  61128. __extends(RefCountSubscriber, _super);
  61129. function RefCountSubscriber(destination, connectable) {
  61130. _super.call(this, destination);
  61131. this.connectable = connectable;
  61132. }
  61133. /** @deprecated internal use only */ RefCountSubscriber.prototype._unsubscribe = function () {
  61134. var connectable = this.connectable;
  61135. if (!connectable) {
  61136. this.connection = null;
  61137. return;
  61138. }
  61139. this.connectable = null;
  61140. var refCount = connectable._refCount;
  61141. if (refCount <= 0) {
  61142. this.connection = null;
  61143. return;
  61144. }
  61145. connectable._refCount = refCount - 1;
  61146. if (refCount > 1) {
  61147. this.connection = null;
  61148. return;
  61149. }
  61150. ///
  61151. // Compare the local RefCountSubscriber's connection Subscription to the
  61152. // connection Subscription on the shared ConnectableObservable. In cases
  61153. // where the ConnectableObservable source synchronously emits values, and
  61154. // the RefCountSubscriber's downstream Observers synchronously unsubscribe,
  61155. // execution continues to here before the RefCountOperator has a chance to
  61156. // supply the RefCountSubscriber with the shared connection Subscription.
  61157. // For example:
  61158. // ```
  61159. // Observable.range(0, 10)
  61160. // .publish()
  61161. // .refCount()
  61162. // .take(5)
  61163. // .subscribe();
  61164. // ```
  61165. // In order to account for this case, RefCountSubscriber should only dispose
  61166. // the ConnectableObservable's shared connection Subscription if the
  61167. // connection Subscription exists, *and* either:
  61168. // a. RefCountSubscriber doesn't have a reference to the shared connection
  61169. // Subscription yet, or,
  61170. // b. RefCountSubscriber's connection Subscription reference is identical
  61171. // to the shared connection Subscription
  61172. ///
  61173. var connection = this.connection;
  61174. var sharedConnection = connectable._connection;
  61175. this.connection = null;
  61176. if (sharedConnection && (!connection || sharedConnection === connection)) {
  61177. sharedConnection.unsubscribe();
  61178. }
  61179. };
  61180. return RefCountSubscriber;
  61181. }(Subscriber_1.Subscriber));
  61182. //# sourceMappingURL=refCount.js.map
  61183. /***/ }),
  61184. /* 114 */,
  61185. /* 115 */
  61186. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61187. "use strict";
  61188. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return OverlayPortal; });
  61189. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  61190. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__app__ = __webpack_require__(6);
  61191. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__config_config__ = __webpack_require__(1);
  61192. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__navigation_deep_linker__ = __webpack_require__(14);
  61193. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__platform_dom_controller__ = __webpack_require__(8);
  61194. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__gestures_gesture_controller__ = __webpack_require__(7);
  61195. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__navigation_nav_controller_base__ = __webpack_require__(42);
  61196. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__platform_platform__ = __webpack_require__(3);
  61197. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__transitions_transition_controller__ = __webpack_require__(44);
  61198. var __extends = (this && this.__extends) || (function () {
  61199. var extendStatics = Object.setPrototypeOf ||
  61200. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  61201. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  61202. return function (d, b) {
  61203. extendStatics(d, b);
  61204. function __() { this.constructor = d; }
  61205. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  61206. };
  61207. })();
  61208. /**
  61209. * @hidden
  61210. */
  61211. var OverlayPortal = (function (_super) {
  61212. __extends(OverlayPortal, _super);
  61213. function OverlayPortal(app, config, plt, elementRef, zone, renderer, cfr, gestureCtrl, transCtrl, linker, viewPort, domCtrl, errHandler) {
  61214. var _this = _super.call(this, null, app, config, plt, elementRef, zone, renderer, cfr, gestureCtrl, transCtrl, linker, domCtrl, errHandler) || this;
  61215. _this._isPortal = true;
  61216. _this._init = true;
  61217. _this.setViewport(viewPort);
  61218. // on every page change make sure the portal has
  61219. // dismissed any views that should be auto dismissed on page change
  61220. app.viewDidLeave.subscribe(function (view) {
  61221. if (!view.isOverlay) {
  61222. _this.dismissPageChangeViews();
  61223. }
  61224. });
  61225. return _this;
  61226. }
  61227. Object.defineProperty(OverlayPortal.prototype, "_overlayPortal", {
  61228. set: function (val) {
  61229. this._zIndexOffset = (val || 0);
  61230. },
  61231. enumerable: true,
  61232. configurable: true
  61233. });
  61234. OverlayPortal.prototype.ngOnDestroy = function () {
  61235. this.destroy();
  61236. };
  61237. /*
  61238. * @private
  61239. */
  61240. OverlayPortal.prototype.getType = function () {
  61241. return 'portal';
  61242. };
  61243. /*
  61244. * @private
  61245. */
  61246. OverlayPortal.prototype.getSecondaryIdentifier = function () {
  61247. return null;
  61248. };
  61249. OverlayPortal.decorators = [
  61250. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  61251. selector: '[overlay-portal]',
  61252. },] },
  61253. ];
  61254. /** @nocollapse */
  61255. OverlayPortal.ctorParameters = function () { return [
  61256. { type: __WEBPACK_IMPORTED_MODULE_1__app__["a" /* App */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["z" /* Inject */], args: [Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_14" /* forwardRef */])(function () { return __WEBPACK_IMPORTED_MODULE_1__app__["a" /* App */]; }),] },] },
  61257. { type: __WEBPACK_IMPORTED_MODULE_2__config_config__["a" /* Config */], },
  61258. { type: __WEBPACK_IMPORTED_MODULE_7__platform_platform__["a" /* Platform */], },
  61259. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  61260. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["M" /* NgZone */], },
  61261. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  61262. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["o" /* ComponentFactoryResolver */], },
  61263. { type: __WEBPACK_IMPORTED_MODULE_5__gestures_gesture_controller__["l" /* GestureController */], },
  61264. { type: __WEBPACK_IMPORTED_MODULE_8__transitions_transition_controller__["a" /* TransitionController */], },
  61265. { type: __WEBPACK_IMPORTED_MODULE_3__navigation_deep_linker__["a" /* DeepLinker */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  61266. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_10" /* ViewContainerRef */], },
  61267. { type: __WEBPACK_IMPORTED_MODULE_4__platform_dom_controller__["a" /* DomController */], },
  61268. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["u" /* ErrorHandler */], },
  61269. ]; };
  61270. OverlayPortal.propDecorators = {
  61271. '_overlayPortal': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */], args: ['overlay-portal',] },],
  61272. };
  61273. return OverlayPortal;
  61274. }(__WEBPACK_IMPORTED_MODULE_6__navigation_nav_controller_base__["a" /* NavControllerBase */]));
  61275. //# sourceMappingURL=overlay-portal.js.map
  61276. /***/ }),
  61277. /* 116 */
  61278. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61279. "use strict";
  61280. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SlideGesture; });
  61281. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__pan_gesture__ = __webpack_require__(43);
  61282. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_util__ = __webpack_require__(2);
  61283. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_dom__ = __webpack_require__(10);
  61284. var __extends = (this && this.__extends) || (function () {
  61285. var extendStatics = Object.setPrototypeOf ||
  61286. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  61287. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  61288. return function (d, b) {
  61289. extendStatics(d, b);
  61290. function __() { this.constructor = d; }
  61291. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  61292. };
  61293. })();
  61294. /**
  61295. * @hidden
  61296. */
  61297. var SlideGesture = (function (_super) {
  61298. __extends(SlideGesture, _super);
  61299. function SlideGesture(plt, element, opts) {
  61300. if (opts === void 0) { opts = {}; }
  61301. var _this = _super.call(this, plt, element, opts) || this;
  61302. _this.slide = null;
  61303. return _this;
  61304. }
  61305. /*
  61306. * Get the min and max for the slide. pageX/pageY.
  61307. * Only called on dragstart.
  61308. */
  61309. SlideGesture.prototype.getSlideBoundaries = function (_slide, _ev) {
  61310. return {
  61311. min: 0,
  61312. max: this.getNativeElement().offsetWidth
  61313. };
  61314. };
  61315. /*
  61316. * Get the element's pos when the drag starts.
  61317. * For example, an open side menu starts at 100% and a closed
  61318. * sidemenu starts at 0%.
  61319. */
  61320. SlideGesture.prototype.getElementStartPos = function (_slide, _ev) {
  61321. return 0;
  61322. };
  61323. SlideGesture.prototype.onDragStart = function (ev) {
  61324. this.onSlideBeforeStart(ev);
  61325. var coord = Object(__WEBPACK_IMPORTED_MODULE_2__util_dom__["f" /* pointerCoord */])(ev);
  61326. var pos = coord[this.direction];
  61327. this.slide = {
  61328. min: 0,
  61329. max: 0,
  61330. pointerStartPos: pos,
  61331. pos: pos,
  61332. timestamp: Date.now(),
  61333. elementStartPos: 0,
  61334. started: true,
  61335. delta: 0,
  61336. distance: 0,
  61337. velocity: 0,
  61338. };
  61339. // TODO: we should run this in the next frame
  61340. var _a = this.getSlideBoundaries(this.slide, ev), min = _a.min, max = _a.max;
  61341. this.slide.min = min;
  61342. this.slide.max = max;
  61343. this.slide.elementStartPos = this.getElementStartPos(this.slide, ev);
  61344. this.onSlideStart(this.slide, ev);
  61345. };
  61346. SlideGesture.prototype.onDragMove = function (ev) {
  61347. var slide = this.slide;
  61348. (void 0) /* assert */;
  61349. var coord = Object(__WEBPACK_IMPORTED_MODULE_2__util_dom__["f" /* pointerCoord */])(ev);
  61350. var newPos = coord[this.direction];
  61351. var newTimestamp = Date.now();
  61352. var velocity = (this.plt.isRTL ? (slide.pos - newPos) : (newPos - slide.pos)) / (newTimestamp - slide.timestamp);
  61353. slide.pos = newPos;
  61354. slide.timestamp = newTimestamp;
  61355. slide.distance = Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["a" /* clamp */])(slide.min, (this.plt.isRTL ? slide.pointerStartPos - newPos : newPos - slide.pointerStartPos) + slide.elementStartPos, slide.max);
  61356. slide.velocity = velocity;
  61357. slide.delta = (this.plt.isRTL ? slide.pointerStartPos - newPos : newPos - slide.pointerStartPos);
  61358. this.onSlide(slide, ev);
  61359. };
  61360. SlideGesture.prototype.onDragEnd = function (ev) {
  61361. this.onSlideEnd(this.slide, ev);
  61362. this.slide = null;
  61363. };
  61364. SlideGesture.prototype.onSlideBeforeStart = function (_ev) { };
  61365. SlideGesture.prototype.onSlideStart = function (_slide, _ev) { };
  61366. SlideGesture.prototype.onSlide = function (_slide, _ev) { };
  61367. SlideGesture.prototype.onSlideEnd = function (_slide, _ev) { };
  61368. return SlideGesture;
  61369. }(__WEBPACK_IMPORTED_MODULE_0__pan_gesture__["a" /* PanGesture */]));
  61370. //# sourceMappingURL=slide-gesture.js.map
  61371. /***/ }),
  61372. /* 117 */
  61373. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61374. "use strict";
  61375. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return PointerEvents; });
  61376. /* unused harmony export POINTER_EVENT_TYPE_MOUSE */
  61377. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return POINTER_EVENT_TYPE_TOUCH; });
  61378. /**
  61379. * @hidden
  61380. */
  61381. var PointerEvents = (function () {
  61382. function PointerEvents(plt, ele, pointerDown, pointerMove, pointerUp, option) {
  61383. this.plt = plt;
  61384. this.ele = ele;
  61385. this.pointerDown = pointerDown;
  61386. this.pointerMove = pointerMove;
  61387. this.pointerUp = pointerUp;
  61388. this.option = option;
  61389. this.rmTouchStart = null;
  61390. this.rmTouchMove = null;
  61391. this.rmTouchEnd = null;
  61392. this.rmTouchCancel = null;
  61393. this.rmMouseStart = null;
  61394. this.rmMouseMove = null;
  61395. this.rmMouseUp = null;
  61396. this.lastTouchEvent = 0;
  61397. this.mouseWait = 2 * 1000;
  61398. (void 0) /* assert */;
  61399. (void 0) /* assert */;
  61400. this.bindTouchEnd = this.handleTouchEnd.bind(this);
  61401. this.bindMouseUp = this.handleMouseUp.bind(this);
  61402. this.rmTouchStart = this.plt.registerListener(ele, 'touchstart', this.handleTouchStart.bind(this), option);
  61403. this.rmMouseStart = this.plt.registerListener(ele, 'mousedown', this.handleMouseDown.bind(this), option);
  61404. }
  61405. PointerEvents.prototype.handleTouchStart = function (ev) {
  61406. (void 0) /* assert */;
  61407. (void 0) /* assert */;
  61408. this.lastTouchEvent = Date.now() + this.mouseWait;
  61409. this.lastEventType = POINTER_EVENT_TYPE_TOUCH;
  61410. if (!this.pointerDown(ev, POINTER_EVENT_TYPE_TOUCH)) {
  61411. return;
  61412. }
  61413. if (!this.rmTouchMove && this.pointerMove) {
  61414. this.rmTouchMove = this.plt.registerListener(this.ele, 'touchmove', this.pointerMove, this.option);
  61415. }
  61416. if (!this.rmTouchEnd) {
  61417. this.rmTouchEnd = this.plt.registerListener(this.ele, 'touchend', this.bindTouchEnd, this.option);
  61418. }
  61419. if (!this.rmTouchCancel) {
  61420. this.rmTouchCancel = this.plt.registerListener(this.ele, 'touchcancel', this.bindTouchEnd, this.option);
  61421. }
  61422. };
  61423. PointerEvents.prototype.handleMouseDown = function (ev) {
  61424. (void 0) /* assert */;
  61425. (void 0) /* assert */;
  61426. if (this.lastTouchEvent > Date.now()) {
  61427. (void 0) /* console.debug */;
  61428. return;
  61429. }
  61430. this.lastEventType = POINTER_EVENT_TYPE_MOUSE;
  61431. if (!this.pointerDown(ev, POINTER_EVENT_TYPE_MOUSE)) {
  61432. return;
  61433. }
  61434. if (!this.rmMouseMove && this.pointerMove) {
  61435. this.rmMouseMove = this.plt.registerListener(this.plt.doc(), 'mousemove', this.pointerMove, this.option);
  61436. }
  61437. if (!this.rmMouseUp) {
  61438. this.rmMouseUp = this.plt.registerListener(this.plt.doc(), 'mouseup', this.bindMouseUp, this.option);
  61439. }
  61440. };
  61441. PointerEvents.prototype.handleTouchEnd = function (ev) {
  61442. this.stopTouch();
  61443. this.pointerUp && this.pointerUp(ev, POINTER_EVENT_TYPE_TOUCH);
  61444. };
  61445. PointerEvents.prototype.handleMouseUp = function (ev) {
  61446. this.stopMouse();
  61447. this.pointerUp && this.pointerUp(ev, POINTER_EVENT_TYPE_MOUSE);
  61448. };
  61449. PointerEvents.prototype.stopTouch = function () {
  61450. this.rmTouchMove && this.rmTouchMove();
  61451. this.rmTouchEnd && this.rmTouchEnd();
  61452. this.rmTouchCancel && this.rmTouchCancel();
  61453. this.rmTouchMove = this.rmTouchEnd = this.rmTouchCancel = null;
  61454. };
  61455. PointerEvents.prototype.stopMouse = function () {
  61456. this.rmMouseMove && this.rmMouseMove();
  61457. this.rmMouseUp && this.rmMouseUp();
  61458. this.rmMouseMove = this.rmMouseUp = null;
  61459. };
  61460. PointerEvents.prototype.stop = function () {
  61461. this.stopTouch();
  61462. this.stopMouse();
  61463. };
  61464. PointerEvents.prototype.destroy = function () {
  61465. this.rmTouchStart && this.rmTouchStart();
  61466. this.rmMouseStart && this.rmMouseStart();
  61467. this.stop();
  61468. this.ele = this.pointerUp = this.pointerMove = this.pointerDown = this.rmTouchStart = this.rmMouseStart = null;
  61469. };
  61470. return PointerEvents;
  61471. }());
  61472. var POINTER_EVENT_TYPE_MOUSE = 1;
  61473. var POINTER_EVENT_TYPE_TOUCH = 2;
  61474. //# sourceMappingURL=pointer-events.js.map
  61475. /***/ }),
  61476. /* 118 */
  61477. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61478. "use strict";
  61479. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ActionSheetController; });
  61480. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  61481. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__action_sheet__ = __webpack_require__(57);
  61482. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__app_app__ = __webpack_require__(6);
  61483. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__config_config__ = __webpack_require__(1);
  61484. /**
  61485. * @name ActionSheetController
  61486. * @description
  61487. * An Action Sheet is a dialog that lets the user choose from a set of
  61488. * options. It appears on top of the app's content, and must be manually
  61489. * dismissed by the user before they can resume interaction with the app.
  61490. * Dangerous (destructive) options are made obvious in `ios` mode. There are easy
  61491. * ways to cancel out of the action sheet, such as tapping the backdrop or
  61492. * hitting the escape key on desktop.
  61493. *
  61494. * An action sheet is created from an array of `buttons`, with each button
  61495. * including properties for its `text`, and optionally a `handler` and `role`.
  61496. * If a handler returns `false` then the action sheet will not be dismissed. An
  61497. * action sheet can also optionally have a `title`, `subTitle` and an `icon`.
  61498. *
  61499. * A button's `role` property can either be `destructive` or `cancel`. Buttons
  61500. * without a role property will have the default look for the platform. Buttons
  61501. * with the `cancel` role will always load as the bottom button, no matter where
  61502. * they are in the array. All other buttons will be displayed in the order they
  61503. * have been added to the `buttons` array. Note: We recommend that `destructive`
  61504. * buttons are always the first button in the array, making them the top button.
  61505. * Additionally, if the action sheet is dismissed by tapping the backdrop, then
  61506. * it will fire the handler from the button with the cancel role.
  61507. *
  61508. * You can pass all of the action sheet's options in the first argument of
  61509. * the create method: `ActionSheet.create(opts)`. Otherwise the action sheet's
  61510. * instance has methods to add options, like `setTitle()` or `addButton()`.
  61511. *
  61512. * @usage
  61513. * ```ts
  61514. * import { ActionSheetController } from 'ionic-angular'
  61515. *
  61516. * export class MyClass{
  61517. *
  61518. * constructor(public actionSheetCtrl: ActionSheetController) { }
  61519. *
  61520. * presentActionSheet() {
  61521. * const actionSheet = this.actionSheetCtrl.create({
  61522. * title: 'Modify your album',
  61523. * buttons: [
  61524. * {
  61525. * text: 'Destructive',
  61526. * role: 'destructive',
  61527. * handler: () => {
  61528. * console.log('Destructive clicked');
  61529. * }
  61530. * },
  61531. * {
  61532. * text: 'Archive',
  61533. * handler: () => {
  61534. * console.log('Archive clicked');
  61535. * }
  61536. * },
  61537. * {
  61538. * text: 'Cancel',
  61539. * role: 'cancel',
  61540. * handler: () => {
  61541. * console.log('Cancel clicked');
  61542. * }
  61543. * }
  61544. * ]
  61545. * });
  61546. *
  61547. * actionSheet.present();
  61548. * }
  61549. * }
  61550. * ```
  61551. *
  61552. * @advanced
  61553. *
  61554. * ActionSheet create options
  61555. *
  61556. * | Option | Type | Description |
  61557. * |-----------------------|------------|--------------------------------------------------------------------|
  61558. * | title |`string` | The title for the Action Sheet. |
  61559. * | subTitle |`string` | The sub-title for the Action Sheet. |
  61560. * | cssClass |`string` | Additional classes for custom styles, separated by spaces. |
  61561. * | enableBackdropDismiss |`boolean` | If the Action Sheet should close when the user taps the backdrop. |
  61562. * | buttons |`array<any>`| An array of buttons to display. |
  61563. *
  61564. * ActionSheet button options
  61565. *
  61566. * | Option | Type | Description |
  61567. * |----------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------|
  61568. * | text | `string` | The buttons text. |
  61569. * | icon | `icon` | The buttons icons. |
  61570. * | handler | `any` | An express the button should evaluate. |
  61571. * | cssClass | `string` | Additional classes for custom styles, separated by spaces. |
  61572. * | role | `string` | How the button should be displayed, `destructive` or `cancel`. If not role is provided, it will display the button without any additional styles.|
  61573. *
  61574. *
  61575. * ### Dismissing And Async Navigation
  61576. *
  61577. * After an action sheet has been dismissed, the app may need to also transition
  61578. * to another page depending on the handler's logic. However, because multiple
  61579. * transitions were fired at roughly the same time, it's difficult for the
  61580. * nav controller to cleanly animate multiple transitions that may
  61581. * have been kicked off asynchronously. This is further described in the
  61582. * [`Nav Transition Promises`](../../nav/NavController/#nav-transition-promises) section. For action sheets,
  61583. * this means it's best to wait for the action sheet to finish its transition
  61584. * out before starting a new transition on the same nav controller.
  61585. *
  61586. * In the example below, after the button has been clicked, its handler
  61587. * waits on async operation to complete, *then* it uses `pop` to navigate
  61588. * back a page in the same stack. The potential problem is that the async operation
  61589. * may have been completed before the action sheet has even finished its transition
  61590. * out. In this case, it's best to ensure the action sheet has finished its transition
  61591. * out first, *then* start the next transition.
  61592. *
  61593. * ```ts
  61594. * const actionSheet = this.actionSheetCtrl.create({
  61595. * title: 'Hello',
  61596. * buttons: [{
  61597. * text: 'Ok',
  61598. * handler: () => {
  61599. * // user has clicked the action sheet button
  61600. * // begin the action sheet's dimiss transition
  61601. * let navTransition = actionSheet.dismiss();
  61602. *
  61603. * // start some async method
  61604. * someAsyncOperation().then(() => {
  61605. * // once the async operation has completed
  61606. * // then run the next nav transition after the
  61607. * // first transition has finished animating out
  61608. *
  61609. * navTransition.then(() => {
  61610. * this.nav.pop();
  61611. * });
  61612. * });
  61613. * return false;
  61614. * }
  61615. * }]
  61616. * });
  61617. *
  61618. * actionSheet.present();
  61619. * ```
  61620. *
  61621. * It's important to note that the handler returns `false`. A feature of
  61622. * button handlers is that they automatically dismiss the action sheet when their button
  61623. * was clicked, however, we'll need more control regarding the transition. Because
  61624. * the handler returns `false`, then the action sheet does not automatically dismiss
  61625. * itself. Instead, you now have complete control of when the action sheet has finished
  61626. * transitioning, and the ability to wait for the action sheet to finish transitioning
  61627. * out before starting a new transition.
  61628. *
  61629. *
  61630. * @demo /docs/demos/src/action-sheet/
  61631. * @see {@link /docs/components#action-sheets ActionSheet Component Docs}
  61632. */
  61633. var ActionSheetController = (function () {
  61634. function ActionSheetController(_app, config) {
  61635. this._app = _app;
  61636. this.config = config;
  61637. }
  61638. /**
  61639. * Open an action sheet with a title, subTitle, and an array of buttons
  61640. * @param {ActionSheetOptions} opts Action sheet options
  61641. */
  61642. ActionSheetController.prototype.create = function (opts) {
  61643. if (opts === void 0) { opts = {}; }
  61644. return new __WEBPACK_IMPORTED_MODULE_1__action_sheet__["a" /* ActionSheet */](this._app, opts, this.config);
  61645. };
  61646. ActionSheetController.decorators = [
  61647. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */] },
  61648. ];
  61649. /** @nocollapse */
  61650. ActionSheetController.ctorParameters = function () { return [
  61651. { type: __WEBPACK_IMPORTED_MODULE_2__app_app__["a" /* App */], },
  61652. { type: __WEBPACK_IMPORTED_MODULE_3__config_config__["a" /* Config */], },
  61653. ]; };
  61654. return ActionSheetController;
  61655. }());
  61656. //# sourceMappingURL=action-sheet-controller.js.map
  61657. /***/ }),
  61658. /* 119 */
  61659. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61660. "use strict";
  61661. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AlertController; });
  61662. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  61663. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__alert__ = __webpack_require__(59);
  61664. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__app_app__ = __webpack_require__(6);
  61665. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__config_config__ = __webpack_require__(1);
  61666. /**
  61667. * @name AlertController
  61668. * @description
  61669. * An Alert is a dialog that presents users with information or collects
  61670. * information from the user using inputs. An alert appears on top
  61671. * of the app's content, and must be manually dismissed by the user before
  61672. * they can resume interaction with the app. It can also optionally have a
  61673. * `title`, `subTitle` and `message`.
  61674. *
  61675. * You can pass all of the alert's options in the first argument of
  61676. * the create method: `create(opts)`. Otherwise the alert's instance
  61677. * has methods to add options, such as `setTitle()` or `addButton()`.
  61678. *
  61679. *
  61680. * ### Alert Buttons
  61681. *
  61682. * In the array of `buttons`, each button includes properties for its `text`,
  61683. * and optionally a `handler`. If a handler returns `false` then the alert
  61684. * will not automatically be dismissed when the button is clicked. All
  61685. * buttons will show up in the order they have been added to the `buttons`
  61686. * array, from left to right. Note: The right most button (the last one in
  61687. * the array) is the main button.
  61688. *
  61689. * Optionally, a `role` property can be added to a button, such as `cancel`.
  61690. * If a `cancel` role is on one of the buttons, then if the alert is
  61691. * dismissed by tapping the backdrop, then it will fire the handler from
  61692. * the button with a cancel role.
  61693. *
  61694. *
  61695. * ### Alert Inputs
  61696. *
  61697. * Alerts can also include several different inputs whose data can be passed
  61698. * back to the app. Inputs can be used as a simple way to prompt users for
  61699. * information. Radios, checkboxes and text inputs are all accepted, but they
  61700. * cannot be mixed. For example, an alert could have all radio button inputs,
  61701. * or all checkbox inputs, but the same alert cannot mix radio and checkbox
  61702. * inputs. Do note however, different types of "text"" inputs can be mixed,
  61703. * such as `url`, `email`, `text`, etc. If you require a complex form UI
  61704. * which doesn't fit within the guidelines of an alert then we recommend
  61705. * building the form within a modal instead.
  61706. *
  61707. *
  61708. * @usage
  61709. * ```ts
  61710. * import { AlertController } from 'ionic-angular';
  61711. *
  61712. * constructor(public alertCtrl: AlertController) { }
  61713. *
  61714. * presentAlert() {
  61715. * const alert = this.alertCtrl.create({
  61716. * title: 'Low battery',
  61717. * subTitle: '10% of battery remaining',
  61718. * buttons: ['Dismiss']
  61719. * });
  61720. * alert.present();
  61721. * }
  61722. *
  61723. * presentConfirm() {
  61724. * const alert = this.alertCtrl.create({
  61725. * title: 'Confirm purchase',
  61726. * message: 'Do you want to buy this book?',
  61727. * buttons: [
  61728. * {
  61729. * text: 'Cancel',
  61730. * role: 'cancel',
  61731. * handler: () => {
  61732. * console.log('Cancel clicked');
  61733. * }
  61734. * },
  61735. * {
  61736. * text: 'Buy',
  61737. * handler: () => {
  61738. * console.log('Buy clicked');
  61739. * }
  61740. * }
  61741. * ]
  61742. * });
  61743. * alert.present();
  61744. * }
  61745. *
  61746. * presentPrompt() {
  61747. * const alert = this.alertCtrl.create({
  61748. * title: 'Login',
  61749. * inputs: [
  61750. * {
  61751. * name: 'username',
  61752. * placeholder: 'Username'
  61753. * },
  61754. * {
  61755. * name: 'password',
  61756. * placeholder: 'Password',
  61757. * type: 'password'
  61758. * }
  61759. * ],
  61760. * buttons: [
  61761. * {
  61762. * text: 'Cancel',
  61763. * role: 'cancel',
  61764. * handler: data => {
  61765. * console.log('Cancel clicked');
  61766. * }
  61767. * },
  61768. * {
  61769. * text: 'Login',
  61770. * handler: data => {
  61771. * if (User.isValid(data.username, data.password)) {
  61772. * // logged in!
  61773. * } else {
  61774. * // invalid login
  61775. * return false;
  61776. * }
  61777. * }
  61778. * }
  61779. * ]
  61780. * });
  61781. * alert.present();
  61782. * }
  61783. * ```
  61784. * @advanced
  61785. *
  61786. *
  61787. * Alert options
  61788. *
  61789. * | Property | Type | Description |
  61790. * |-----------------------|-----------|------------------------------------------------------------------------------|
  61791. * | title | `string` | The title for the alert. |
  61792. * | subTitle | `string` | The subtitle for the alert. |
  61793. * | message | `string` | The message for the alert. |
  61794. * | cssClass | `string` | Additional classes for custom styles, separated by spaces. |
  61795. * | inputs | `array` | An array of inputs for the alert. See input options. |
  61796. * | buttons | `array` | An array of buttons for the alert. See buttons options. |
  61797. * | enableBackdropDismiss | `boolean` | Whether the alert should be dismissed by tapping the backdrop. Default true. |
  61798. *
  61799. *
  61800. * Input options
  61801. *
  61802. * | Property | Type | Description |
  61803. * |-------------|-----------|-----------------------------------------------------------------|
  61804. * | type | `string` | The type the input should be: text, tel, number, etc. |
  61805. * | name | `string` | The name for the input. |
  61806. * | placeholder | `string` | The input's placeholder (for textual/numeric inputs) |
  61807. * | value | `string` | The input's value. |
  61808. * | label | `string` | The input's label (only for radio/checkbox inputs) |
  61809. * | checked | `boolean` | Whether or not the input is checked. |
  61810. * | id | `string` | The input's id. |
  61811. *
  61812. * Button options
  61813. *
  61814. * | Property | Type | Description |
  61815. * |----------|----------|-----------------------------------------------------------------|
  61816. * | text | `string` | The buttons displayed text. |
  61817. * | handler | `any` | Emitted when the button is pressed. |
  61818. * | cssClass | `string` | An additional CSS class for the button. |
  61819. * | role | `string` | The buttons role, null or `cancel`. |
  61820. *
  61821. * ### Dismissing And Async Navigation
  61822. *
  61823. * After an alert has been dismissed, the app may need to also transition
  61824. * to another page depending on the handler's logic. However, because multiple
  61825. * transitions were fired at roughly the same time, it's difficult for the
  61826. * nav controller to cleanly animate multiple transitions that may
  61827. * have been kicked off asynchronously. This is further described in the
  61828. * [`Nav Transition Promises`](../../nav/NavController) section. For alerts,
  61829. * this means it's best to wait for the alert to finish its transition
  61830. * out before starting a new transition on the same nav controller.
  61831. *
  61832. * In the example below, after the alert button has been clicked, its handler
  61833. * waits on async operation to complete, *then* it uses `pop` to navigate
  61834. * back a page in the same stack. The potential problem is that the async operation
  61835. * may have been completed before the alert has even finished its transition
  61836. * out. In this case, it's best to ensure the alert has finished its transition
  61837. * out first, *then* start the next transition.
  61838. *
  61839. * ```ts
  61840. * const alert = this.alertCtrl.create({
  61841. * title: 'Hello',
  61842. * buttons: [{
  61843. * text: 'Ok',
  61844. * handler: () => {
  61845. * // user has clicked the alert button
  61846. * // begin the alert's dismiss transition
  61847. * const navTransition = alert.dismiss();
  61848. *
  61849. * // start some async method
  61850. * someAsyncOperation().then(() => {
  61851. * // once the async operation has completed
  61852. * // then run the next nav transition after the
  61853. * // first transition has finished animating out
  61854. *
  61855. * navTransition.then(() => {
  61856. * this.nav.pop();
  61857. * });
  61858. * });
  61859. * return false;
  61860. * }
  61861. * }]
  61862. * });
  61863. *
  61864. * alert.present();
  61865. * ```
  61866. *
  61867. * It's important to note that the handler returns `false`. A feature of
  61868. * button handlers is that they automatically dismiss the alert when their button
  61869. * was clicked, however, we'll need more control regarding the transition. Because
  61870. * the handler returns `false`, then the alert does not automatically dismiss
  61871. * itself. Instead, you now have complete control of when the alert has finished
  61872. * transitioning, and the ability to wait for the alert to finish transitioning
  61873. * out before starting a new transition.
  61874. *
  61875. *
  61876. * @demo /docs/demos/src/alert/
  61877. */
  61878. var AlertController = (function () {
  61879. function AlertController(_app, config) {
  61880. this._app = _app;
  61881. this.config = config;
  61882. }
  61883. /**
  61884. * Display an alert with a title, inputs, and buttons
  61885. * @param {AlertOptions} opts Alert. See the table below
  61886. */
  61887. AlertController.prototype.create = function (opts) {
  61888. if (opts === void 0) { opts = {}; }
  61889. return new __WEBPACK_IMPORTED_MODULE_1__alert__["a" /* Alert */](this._app, opts, this.config);
  61890. };
  61891. AlertController.decorators = [
  61892. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */] },
  61893. ];
  61894. /** @nocollapse */
  61895. AlertController.ctorParameters = function () { return [
  61896. { type: __WEBPACK_IMPORTED_MODULE_2__app_app__["a" /* App */], },
  61897. { type: __WEBPACK_IMPORTED_MODULE_3__config_config__["a" /* Config */], },
  61898. ]; };
  61899. return AlertController;
  61900. }());
  61901. //# sourceMappingURL=alert-controller.js.map
  61902. /***/ }),
  61903. /* 120 */
  61904. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61905. "use strict";
  61906. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Avatar; });
  61907. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  61908. /**
  61909. * @name Avatar
  61910. * @module ionic
  61911. * @description
  61912. * An Avatar is a component that creates a circular image for an item.
  61913. * Avatars can be placed on the left or right side of an item with the `item-start` or `item-end` directive.
  61914. * @see {@link /docs/components/#avatar-list Avatar Component Docs}
  61915. */
  61916. var Avatar = (function () {
  61917. function Avatar() {
  61918. }
  61919. Avatar.decorators = [
  61920. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  61921. selector: 'ion-avatar'
  61922. },] },
  61923. ];
  61924. /** @nocollapse */
  61925. Avatar.ctorParameters = function () { return []; };
  61926. return Avatar;
  61927. }());
  61928. //# sourceMappingURL=avatar.js.map
  61929. /***/ }),
  61930. /* 121 */
  61931. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61932. "use strict";
  61933. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Badge; });
  61934. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  61935. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__config_config__ = __webpack_require__(1);
  61936. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ion__ = __webpack_require__(4);
  61937. var __extends = (this && this.__extends) || (function () {
  61938. var extendStatics = Object.setPrototypeOf ||
  61939. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  61940. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  61941. return function (d, b) {
  61942. extendStatics(d, b);
  61943. function __() { this.constructor = d; }
  61944. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  61945. };
  61946. })();
  61947. /**
  61948. * @name Badge
  61949. * @module ionic
  61950. * @description
  61951. * Badges are simple components in Ionic containing numbers or text. You can display a badge to indicate that there is new information associated with the item it is on.
  61952. * @see {@link /docs/components/#badges Badges Component Docs}
  61953. */
  61954. var Badge = (function (_super) {
  61955. __extends(Badge, _super);
  61956. function Badge(config, elementRef, renderer) {
  61957. return _super.call(this, config, elementRef, renderer, 'badge') || this;
  61958. }
  61959. Badge.decorators = [
  61960. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  61961. selector: 'ion-badge'
  61962. },] },
  61963. ];
  61964. /** @nocollapse */
  61965. Badge.ctorParameters = function () { return [
  61966. { type: __WEBPACK_IMPORTED_MODULE_1__config_config__["a" /* Config */], },
  61967. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  61968. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  61969. ]; };
  61970. return Badge;
  61971. }(__WEBPACK_IMPORTED_MODULE_2__ion__["a" /* Ion */]));
  61972. //# sourceMappingURL=badge.js.map
  61973. /***/ }),
  61974. /* 122 */
  61975. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61976. "use strict";
  61977. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Card; });
  61978. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  61979. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__config_config__ = __webpack_require__(1);
  61980. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ion__ = __webpack_require__(4);
  61981. var __extends = (this && this.__extends) || (function () {
  61982. var extendStatics = Object.setPrototypeOf ||
  61983. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  61984. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  61985. return function (d, b) {
  61986. extendStatics(d, b);
  61987. function __() { this.constructor = d; }
  61988. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  61989. };
  61990. })();
  61991. /**
  61992. * @hidden
  61993. */
  61994. var Card = (function (_super) {
  61995. __extends(Card, _super);
  61996. function Card(config, elementRef, renderer) {
  61997. return _super.call(this, config, elementRef, renderer, 'card') || this;
  61998. }
  61999. Card.decorators = [
  62000. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  62001. selector: 'ion-card'
  62002. },] },
  62003. ];
  62004. /** @nocollapse */
  62005. Card.ctorParameters = function () { return [
  62006. { type: __WEBPACK_IMPORTED_MODULE_1__config_config__["a" /* Config */], },
  62007. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  62008. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  62009. ]; };
  62010. return Card;
  62011. }(__WEBPACK_IMPORTED_MODULE_2__ion__["a" /* Ion */]));
  62012. //# sourceMappingURL=card.js.map
  62013. /***/ }),
  62014. /* 123 */
  62015. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  62016. "use strict";
  62017. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CardContent; });
  62018. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  62019. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__config_config__ = __webpack_require__(1);
  62020. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ion__ = __webpack_require__(4);
  62021. var __extends = (this && this.__extends) || (function () {
  62022. var extendStatics = Object.setPrototypeOf ||
  62023. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  62024. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  62025. return function (d, b) {
  62026. extendStatics(d, b);
  62027. function __() { this.constructor = d; }
  62028. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  62029. };
  62030. })();
  62031. /**
  62032. * @hidden
  62033. */
  62034. var CardContent = (function (_super) {
  62035. __extends(CardContent, _super);
  62036. function CardContent(config, elementRef, renderer) {
  62037. return _super.call(this, config, elementRef, renderer, 'card-content') || this;
  62038. }
  62039. CardContent.decorators = [
  62040. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  62041. selector: 'ion-card-content'
  62042. },] },
  62043. ];
  62044. /** @nocollapse */
  62045. CardContent.ctorParameters = function () { return [
  62046. { type: __WEBPACK_IMPORTED_MODULE_1__config_config__["a" /* Config */], },
  62047. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  62048. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  62049. ]; };
  62050. return CardContent;
  62051. }(__WEBPACK_IMPORTED_MODULE_2__ion__["a" /* Ion */]));
  62052. //# sourceMappingURL=card-content.js.map
  62053. /***/ }),
  62054. /* 124 */
  62055. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  62056. "use strict";
  62057. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CardHeader; });
  62058. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  62059. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__config_config__ = __webpack_require__(1);
  62060. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ion__ = __webpack_require__(4);
  62061. var __extends = (this && this.__extends) || (function () {
  62062. var extendStatics = Object.setPrototypeOf ||
  62063. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  62064. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  62065. return function (d, b) {
  62066. extendStatics(d, b);
  62067. function __() { this.constructor = d; }
  62068. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  62069. };
  62070. })();
  62071. /**
  62072. * @hidden
  62073. */
  62074. var CardHeader = (function (_super) {
  62075. __extends(CardHeader, _super);
  62076. function CardHeader(config, elementRef, renderer) {
  62077. return _super.call(this, config, elementRef, renderer, 'card-header') || this;
  62078. }
  62079. CardHeader.decorators = [
  62080. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  62081. selector: 'ion-card-header'
  62082. },] },
  62083. ];
  62084. /** @nocollapse */
  62085. CardHeader.ctorParameters = function () { return [
  62086. { type: __WEBPACK_IMPORTED_MODULE_1__config_config__["a" /* Config */], },
  62087. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  62088. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  62089. ]; };
  62090. return CardHeader;
  62091. }(__WEBPACK_IMPORTED_MODULE_2__ion__["a" /* Ion */]));
  62092. //# sourceMappingURL=card-header.js.map
  62093. /***/ }),
  62094. /* 125 */
  62095. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  62096. "use strict";
  62097. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CardTitle; });
  62098. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  62099. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__config_config__ = __webpack_require__(1);
  62100. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ion__ = __webpack_require__(4);
  62101. var __extends = (this && this.__extends) || (function () {
  62102. var extendStatics = Object.setPrototypeOf ||
  62103. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  62104. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  62105. return function (d, b) {
  62106. extendStatics(d, b);
  62107. function __() { this.constructor = d; }
  62108. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  62109. };
  62110. })();
  62111. /**
  62112. * @hidden
  62113. */
  62114. var CardTitle = (function (_super) {
  62115. __extends(CardTitle, _super);
  62116. function CardTitle(config, elementRef, renderer) {
  62117. return _super.call(this, config, elementRef, renderer, 'card-title') || this;
  62118. }
  62119. CardTitle.decorators = [
  62120. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  62121. selector: 'ion-card-title'
  62122. },] },
  62123. ];
  62124. /** @nocollapse */
  62125. CardTitle.ctorParameters = function () { return [
  62126. { type: __WEBPACK_IMPORTED_MODULE_1__config_config__["a" /* Config */], },
  62127. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  62128. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  62129. ]; };
  62130. return CardTitle;
  62131. }(__WEBPACK_IMPORTED_MODULE_2__ion__["a" /* Ion */]));
  62132. //# sourceMappingURL=card-title.js.map
  62133. /***/ }),
  62134. /* 126 */
  62135. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  62136. "use strict";
  62137. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Checkbox; });
  62138. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  62139. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_forms__ = __webpack_require__(15);
  62140. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__config_config__ = __webpack_require__(1);
  62141. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_util__ = __webpack_require__(2);
  62142. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_form__ = __webpack_require__(16);
  62143. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_base_input__ = __webpack_require__(24);
  62144. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__item_item__ = __webpack_require__(17);
  62145. var __extends = (this && this.__extends) || (function () {
  62146. var extendStatics = Object.setPrototypeOf ||
  62147. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  62148. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  62149. return function (d, b) {
  62150. extendStatics(d, b);
  62151. function __() { this.constructor = d; }
  62152. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  62153. };
  62154. })();
  62155. /**
  62156. * @name Checkbox
  62157. * @module ionic
  62158. *
  62159. * @description
  62160. * The Checkbox is a simple component styled based on the mode. It can be
  62161. * placed in an `ion-item` or used as a stand-alone checkbox.
  62162. *
  62163. * See the [Angular Docs](https://angular.io/docs/ts/latest/guide/forms.html)
  62164. * for more info on forms and inputs.
  62165. *
  62166. *
  62167. * @usage
  62168. * ```html
  62169. *
  62170. * <ion-list>
  62171. *
  62172. * <ion-item>
  62173. * <ion-label>Pepperoni</ion-label>
  62174. * <ion-checkbox [(ngModel)]="pepperoni"></ion-checkbox>
  62175. * </ion-item>
  62176. *
  62177. * <ion-item>
  62178. * <ion-label>Sausage</ion-label>
  62179. * <ion-checkbox [(ngModel)]="sausage" disabled="true"></ion-checkbox>
  62180. * </ion-item>
  62181. *
  62182. * <ion-item>
  62183. * <ion-label>Mushrooms</ion-label>
  62184. * <ion-checkbox [(ngModel)]="mushrooms"></ion-checkbox>
  62185. * </ion-item>
  62186. *
  62187. * </ion-list>
  62188. * ```
  62189. *
  62190. * @advanced
  62191. *
  62192. * ```html
  62193. *
  62194. * <!-- Call function when state changes -->
  62195. * <ion-list>
  62196. *
  62197. * <ion-item>
  62198. * <ion-label>Cucumber</ion-label>
  62199. * <ion-checkbox [(ngModel)]="cucumber" (ionChange)="updateCucumber()"></ion-checkbox>
  62200. * </ion-item>
  62201. *
  62202. * </ion-list>
  62203. * ```
  62204. *
  62205. * ```ts
  62206. * @Component({
  62207. * templateUrl: 'main.html'
  62208. * })
  62209. * class SaladPage {
  62210. * cucumber: boolean;
  62211. *
  62212. * updateCucumber() {
  62213. * console.log('Cucumbers new state:' + this.cucumber);
  62214. * }
  62215. * }
  62216. * ```
  62217. *
  62218. * @demo /docs/demos/src/checkbox/
  62219. * @see {@link /docs/components#checkbox Checkbox Component Docs}
  62220. */
  62221. var Checkbox = (function (_super) {
  62222. __extends(Checkbox, _super);
  62223. function Checkbox(config, form, item, elementRef, renderer) {
  62224. return _super.call(this, config, elementRef, renderer, 'checkbox', false, form, item, null) || this;
  62225. }
  62226. Object.defineProperty(Checkbox.prototype, "checked", {
  62227. /**
  62228. * @input {boolean} If true, the element is selected.
  62229. */
  62230. get: function () {
  62231. return this.value;
  62232. },
  62233. set: function (val) {
  62234. this.value = val;
  62235. },
  62236. enumerable: true,
  62237. configurable: true
  62238. });
  62239. /**
  62240. * @hidden
  62241. */
  62242. Checkbox.prototype._click = function (ev) {
  62243. ev.preventDefault();
  62244. ev.stopPropagation();
  62245. this.value = !this.value;
  62246. this._fireTouched();
  62247. };
  62248. /**
  62249. * @hidden
  62250. */
  62251. Checkbox.prototype._inputNormalize = function (val) {
  62252. return Object(__WEBPACK_IMPORTED_MODULE_3__util_util__["o" /* isTrueProperty */])(val);
  62253. };
  62254. /**
  62255. * @hidden
  62256. */
  62257. Checkbox.prototype._inputUpdated = function () {
  62258. this._item && this._item.setElementClass('item-checkbox-checked', this._value);
  62259. };
  62260. Checkbox.decorators = [
  62261. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  62262. selector: 'ion-checkbox',
  62263. template: '<div class="checkbox-icon" [class.checkbox-checked]="_value">' +
  62264. '<div class="checkbox-inner"></div>' +
  62265. '</div>' +
  62266. '<button role="checkbox" ' +
  62267. 'type="button" ' +
  62268. 'ion-button="item-cover" ' +
  62269. '[id]="id" ' +
  62270. '[attr.aria-checked]="_value" ' +
  62271. '[attr.aria-labelledby]="_labelId" ' +
  62272. '[attr.aria-disabled]="_disabled" ' +
  62273. 'class="item-cover"> ' +
  62274. '</button>',
  62275. host: {
  62276. '[class.checkbox-disabled]': '_disabled'
  62277. },
  62278. providers: [{ provide: __WEBPACK_IMPORTED_MODULE_1__angular_forms__["b" /* NG_VALUE_ACCESSOR */], useExisting: Checkbox, multi: true }],
  62279. encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_11" /* ViewEncapsulation */].None,
  62280. },] },
  62281. ];
  62282. /** @nocollapse */
  62283. Checkbox.ctorParameters = function () { return [
  62284. { type: __WEBPACK_IMPORTED_MODULE_2__config_config__["a" /* Config */], },
  62285. { type: __WEBPACK_IMPORTED_MODULE_4__util_form__["a" /* Form */], },
  62286. { type: __WEBPACK_IMPORTED_MODULE_6__item_item__["a" /* Item */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  62287. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  62288. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  62289. ]; };
  62290. Checkbox.propDecorators = {
  62291. 'checked': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  62292. '_click': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["y" /* HostListener */], args: ['click', ['$event'],] },],
  62293. };
  62294. return Checkbox;
  62295. }(__WEBPACK_IMPORTED_MODULE_5__util_base_input__["a" /* BaseInput */]));
  62296. //# sourceMappingURL=checkbox.js.map
  62297. /***/ }),
  62298. /* 127 */
  62299. /***/ (function(module, exports, __webpack_require__) {
  62300. "use strict";
  62301. var map_1 = __webpack_require__(237);
  62302. /**
  62303. * Applies a given `project` function to each value emitted by the source
  62304. * Observable, and emits the resulting values as an Observable.
  62305. *
  62306. * <span class="informal">Like [Array.prototype.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map),
  62307. * it passes each source value through a transformation function to get
  62308. * corresponding output values.</span>
  62309. *
  62310. * <img src="./img/map.png" width="100%">
  62311. *
  62312. * Similar to the well known `Array.prototype.map` function, this operator
  62313. * applies a projection to each value and emits that projection in the output
  62314. * Observable.
  62315. *
  62316. * @example <caption>Map every click to the clientX position of that click</caption>
  62317. * var clicks = Rx.Observable.fromEvent(document, 'click');
  62318. * var positions = clicks.map(ev => ev.clientX);
  62319. * positions.subscribe(x => console.log(x));
  62320. *
  62321. * @see {@link mapTo}
  62322. * @see {@link pluck}
  62323. *
  62324. * @param {function(value: T, index: number): R} project The function to apply
  62325. * to each `value` emitted by the source Observable. The `index` parameter is
  62326. * the number `i` for the i-th emission that has happened since the
  62327. * subscription, starting from the number `0`.
  62328. * @param {any} [thisArg] An optional argument to define what `this` is in the
  62329. * `project` function.
  62330. * @return {Observable<R>} An Observable that emits the values from the source
  62331. * Observable transformed by the given `project` function.
  62332. * @method map
  62333. * @owner Observable
  62334. */
  62335. function map(project, thisArg) {
  62336. return map_1.map(project, thisArg)(this);
  62337. }
  62338. exports.map = map;
  62339. //# sourceMappingURL=map.js.map
  62340. /***/ }),
  62341. /* 128 */
  62342. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  62343. "use strict";
  62344. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TimeoutDebouncer; });
  62345. var TimeoutDebouncer = (function () {
  62346. function TimeoutDebouncer(wait) {
  62347. this.wait = wait;
  62348. this.timer = null;
  62349. }
  62350. TimeoutDebouncer.prototype.debounce = function (callback) {
  62351. this.callback = callback;
  62352. this.schedule();
  62353. };
  62354. TimeoutDebouncer.prototype.schedule = function () {
  62355. this.cancel();
  62356. if (this.wait <= 0) {
  62357. this.callback();
  62358. }
  62359. else {
  62360. this.timer = setTimeout(this.callback, this.wait);
  62361. }
  62362. };
  62363. TimeoutDebouncer.prototype.cancel = function () {
  62364. if (this.timer) {
  62365. clearTimeout(this.timer);
  62366. this.timer = null;
  62367. }
  62368. };
  62369. return TimeoutDebouncer;
  62370. }());
  62371. //# sourceMappingURL=debouncer.js.map
  62372. /***/ }),
  62373. /* 129 */
  62374. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  62375. "use strict";
  62376. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ScrollView; });
  62377. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__dom__ = __webpack_require__(10);
  62378. var ScrollView = (function () {
  62379. function ScrollView(_app, _plt, _dom) {
  62380. this._app = _app;
  62381. this._plt = _plt;
  62382. this._dom = _dom;
  62383. this.isScrolling = false;
  62384. this.initialized = false;
  62385. this._eventsEnabled = false;
  62386. this._t = 0;
  62387. this._l = 0;
  62388. this.ev = {
  62389. timeStamp: 0,
  62390. scrollTop: 0,
  62391. scrollLeft: 0,
  62392. scrollHeight: 0,
  62393. scrollWidth: 0,
  62394. contentHeight: 0,
  62395. contentWidth: 0,
  62396. contentTop: 0,
  62397. contentBottom: 0,
  62398. startY: 0,
  62399. startX: 0,
  62400. deltaY: 0,
  62401. deltaX: 0,
  62402. velocityY: 0,
  62403. velocityX: 0,
  62404. directionY: 'down',
  62405. directionX: null,
  62406. domWrite: _dom.write.bind(_dom)
  62407. };
  62408. }
  62409. ScrollView.prototype.init = function (ele, contentTop, contentBottom) {
  62410. (void 0) /* assert */;
  62411. this._el = ele;
  62412. if (!this.initialized) {
  62413. this.initialized = true;
  62414. if (this._js) {
  62415. this.enableJsScroll(contentTop, contentBottom);
  62416. }
  62417. else {
  62418. this.enableNativeScrolling();
  62419. }
  62420. }
  62421. };
  62422. ScrollView.prototype.enableEvents = function () {
  62423. this._eventsEnabled = true;
  62424. };
  62425. ScrollView.prototype.setScrolling = function (isScrolling, ev) {
  62426. if (this.isScrolling) {
  62427. if (isScrolling) {
  62428. this.onScroll && this.onScroll(ev);
  62429. }
  62430. else {
  62431. this.isScrolling = false;
  62432. this.onScrollEnd && this.onScrollEnd(ev);
  62433. }
  62434. }
  62435. else if (isScrolling) {
  62436. this.isScrolling = true;
  62437. this.onScrollStart && this.onScrollStart(ev);
  62438. }
  62439. };
  62440. ScrollView.prototype.enableNativeScrolling = function () {
  62441. (void 0) /* assert */;
  62442. (void 0) /* assert */;
  62443. (void 0) /* assert */;
  62444. this._js = false;
  62445. if (!this._el) {
  62446. return;
  62447. }
  62448. (void 0) /* console.debug */;
  62449. var self = this;
  62450. var ev = self.ev;
  62451. var positions = [];
  62452. function scrollCallback(scrollEvent) {
  62453. // remind the app that it's currently scrolling
  62454. self._app.setScrolling();
  62455. // if events are disabled, we do nothing
  62456. if (!self._eventsEnabled) {
  62457. return;
  62458. }
  62459. ev.timeStamp = scrollEvent.timeStamp;
  62460. // Event.timeStamp is 0 in firefox
  62461. if (!ev.timeStamp) {
  62462. ev.timeStamp = Date.now();
  62463. }
  62464. // get the current scrollTop
  62465. // ******** DOM READ ****************
  62466. ev.scrollTop = self.getTop();
  62467. // get the current scrollLeft
  62468. // ******** DOM READ ****************
  62469. ev.scrollLeft = self.getLeft();
  62470. if (!self.isScrolling) {
  62471. // remember the start positions
  62472. ev.startY = ev.scrollTop;
  62473. ev.startX = ev.scrollLeft;
  62474. // new scroll, so do some resets
  62475. ev.velocityY = ev.velocityX = 0;
  62476. ev.deltaY = ev.deltaX = 0;
  62477. positions.length = 0;
  62478. }
  62479. // actively scrolling
  62480. positions.push(ev.scrollTop, ev.scrollLeft, ev.timeStamp);
  62481. if (positions.length > 3) {
  62482. // we've gotten at least 2 scroll events so far
  62483. ev.deltaY = (ev.scrollTop - ev.startY);
  62484. ev.deltaX = (ev.scrollLeft - ev.startX);
  62485. var endPos = (positions.length - 1);
  62486. var startPos = endPos;
  62487. var timeRange = (ev.timeStamp - 100);
  62488. // move pointer to position measured 100ms ago
  62489. for (var i = endPos; i > 0 && positions[i] > timeRange; i -= 3) {
  62490. startPos = i;
  62491. }
  62492. if (startPos !== endPos) {
  62493. // compute relative movement between these two points
  62494. var movedTop = (positions[startPos - 2] - positions[endPos - 2]);
  62495. var movedLeft = (positions[startPos - 1] - positions[endPos - 1]);
  62496. var factor = FRAME_MS / (positions[endPos] - positions[startPos]);
  62497. // based on XXms compute the movement to apply for each render step
  62498. ev.velocityY = movedTop * factor;
  62499. ev.velocityX = movedLeft * factor;
  62500. // figure out which direction we're scrolling
  62501. ev.directionY = (movedTop > 0 ? 'up' : 'down');
  62502. ev.directionX = (movedLeft > 0 ? 'left' : 'right');
  62503. }
  62504. }
  62505. function scrollEnd() {
  62506. // reset velocity, do not reset the directions or deltas
  62507. ev.velocityY = ev.velocityX = 0;
  62508. // emit that the scroll has ended
  62509. self.setScrolling(false, ev);
  62510. self._endTmr = null;
  62511. }
  62512. // emit on each scroll event
  62513. self.setScrolling(true, ev);
  62514. // debounce for a moment after the last scroll event
  62515. self._dom.cancel(self._endTmr);
  62516. self._endTmr = self._dom.read(scrollEnd, SCROLL_END_DEBOUNCE_MS);
  62517. }
  62518. // clear out any existing listeners (just to be safe)
  62519. self._lsn && self._lsn();
  62520. // assign the raw scroll listener
  62521. // note that it does not have a wrapping requestAnimationFrame on purpose
  62522. // a scroll event callback will always be right before the raf callback
  62523. // so there's little to no value of using raf here since it'll all ways immediately
  62524. // call the raf if it was set within the scroll event, so this will save us some time
  62525. self._lsn = self._plt.registerListener(self._el, 'scroll', scrollCallback, EVENT_OPTS);
  62526. };
  62527. /**
  62528. * @hidden
  62529. * JS Scrolling has been provided only as a temporary solution
  62530. * until iOS apps can take advantage of scroll events at all times.
  62531. * The goal is to eventually remove JS scrolling entirely. When we
  62532. * no longer have to worry about iOS not firing scroll events during
  62533. * inertia then this can be burned to the ground. iOS's more modern
  62534. * WKWebView does not have this issue, only UIWebView does.
  62535. */
  62536. ScrollView.prototype.enableJsScroll = function (contentTop, contentBottom) {
  62537. var self = this;
  62538. self._js = true;
  62539. var ele = self._el;
  62540. if (!ele) {
  62541. return;
  62542. }
  62543. (void 0) /* console.debug */;
  62544. var ev = self.ev;
  62545. var positions = [];
  62546. var rafCancel;
  62547. var max;
  62548. function setMax() {
  62549. if (!max) {
  62550. // ******** DOM READ ****************
  62551. max = ele.scrollHeight - ele.parentElement.offsetHeight + contentTop + contentBottom;
  62552. }
  62553. }
  62554. function jsScrollDecelerate(timeStamp) {
  62555. ev.timeStamp = timeStamp;
  62556. (void 0) /* console.debug */;
  62557. if (ev.velocityY) {
  62558. ev.velocityY *= DECELERATION_FRICTION;
  62559. // update top with updated velocity
  62560. // clamp top within scroll limits
  62561. // ******** DOM READ ****************
  62562. setMax();
  62563. self._t = Math.min(Math.max(self._t + ev.velocityY, 0), max);
  62564. ev.scrollTop = self._t;
  62565. // emit on each scroll event
  62566. self.onScroll(ev);
  62567. self._dom.write(function () {
  62568. // ******** DOM WRITE ****************
  62569. self.setTop(self._t);
  62570. if (self._t > 0 && self._t < max && Math.abs(ev.velocityY) > MIN_VELOCITY_CONTINUE_DECELERATION) {
  62571. rafCancel = self._dom.read(function (rafTimeStamp) {
  62572. jsScrollDecelerate(rafTimeStamp);
  62573. });
  62574. }
  62575. else {
  62576. // haven't scrolled in a while, so it's a scrollend
  62577. self.isScrolling = false;
  62578. // reset velocity, do not reset the directions or deltas
  62579. ev.velocityY = ev.velocityX = 0;
  62580. // emit that the scroll has ended
  62581. self.onScrollEnd(ev);
  62582. }
  62583. });
  62584. }
  62585. }
  62586. function jsScrollTouchStart(touchEvent) {
  62587. positions.length = 0;
  62588. max = null;
  62589. self._dom.cancel(rafCancel);
  62590. positions.push(Object(__WEBPACK_IMPORTED_MODULE_0__dom__["f" /* pointerCoord */])(touchEvent).y, touchEvent.timeStamp);
  62591. }
  62592. function jsScrollTouchMove(touchEvent) {
  62593. if (!positions.length) {
  62594. return;
  62595. }
  62596. ev.timeStamp = touchEvent.timeStamp;
  62597. var y = Object(__WEBPACK_IMPORTED_MODULE_0__dom__["f" /* pointerCoord */])(touchEvent).y;
  62598. // ******** DOM READ ****************
  62599. setMax();
  62600. self._t -= (y - positions[positions.length - 2]);
  62601. self._t = Math.min(Math.max(self._t, 0), max);
  62602. positions.push(y, ev.timeStamp);
  62603. if (!self.isScrolling) {
  62604. // remember the start position
  62605. ev.startY = self._t;
  62606. // new scroll, so do some resets
  62607. ev.velocityY = ev.deltaY = 0;
  62608. self.isScrolling = true;
  62609. // emit only on the first scroll event
  62610. self.onScrollStart(ev);
  62611. }
  62612. self._dom.write(function () {
  62613. // ******** DOM WRITE ****************
  62614. self.setTop(self._t);
  62615. });
  62616. }
  62617. function jsScrollTouchEnd(touchEvent) {
  62618. // figure out what the scroll position was about 100ms ago
  62619. self._dom.cancel(rafCancel);
  62620. if (!positions.length && self.isScrolling) {
  62621. self.isScrolling = false;
  62622. ev.velocityY = ev.velocityX = 0;
  62623. self.onScrollEnd(ev);
  62624. return;
  62625. }
  62626. var y = Object(__WEBPACK_IMPORTED_MODULE_0__dom__["f" /* pointerCoord */])(touchEvent).y;
  62627. positions.push(y, touchEvent.timeStamp);
  62628. var endPos = (positions.length - 1);
  62629. var startPos = endPos;
  62630. var timeRange = (touchEvent.timeStamp - 100);
  62631. // move pointer to position measured 100ms ago
  62632. for (var i = endPos; i > 0 && positions[i] > timeRange; i -= 2) {
  62633. startPos = i;
  62634. }
  62635. if (startPos !== endPos) {
  62636. // compute relative movement between these two points
  62637. var timeOffset = (positions[endPos] - positions[startPos]);
  62638. var movedTop = (positions[startPos - 1] - positions[endPos - 1]);
  62639. // based on XXms compute the movement to apply for each render step
  62640. ev.velocityY = ((movedTop / timeOffset) * FRAME_MS);
  62641. // verify that we have enough velocity to start deceleration
  62642. if (Math.abs(ev.velocityY) > MIN_VELOCITY_START_DECELERATION) {
  62643. // ******** DOM READ ****************
  62644. setMax();
  62645. rafCancel = self._dom.read(function (rafTimeStamp) {
  62646. jsScrollDecelerate(rafTimeStamp);
  62647. });
  62648. }
  62649. }
  62650. else {
  62651. self.isScrolling = false;
  62652. ev.velocityY = 0;
  62653. self.onScrollEnd(ev);
  62654. }
  62655. positions.length = 0;
  62656. }
  62657. var plt = self._plt;
  62658. var unRegStart = plt.registerListener(ele, 'touchstart', jsScrollTouchStart, EVENT_OPTS);
  62659. var unRegMove = plt.registerListener(ele, 'touchmove', jsScrollTouchMove, EVENT_OPTS);
  62660. var unRegEnd = plt.registerListener(ele, 'touchend', jsScrollTouchEnd, EVENT_OPTS);
  62661. ele.parentElement.classList.add('js-scroll');
  62662. // stop listening for actual scroll events
  62663. self._lsn && self._lsn();
  62664. // create an unregister for all of these events
  62665. self._lsn = function () {
  62666. unRegStart();
  62667. unRegMove();
  62668. unRegEnd();
  62669. ele.parentElement.classList.remove('js-scroll');
  62670. };
  62671. };
  62672. /**
  62673. * DOM READ
  62674. */
  62675. ScrollView.prototype.getTop = function () {
  62676. if (this._js) {
  62677. return this._t;
  62678. }
  62679. return this._t = this._el.scrollTop;
  62680. };
  62681. /**
  62682. * DOM READ
  62683. */
  62684. ScrollView.prototype.getLeft = function () {
  62685. if (this._js) {
  62686. return 0;
  62687. }
  62688. return this._l = this._el.scrollLeft;
  62689. };
  62690. /**
  62691. * DOM WRITE
  62692. */
  62693. ScrollView.prototype.setTop = function (top) {
  62694. this._t = top;
  62695. if (this._js) {
  62696. this._el.style[this._plt.Css.transform] = "translate3d(" + this._l * -1 + "px," + top * -1 + "px,0px)";
  62697. }
  62698. else {
  62699. this._el.scrollTop = top;
  62700. }
  62701. };
  62702. /**
  62703. * DOM WRITE
  62704. */
  62705. ScrollView.prototype.setLeft = function (left) {
  62706. this._l = left;
  62707. if (this._js) {
  62708. this._el.style[this._plt.Css.transform] = "translate3d(" + left * -1 + "px," + this._t * -1 + "px,0px)";
  62709. }
  62710. else {
  62711. this._el.scrollLeft = left;
  62712. }
  62713. };
  62714. ScrollView.prototype.scrollTo = function (x, y, duration, done) {
  62715. // scroll animation loop w/ easing
  62716. // credit https://gist.github.com/dezinezync/5487119
  62717. var promise;
  62718. if (done === undefined) {
  62719. // only create a promise if a done callback wasn't provided
  62720. // done can be a null, which avoids any functions
  62721. promise = new Promise(function (resolve) {
  62722. done = resolve;
  62723. });
  62724. }
  62725. var self = this;
  62726. var el = self._el;
  62727. if (!el) {
  62728. // invalid element
  62729. done();
  62730. return promise;
  62731. }
  62732. if (duration < 32) {
  62733. self.setTop(y);
  62734. self.setLeft(x);
  62735. done();
  62736. return promise;
  62737. }
  62738. var fromY = el.scrollTop;
  62739. var fromX = el.scrollLeft;
  62740. var maxAttempts = (duration / 16) + 100;
  62741. var transform = self._plt.Css.transform;
  62742. var startTime;
  62743. var attempts = 0;
  62744. var stopScroll = false;
  62745. // scroll loop
  62746. function step(timeStamp) {
  62747. attempts++;
  62748. if (!self._el || stopScroll || attempts > maxAttempts) {
  62749. self.setScrolling(false, null);
  62750. el.style[transform] = '';
  62751. done();
  62752. return;
  62753. }
  62754. var time = Math.min(1, ((timeStamp - startTime) / duration));
  62755. // where .5 would be 50% of time on a linear scale easedT gives a
  62756. // fraction based on the easing method
  62757. var easedT = (--time) * time * time + 1;
  62758. if (fromY !== y) {
  62759. self.setTop((easedT * (y - fromY)) + fromY);
  62760. }
  62761. if (fromX !== x) {
  62762. self.setLeft(Math.floor((easedT * (x - fromX)) + fromX));
  62763. }
  62764. if (easedT < 1) {
  62765. // do not use DomController here
  62766. // must use nativeRaf in order to fire in the next frame
  62767. self._plt.raf(step);
  62768. }
  62769. else {
  62770. stopScroll = true;
  62771. self.setScrolling(false, null);
  62772. el.style[transform] = '';
  62773. done();
  62774. }
  62775. }
  62776. // start scroll loop
  62777. self.setScrolling(true, null);
  62778. self.isScrolling = true;
  62779. // chill out for a frame first
  62780. self._dom.write(function (timeStamp) {
  62781. startTime = timeStamp;
  62782. step(timeStamp);
  62783. }, 16);
  62784. return promise;
  62785. };
  62786. ScrollView.prototype.scrollToTop = function (duration) {
  62787. return this.scrollTo(0, 0, duration);
  62788. };
  62789. ScrollView.prototype.scrollToBottom = function (duration) {
  62790. var y = 0;
  62791. if (this._el) {
  62792. y = this._el.scrollHeight - this._el.clientHeight;
  62793. }
  62794. return this.scrollTo(0, y, duration);
  62795. };
  62796. ScrollView.prototype.stop = function () {
  62797. this.setScrolling(false, null);
  62798. };
  62799. /**
  62800. * @hidden
  62801. */
  62802. ScrollView.prototype.destroy = function () {
  62803. this.stop();
  62804. this._endTmr && this._dom.cancel(this._endTmr);
  62805. this._lsn && this._lsn();
  62806. var ev = this.ev;
  62807. ev.domWrite = ev.contentElement = ev.fixedElement = ev.scrollElement = ev.headerElement = null;
  62808. this._lsn = this._el = this._dom = this.ev = ev = null;
  62809. this.onScrollStart = this.onScroll = this.onScrollEnd = null;
  62810. };
  62811. return ScrollView;
  62812. }());
  62813. var SCROLL_END_DEBOUNCE_MS = 80;
  62814. var MIN_VELOCITY_START_DECELERATION = 4;
  62815. var MIN_VELOCITY_CONTINUE_DECELERATION = 0.12;
  62816. var DECELERATION_FRICTION = 0.97;
  62817. var FRAME_MS = (1000 / 60);
  62818. var EVENT_OPTS = {
  62819. passive: true,
  62820. zone: false
  62821. };
  62822. //# sourceMappingURL=scroll-view.js.map
  62823. /***/ }),
  62824. /* 130 */
  62825. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  62826. "use strict";
  62827. /* harmony export (immutable) */ __webpack_exports__["b"] = indexForItem;
  62828. /* unused harmony export reorderListForItem */
  62829. /* harmony export (immutable) */ __webpack_exports__["a"] = findReorderItem;
  62830. /**
  62831. * @hidden
  62832. */
  62833. function indexForItem(element) {
  62834. return element['$ionIndex'];
  62835. }
  62836. /**
  62837. * @hidden
  62838. */
  62839. function reorderListForItem(element) {
  62840. return element['$ionReorderList'];
  62841. }
  62842. /**
  62843. * @hidden
  62844. */
  62845. function findReorderItem(node, listNode) {
  62846. var nested = 0;
  62847. while (node && nested < 4) {
  62848. if (indexForItem(node) !== undefined) {
  62849. if (listNode && node.parentNode !== listNode) {
  62850. return null;
  62851. }
  62852. return node;
  62853. }
  62854. node = node.parentNode;
  62855. nested++;
  62856. }
  62857. return null;
  62858. }
  62859. //# sourceMappingURL=item-reorder-util.js.map
  62860. /***/ }),
  62861. /* 131 */
  62862. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  62863. "use strict";
  62864. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Chip; });
  62865. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  62866. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__config_config__ = __webpack_require__(1);
  62867. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ion__ = __webpack_require__(4);
  62868. var __extends = (this && this.__extends) || (function () {
  62869. var extendStatics = Object.setPrototypeOf ||
  62870. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  62871. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  62872. return function (d, b) {
  62873. extendStatics(d, b);
  62874. function __() { this.constructor = d; }
  62875. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  62876. };
  62877. })();
  62878. /**
  62879. * @name Chip
  62880. * @module ionic
  62881. * @description
  62882. * Chips represent complex entities in small blocks, such as a contact.
  62883. *
  62884. *
  62885. * @usage
  62886. *
  62887. * ```html
  62888. * <ion-chip>
  62889. * <ion-label>Default</ion-label>
  62890. * </ion-chip>
  62891. *
  62892. * <ion-chip>
  62893. * <ion-label color="secondary">Secondary Label</ion-label>
  62894. * </ion-chip>
  62895. *
  62896. * <ion-chip color="secondary">
  62897. * <ion-label color="dark">Secondary w/ Dark label</ion-label>
  62898. * </ion-chip>
  62899. *
  62900. * <ion-chip color="danger">
  62901. * <ion-label>Danger</ion-label>
  62902. * </ion-chip>
  62903. *
  62904. * <ion-chip>
  62905. * <ion-icon name="pin"></ion-icon>
  62906. * <ion-label>Default</ion-label>
  62907. * </ion-chip>
  62908. *
  62909. * <ion-chip>
  62910. * <ion-icon name="heart" color="dark"></ion-icon>
  62911. * <ion-label>Default</ion-label>
  62912. * </ion-chip>
  62913. *
  62914. * <ion-chip>
  62915. * <ion-avatar>
  62916. * <img src="assets/img/my-img.png">
  62917. * </ion-avatar>
  62918. * <ion-label>Default</ion-label>
  62919. * </ion-chip>
  62920. * ```
  62921. *
  62922. *
  62923. * @advanced
  62924. *
  62925. * ```html
  62926. * <ion-chip #chip1>
  62927. * <ion-label>Default</ion-label>
  62928. * <button ion-button clear color="light" (click)="delete(chip1)">
  62929. * <ion-icon name="close-circle"></ion-icon>
  62930. * </button>
  62931. * </ion-chip>
  62932. *
  62933. * <ion-chip #chip2>
  62934. * <ion-icon name="pin" color="primary"></ion-icon>
  62935. * <ion-label>With Icon</ion-label>
  62936. * <button ion-button (click)="delete(chip2)">
  62937. * <ion-icon name="close"></ion-icon>
  62938. * </button>
  62939. * </ion-chip>
  62940. *
  62941. * <ion-chip #chip3>
  62942. * <ion-avatar>
  62943. * <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAAAAACH5BAAAAAAALAAAAAABAAEAAAICTAEAOw==">
  62944. * </ion-avatar>
  62945. * <ion-label>With Avatar</ion-label>
  62946. * <button ion-button clear color="dark" (click)="delete(chip3)">
  62947. * <ion-icon name="close-circle"></ion-icon>
  62948. * </button>
  62949. * </ion-chip>
  62950. * ```
  62951. *
  62952. * ```ts
  62953. * @Component({
  62954. * templateUrl: 'main.html'
  62955. * })
  62956. * class E2EPage {
  62957. * delete(chip: Element) {
  62958. * chip.remove();
  62959. * }
  62960. * }
  62961. * ```
  62962. *
  62963. * @demo /docs/demos/src/chip/
  62964. **/
  62965. var Chip = (function (_super) {
  62966. __extends(Chip, _super);
  62967. function Chip(config, elementRef, renderer) {
  62968. return _super.call(this, config, elementRef, renderer, 'chip') || this;
  62969. }
  62970. Chip.decorators = [
  62971. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  62972. selector: 'ion-chip'
  62973. },] },
  62974. ];
  62975. /** @nocollapse */
  62976. Chip.ctorParameters = function () { return [
  62977. { type: __WEBPACK_IMPORTED_MODULE_1__config_config__["a" /* Config */], },
  62978. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  62979. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  62980. ]; };
  62981. return Chip;
  62982. }(__WEBPACK_IMPORTED_MODULE_2__ion__["a" /* Ion */]));
  62983. //# sourceMappingURL=chip.js.map
  62984. /***/ }),
  62985. /* 132 */
  62986. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  62987. "use strict";
  62988. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DateTime; });
  62989. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  62990. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_forms__ = __webpack_require__(15);
  62991. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__config_config__ = __webpack_require__(1);
  62992. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__picker_picker_controller__ = __webpack_require__(65);
  62993. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_form__ = __webpack_require__(16);
  62994. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_base_input__ = __webpack_require__(24);
  62995. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__item_item__ = __webpack_require__(17);
  62996. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__util_util__ = __webpack_require__(2);
  62997. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__util_datetime_util__ = __webpack_require__(241);
  62998. var __extends = (this && this.__extends) || (function () {
  62999. var extendStatics = Object.setPrototypeOf ||
  63000. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  63001. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  63002. return function (d, b) {
  63003. extendStatics(d, b);
  63004. function __() { this.constructor = d; }
  63005. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  63006. };
  63007. })();
  63008. var __assign = (this && this.__assign) || Object.assign || function(t) {
  63009. for (var s, i = 1, n = arguments.length; i < n; i++) {
  63010. s = arguments[i];
  63011. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
  63012. t[p] = s[p];
  63013. }
  63014. return t;
  63015. };
  63016. /**
  63017. * @name DateTime
  63018. * @description
  63019. * The DateTime component is used to present an interface which makes it easy for
  63020. * users to select dates and times. Tapping on `<ion-datetime>` will display a picker
  63021. * interface that slides up from the bottom of the page. The picker then displays
  63022. * scrollable columns that can be used to individually select years, months, days,
  63023. * hours and minute values. The DateTime component is similar to the native
  63024. * `<input type="datetime-local">` element, however, Ionic's DateTime component makes
  63025. * it easy to display the date and time in a preferred format, and manage the datetime
  63026. * values.
  63027. *
  63028. * ```html
  63029. * <ion-item>
  63030. * <ion-label>Date</ion-label>
  63031. * <ion-datetime displayFormat="MM/DD/YYYY" [(ngModel)]="myDate"></ion-datetime>
  63032. * </ion-item>
  63033. * ```
  63034. *
  63035. *
  63036. * ## Display and Picker Formats
  63037. *
  63038. * The DateTime component displays the values in two places: in the `<ion-datetime>`
  63039. * component, and in the interface that is presented from the bottom of the screen.
  63040. * The following chart lists all of the formats that can be used.
  63041. *
  63042. * | Format | Description | Example |
  63043. * |---------|--------------------------------|-------------------------|
  63044. * | `YYYY` | Year, 4 digits | `2018` |
  63045. * | `YY` | Year, 2 digits | `18` |
  63046. * | `M` | Month | `1` ... `12` |
  63047. * | `MM` | Month, leading zero | `01` ... `12` |
  63048. * | `MMM` | Month, short name | `Jan` |
  63049. * | `MMMM` | Month, full name | `January` |
  63050. * | `D` | Day | `1` ... `31` |
  63051. * | `DD` | Day, leading zero | `01` ... `31` |
  63052. * | `DDD` | Day, short name | `Fri` |
  63053. * | `DDDD` | Day, full name | `Friday` |
  63054. * | `H` | Hour, 24-hour | `0` ... `23` |
  63055. * | `HH` | Hour, 24-hour, leading zero | `00` ... `23` |
  63056. * | `h` | Hour, 12-hour | `1` ... `12` |
  63057. * | `hh` | Hour, 12-hour, leading zero | `01` ... `12` |
  63058. * | `a` | 12-hour time period, lowercase | `am` `pm` |
  63059. * | `A` | 12-hour time period, uppercase | `AM` `PM` |
  63060. * | `m` | Minute | `1` ... `59` |
  63061. * | `mm` | Minute, leading zero | `01` ... `59` |
  63062. * | `s` | Second | `1` ... `59` |
  63063. * | `ss` | Second, leading zero | `01` ... `59` |
  63064. * | `Z` | UTC Timezone Offset | `Z or +HH:mm or -HH:mm` |
  63065. *
  63066. * **Important**: See the [Month Names and Day of the Week Names](#month-names-and-day-of-the-week-names)
  63067. * section below on how to use different names for the month and day.
  63068. *
  63069. * ### Display Format
  63070. *
  63071. * The `displayFormat` input property specifies how a datetime's value should be
  63072. * printed, as formatted text, within the `ion-datetime` component.
  63073. *
  63074. * In the following example, the display in the `<ion-datetime>` will use the
  63075. * month's short name, the numerical day with a leading zero, a comma and the
  63076. * four-digit year. In addition to the date, it will display the time with the hours
  63077. * in the 24-hour format and the minutes. Any character can be used as a separator.
  63078. * An example display using this format is: `Jun 17, 2005 11:06`.
  63079. *
  63080. * ```html
  63081. * <ion-item>
  63082. * <ion-label>Date</ion-label>
  63083. * <ion-datetime displayFormat="MMM DD, YYYY HH:mm" [(ngModel)]="myDate"></ion-datetime>
  63084. * </ion-item>
  63085. * ```
  63086. *
  63087. * ### Picker Format
  63088. *
  63089. * The `pickerFormat` input property determines which columns should be shown in the
  63090. * interface, the order of the columns, and which format to use within each column.
  63091. * If the `pickerFormat` input is not provided then it will default to the `displayFormat`.
  63092. *
  63093. * In the following example, the display in the `<ion-datetime>` will use the
  63094. * `MM/YYYY` format, such as `06/2020`. However, the picker interface
  63095. * will display two columns with the month's long name, and the four-digit year.
  63096. *
  63097. * ```html
  63098. * <ion-item>
  63099. * <ion-label>Date</ion-label>
  63100. * <ion-datetime displayFormat="MM/YYYY" pickerFormat="MMMM YYYY" [(ngModel)]="myDate"></ion-datetime>
  63101. * </ion-item>
  63102. * ```
  63103. *
  63104. * ### Datetime Data
  63105. *
  63106. * Historically, handling datetime values within JavaScript, or even within HTML
  63107. * inputs, has always been a challenge. Specifically, JavaScript's `Date` object is
  63108. * notoriously difficult to correctly parse apart datetime strings or to format
  63109. * datetime values. Even worse is how different browsers and JavaScript versions
  63110. * parse various datetime strings differently, especially per locale.
  63111. *
  63112. * But no worries, all is not lost! Ionic's datetime input has been designed so
  63113. * developers can avoid the common pitfalls, allowing developers to easily format
  63114. * datetime values within the input, and give the user a simple datetime picker for a
  63115. * great user experience.
  63116. *
  63117. * ##### ISO 8601 Datetime Format: YYYY-MM-DDTHH:mmZ
  63118. *
  63119. * Ionic uses the [ISO 8601 datetime format](https://www.w3.org/TR/NOTE-datetime)
  63120. * for its value. The value is simply a string, rather than using JavaScript's `Date`
  63121. * object. Additionally, when using the ISO datetime format, it makes it easier
  63122. * to serialize and pass within JSON objects, and sending databases a standardized
  63123. * format which it can be easily parsed if need be.
  63124. *
  63125. * To create an ISO datetime string for the current date and time, e.g. use `const currentDate = (new Date()).toISOString();`.
  63126. *
  63127. * An ISO format can be used as a simple year, or just the hour and minute, or get more
  63128. * detailed down to the millisecond and timezone. Any of the ISO formats below can be used,
  63129. * and after a user selects a new value, Ionic will continue to use the same ISO format
  63130. * which datetime value was originally given as.
  63131. *
  63132. * | Description | Format | Datetime Value Example |
  63133. * |----------------------|------------------------|------------------------------|
  63134. * | Year | YYYY | 1994 |
  63135. * | Year and Month | YYYY-MM | 1994-12 |
  63136. * | Complete Date | YYYY-MM-DD | 1994-12-15 |
  63137. * | Date and Time | YYYY-MM-DDTHH:mm | 1994-12-15T13:47 |
  63138. * | UTC Timezone | YYYY-MM-DDTHH:mm:ssTZD | 1994-12-15T13:47:20.789Z |
  63139. * | Timezone Offset | YYYY-MM-DDTHH:mm:ssTZD | 1994-12-15T13:47:20.789+5:00 |
  63140. * | Hour and Minute | HH:mm | 13:47 |
  63141. * | Hour, Minute, Second | HH:mm:ss | 13:47:20 |
  63142. *
  63143. * Note that the year is always four-digits, milliseconds (if it's added) is always
  63144. * three-digits, and all others are always two-digits. So the number representing
  63145. * January always has a leading zero, such as `01`. Additionally, the hour is always
  63146. * in the 24-hour format, so `00` is `12am` on a 12-hour clock, `13` means `1pm`,
  63147. * and `23` means `11pm`.
  63148. *
  63149. * It's also important to note that neither the `displayFormat` or `pickerFormat` can
  63150. * set the datetime value's output, which is the value that is set by the component's
  63151. * `ngModel`. The format's are merely for displaying the value as text and the picker's
  63152. * interface, but the datetime's value is always persisted as a valid ISO 8601 datetime
  63153. * string.
  63154. *
  63155. *
  63156. * ## Min and Max Datetimes
  63157. *
  63158. * Dates are infinite in either direction, so for a user's selection there should be at
  63159. * least some form of restricting the dates that can be selected. By default, the maximum
  63160. * date is to the end of the current year, and the minimum date is from the beginning
  63161. * of the year that was 100 years ago.
  63162. *
  63163. * To customize the minimum and maximum datetime values, the `min` and `max` component
  63164. * inputs can be provided which may make more sense for the app's use-case, rather
  63165. * than the default of the last 100 years. Following the same IS0 8601 format listed
  63166. * in the table above, each component can restrict which dates can be selected by the
  63167. * user. Below is an example of restricting the date selection between the beginning
  63168. * of 2016, and October 31st of 2020:
  63169. *
  63170. * ```html
  63171. * <ion-item>
  63172. * <ion-label>Date</ion-label>
  63173. * <ion-datetime displayFormat="MMMM YYYY" min="2016" max="2020-10-31" [(ngModel)]="myDate">
  63174. * </ion-datetime>
  63175. * </ion-item>
  63176. * ```
  63177. *
  63178. *
  63179. * ## Month Names and Day of the Week Names
  63180. *
  63181. * At this time, there is no one-size-fits-all standard to automatically choose the correct
  63182. * language/spelling for a month name, or day of the week name, depending on the language
  63183. * or locale. Good news is that there is an
  63184. * [Intl.DateTimeFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat)
  63185. * standard which *most* browsers have adopted. However, at this time the standard has not
  63186. * been fully implemented by all popular browsers so Ionic is unavailable to take advantage
  63187. * of it *yet*. Additionally, Angular also provides an internationalization service, but it
  63188. * is still under heavy development so Ionic does not depend on it at this time.
  63189. *
  63190. * All things considered, the by far easiest solution is to just provide an array of names
  63191. * if the app needs to use names other than the default English version of month and day
  63192. * names. The month names and day names can be either configured at the app level, or
  63193. * individual `ion-datetime` level.
  63194. *
  63195. * ### App Config Level
  63196. *
  63197. * ```ts
  63198. * //app.module.ts
  63199. * @NgModule({
  63200. * ...,
  63201. * imports: [
  63202. * IonicModule.forRoot(MyApp, {
  63203. * monthNames: ['janeiro', 'fevereiro', 'mar\u00e7o', ... ],
  63204. * monthShortNames: ['jan', 'fev', 'mar', ... ],
  63205. * dayNames: ['domingo', 'segunda-feira', 'ter\u00e7a-feira', ... ],
  63206. * dayShortNames: ['dom', 'seg', 'ter', ... ],
  63207. * })
  63208. * ],
  63209. * ...
  63210. * })
  63211. * ```
  63212. *
  63213. * ### Component Input Level
  63214. *
  63215. * ```html
  63216. * <ion-item>
  63217. * <ion-label>Período</ion-label>
  63218. * <ion-datetime displayFormat="DDDD MMM D, YYYY" [(ngModel)]="myDate"
  63219. * monthNames="janeiro, fevereiro, mar\u00e7o, ..."
  63220. * monthShortNames="jan, fev, mar, ..."
  63221. * dayNames="domingo, segunda-feira, ter\u00e7a-feira, ..."
  63222. * dayShortNames="dom, seg, ter, ..."></ion-datetime>
  63223. * </ion-item>
  63224. * ```
  63225. *
  63226. *
  63227. * ### Advanced Datetime Validation and Manipulation
  63228. *
  63229. * The datetime picker provides the simplicity of selecting an exact format, and persists
  63230. * the datetime values as a string using the standardized
  63231. * [ISO 8601 datetime format](https://www.w3.org/TR/NOTE-datetime).
  63232. * However, it's important to note that `ion-datetime` does not attempt to solve all
  63233. * situtations when validating and manipulating datetime values. If datetime values need
  63234. * to be parsed from a certain format, or manipulated (such as adding 5 days to a date,
  63235. * subtracting 30 minutes, etc.), or even formatting data to a specific locale, then we highly
  63236. * recommend using [moment.js](http://momentjs.com/) to "Parse, validate, manipulate, and
  63237. * display dates in JavaScript". [Moment.js](http://momentjs.com/) has quickly become
  63238. * our goto standard when dealing with datetimes within JavaScript, but Ionic does not
  63239. * prepackage this dependency since most apps will not require it, and its locale
  63240. * configuration should be decided by the end-developer.
  63241. *
  63242. *
  63243. * @usage
  63244. * ```html
  63245. * <ion-item>
  63246. * <ion-label>Date</ion-label>
  63247. * <ion-datetime displayFormat="MM/DD/YYYY" [(ngModel)]="myDate">
  63248. * </ion-datetime>
  63249. * </ion-item>
  63250. * ```
  63251. *
  63252. *
  63253. * @demo /docs/demos/src/datetime/
  63254. */
  63255. var DateTime = (function (_super) {
  63256. __extends(DateTime, _super);
  63257. function DateTime(form, config, elementRef, renderer, item, _pickerCtrl) {
  63258. var _this = _super.call(this, config, elementRef, renderer, 'datetime', {}, form, item, null) || this;
  63259. _this._pickerCtrl = _pickerCtrl;
  63260. _this._text = '';
  63261. _this._locale = {};
  63262. /**
  63263. * @input {string} The text to display on the picker's cancel button. Default: `Cancel`.
  63264. */
  63265. _this.cancelText = 'Cancel';
  63266. /**
  63267. * @input {string} The text to display on the picker's "Done" button. Default: `Done`.
  63268. */
  63269. _this.doneText = 'Done';
  63270. /**
  63271. * @input {any} Any additional options that the picker interface can accept.
  63272. * See the [Picker API docs](../../picker/Picker) for the picker options.
  63273. */
  63274. _this.pickerOptions = {};
  63275. /**
  63276. * @input {string} The text to display when there's no date selected yet.
  63277. * Using lowercase to match the input attribute
  63278. */
  63279. _this.placeholder = '';
  63280. /**
  63281. * @output {any} Emitted when the datetime selection was cancelled.
  63282. */
  63283. _this.ionCancel = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  63284. return _this;
  63285. }
  63286. /**
  63287. * @hidden
  63288. */
  63289. DateTime.prototype.ngAfterContentInit = function () {
  63290. var _this = this;
  63291. // first see if locale names were provided in the inputs
  63292. // then check to see if they're in the config
  63293. // if neither were provided then it will use default English names
  63294. ['monthNames', 'monthShortNames', 'dayNames', 'dayShortNames'].forEach(function (type) {
  63295. _this._locale[type] = convertToArrayOfStrings(Object(__WEBPACK_IMPORTED_MODULE_7__util_util__["l" /* isPresent */])(_this[type]) ? _this[type] : _this._config.get(type), type);
  63296. });
  63297. this._initialize();
  63298. };
  63299. /**
  63300. * @hidden
  63301. */
  63302. DateTime.prototype._inputNormalize = function (val) {
  63303. Object(__WEBPACK_IMPORTED_MODULE_8__util_datetime_util__["m" /* updateDate */])(this._value, val);
  63304. return this._value;
  63305. };
  63306. /**
  63307. * @hidden
  63308. */
  63309. DateTime.prototype._inputUpdated = function () {
  63310. _super.prototype._inputUpdated.call(this);
  63311. this.updateText();
  63312. };
  63313. /**
  63314. * @hidden
  63315. */
  63316. DateTime.prototype._inputShouldChange = function () {
  63317. return true;
  63318. };
  63319. /**
  63320. * TODO: REMOVE THIS
  63321. * @hidden
  63322. */
  63323. DateTime.prototype._inputChangeEvent = function () {
  63324. return this.value;
  63325. };
  63326. /**
  63327. * @hidden
  63328. */
  63329. DateTime.prototype._inputNgModelEvent = function () {
  63330. return Object(__WEBPACK_IMPORTED_MODULE_8__util_datetime_util__["b" /* convertDataToISO */])(this.value);
  63331. };
  63332. DateTime.prototype._click = function (ev) {
  63333. ev.preventDefault();
  63334. ev.stopPropagation();
  63335. this.open();
  63336. };
  63337. DateTime.prototype._keyup = function () {
  63338. this.open();
  63339. };
  63340. /**
  63341. * @hidden
  63342. */
  63343. DateTime.prototype.open = function () {
  63344. var _this = this;
  63345. if (this.isFocus() || this._disabled) {
  63346. return;
  63347. }
  63348. (void 0) /* console.debug */;
  63349. // the user may have assigned some options specifically for the picker
  63350. var pickerOptions = __assign({}, this.pickerOptions);
  63351. // Add a cancel and done button by default to the picker
  63352. var defaultButtons = [{
  63353. text: this.cancelText,
  63354. role: 'cancel',
  63355. handler: function () { return _this.ionCancel.emit(_this); }
  63356. }, {
  63357. text: this.doneText,
  63358. handler: function (data) { return _this.value = data; },
  63359. }];
  63360. pickerOptions.buttons = (pickerOptions.buttons || []).concat(defaultButtons);
  63361. // Configure picker under the hood
  63362. var picker = this._picker = this._pickerCtrl.create(pickerOptions);
  63363. picker.ionChange.subscribe(function () {
  63364. _this.validate();
  63365. picker.refresh();
  63366. });
  63367. // Update picker status before presenting
  63368. this.generate();
  63369. this.validate();
  63370. // Present picker
  63371. this._fireFocus();
  63372. picker.present(pickerOptions);
  63373. picker.onDidDismiss(function () {
  63374. _this._fireBlur();
  63375. });
  63376. };
  63377. /**
  63378. * @hidden
  63379. */
  63380. DateTime.prototype.generate = function () {
  63381. var _this = this;
  63382. var picker = this._picker;
  63383. // if a picker format wasn't provided, then fallback
  63384. // to use the display format
  63385. var template = this.pickerFormat || this.displayFormat || DEFAULT_FORMAT;
  63386. if (Object(__WEBPACK_IMPORTED_MODULE_7__util_util__["l" /* isPresent */])(template)) {
  63387. // make sure we've got up to date sizing information
  63388. this.calcMinMax();
  63389. // does not support selecting by day name
  63390. // automaticallly remove any day name formats
  63391. template = template.replace('DDDD', '{~}').replace('DDD', '{~}');
  63392. if (template.indexOf('D') === -1) {
  63393. // there is not a day in the template
  63394. // replace the day name with a numeric one if it exists
  63395. template = template.replace('{~}', 'D');
  63396. }
  63397. // make sure no day name replacer is left in the string
  63398. template = template.replace(/{~}/g, '');
  63399. // parse apart the given template into an array of "formats"
  63400. Object(__WEBPACK_IMPORTED_MODULE_8__util_datetime_util__["j" /* parseTemplate */])(template).forEach(function (format) {
  63401. // loop through each format in the template
  63402. // create a new picker column to build up with data
  63403. var key = Object(__WEBPACK_IMPORTED_MODULE_8__util_datetime_util__["c" /* convertFormatToKey */])(format);
  63404. var values;
  63405. // first see if they have exact values to use for this input
  63406. if (Object(__WEBPACK_IMPORTED_MODULE_7__util_util__["l" /* isPresent */])(_this[key + 'Values'])) {
  63407. // user provide exact values for this date part
  63408. values = convertToArrayOfNumbers(_this[key + 'Values'], key);
  63409. }
  63410. else {
  63411. // use the default date part values
  63412. values = Object(__WEBPACK_IMPORTED_MODULE_8__util_datetime_util__["f" /* dateValueRange */])(format, _this._min, _this._max);
  63413. }
  63414. var column = {
  63415. name: key,
  63416. selectedIndex: 0,
  63417. options: values.map(function (val) {
  63418. return {
  63419. value: val,
  63420. text: Object(__WEBPACK_IMPORTED_MODULE_8__util_datetime_util__["l" /* renderTextFormat */])(format, val, null, _this._locale),
  63421. };
  63422. })
  63423. };
  63424. // cool, we've loaded up the columns with options
  63425. // preselect the option for this column
  63426. var optValue = Object(__WEBPACK_IMPORTED_MODULE_8__util_datetime_util__["h" /* getValueFromFormat */])(_this.getValueOrDefault(), format);
  63427. var selectedIndex = column.options.findIndex(function (opt) { return opt.value === optValue; });
  63428. if (selectedIndex >= 0) {
  63429. // set the select index for this column's options
  63430. column.selectedIndex = selectedIndex;
  63431. }
  63432. // add our newly created column to the picker
  63433. picker.addColumn(column);
  63434. });
  63435. // Normalize min/max
  63436. var min_1 = this._min;
  63437. var max_1 = this._max;
  63438. var columns_1 = this._picker.getColumns();
  63439. ['month', 'day', 'hour', 'minute']
  63440. .filter(function (name) { return !columns_1.find(function (column) { return column.name === name; }); })
  63441. .forEach(function (name) {
  63442. min_1[name] = 0;
  63443. max_1[name] = 0;
  63444. });
  63445. this.divyColumns();
  63446. }
  63447. };
  63448. /**
  63449. * @hidden
  63450. */
  63451. DateTime.prototype.validateColumn = function (name, index, min, max, lowerBounds, upperBounds) {
  63452. (void 0) /* assert */;
  63453. (void 0) /* assert */;
  63454. var column = this._picker.getColumn(name);
  63455. if (!column) {
  63456. return 0;
  63457. }
  63458. var lb = lowerBounds.slice();
  63459. var ub = upperBounds.slice();
  63460. var options = column.options;
  63461. var indexMin = options.length - 1;
  63462. var indexMax = 0;
  63463. for (var i = 0; i < options.length; i++) {
  63464. var opt = options[i];
  63465. var value = opt.value;
  63466. lb[index] = opt.value;
  63467. ub[index] = opt.value;
  63468. var disabled = opt.disabled = (value < lowerBounds[index] ||
  63469. value > upperBounds[index] ||
  63470. Object(__WEBPACK_IMPORTED_MODULE_8__util_datetime_util__["e" /* dateSortValue */])(ub[0], ub[1], ub[2], ub[3], ub[4]) < min ||
  63471. Object(__WEBPACK_IMPORTED_MODULE_8__util_datetime_util__["e" /* dateSortValue */])(lb[0], lb[1], lb[2], lb[3], lb[4]) > max);
  63472. if (!disabled) {
  63473. indexMin = Math.min(indexMin, i);
  63474. indexMax = Math.max(indexMax, i);
  63475. }
  63476. }
  63477. var selectedIndex = column.selectedIndex = Object(__WEBPACK_IMPORTED_MODULE_7__util_util__["a" /* clamp */])(indexMin, column.selectedIndex, indexMax);
  63478. opt = column.options[selectedIndex];
  63479. if (opt) {
  63480. return opt.value;
  63481. }
  63482. return 0;
  63483. };
  63484. /**
  63485. * @private
  63486. */
  63487. DateTime.prototype.validate = function () {
  63488. var today = new Date();
  63489. var minCompareVal = Object(__WEBPACK_IMPORTED_MODULE_8__util_datetime_util__["d" /* dateDataSortValue */])(this._min);
  63490. var maxCompareVal = Object(__WEBPACK_IMPORTED_MODULE_8__util_datetime_util__["d" /* dateDataSortValue */])(this._max);
  63491. var yearCol = this._picker.getColumn('year');
  63492. (void 0) /* assert */;
  63493. var selectedYear = today.getFullYear();
  63494. if (yearCol) {
  63495. // default to the first value if the current year doesn't exist in the options
  63496. if (!yearCol.options.find(function (col) { return col.value === today.getFullYear(); })) {
  63497. selectedYear = yearCol.options[0].value;
  63498. }
  63499. var yearOpt = yearCol.options[yearCol.selectedIndex];
  63500. if (yearOpt) {
  63501. // they have a selected year value
  63502. selectedYear = yearOpt.value;
  63503. }
  63504. }
  63505. var selectedMonth = this.validateColumn('month', 1, minCompareVal, maxCompareVal, [selectedYear, 0, 0, 0, 0], [selectedYear, 12, 31, 23, 59]);
  63506. var numDaysInMonth = Object(__WEBPACK_IMPORTED_MODULE_8__util_datetime_util__["g" /* daysInMonth */])(selectedMonth, selectedYear);
  63507. var selectedDay = this.validateColumn('day', 2, minCompareVal, maxCompareVal, [selectedYear, selectedMonth, 0, 0, 0], [selectedYear, selectedMonth, numDaysInMonth, 23, 59]);
  63508. var selectedHour = this.validateColumn('hour', 3, minCompareVal, maxCompareVal, [selectedYear, selectedMonth, selectedDay, 0, 0], [selectedYear, selectedMonth, selectedDay, 23, 59]);
  63509. this.validateColumn('minute', 4, minCompareVal, maxCompareVal, [selectedYear, selectedMonth, selectedDay, selectedHour, 0], [selectedYear, selectedMonth, selectedDay, selectedHour, 59]);
  63510. };
  63511. /**
  63512. * @hidden
  63513. */
  63514. DateTime.prototype.divyColumns = function () {
  63515. var pickerColumns = this._picker.getColumns();
  63516. var columnsWidth = [];
  63517. var col;
  63518. var width;
  63519. for (var i = 0; i < pickerColumns.length; i++) {
  63520. col = pickerColumns[i];
  63521. columnsWidth.push(0);
  63522. for (var j = 0; j < col.options.length; j++) {
  63523. width = col.options[j].text.length;
  63524. if (width > columnsWidth[i]) {
  63525. columnsWidth[i] = width;
  63526. }
  63527. }
  63528. }
  63529. if (columnsWidth.length === 2) {
  63530. width = Math.max(columnsWidth[0], columnsWidth[1]);
  63531. pickerColumns[0].align = 'right';
  63532. pickerColumns[1].align = 'left';
  63533. pickerColumns[0].optionsWidth = pickerColumns[1].optionsWidth = width * 17 + "px";
  63534. }
  63535. else if (columnsWidth.length === 3) {
  63536. width = Math.max(columnsWidth[0], columnsWidth[2]);
  63537. pickerColumns[0].align = 'right';
  63538. pickerColumns[1].columnWidth = columnsWidth[1] * 17 + "px";
  63539. pickerColumns[0].optionsWidth = pickerColumns[2].optionsWidth = width * 17 + "px";
  63540. pickerColumns[2].align = 'left';
  63541. }
  63542. };
  63543. /**
  63544. * @hidden
  63545. */
  63546. DateTime.prototype.updateText = function () {
  63547. // create the text of the formatted data
  63548. var template = this.displayFormat || this.pickerFormat || DEFAULT_FORMAT;
  63549. this._text = Object(__WEBPACK_IMPORTED_MODULE_8__util_datetime_util__["k" /* renderDateTime */])(template, this.getValue(), this._locale);
  63550. };
  63551. /**
  63552. * @hidden
  63553. */
  63554. DateTime.prototype.getValue = function () {
  63555. return this._value;
  63556. };
  63557. /**
  63558. * @hidden
  63559. */
  63560. DateTime.prototype.getValueOrDefault = function () {
  63561. if (this.hasValue()) {
  63562. return this._value;
  63563. }
  63564. var initialDateString = this.getDefaultValueDateString();
  63565. var _default = {};
  63566. Object(__WEBPACK_IMPORTED_MODULE_8__util_datetime_util__["m" /* updateDate */])(_default, initialDateString);
  63567. return _default;
  63568. };
  63569. /**
  63570. * Get the default value as a date string
  63571. * @hidden
  63572. */
  63573. DateTime.prototype.getDefaultValueDateString = function () {
  63574. if (this.initialValue) {
  63575. return this.initialValue;
  63576. }
  63577. var nowString = (new Date).toISOString();
  63578. if (this.max) {
  63579. var now = Object(__WEBPACK_IMPORTED_MODULE_8__util_datetime_util__["i" /* parseDate */])(nowString);
  63580. var max = Object(__WEBPACK_IMPORTED_MODULE_8__util_datetime_util__["i" /* parseDate */])(this.max);
  63581. var v = void 0;
  63582. for (var i in max) {
  63583. v = max[i];
  63584. if (v === null) {
  63585. max[i] = now[i];
  63586. }
  63587. }
  63588. var diff = Object(__WEBPACK_IMPORTED_MODULE_8__util_datetime_util__["a" /* compareDates */])(now, max);
  63589. // If max is before current time, return max
  63590. if (diff > 0) {
  63591. return this.max;
  63592. }
  63593. }
  63594. return nowString;
  63595. };
  63596. /**
  63597. * @hidden
  63598. */
  63599. DateTime.prototype.hasValue = function () {
  63600. var val = this._value;
  63601. return Object(__WEBPACK_IMPORTED_MODULE_7__util_util__["l" /* isPresent */])(val)
  63602. && Object(__WEBPACK_IMPORTED_MODULE_7__util_util__["k" /* isObject */])(val)
  63603. && Object.keys(val).length > 0;
  63604. };
  63605. /**
  63606. * @hidden
  63607. */
  63608. DateTime.prototype.calcMinMax = function (now) {
  63609. var todaysYear = (now || new Date()).getFullYear();
  63610. if (Object(__WEBPACK_IMPORTED_MODULE_7__util_util__["l" /* isPresent */])(this.yearValues)) {
  63611. var years = convertToArrayOfNumbers(this.yearValues, 'year');
  63612. if (Object(__WEBPACK_IMPORTED_MODULE_7__util_util__["f" /* isBlank */])(this.min)) {
  63613. this.min = Math.min.apply(Math, years);
  63614. }
  63615. if (Object(__WEBPACK_IMPORTED_MODULE_7__util_util__["f" /* isBlank */])(this.max)) {
  63616. this.max = Math.max.apply(Math, years);
  63617. }
  63618. }
  63619. else {
  63620. if (Object(__WEBPACK_IMPORTED_MODULE_7__util_util__["f" /* isBlank */])(this.min)) {
  63621. this.min = (todaysYear - 100).toString();
  63622. }
  63623. if (Object(__WEBPACK_IMPORTED_MODULE_7__util_util__["f" /* isBlank */])(this.max)) {
  63624. this.max = todaysYear.toString();
  63625. }
  63626. }
  63627. var min = this._min = Object(__WEBPACK_IMPORTED_MODULE_8__util_datetime_util__["i" /* parseDate */])(this.min);
  63628. var max = this._max = Object(__WEBPACK_IMPORTED_MODULE_8__util_datetime_util__["i" /* parseDate */])(this.max);
  63629. min.year = min.year || todaysYear;
  63630. max.year = max.year || todaysYear;
  63631. min.month = min.month || 1;
  63632. max.month = max.month || 12;
  63633. min.day = min.day || 1;
  63634. max.day = max.day || 31;
  63635. min.hour = min.hour || 0;
  63636. max.hour = max.hour || 23;
  63637. min.minute = min.minute || 0;
  63638. max.minute = max.minute || 59;
  63639. min.second = min.second || 0;
  63640. max.second = max.second || 59;
  63641. // Ensure min/max constraits
  63642. if (min.year > max.year) {
  63643. console.error('min.year > max.year');
  63644. min.year = max.year - 100;
  63645. }
  63646. if (min.year === max.year) {
  63647. if (min.month > max.month) {
  63648. console.error('min.month > max.month');
  63649. min.month = 1;
  63650. }
  63651. else if (min.month === max.month && min.day > max.day) {
  63652. console.error('min.day > max.day');
  63653. min.day = 1;
  63654. }
  63655. }
  63656. };
  63657. DateTime.decorators = [
  63658. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  63659. selector: 'ion-datetime',
  63660. template: '<div *ngIf="!_text" class="datetime-text datetime-placeholder">{{placeholder}}</div>' +
  63661. '<div *ngIf="_text" class="datetime-text">{{_text}}</div>' +
  63662. '<button aria-haspopup="true" ' +
  63663. 'type="button" ' +
  63664. '[id]="id" ' +
  63665. 'ion-button="item-cover" ' +
  63666. '[attr.aria-labelledby]="_labelId" ' +
  63667. '[attr.aria-disabled]="_disabled" ' +
  63668. 'class="item-cover">' +
  63669. '</button>',
  63670. host: {
  63671. '[class.datetime-disabled]': '_disabled'
  63672. },
  63673. providers: [{ provide: __WEBPACK_IMPORTED_MODULE_1__angular_forms__["b" /* NG_VALUE_ACCESSOR */], useExisting: DateTime, multi: true }],
  63674. encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_11" /* ViewEncapsulation */].None,
  63675. },] },
  63676. ];
  63677. /** @nocollapse */
  63678. DateTime.ctorParameters = function () { return [
  63679. { type: __WEBPACK_IMPORTED_MODULE_4__util_form__["a" /* Form */], },
  63680. { type: __WEBPACK_IMPORTED_MODULE_2__config_config__["a" /* Config */], },
  63681. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  63682. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  63683. { type: __WEBPACK_IMPORTED_MODULE_6__item_item__["a" /* Item */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  63684. { type: __WEBPACK_IMPORTED_MODULE_3__picker_picker_controller__["a" /* PickerController */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  63685. ]; };
  63686. DateTime.propDecorators = {
  63687. 'min': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  63688. 'max': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  63689. 'displayFormat': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  63690. 'initialValue': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  63691. 'pickerFormat': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  63692. 'cancelText': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  63693. 'doneText': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  63694. 'yearValues': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  63695. 'monthValues': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  63696. 'dayValues': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  63697. 'hourValues': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  63698. 'minuteValues': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  63699. 'monthNames': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  63700. 'monthShortNames': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  63701. 'dayNames': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  63702. 'dayShortNames': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  63703. 'pickerOptions': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  63704. 'placeholder': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  63705. 'ionCancel': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  63706. '_click': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["y" /* HostListener */], args: ['click', ['$event'],] },],
  63707. '_keyup': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["y" /* HostListener */], args: ['keyup.space',] },],
  63708. };
  63709. return DateTime;
  63710. }(__WEBPACK_IMPORTED_MODULE_5__util_base_input__["a" /* BaseInput */]));
  63711. /**
  63712. * @hidden
  63713. * Use to convert a string of comma separated numbers or
  63714. * an array of numbers, and clean up any user input
  63715. */
  63716. function convertToArrayOfNumbers(input, type) {
  63717. if (Object(__WEBPACK_IMPORTED_MODULE_7__util_util__["n" /* isString */])(input)) {
  63718. // convert the string to an array of strings
  63719. // auto remove any whitespace and [] characters
  63720. input = input.replace(/\[|\]|\s/g, '').split(',');
  63721. }
  63722. var values;
  63723. if (Object(__WEBPACK_IMPORTED_MODULE_7__util_util__["e" /* isArray */])(input)) {
  63724. // ensure each value is an actual number in the returned array
  63725. values = input
  63726. .map(function (num) { return parseInt(num, 10); })
  63727. .filter(isFinite);
  63728. }
  63729. if (!values || !values.length) {
  63730. console.warn("Invalid \"" + type + "Values\". Must be an array of numbers, or a comma separated string of numbers.");
  63731. }
  63732. return values;
  63733. }
  63734. /**
  63735. * @hidden
  63736. * Use to convert a string of comma separated strings or
  63737. * an array of strings, and clean up any user input
  63738. */
  63739. function convertToArrayOfStrings(input, type) {
  63740. if (Object(__WEBPACK_IMPORTED_MODULE_7__util_util__["l" /* isPresent */])(input)) {
  63741. if (Object(__WEBPACK_IMPORTED_MODULE_7__util_util__["n" /* isString */])(input)) {
  63742. // convert the string to an array of strings
  63743. // auto remove any [] characters
  63744. input = input.replace(/\[|\]/g, '').split(',');
  63745. }
  63746. var values;
  63747. if (Object(__WEBPACK_IMPORTED_MODULE_7__util_util__["e" /* isArray */])(input)) {
  63748. // trim up each string value
  63749. values = input.map(function (val) { return val.trim(); });
  63750. }
  63751. if (!values || !values.length) {
  63752. console.warn("Invalid \"" + type + "Names\". Must be an array of strings, or a comma separated string.");
  63753. }
  63754. return values;
  63755. }
  63756. }
  63757. var DEFAULT_FORMAT = 'MMM D, YYYY';
  63758. //# sourceMappingURL=datetime.js.map
  63759. /***/ }),
  63760. /* 133 */
  63761. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63762. "use strict";
  63763. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Picker; });
  63764. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  63765. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_util__ = __webpack_require__(2);
  63766. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__picker_component__ = __webpack_require__(66);
  63767. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__picker_transitions__ = __webpack_require__(240);
  63768. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__navigation_view_controller__ = __webpack_require__(5);
  63769. var __extends = (this && this.__extends) || (function () {
  63770. var extendStatics = Object.setPrototypeOf ||
  63771. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  63772. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  63773. return function (d, b) {
  63774. extendStatics(d, b);
  63775. function __() { this.constructor = d; }
  63776. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  63777. };
  63778. })();
  63779. /**
  63780. * @hidden
  63781. */
  63782. var Picker = (function (_super) {
  63783. __extends(Picker, _super);
  63784. function Picker(app, opts, config) {
  63785. if (opts === void 0) { opts = {}; }
  63786. var _this = this;
  63787. if (!opts) {
  63788. opts = {};
  63789. }
  63790. opts.columns = opts.columns || [];
  63791. opts.buttons = opts.buttons || [];
  63792. opts.enableBackdropDismiss = Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["l" /* isPresent */])(opts.enableBackdropDismiss) ? Boolean(opts.enableBackdropDismiss) : true;
  63793. _this = _super.call(this, __WEBPACK_IMPORTED_MODULE_2__picker_component__["a" /* PickerCmp */], opts, null) || this;
  63794. _this._app = app;
  63795. _this.isOverlay = true;
  63796. _this.ionChange = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  63797. config.setTransition('picker-slide-in', __WEBPACK_IMPORTED_MODULE_3__picker_transitions__["a" /* PickerSlideIn */]);
  63798. config.setTransition('picker-slide-out', __WEBPACK_IMPORTED_MODULE_3__picker_transitions__["b" /* PickerSlideOut */]);
  63799. return _this;
  63800. }
  63801. /**
  63802. * @hidden
  63803. */
  63804. Picker.prototype.getTransitionName = function (direction) {
  63805. var key = (direction === 'back' ? 'pickerLeave' : 'pickerEnter');
  63806. return this._nav && this._nav.config.get(key);
  63807. };
  63808. /**
  63809. * @param {any} button Picker toolbar button
  63810. */
  63811. Picker.prototype.addButton = function (button) {
  63812. this.data.buttons.push(button);
  63813. };
  63814. /**
  63815. * @param {PickerColumn} column Picker toolbar button
  63816. */
  63817. Picker.prototype.addColumn = function (column) {
  63818. this.data.columns.push(column);
  63819. };
  63820. Picker.prototype.getColumns = function () {
  63821. return this.data.columns;
  63822. };
  63823. Picker.prototype.getColumn = function (name) {
  63824. return this.getColumns().find(function (column) { return column.name === name; });
  63825. };
  63826. Picker.prototype.refresh = function () {
  63827. (void 0) /* assert */;
  63828. (void 0) /* assert */;
  63829. this._cmp && this._cmp.instance.refresh && this._cmp.instance.refresh();
  63830. };
  63831. /**
  63832. * @param {string} cssClass CSS class name to add to the picker's outer wrapper.
  63833. */
  63834. Picker.prototype.setCssClass = function (cssClass) {
  63835. this.data.cssClass = cssClass;
  63836. };
  63837. /**
  63838. * Present the picker instance.
  63839. *
  63840. * @param {NavOptions} [navOptions={}] Nav options to go with this transition.
  63841. * @returns {Promise} Returns a promise which is resolved when the transition has completed.
  63842. */
  63843. Picker.prototype.present = function (navOptions) {
  63844. if (navOptions === void 0) { navOptions = {}; }
  63845. return this._app.present(this, navOptions);
  63846. };
  63847. Picker.propDecorators = {
  63848. 'ionChange': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  63849. };
  63850. return Picker;
  63851. }(__WEBPACK_IMPORTED_MODULE_4__navigation_view_controller__["a" /* ViewController */]));
  63852. //# sourceMappingURL=picker.js.map
  63853. /***/ }),
  63854. /* 134 */
  63855. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63856. "use strict";
  63857. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FabContainer; });
  63858. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  63859. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__platform_platform__ = __webpack_require__(3);
  63860. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__gestures_ui_event_manager__ = __webpack_require__(23);
  63861. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__fab__ = __webpack_require__(45);
  63862. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__fab_list__ = __webpack_require__(68);
  63863. /**
  63864. * @name FabContainer
  63865. * @module ionic
  63866. *
  63867. * @description
  63868. * `<ion-fab>` is not a FAB button by itself but a container that assist the fab button (`<button ion-fab>`) allowing it
  63869. * to be placed in fixed position that does not scroll with the content. It is also used to implement "material design speed dial",
  63870. * ie. a FAB buttons displays a small lists of related actions when clicked.
  63871. *
  63872. * @property [top] - Places the container on the top of the content
  63873. * @property [bottom] - Places the container on the bottom of the content
  63874. * @property [left] - Places the container on the left
  63875. * @property [right] - Places the container on the right
  63876. * @property [middle] - Places the container on the middle vertically
  63877. * @property [center] - Places the container on the center horizontally
  63878. * @property [edge] - Used to place the container between the content and the header/footer
  63879. *
  63880. * @usage
  63881. *
  63882. * ```html
  63883. * <!-- this fab is placed at top right -->
  63884. * <ion-content>
  63885. * <ion-fab top right>
  63886. * <button ion-fab>Button</button>
  63887. * </ion-fab>
  63888. *
  63889. * <!-- this fab is placed at the center of the content viewport -->
  63890. * <ion-fab center middle>
  63891. * <button ion-fab>Button</button>
  63892. * </ion-fab>
  63893. * </ion-content>
  63894. * ```
  63895. *
  63896. * Ionic's FAB also supports "material design's fab speed dial". It is a normal fab button
  63897. * that shows a list of related actions when clicked.
  63898. *
  63899. * The same `ion-fab` container can contain several `ion-fab-list` with different side values:
  63900. * `top`, `bottom`, `left` and `right`. For example, if you want to have a list of button that are
  63901. * on the top of the main button, you should use `side="top"` and so on. By default, if side is ommited, `side="bottom"`.
  63902. *
  63903. * ```html
  63904. * <ion-content>
  63905. * <!-- this fab is placed at bottom right -->
  63906. * <ion-fab bottom right >
  63907. * <button ion-fab>Share</button>
  63908. * <ion-fab-list side="top">
  63909. * <button ion-fab>Facebook</button>
  63910. * <button ion-fab>Twitter</button>
  63911. * <button ion-fab>Youtube</button>
  63912. * </ion-fab-list>
  63913. * <ion-fab-list side="left">
  63914. * <button ion-fab>Vimeo</button>
  63915. * </ion-fab-list>
  63916. * </ion-fab>
  63917. * </ion-content>
  63918. * ```
  63919. *
  63920. * A FAB speed dial can also be closed programatically.
  63921. *
  63922. * ```html
  63923. * <ion-content>
  63924. * <ion-fab bottom right #fab>
  63925. * <button ion-fab>Share</button>
  63926. * <ion-fab-list side="top">
  63927. * <button ion-fab (click)="share('facebook', fab)">Facebook</button>
  63928. * <button ion-fab (click)="share('twitter', fab)">Twitter</button>
  63929. * </ion-fab-list>
  63930. * </ion-fab>
  63931. * </ion-content>
  63932. * ```
  63933. *
  63934. * ```ts
  63935. * share(socialNet: string, fab: FabContainer) {
  63936. * fab.close();
  63937. * console.log("Sharing in", socialNet);
  63938. * }
  63939. * ```
  63940. *
  63941. * @demo /docs/demos/src/fab/
  63942. * @see {@link /docs/components#fabs FAB Component Docs}
  63943. */
  63944. var FabContainer = (function () {
  63945. function FabContainer(plt) {
  63946. /**
  63947. * @hidden
  63948. */
  63949. this._listsActive = false;
  63950. this._events = new __WEBPACK_IMPORTED_MODULE_2__gestures_ui_event_manager__["a" /* UIEventManager */](plt);
  63951. }
  63952. /**
  63953. * @hidden
  63954. */
  63955. FabContainer.prototype.ngAfterContentInit = function () {
  63956. var mainButton = this._mainButton;
  63957. if (!mainButton || !mainButton.getNativeElement()) {
  63958. console.error('FAB container needs a main <button ion-fab>');
  63959. return;
  63960. }
  63961. this._events.listen(mainButton.getNativeElement(), 'click', this.clickHandler.bind(this), { zone: true });
  63962. };
  63963. /**
  63964. * @hidden
  63965. */
  63966. FabContainer.prototype.clickHandler = function (ev) {
  63967. if (this.canActivateList(ev)) {
  63968. this.toggleList();
  63969. }
  63970. };
  63971. /**
  63972. * @hidden
  63973. */
  63974. FabContainer.prototype.canActivateList = function (ev) {
  63975. if (this._fabLists.length > 0 && this._mainButton && ev.target) {
  63976. var ele = ev.target.closest('ion-fab>[ion-fab]');
  63977. return (ele && ele === this._mainButton.getNativeElement());
  63978. }
  63979. return false;
  63980. };
  63981. /**
  63982. * @hidden
  63983. */
  63984. FabContainer.prototype.toggleList = function () {
  63985. this.setActiveLists(!this._listsActive);
  63986. };
  63987. /**
  63988. * @hidden
  63989. */
  63990. FabContainer.prototype.setActiveLists = function (isActive) {
  63991. if (isActive === this._listsActive) {
  63992. return;
  63993. }
  63994. var lists = this._fabLists.toArray();
  63995. for (var _i = 0, lists_1 = lists; _i < lists_1.length; _i++) {
  63996. var list = lists_1[_i];
  63997. list.setVisible(isActive);
  63998. }
  63999. this._mainButton.setActiveClose(isActive);
  64000. this._listsActive = isActive;
  64001. };
  64002. /**
  64003. * Close an active FAB list container
  64004. */
  64005. FabContainer.prototype.close = function () {
  64006. this.setActiveLists(false);
  64007. };
  64008. /**
  64009. * @hidden
  64010. */
  64011. FabContainer.prototype.ngOnDestroy = function () {
  64012. this._events.destroy();
  64013. };
  64014. FabContainer.decorators = [
  64015. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  64016. selector: 'ion-fab',
  64017. template: '<ng-content></ng-content>'
  64018. },] },
  64019. ];
  64020. /** @nocollapse */
  64021. FabContainer.ctorParameters = function () { return [
  64022. { type: __WEBPACK_IMPORTED_MODULE_1__platform_platform__["a" /* Platform */], },
  64023. ]; };
  64024. FabContainer.propDecorators = {
  64025. '_mainButton': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["q" /* ContentChild */], args: [__WEBPACK_IMPORTED_MODULE_3__fab__["a" /* FabButton */],] },],
  64026. '_fabLists': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["r" /* ContentChildren */], args: [__WEBPACK_IMPORTED_MODULE_4__fab_list__["a" /* FabList */],] },],
  64027. };
  64028. return FabContainer;
  64029. }());
  64030. //# sourceMappingURL=fab-container.js.map
  64031. /***/ }),
  64032. /* 135 */
  64033. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64034. "use strict";
  64035. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Col; });
  64036. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  64037. /**
  64038. * @name Col
  64039. * @module ionic
  64040. * @description
  64041. *
  64042. * Columns are cellular components of the [grid](../Grid) system and go inside of a [row](../Row).
  64043. * They will expand to fill their row. All content within a grid should go inside of a column.
  64044. *
  64045. * ## Column attributes
  64046. *
  64047. * By default, columns will stretch to fill the entire height of the row.
  64048. * There are several attributes that can be added to a column to customize this behavior.
  64049. *
  64050. * | Property | Description |
  64051. * |-----------------------|-------------------------------------------------------------------------------------------------------------|
  64052. * | align-self-start | Adds `align-self: flex-start`. The column will be vertically aligned at the top. |
  64053. * | align-self-center | Adds `align-self: center`. The column will be vertically aligned in the center. |
  64054. * | align-self-end | Adds `align-self: flex-end`. The column will be vertically aligned at the bottom. |
  64055. * | align-self-stretch | Adds `align-self: stretch`. The column will be stretched to take up the entire height of the row. |
  64056. * | align-self-baseline | Adds `align-self: baseline`. The column will be vertically aligned at its baseline. |
  64057. *
  64058. *
  64059. */
  64060. var Col = (function () {
  64061. function Col() {
  64062. }
  64063. Col.decorators = [
  64064. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  64065. selector: 'ion-col, [ion-col]',
  64066. host: {
  64067. 'class': 'col'
  64068. }
  64069. },] },
  64070. ];
  64071. /** @nocollapse */
  64072. Col.ctorParameters = function () { return []; };
  64073. return Col;
  64074. }());
  64075. //# sourceMappingURL=col.js.map
  64076. /***/ }),
  64077. /* 136 */
  64078. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64079. "use strict";
  64080. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Grid; });
  64081. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  64082. /**
  64083. * @name Grid
  64084. * @module ionic
  64085. * @description
  64086. *
  64087. * The grid is a powerful mobile-first flexbox system for building custom layouts.
  64088. * It is heavily influenced by [Bootstrap's grid system](http://v4-alpha.getbootstrap.com/layout/grid/).
  64089. *
  64090. * The grid is composed of three units — a grid, row(s) and column(s). Columns will expand to fill their
  64091. * row, and will resize to fit additional columns. It is based on a 12 column layout with different
  64092. * breakpoints based on the screen size. The number of columns and breakpoints can be fully customized
  64093. * using Sass.
  64094. *
  64095. * - [How it works](#how-it-works)
  64096. * - [Grid size](#grid-size)
  64097. * - [Grid attributes](#grid-attributes)
  64098. * - [Default breakpoints](#default-breakpoints)
  64099. * - [Auto-layout columns](#auto-layout-columns)
  64100. * - [Equal-width](#equal-width)
  64101. * - [Setting one column width](#setting-one-column-width)
  64102. * - [Variable-width](#variable-width)
  64103. * - [Responsive attributes](#responsive-attributes)
  64104. * - [All breakpoints](#all-breakpoints)
  64105. * - [Stacked to horizontal](#stacked-to-horizontal)
  64106. * - [Reordering](#reordering)
  64107. * - [Offsetting columns](#offsetting-columns)
  64108. * - [Push and pull](#push-and-pull)
  64109. * - [Alignment](#alignment)
  64110. * - [Vertical Alignment](#vertical-alignment)
  64111. * - [Horizontal Alignment](#horizontal-alignment)
  64112. * - [Customizing the grid](#customizing-the-grid)
  64113. * - [Number of columns and padding](#number-of-columns-and-padding)
  64114. * - [Grid tiers](#grid-tiers)
  64115. *
  64116. *
  64117. * ## How it works
  64118. *
  64119. * The grid is a mobile-first system made up of any number of rows and columns.
  64120. * It is built with flexbox making it extremely responsive. The components that
  64121. * make up the grid can be written as an element (e.g., `<ion-grid>`) or added as
  64122. * an attribute to any element (e.g., `<div ion-row>`).
  64123. *
  64124. * Here's how it works:
  64125. *
  64126. * - Grids act as a container for all rows and columns. Grids take up the full width of their container,
  64127. * but adding the `fixed` attribute will specify the width per screen size, see [grid size](#grid-size) below.
  64128. * - Rows are horizontal groups of columns that line the columns up properly.
  64129. * - Content should be placed within columns, and only columns may be immediate children of rows.
  64130. * - Grid columns without a specified width will automatically have equal widths.
  64131. * For example, four instances of `col-sm` will each automatically be 25% wide for small breakpoints.
  64132. * - Column attributes indicate the number of columns to use out of the default 12 per row.
  64133. * So, `col-4` can be added in order to have three equal-width columns.
  64134. * - Column widths are set as a percentage, so they’re always fluid and sized relative to their parent element.
  64135. * - Columns have padding between individual columns, however, the padding can be removed from the grid and
  64136. * columns by adding `no-padding` on the grid.
  64137. * - There are five grid tiers by default, one for each responsive breakpoint: all breakpoints (extra small),
  64138. * small, medium, large, and extra large.
  64139. * - Grid tiers are based on minimum widths, meaning they apply to their tier and all those larger than it
  64140. * (e.g., `col-sm-4` applies to small, medium, large, and extra large devices).
  64141. * - Grids can easily be customized via Sass variables. See [customizing the grid](#customizing-the-grid).
  64142. *
  64143. * There are some [known bugs with flexbox](https://github.com/philipwalton/flexbugs) that
  64144. * should be checked prior to creating issues with Ionic.
  64145. *
  64146. * ## Grid size
  64147. *
  64148. * By default, the grid will take up 100% width. To set a maximum width based on the screen
  64149. * size add the `fixed` attribute. The maximum width of the grid for each breakpoint is defined
  64150. * in the `$grid-max-widths` Sass variable. For more information, see
  64151. * [customizing the grid](#customizing-the-grid).
  64152. *
  64153. * | Name | Value | Description |
  64154. * |----------|----------|-----------------------------------------------------|
  64155. * | xs | auto | Don't set the grid width for xs screens |
  64156. * | sm | 540px | Set grid width to 540px when (min-width: 576px) |
  64157. * | md | 720px | Set grid width to 720px when (min-width: 768px) |
  64158. * | lg | 960px | Set grid width to 960px when (min-width: 992px) |
  64159. * | xl | 1140px | Set grid width to 1140px when (min-width: 1200px) |
  64160. *
  64161. *
  64162. * ## Grid attributes
  64163. *
  64164. * The grid takes up full width and has padding added to it based on the screen size. There are two
  64165. * attributes that can be used to adjust this behavior.
  64166. *
  64167. * | Property | Description |
  64168. * |-----------------|-------------------------------------------------------------------------------------------------------------------|
  64169. * | no-padding | Removes padding from the grid and immediate children columns. |
  64170. * | fixed | Set a max width based on the screen size. |
  64171. *
  64172. *
  64173. * ## Default breakpoints
  64174. *
  64175. * The default breakpoints are defined by the `$grid-breakpoints` Sass variable. It can be
  64176. * customized to use different values for the breakpoint, rename and add/remove breakpoints.
  64177. * For more information, see [customizing the grid](#customizing-the-grid).
  64178. *
  64179. * | Name | Value | Width Prefix | Offset Prefix | Push Prefix | Pull Prefix | Description |
  64180. * |----------|----------|--------------|---------------|--------------|-------------|---------------------------------------------------|
  64181. * | xs | 0 | `col-` | `offset-` | `push-` | `pull-` | Set columns when (min-width: 0) |
  64182. * | sm | 576px | `col-sm-` | `offset-sm-` | `push-sm-` | `pull-sm-` | Set columns when (min-width: 576px) |
  64183. * | md | 768px | `col-md-` | `offset-md-` | `push-md-` | `pull-md-` | Set columns when (min-width: 768px) |
  64184. * | lg | 992px | `col-lg-` | `offset-lg-` | `push-lg-` | `pull-lg-` | Set columns when (min-width: 992px) |
  64185. * | xl | 1200px | `col-xl-` | `offset-xl-` | `push-xl-` | `pull-xl-` | Set columns when (min-width: 1200px) |
  64186. *
  64187. * _Note: the first breakpoint must have the value set to 0 and all breakpoint values must be in
  64188. * ascending order._
  64189. *
  64190. * ## Auto-layout columns
  64191. *
  64192. * ### Equal-width
  64193. *
  64194. * By default, columns will take up equal width inside of a row for all devices and screen sizes.
  64195. *
  64196. * ```
  64197. * <ion-grid>
  64198. * <ion-row>
  64199. * <ion-col>
  64200. * 1 of 2
  64201. * </ion-col>
  64202. * <ion-col>
  64203. * 2 of 2
  64204. * </ion-col>
  64205. * </ion-row>
  64206. * <ion-row>
  64207. * <ion-col>
  64208. * 1 of 3
  64209. * </ion-col>
  64210. * <ion-col>
  64211. * 2 of 3
  64212. * </ion-col>
  64213. * <ion-col>
  64214. * 3 of 3
  64215. * </ion-col>
  64216. * </ion-row>
  64217. * </ion-grid>
  64218. * ```
  64219. *
  64220. * ### Setting one column width
  64221. *
  64222. * Set the width of one column and the others will automatically resize around it.
  64223. * This can be done using our predefined grid attributes. In the example below,
  64224. * the other columns will resize no matter the width of the center column.
  64225. *
  64226. * ```
  64227. * <ion-grid>
  64228. * <ion-row>
  64229. * <ion-col>
  64230. * 1 of 3
  64231. * </ion-col>
  64232. * <ion-col col-8>
  64233. * 2 of 3 (wider)
  64234. * </ion-col>
  64235. * <ion-col>
  64236. * 3 of 3
  64237. * </ion-col>
  64238. * </ion-row>
  64239. * <ion-row>
  64240. * <ion-col>
  64241. * 1 of 3
  64242. * </ion-col>
  64243. * <ion-col col-6>
  64244. * 2 of 3 (wider)
  64245. * </ion-col>
  64246. * <ion-col>
  64247. * 3 of 3
  64248. * </ion-col>
  64249. * </ion-row>
  64250. * </ion-grid>
  64251. * ```
  64252. *
  64253. * ### Variable-width
  64254. *
  64255. * Using the `col-{breakpoint}-auto` attributes, the column can size itself based on the
  64256. * natural width of its content. This is extremely useful for setting a column width
  64257. * using pixels. The columns next to the variable-width column will resize to fill the row.
  64258. *
  64259. * ```
  64260. * <ion-grid>
  64261. * <ion-row>
  64262. * <ion-col>
  64263. * 1 of 3
  64264. * </ion-col>
  64265. * <ion-col col-auto>
  64266. * Variable width content
  64267. * </ion-col>
  64268. * <ion-col>
  64269. * 3 of 3
  64270. * </ion-col>
  64271. * </ion-row>
  64272. * <ion-row>
  64273. * <ion-col>
  64274. * 1 of 4
  64275. * </ion-col>
  64276. * <ion-col>
  64277. * 2 of 4
  64278. * </ion-col>
  64279. * <ion-col col-auto>
  64280. * <ion-input placeholder="Variable width input"></ion-input>
  64281. * </ion-col>
  64282. * <ion-col>
  64283. * 4 of 4
  64284. * </ion-col>
  64285. * </ion-row>
  64286. * </ion-grid>
  64287. * ```
  64288. *
  64289. *
  64290. * ## Responsive attributes
  64291. *
  64292. * ### All breakpoints
  64293. *
  64294. * To customize a column's width for all devices and screens, add the `col-*`
  64295. * attribute. These attributes tell the column to take up `*` columns out
  64296. * of the available columns.
  64297. *
  64298. * ```
  64299. * <ion-grid>
  64300. * <ion-row>
  64301. * <ion-col col-4>
  64302. * 1 of 4
  64303. * </ion-col>
  64304. * <ion-col col-2>
  64305. * 2 of 4
  64306. * </ion-col>
  64307. * <ion-col col-2>
  64308. * 3 of 4
  64309. * </ion-col>
  64310. * <ion-col col-4>
  64311. * 4 of 4
  64312. * </ion-col>
  64313. * </ion-row>
  64314. * </ion-grid>
  64315. * ```
  64316. *
  64317. * ### Stacked to horizontal
  64318. *
  64319. * Use a combination of width and breakpoint attributes to create a grid that starts out stacked
  64320. * on extra small screens before becoming horizontal on small screens.
  64321. *
  64322. * ```
  64323. * <ion-grid>
  64324. * <ion-row>
  64325. * <ion-col col-12 col-sm>
  64326. * 1 of 4
  64327. * </ion-col>
  64328. * <ion-col col-12 col-sm>
  64329. * 2 of 4
  64330. * </ion-col>
  64331. * <ion-col col-12 col-sm>
  64332. * 3 of 4
  64333. * </ion-col>
  64334. * <ion-col col-12 col-sm>
  64335. * 4 of 4
  64336. * </ion-col>
  64337. * </ion-row>
  64338. * </ion-grid>
  64339. * ```
  64340. *
  64341. *
  64342. * ## Reordering
  64343. *
  64344. * ### Offsetting columns
  64345. *
  64346. * Move columns to the right by adding the `offset-*` attributes. These attributes
  64347. * increase the margin start of the column by `*` columns. For example, in the following
  64348. * grid the last column will be offset by 3 columns and take up 3 columns:
  64349. *
  64350. * ```
  64351. * <ion-grid>
  64352. * <ion-row>
  64353. * <ion-col col-3>
  64354. * 1 of 2
  64355. * </ion-col>
  64356. * <ion-col col-3 offset-3>
  64357. * 2 of 2
  64358. * </ion-col>
  64359. * </ion-row>
  64360. * </ion-grid>
  64361. * ```
  64362. *
  64363. * Offsets can also be added based on screen breakpoints. Here's an example of a
  64364. * grid where the last column will be offset by 3 columns for `md` screens and up:
  64365. *
  64366. * ```
  64367. * <ion-grid>
  64368. * <ion-row>
  64369. * <ion-col col-md-3>
  64370. * 1 of 3
  64371. * </ion-col>
  64372. * <ion-col col-md-3>
  64373. * 2 of 3
  64374. * </ion-col>
  64375. * <ion-col col-md-3 offset-md-3>
  64376. * 3 of 3
  64377. * </ion-col>
  64378. * </ion-row>
  64379. * </ion-grid>
  64380. * ```
  64381. *
  64382. * ### Push and pull
  64383. *
  64384. * Reorder the columns by adding the `push-*` and `pull-*` attributes. These attributes
  64385. * adjust the `left` and `right` of the columns by `*` columns making it easy to reorder
  64386. * columns. For example, in the following grid the column with the `1st col` description
  64387. * will actually be the last column and the `2nd col` will be the first column.
  64388. *
  64389. * ```
  64390. * <ion-grid>
  64391. * <ion-row>
  64392. * <ion-col col-9 push-3>
  64393. * 1 of 2
  64394. * </ion-col>
  64395. * <ion-col col-3 pull-9>
  64396. * 2 of 2
  64397. * </ion-col>
  64398. * </ion-row>
  64399. * </ion-grid>
  64400. * ```
  64401. *
  64402. * Push and pull can also be added based on screen breakpoints. In the following example,
  64403. * the column with the `3rd` column description will actually be the first column for
  64404. * `md` screens and up:
  64405. *
  64406. * ```
  64407. * <ion-grid>
  64408. * <ion-row>
  64409. * <ion-col col-md-6 push-md-3>
  64410. * 1 of 3
  64411. * </ion-col>
  64412. * <ion-col col-md-3 push-md-3>
  64413. * 2 of 3
  64414. * </ion-col>
  64415. * <ion-col col-md-3 pull-md-9>
  64416. * 3 of 3
  64417. * </ion-col>
  64418. * </ion-row>
  64419. * </ion-grid>
  64420. * ```
  64421. *
  64422. *
  64423. * ## Alignment
  64424. *
  64425. * ### Vertical alignment
  64426. *
  64427. * All columns can be vertically aligned inside of a row by adding different
  64428. * attributes to the row. For a list of available attributes, see
  64429. * [row attributes](../Row#row-attributes).
  64430. *
  64431. * ```
  64432. * <ion-grid>
  64433. * <ion-row align-items-start>
  64434. * <ion-col>
  64435. * 1 of 4
  64436. * </ion-col>
  64437. * <ion-col>
  64438. * 2 of 4
  64439. * </ion-col>
  64440. * <ion-col>
  64441. * 3 of 4
  64442. * </ion-col>
  64443. * <ion-col>
  64444. * 4 of 4 <br>#<br>#<br>#
  64445. * </ion-col>
  64446. * </ion-row>
  64447. *
  64448. * <ion-row align-items-center>
  64449. * <ion-col>
  64450. * 1 of 4
  64451. * </ion-col>
  64452. * <ion-col>
  64453. * 2 of 4
  64454. * </ion-col>
  64455. * <ion-col>
  64456. * 3 of 4
  64457. * </ion-col>
  64458. * <ion-col>
  64459. * 4 of 4 <br>#<br>#<br>#
  64460. * </ion-col>
  64461. * </ion-row>
  64462. *
  64463. * <ion-row align-items-end>
  64464. * <ion-col>
  64465. * 1 of 4
  64466. * </ion-col>
  64467. * <ion-col>
  64468. * 2 of 4
  64469. * </ion-col>
  64470. * <ion-col>
  64471. * 3 of 4
  64472. * </ion-col>
  64473. * <ion-col>
  64474. * 4 of 4 <br>#<br>#<br>#
  64475. * </ion-col>
  64476. * </ion-row>
  64477. * </ion-grid>
  64478. * ```
  64479. *
  64480. * Columns can also align themselves differently than other columns by
  64481. * adding the alignment attribute directly to the column. For a list of available
  64482. * attributes, see [column attributes](../Col#column-attributes).
  64483. *
  64484. * ```
  64485. * <ion-grid>
  64486. * <ion-row>
  64487. * <ion-col align-self-start>
  64488. * <div>
  64489. * 1 of 4
  64490. * </div>
  64491. * </ion-col>
  64492. * <ion-col align-self-center>
  64493. * <div>
  64494. * 2 of 4
  64495. * </div>
  64496. * </ion-col>
  64497. * <ion-col align-self-end>
  64498. * <div>
  64499. * 3 of 4
  64500. * </div>
  64501. * </ion-col>
  64502. * <ion-col>
  64503. * <div>
  64504. * 4 of 4 <br>#<br>#<br>#
  64505. * </div>
  64506. * </ion-col>
  64507. * </ion-row>
  64508. * </ion-grid>
  64509. * ```
  64510. *
  64511. * ### Horizontal alignment
  64512. *
  64513. * All columns can be horizontally aligned inside of a row by adding different
  64514. * attributes to the row. For a list of available attributes, see
  64515. * [row attributes](../Row#row-attributes).
  64516. *
  64517. * ```
  64518. * <ion-grid>
  64519. * <ion-row justify-content-start>
  64520. * <ion-col col-3>
  64521. * 1 of 2
  64522. * </ion-col>
  64523. * <ion-col col-3>
  64524. * 2 of 2
  64525. * </ion-col>
  64526. * </ion-row>
  64527. *
  64528. * <ion-row justify-content-center>
  64529. * <ion-col col-3>
  64530. * 1 of 2
  64531. * </ion-col>
  64532. * <ion-col col-3>
  64533. * 2 of 2
  64534. * </ion-col>
  64535. * </ion-row>
  64536. *
  64537. * <ion-row justify-content-end>
  64538. * <ion-col col-3>
  64539. * 1 of 2
  64540. * </ion-col>
  64541. * <ion-col col-3>
  64542. * 2 of 2
  64543. * </ion-col>
  64544. * </ion-row>
  64545. *
  64546. * <ion-row justify-content-around>
  64547. * <ion-col col-3>
  64548. * 1 of 2
  64549. * </ion-col>
  64550. * <ion-col col-3>
  64551. * 2 of 2
  64552. * </ion-col>
  64553. * </ion-row>
  64554. *
  64555. * <ion-row justify-content-between>
  64556. * <ion-col col-3>
  64557. * 1 of 2
  64558. * </ion-col>
  64559. * <ion-col col-3>
  64560. * 2 of 2
  64561. * </ion-col>
  64562. * </ion-row>
  64563. * </ion-grid>
  64564. * ```
  64565. *
  64566. *
  64567. * ## Customizing the grid
  64568. *
  64569. * Using our built-in grid Sass variables and maps, it’s possible to completely customize
  64570. * the predefined grid attributes. Change the number of breakpoints, the media query values,
  64571. * the number of columns, and more.
  64572. *
  64573. * ### Number of columns and padding
  64574. *
  64575. * The number of grid columns and their padding can be modified via Sass variables.
  64576. * `$grid-columns` is used to generate the widths (in percent) of each individual column.
  64577. * `$grid-padding-width` is used for the padding on the grid, while `$grid-padding-widths`
  64578. * allows breakpoint-specific widths that are divided evenly across `padding-left` and
  64579. * `padding-right` as well as `padding-top` and `padding-bottom` of the grid and columns.
  64580. *
  64581. * ```
  64582. * $grid-columns: 12 !default;
  64583. *
  64584. * $grid-padding-width: 10px !default;
  64585. *
  64586. * $grid-padding-widths: (
  64587. * xs: $grid-padding-width,
  64588. * sm: $grid-padding-width,
  64589. * md: $grid-padding-width,
  64590. * lg: $grid-padding-width,
  64591. * xl: $grid-padding-width
  64592. * ) !default;
  64593. * ```
  64594. *
  64595. * ### Grid tiers
  64596. *
  64597. * To customize the breakpoints and their values, override the values of
  64598. * `$grid-breakpoints` and `$grid-max-widths`. For example, to only use
  64599. * 3 breakpoints, the following could be written:
  64600. *
  64601. * ```
  64602. * $grid-breakpoints: (
  64603. * sm: 0,
  64604. * md: 768px,
  64605. * lg: 1024px
  64606. * );
  64607. *
  64608. * $grid-max-widths: (
  64609. * sm: 420px,
  64610. * md: 720px,
  64611. * lg: 960px
  64612. * );
  64613. * ```
  64614. *
  64615. */
  64616. var Grid = (function () {
  64617. function Grid() {
  64618. }
  64619. Grid.decorators = [
  64620. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  64621. selector: 'ion-grid, [ion-grid]',
  64622. host: {
  64623. 'class': 'grid'
  64624. }
  64625. },] },
  64626. ];
  64627. /** @nocollapse */
  64628. Grid.ctorParameters = function () { return []; };
  64629. return Grid;
  64630. }());
  64631. //# sourceMappingURL=grid.js.map
  64632. /***/ }),
  64633. /* 137 */
  64634. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64635. "use strict";
  64636. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Row; });
  64637. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  64638. /**
  64639. * @name Row
  64640. * @module ionic
  64641. * @description
  64642. *
  64643. * Rows are horizontal components of the [grid](../Grid) system and contain varying numbers of
  64644. * [columns](../Col). They ensure the columns are positioned properly.
  64645. *
  64646. * ## Row attributes
  64647. *
  64648. * By default, columns will stretch to fill the entire height of the row and wrap when necessary.
  64649. * There are several attributes that can be added to a row to customize this behavior.
  64650. *
  64651. * | Property | Description |
  64652. * |-----------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|
  64653. * | nowrap | Adds `flex-wrap: nowrap`. Forces the columns to a single row. |
  64654. * | wrap-reverse | Adds `flex-wrap: wrap-reverse`. The columns will wrap in reverse. |
  64655. * | align-items-start | Adds `align-items: flex-start`. All columns will be vertically aligned at the top, unless they specify their own alignment. |
  64656. * | align-items-center | Adds `align-items: center`. All columns will be vertically aligned in the center, unless they specify their own alignment. |
  64657. * | align-items-end | Adds `align-items: flex-end`. All columns will be vertically aligned at the bottom, unless they specify their own alignment. |
  64658. * | align-items-stretch | Adds `align-items: stretch`. All columns will be stretched to take up the entire height of the row, unless they specify their own alignment. |
  64659. * | align-items-baseline | Adds `align-items: baseline`. All columns will be vertically aligned at their baselines, unless they specify their own alignment. |
  64660. * | justify-content-start | Adds `justify-content: start`. All columns will be horizontally aligned at the start. |
  64661. * | justify-content-center | Adds `justify-content: center`. All columns will be horizontally aligned at the center. |
  64662. * | justify-content-end | Adds `justify-content: end`. All columns will be horizontally aligned at the end. |
  64663. * | justify-content-around | Adds `justify-content: space-around`. All columns will be horizontally aligned with equal space around them. |
  64664. * | justify-content-between | Adds `justify-content: space-between`. All columns will be horizontally aligned with a half-size space on either end. |
  64665. *
  64666. *
  64667. */
  64668. var Row = (function () {
  64669. function Row() {
  64670. }
  64671. Row.decorators = [
  64672. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  64673. selector: 'ion-row, [ion-row]',
  64674. host: {
  64675. 'class': 'row'
  64676. }
  64677. },] },
  64678. ];
  64679. /** @nocollapse */
  64680. Row.ctorParameters = function () { return []; };
  64681. return Row;
  64682. }());
  64683. //# sourceMappingURL=row.js.map
  64684. /***/ }),
  64685. /* 138 */
  64686. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64687. "use strict";
  64688. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Img; });
  64689. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  64690. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__content_content__ = __webpack_require__(19);
  64691. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__platform_dom_controller__ = __webpack_require__(8);
  64692. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_util__ = __webpack_require__(2);
  64693. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__platform_platform__ = __webpack_require__(3);
  64694. /**
  64695. * @name Img
  64696. * @description
  64697. * Two of the biggest cuprits of scroll jank is starting up a new HTTP
  64698. * request, and rendering images. These two reasons is largely why
  64699. * `ion-img` was created. The standard HTML `img` element is often a large
  64700. * source of these problems, and what makes matters worse is that the app
  64701. * does not have fine-grained control of requests and rendering for each
  64702. * `img` element.
  64703. *
  64704. * The `ion-img` component is similar to the standard `img` element,
  64705. * but it also adds features in order to provide improved performance.
  64706. * Features include only loading images which are visible, using web workers
  64707. * for HTTP requests, preventing jank while scrolling and in-memory caching.
  64708. *
  64709. * Note that `ion-img` also comes with a few more restrictions in comparison
  64710. * to the standard `img` element. A good rule is, if there are only a few
  64711. * images to be rendered on a page, then the standard `img` is probably
  64712. * best. However, if a page has the potential for hundreds or even thousands
  64713. * of images within a scrollable area, then `ion-img` would be better suited
  64714. * for the job.
  64715. *
  64716. * > Note: `ion-img` is only meant to be used inside of [virtual-scroll](/docs/api/components/virtual-scroll/VirtualScroll/)
  64717. *
  64718. *
  64719. * ### Lazy Loading
  64720. *
  64721. * Lazy loading images refers to only loading images which are actually
  64722. * visible within the user's viewport. This also means that images which are
  64723. * not viewable on the initial load would not be downloaded or rendered. Next,
  64724. * as the user scrolls, each image which becomes visible is then requested
  64725. * then rendered on-demand.
  64726. *
  64727. * The benefits of this approach is that unnecessary and resource intensive
  64728. * HTTP requests are not started, valuable bandwidth isn't wasted, and this
  64729. * allows the browser to free up resources which would be wasted on images
  64730. * which are not even viewable. For example, animated GIFs are enourmous
  64731. * performance drains, however, with `ion-img` the app is able to dedicate
  64732. * resources to just the viewable images. But again, if the problems listed
  64733. * above are not problems within your app, then the standard `img` element
  64734. * may be best.
  64735. *
  64736. *
  64737. * ### Image Dimensions
  64738. *
  64739. * By providing image dimensions up front, Ionic is able to accurately size
  64740. * up the image's location within the viewport, which helps lazy load only
  64741. * images which are viewable. Image dimensions can either by set as
  64742. * properties, inline styles, or external stylesheets. It doesn't matter
  64743. * which method of setting dimensions is used, but it's important that somehow
  64744. * each `ion-img` has been given an exact size.
  64745. *
  64746. * For example, by default `<ion-avatar>` and `<ion-thumbnail>` already come
  64747. * with exact sizes when placed within an `<ion-item>`. By giving each image
  64748. * an exact size, this then further locks in the size of each `ion-item`,
  64749. * which again helps improve scroll performance.
  64750. *
  64751. * ```html
  64752. * <!-- dimensions set using attributes -->
  64753. * <ion-img width="80" height="80" src="..."></ion-img>
  64754. *
  64755. * <!-- dimensions set using input properties -->
  64756. * <ion-img [width]="imgWidth" [height]="imgHeight" src="..."></ion-img>
  64757. *
  64758. * <!-- dimensions set using inline styles -->
  64759. * <ion-img style="width: 80px; height: 80px;" src="..."></ion-img>
  64760. * ```
  64761. *
  64762. * Additionally, each `ion-img` uses the `object-fit: cover` CSS property.
  64763. * What this means is that the actual rendered image will center itself within
  64764. * it's container. Or to really get detailed: The image is sized to maintain
  64765. * its aspect ratio while filling the containing element’s entire content box.
  64766. * Its concrete object size is resolved as a cover constraint against the
  64767. * element’s used width and height.
  64768. *
  64769. * ### Future Optimizations
  64770. *
  64771. * Future goals are to place image requests within web workers, and cache
  64772. * images in-memory as datauris. This method has proven to be effective,
  64773. * however there are some current limitations with Cordova which we are
  64774. * currently working on.
  64775. *
  64776. */
  64777. var Img = (function () {
  64778. function Img(_elementRef, _renderer, _plt, _content, _dom) {
  64779. this._elementRef = _elementRef;
  64780. this._renderer = _renderer;
  64781. this._plt = _plt;
  64782. this._content = _content;
  64783. this._dom = _dom;
  64784. /** @internal */
  64785. this._cache = true;
  64786. /** @internal */
  64787. this._w = '';
  64788. /** @internal */
  64789. this._h = '';
  64790. /** @internal */
  64791. this._wQ = '';
  64792. /** @internal */
  64793. this._hQ = '';
  64794. /**
  64795. * @input {string} Set the `alt` attribute which gets assigned to
  64796. * the inner `img` element.
  64797. */
  64798. this.alt = '';
  64799. if (!this._content) {
  64800. console.warn("ion-img can only be used within an ion-content");
  64801. }
  64802. else {
  64803. this._content.addImg(this);
  64804. }
  64805. this._isLoaded(false);
  64806. }
  64807. Object.defineProperty(Img.prototype, "src", {
  64808. /**
  64809. * @input {string} The source of the image.
  64810. */
  64811. get: function () {
  64812. return this._src;
  64813. },
  64814. set: function (newSrc) {
  64815. // if the source hasn't changed, then um, let's not change it
  64816. if (newSrc !== this._src) {
  64817. // we're changing the source
  64818. // so abort any active http requests
  64819. // and render the image empty
  64820. this.reset();
  64821. // update to the new src
  64822. this._src = newSrc;
  64823. // Are they using an actual datauri already,
  64824. // or reset any existing datauri we might be holding onto
  64825. this._hasLoaded = newSrc.indexOf('data:') === 0;
  64826. // run update to kick off requests or render if everything is good
  64827. this.update();
  64828. }
  64829. },
  64830. enumerable: true,
  64831. configurable: true
  64832. });
  64833. /**
  64834. * @hidden
  64835. */
  64836. Img.prototype.reset = function () {
  64837. if (this._requestingSrc) {
  64838. // abort any active requests
  64839. (void 0) /* console.debug */;
  64840. this._srcAttr('');
  64841. this._requestingSrc = null;
  64842. }
  64843. if (this._renderedSrc) {
  64844. // clear out the currently rendered img
  64845. (void 0) /* console.debug */;
  64846. this._renderedSrc = null;
  64847. this._isLoaded(false);
  64848. }
  64849. };
  64850. /**
  64851. * @hidden
  64852. */
  64853. Img.prototype.update = function () {
  64854. var _this = this;
  64855. // only attempt an update if there is an active src
  64856. // and the content containing the image considers it updatable
  64857. if (this._src && this._content.isImgsUpdatable()) {
  64858. if (this.canRequest && (this._src !== this._renderedSrc && this._src !== this._requestingSrc) && !this._hasLoaded) {
  64859. // only begin the request if we "can" request
  64860. // begin the image request if the src is different from the rendered src
  64861. // and if we don't already has a tmpDataUri
  64862. (void 0) /* console.debug */;
  64863. this._requestingSrc = this._src;
  64864. this._isLoaded(false);
  64865. this._srcAttr(this._src);
  64866. // set the dimensions of the image if we do have different data
  64867. this._setDims();
  64868. }
  64869. if (this.canRender && this._hasLoaded && this._src !== this._renderedSrc) {
  64870. // we can render and we have a datauri to render
  64871. this._renderedSrc = this._src;
  64872. this._setDims();
  64873. this._dom.write(function () {
  64874. if (_this._hasLoaded) {
  64875. (void 0) /* console.debug */;
  64876. _this._isLoaded(true);
  64877. _this._srcAttr(_this._src);
  64878. }
  64879. });
  64880. }
  64881. }
  64882. };
  64883. /**
  64884. * @internal
  64885. */
  64886. Img.prototype._isLoaded = function (isLoaded) {
  64887. var renderer = this._renderer;
  64888. var ele = this._elementRef.nativeElement;
  64889. renderer.setElementClass(ele, 'img-loaded', isLoaded);
  64890. renderer.setElementClass(ele, 'img-unloaded', !isLoaded);
  64891. };
  64892. /**
  64893. * @internal
  64894. */
  64895. Img.prototype._srcAttr = function (srcAttr) {
  64896. var imgEle = this._img;
  64897. var renderer = this._renderer;
  64898. if (imgEle && imgEle.src !== srcAttr) {
  64899. renderer.setElementAttribute(this._img, 'src', srcAttr);
  64900. renderer.setElementAttribute(this._img, 'alt', this.alt);
  64901. }
  64902. };
  64903. Object.defineProperty(Img.prototype, "top", {
  64904. /**
  64905. * @hidden
  64906. */
  64907. get: function () {
  64908. var bounds = this._getBounds();
  64909. return bounds && bounds.top || 0;
  64910. },
  64911. enumerable: true,
  64912. configurable: true
  64913. });
  64914. Object.defineProperty(Img.prototype, "bottom", {
  64915. /**
  64916. * @hidden
  64917. */
  64918. get: function () {
  64919. var bounds = this._getBounds();
  64920. return bounds && bounds.bottom || 0;
  64921. },
  64922. enumerable: true,
  64923. configurable: true
  64924. });
  64925. Img.prototype._getBounds = function () {
  64926. if (this._bounds) {
  64927. // we've been manually passed bounds data
  64928. // this is probably from Virtual Scroll items
  64929. return this._bounds;
  64930. }
  64931. if (!this._rect) {
  64932. // we don't have bounds from virtual scroll
  64933. // so let's do the raw DOM lookup w/ getBoundingClientRect
  64934. this._rect = this._elementRef.nativeElement.getBoundingClientRect();
  64935. (void 0) /* console.debug */;
  64936. }
  64937. return this._rect;
  64938. };
  64939. Object.defineProperty(Img.prototype, "bounds", {
  64940. /**
  64941. * @input {any} Sets the bounding rectangle of the element relative to the viewport.
  64942. * When using `VirtualScroll`, each virtual item should pass its bounds to each
  64943. * `ion-img`. The passed in data object should include `top` and `bottom` properties.
  64944. */
  64945. set: function (b) {
  64946. if (Object(__WEBPACK_IMPORTED_MODULE_3__util_util__["l" /* isPresent */])(b)) {
  64947. this._bounds = b;
  64948. }
  64949. },
  64950. enumerable: true,
  64951. configurable: true
  64952. });
  64953. Object.defineProperty(Img.prototype, "cache", {
  64954. /**
  64955. * @input {boolean} After an image has been successfully downloaded, it can be cached
  64956. * in-memory. This is useful for `VirtualScroll` by allowing image responses to be
  64957. * cached, and not rendered, until after scrolling has completed, which allows for
  64958. * smoother scrolling.
  64959. */
  64960. get: function () {
  64961. return this._cache;
  64962. },
  64963. set: function (val) {
  64964. this._cache = Object(__WEBPACK_IMPORTED_MODULE_3__util_util__["o" /* isTrueProperty */])(val);
  64965. },
  64966. enumerable: true,
  64967. configurable: true
  64968. });
  64969. Object.defineProperty(Img.prototype, "width", {
  64970. /**
  64971. * @input {string} Image width. If this property is not set it's important that
  64972. * the dimensions are still set using CSS. If the dimension is just a number it
  64973. * will assume the `px` unit.
  64974. */
  64975. set: function (val) {
  64976. this._wQ = getUnitValue(val);
  64977. this._setDims();
  64978. },
  64979. enumerable: true,
  64980. configurable: true
  64981. });
  64982. Object.defineProperty(Img.prototype, "height", {
  64983. /**
  64984. * @input {string} Image height. If this property is not set it's important that
  64985. * the dimensions are still set using CSS. If the dimension is just a number it
  64986. * will assume the `px` unit.
  64987. */
  64988. set: function (val) {
  64989. this._hQ = getUnitValue(val);
  64990. this._setDims();
  64991. },
  64992. enumerable: true,
  64993. configurable: true
  64994. });
  64995. Img.prototype._setDims = function () {
  64996. var _this = this;
  64997. // only set the dimensions if we can render
  64998. // and only if the dimensions have changed from when we last set it
  64999. if (this.canRender && (this._w !== this._wQ || this._h !== this._hQ)) {
  65000. var wrapperEle = this._elementRef.nativeElement;
  65001. var renderer = this._renderer;
  65002. this._dom.write(function () {
  65003. if (_this._w !== _this._wQ) {
  65004. _this._w = _this._wQ;
  65005. renderer.setElementStyle(wrapperEle, 'width', _this._w);
  65006. }
  65007. if (_this._h !== _this._hQ) {
  65008. _this._h = _this._hQ;
  65009. renderer.setElementStyle(wrapperEle, 'height', _this._h);
  65010. }
  65011. });
  65012. }
  65013. };
  65014. /**
  65015. * @hidden
  65016. */
  65017. Img.prototype.ngAfterContentInit = function () {
  65018. var _this = this;
  65019. this._img = this._elementRef.nativeElement.firstChild;
  65020. this._unreg = this._plt.registerListener(this._img, 'load', function () {
  65021. _this._hasLoaded = true;
  65022. _this.update();
  65023. }, { passive: true });
  65024. };
  65025. /**
  65026. * @hidden
  65027. */
  65028. Img.prototype.ngOnDestroy = function () {
  65029. this._unreg && this._unreg();
  65030. this._content && this._content.removeImg(this);
  65031. };
  65032. Img.decorators = [
  65033. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  65034. selector: 'ion-img',
  65035. template: '<img>',
  65036. changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["i" /* ChangeDetectionStrategy */].OnPush,
  65037. encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_11" /* ViewEncapsulation */].None,
  65038. },] },
  65039. ];
  65040. /** @nocollapse */
  65041. Img.ctorParameters = function () { return [
  65042. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  65043. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  65044. { type: __WEBPACK_IMPORTED_MODULE_4__platform_platform__["a" /* Platform */], },
  65045. { type: __WEBPACK_IMPORTED_MODULE_1__content_content__["a" /* Content */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  65046. { type: __WEBPACK_IMPORTED_MODULE_2__platform_dom_controller__["a" /* DomController */], },
  65047. ]; };
  65048. Img.propDecorators = {
  65049. 'src': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  65050. 'bounds': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  65051. 'cache': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  65052. 'width': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  65053. 'height': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  65054. 'alt': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  65055. };
  65056. return Img;
  65057. }());
  65058. function getUnitValue(val) {
  65059. if (Object(__WEBPACK_IMPORTED_MODULE_3__util_util__["l" /* isPresent */])(val)) {
  65060. if (typeof val === 'string') {
  65061. if (val.indexOf('%') > -1 || val.indexOf('px') > -1) {
  65062. return val;
  65063. }
  65064. if (val.length) {
  65065. return val + 'px';
  65066. }
  65067. }
  65068. else if (typeof val === 'number') {
  65069. return val + 'px';
  65070. }
  65071. }
  65072. return '';
  65073. }
  65074. //# sourceMappingURL=img.js.map
  65075. /***/ }),
  65076. /* 139 */
  65077. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  65078. "use strict";
  65079. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return InfiniteScrollContent; });
  65080. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  65081. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__config_config__ = __webpack_require__(1);
  65082. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__infinite_scroll__ = __webpack_require__(69);
  65083. /**
  65084. * @hidden
  65085. */
  65086. var InfiniteScrollContent = (function () {
  65087. function InfiniteScrollContent(inf, _config) {
  65088. this.inf = inf;
  65089. this._config = _config;
  65090. }
  65091. /**
  65092. * @hidden
  65093. */
  65094. InfiniteScrollContent.prototype.ngOnInit = function () {
  65095. if (!this.loadingSpinner) {
  65096. this.loadingSpinner = this._config.get('infiniteLoadingSpinner', this._config.get('spinner', 'ios'));
  65097. }
  65098. };
  65099. InfiniteScrollContent.decorators = [
  65100. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  65101. selector: 'ion-infinite-scroll-content',
  65102. template: '<div class="infinite-loading">' +
  65103. '<div class="infinite-loading-spinner" *ngIf="loadingSpinner">' +
  65104. '<ion-spinner [name]="loadingSpinner"></ion-spinner>' +
  65105. '</div>' +
  65106. '<div class="infinite-loading-text" [innerHTML]="loadingText" *ngIf="loadingText"></div>' +
  65107. '</div>',
  65108. host: {
  65109. '[attr.state]': 'inf.state'
  65110. },
  65111. encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_11" /* ViewEncapsulation */].None,
  65112. },] },
  65113. ];
  65114. /** @nocollapse */
  65115. InfiniteScrollContent.ctorParameters = function () { return [
  65116. { type: __WEBPACK_IMPORTED_MODULE_2__infinite_scroll__["a" /* InfiniteScroll */], },
  65117. { type: __WEBPACK_IMPORTED_MODULE_1__config_config__["a" /* Config */], },
  65118. ]; };
  65119. InfiniteScrollContent.propDecorators = {
  65120. 'loadingSpinner': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  65121. 'loadingText': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  65122. };
  65123. return InfiniteScrollContent;
  65124. }());
  65125. //# sourceMappingURL=infinite-scroll-content.js.map
  65126. /***/ }),
  65127. /* 140 */
  65128. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  65129. "use strict";
  65130. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TextInput; });
  65131. /* unused harmony export getScrollData */
  65132. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  65133. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_forms__ = __webpack_require__(15);
  65134. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Subject__ = __webpack_require__(33);
  65135. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Subject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_Subject__);
  65136. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_takeUntil__ = __webpack_require__(141);
  65137. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_takeUntil___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_add_operator_takeUntil__);
  65138. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__app_app__ = __webpack_require__(6);
  65139. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__config_config__ = __webpack_require__(1);
  65140. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__content_content__ = __webpack_require__(19);
  65141. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__util_dom__ = __webpack_require__(10);
  65142. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__platform_dom_controller__ = __webpack_require__(8);
  65143. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__util_form__ = __webpack_require__(16);
  65144. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__util_base_input__ = __webpack_require__(24);
  65145. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__util_util__ = __webpack_require__(2);
  65146. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__item_item__ = __webpack_require__(17);
  65147. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__platform_platform__ = __webpack_require__(3);
  65148. var __extends = (this && this.__extends) || (function () {
  65149. var extendStatics = Object.setPrototypeOf ||
  65150. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  65151. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  65152. return function (d, b) {
  65153. extendStatics(d, b);
  65154. function __() { this.constructor = d; }
  65155. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  65156. };
  65157. })();
  65158. /**
  65159. * @name Input
  65160. * @description
  65161. *
  65162. * `ion-input` is meant for text type inputs only, such as `text`,
  65163. * `password`, `email`, `number`, `search`, `tel`, and `url`. Ionic
  65164. * still uses an actual `<input type="text">` HTML element within the
  65165. * component, however, with Ionic wrapping the native HTML input
  65166. * element it's better able to handle the user experience and
  65167. * interactivity.
  65168. *
  65169. * Similarly, `<ion-textarea>` should be used in place of `<textarea>`.
  65170. *
  65171. * An `ion-input` is **not** used for non-text type inputs, such as a
  65172. * `checkbox`, `radio`, `toggle`, `range`, `select`, etc.
  65173. *
  65174. * Along with the blur/focus events, `input` support all standard text input
  65175. * events like `keyup`, `keydown`, `keypress`, `input`,etc. Any standard event
  65176. * can be attached and will function as expected.
  65177. *
  65178. * @usage
  65179. * ```html
  65180. * <ion-list>
  65181. * <ion-item>
  65182. * <ion-label color="primary">Inline Label</ion-label>
  65183. * <ion-input placeholder="Text Input"></ion-input>
  65184. * </ion-item>
  65185. *
  65186. * <ion-item>
  65187. * <ion-label color="primary" fixed>Fixed Label</ion-label>
  65188. * <ion-input type="tel" placeholder="Tel Input"></ion-input>
  65189. * </ion-item>
  65190. *
  65191. * <ion-item>
  65192. * <ion-input type="number" placeholder="Number Input with no label"></ion-input>
  65193. * </ion-item>
  65194. *
  65195. * <ion-item>
  65196. * <ion-label color="primary" stacked>Stacked Label</ion-label>
  65197. * <ion-input type="email" placeholder="Email Input"></ion-input>
  65198. * </ion-item>
  65199. *
  65200. * <ion-item>
  65201. * <ion-label color="primary" stacked>Stacked Label</ion-label>
  65202. * <ion-input type="password" placeholder="Password Input"></ion-input>
  65203. * </ion-item>
  65204. *
  65205. * <ion-item>
  65206. * <ion-label color="primary" floating>Floating Label</ion-label>
  65207. * <ion-input></ion-input>
  65208. * </ion-item>
  65209. *
  65210. * <ion-item>
  65211. * <ion-input placeholder="Clear Input" clearInput></ion-input>
  65212. * </ion-item>
  65213. *
  65214. * <ion-item>
  65215. * <ion-textarea placeholder="Enter a description"></ion-textarea>
  65216. * </ion-item>
  65217. * </ion-list>
  65218. * ```
  65219. *
  65220. * @demo /docs/demos/src/input/
  65221. */
  65222. var TextInput = (function (_super) {
  65223. __extends(TextInput, _super);
  65224. function TextInput(config, _plt, _form, _app, elementRef, renderer, _content, _item, ngControl, _dom) {
  65225. var _this = _super.call(this, config, elementRef, renderer, 'input', '', _form, _item, ngControl) || this;
  65226. _this._plt = _plt;
  65227. _this._app = _app;
  65228. _this._content = _content;
  65229. _this.ngControl = ngControl;
  65230. _this._dom = _dom;
  65231. _this._clearInput = false;
  65232. _this._readonly = false;
  65233. _this._type = 'text';
  65234. _this._isTextarea = false;
  65235. _this._onDestroy = new __WEBPACK_IMPORTED_MODULE_2_rxjs_Subject__["Subject"]();
  65236. _this._useAssist = false;
  65237. _this._relocated = false;
  65238. /**
  65239. * @input {string} Set the input's autocomplete property. Values: `"on"`, `"off"`. Default `"off"`.
  65240. */
  65241. _this.autocomplete = '';
  65242. /**
  65243. * @input {string} Set the input's autocorrect property. Values: `"on"`, `"off"`. Default `"off"`.
  65244. */
  65245. _this.autocorrect = '';
  65246. /**
  65247. * @input {string} Instructional text that shows before the input has a value.
  65248. */
  65249. _this.placeholder = '';
  65250. /**
  65251. * @input {any} The minimum value, which must not be greater than its maximum (max attribute) value.
  65252. */
  65253. _this.min = null;
  65254. /**
  65255. * @input {any} The maximum value, which must not be less than its minimum (min attribute) value.
  65256. */
  65257. _this.max = null;
  65258. /**
  65259. * @input {any} Works with the min and max attributes to limit the increments at which a value can be set.
  65260. */
  65261. _this.step = null;
  65262. /**
  65263. * @hidden
  65264. */
  65265. _this.input = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  65266. /**
  65267. * @hidden
  65268. */
  65269. _this.blur = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  65270. /**
  65271. * @hidden
  65272. */
  65273. _this.focus = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  65274. _this.autocomplete = config.get('autocomplete', 'off');
  65275. _this.autocorrect = config.get('autocorrect', 'off');
  65276. _this._autoFocusAssist = config.get('autoFocusAssist', 'delay');
  65277. _this._keyboardHeight = config.getNumber('keyboardHeight');
  65278. _this._isTextarea = !!(elementRef.nativeElement.tagName === 'ION-TEXTAREA');
  65279. if (_this._isTextarea && _item) {
  65280. _item.setElementClass('item-textarea', true);
  65281. }
  65282. // If not inside content, let's disable all the hacks
  65283. if (!_content) {
  65284. return _this;
  65285. }
  65286. var hideCaretOnScroll = config.getBoolean('hideCaretOnScroll', false);
  65287. if (hideCaretOnScroll) {
  65288. _this._enableHideCaretOnScroll();
  65289. }
  65290. var win = _plt.win();
  65291. var keyboardPlugin = win.Ionic && win.Ionic.keyboardPlugin;
  65292. if (keyboardPlugin) {
  65293. var keyboardResizes = config.getBoolean('keyboardResizes', false);
  65294. if (keyboardResizes) {
  65295. _this._keyboardHeight = config.getNumber('keyboardSafeArea', 60);
  65296. _this._enableScrollMove();
  65297. }
  65298. else {
  65299. _this._enableScrollPadding();
  65300. _this._enableScrollMove();
  65301. }
  65302. }
  65303. else {
  65304. _this._useAssist = config.getBoolean('scrollAssist', false);
  65305. var usePadding = config.getBoolean('scrollPadding', _this._useAssist);
  65306. if (usePadding) {
  65307. _this._enableScrollPadding();
  65308. }
  65309. }
  65310. return _this;
  65311. }
  65312. Object.defineProperty(TextInput.prototype, "clearInput", {
  65313. /**
  65314. * @input {boolean} If true, a clear icon will appear in the input when there is a value. Clicking it clears the input.
  65315. */
  65316. get: function () {
  65317. return this._clearInput;
  65318. },
  65319. set: function (val) {
  65320. this._clearInput = (!this._isTextarea && Object(__WEBPACK_IMPORTED_MODULE_11__util_util__["o" /* isTrueProperty */])(val));
  65321. },
  65322. enumerable: true,
  65323. configurable: true
  65324. });
  65325. Object.defineProperty(TextInput.prototype, "type", {
  65326. /**
  65327. * @input {string} The type of control to display. The default type is text.
  65328. * Possible values are: `"text"`, `"password"`, `"email"`, `"number"`, `"search"`, `"tel"`, or `"url"`.
  65329. */
  65330. get: function () {
  65331. return (this._isTextarea)
  65332. ? 'text'
  65333. : this._type;
  65334. },
  65335. set: function (val) {
  65336. this._type = val;
  65337. },
  65338. enumerable: true,
  65339. configurable: true
  65340. });
  65341. Object.defineProperty(TextInput.prototype, "readonly", {
  65342. /**
  65343. * @input {boolean} If true, the user cannot modify the value.
  65344. */
  65345. get: function () {
  65346. return this._readonly;
  65347. },
  65348. set: function (val) {
  65349. this._readonly = Object(__WEBPACK_IMPORTED_MODULE_11__util_util__["o" /* isTrueProperty */])(val);
  65350. },
  65351. enumerable: true,
  65352. configurable: true
  65353. });
  65354. Object.defineProperty(TextInput.prototype, "clearOnEdit", {
  65355. /**
  65356. * @input {boolean} If true, the value will be cleared after focus upon edit.
  65357. * Defaults to `true` when `type` is `"password"`, `false` for all other types.
  65358. */
  65359. get: function () {
  65360. return this._clearOnEdit;
  65361. },
  65362. set: function (val) {
  65363. this._clearOnEdit = Object(__WEBPACK_IMPORTED_MODULE_11__util_util__["o" /* isTrueProperty */])(val);
  65364. },
  65365. enumerable: true,
  65366. configurable: true
  65367. });
  65368. TextInput.prototype.ngAfterContentInit = function () { };
  65369. /**
  65370. * @hidden
  65371. */
  65372. TextInput.prototype.ngAfterViewInit = function () {
  65373. (void 0) /* assert */;
  65374. // By default, password inputs clear after focus when they have content
  65375. if (this.clearOnEdit !== false && this.type === 'password') {
  65376. this.clearOnEdit = true;
  65377. }
  65378. var ionInputEle = this._elementRef.nativeElement;
  65379. var nativeInputEle = this._native.nativeElement;
  65380. // Copy remaining attributes, not handled by ionic/angular
  65381. Object(__WEBPACK_IMPORTED_MODULE_7__util_dom__["b" /* copyInputAttributes */])(ionInputEle, nativeInputEle);
  65382. // prevent having tabIndex duplicated
  65383. if (ionInputEle.hasAttribute('tabIndex')) {
  65384. ionInputEle.removeAttribute('tabIndex');
  65385. }
  65386. // handle the autofocus attribute
  65387. if (ionInputEle.hasAttribute('autofocus')) {
  65388. ionInputEle.removeAttribute('autofocus');
  65389. switch (this._autoFocusAssist) {
  65390. case 'immediate':
  65391. // config says to immediate focus on the input
  65392. // works best on android devices
  65393. nativeInputEle.focus();
  65394. break;
  65395. case 'delay':
  65396. // config says to chill out a bit and focus on the input after transitions
  65397. // works best on desktop
  65398. this._plt.timeout(function () { return nativeInputEle.focus(); }, 800);
  65399. break;
  65400. }
  65401. // traditionally iOS has big issues with autofocus on actual devices
  65402. // autoFocus is disabled by default with the iOS mode config
  65403. }
  65404. // Initialize the input (can start emitting events)
  65405. this._initialize();
  65406. if (this.focus.observers.length > 0) {
  65407. console.warn('(focus) is deprecated in ion-input, use (ionFocus) instead');
  65408. }
  65409. if (this.blur.observers.length > 0) {
  65410. console.warn('(blur) is deprecated in ion-input, use (ionBlur) instead');
  65411. }
  65412. };
  65413. /**
  65414. * @hidden
  65415. */
  65416. TextInput.prototype.ngOnDestroy = function () {
  65417. _super.prototype.ngOnDestroy.call(this);
  65418. this._onDestroy.next();
  65419. this._onDestroy = null;
  65420. };
  65421. /**
  65422. * @hidden
  65423. */
  65424. TextInput.prototype.initFocus = function () {
  65425. this.setFocus();
  65426. };
  65427. /**
  65428. * @hidden
  65429. */
  65430. TextInput.prototype.setFocus = function () {
  65431. // let's set focus to the element
  65432. // but only if it does not already have focus
  65433. if (!this.isFocus()) {
  65434. this._native.nativeElement.focus();
  65435. }
  65436. };
  65437. /**
  65438. * @hidden
  65439. */
  65440. TextInput.prototype.setBlur = function () {
  65441. if (this.isFocus()) {
  65442. this._native.nativeElement.blur();
  65443. }
  65444. };
  65445. /**
  65446. * @hidden
  65447. */
  65448. TextInput.prototype.onInput = function (ev) {
  65449. this.value = ev.target.value;
  65450. // TODO: deprecate this
  65451. this.input.emit(ev);
  65452. };
  65453. /**
  65454. * @hidden
  65455. */
  65456. TextInput.prototype.onBlur = function (ev) {
  65457. this._fireBlur();
  65458. // TODO: deprecate this (06/07/2017)
  65459. this.blur.emit(ev);
  65460. this._scrollData = null;
  65461. if (this._clearOnEdit && this.hasValue()) {
  65462. this._didBlurAfterEdit = true;
  65463. }
  65464. };
  65465. /**
  65466. * @hidden
  65467. */
  65468. TextInput.prototype.onFocus = function (ev) {
  65469. this._fireFocus();
  65470. // TODO: deprecate this (06/07/2017)
  65471. this.focus.emit(ev);
  65472. };
  65473. /**
  65474. * @hidden
  65475. */
  65476. TextInput.prototype.onKeydown = function (ev) {
  65477. if (ev && this._clearOnEdit) {
  65478. this.checkClearOnEdit(ev.target.value);
  65479. }
  65480. };
  65481. /**
  65482. * @hidden
  65483. */
  65484. TextInput.prototype._inputUpdated = function () {
  65485. _super.prototype._inputUpdated.call(this);
  65486. var inputEle = this._native.nativeElement;
  65487. var value = this._value;
  65488. if (inputEle.value !== value) {
  65489. inputEle.value = value;
  65490. }
  65491. };
  65492. /**
  65493. * @hidden
  65494. */
  65495. TextInput.prototype.clearTextInput = function () {
  65496. this.value = '';
  65497. };
  65498. /**
  65499. * Check if we need to clear the text input if clearOnEdit is enabled
  65500. * @hidden
  65501. */
  65502. TextInput.prototype.checkClearOnEdit = function (_) {
  65503. if (!this._clearOnEdit) {
  65504. return;
  65505. }
  65506. // Did the input value change after it was blurred and edited?
  65507. if (this._didBlurAfterEdit && this.hasValue()) {
  65508. // Clear the input
  65509. this.clearTextInput();
  65510. }
  65511. // Reset the flag
  65512. this._didBlurAfterEdit = false;
  65513. };
  65514. TextInput.prototype._getScrollData = function () {
  65515. if (!this._content) {
  65516. return newScrollData();
  65517. }
  65518. // get container of this input, probably an ion-item a few nodes up
  65519. if (this._scrollData) {
  65520. return this._scrollData;
  65521. }
  65522. var ele = this._elementRef.nativeElement;
  65523. ele = ele.closest('ion-item,[ion-item]') || ele;
  65524. return this._scrollData = getScrollData(ele.offsetTop, ele.offsetHeight, this._content.getContentDimensions(), this._keyboardHeight, this._plt.height());
  65525. };
  65526. TextInput.prototype._relocateInput = function (shouldRelocate) {
  65527. if (this._relocated === shouldRelocate) {
  65528. return;
  65529. }
  65530. var platform = this._plt;
  65531. var componentEle = this.getNativeElement();
  65532. var focusedInputEle = this._native.nativeElement;
  65533. (void 0) /* console.debug */;
  65534. if (shouldRelocate) {
  65535. // this allows for the actual input to receive the focus from
  65536. // the user's touch event, but before it receives focus, it
  65537. // moves the actual input to a location that will not screw
  65538. // up the app's layout, and does not allow the native browser
  65539. // to attempt to scroll the input into place (messing up headers/footers)
  65540. // the cloned input fills the area of where native input should be
  65541. // while the native input fakes out the browser by relocating itself
  65542. // before it receives the actual focus event
  65543. // We hide the focused input (with the visible caret) invisiable by making it scale(0),
  65544. cloneInputComponent(platform, componentEle, focusedInputEle);
  65545. var inputRelativeY = this._getScrollData().inputSafeY;
  65546. // fix for #11817
  65547. var tx = this._plt.isRTL ? 9999 : -9999;
  65548. focusedInputEle.style[platform.Css.transform] = "translate3d(" + tx + "px," + inputRelativeY + "px,0)";
  65549. focusedInputEle.style.opacity = '0';
  65550. }
  65551. else {
  65552. removeClone(platform, componentEle, focusedInputEle);
  65553. }
  65554. this._relocated = shouldRelocate;
  65555. };
  65556. TextInput.prototype._enableScrollPadding = function () {
  65557. var _this = this;
  65558. (void 0) /* assert */;
  65559. (void 0) /* console.debug */;
  65560. this.ionFocus.subscribe(function () {
  65561. var content = _this._content;
  65562. var scrollPadding = _this._getScrollData().scrollPadding;
  65563. content.addScrollPadding(scrollPadding);
  65564. content.clearScrollPaddingFocusOut();
  65565. });
  65566. };
  65567. TextInput.prototype._enableHideCaretOnScroll = function () {
  65568. var _this = this;
  65569. (void 0) /* assert */;
  65570. var content = this._content;
  65571. (void 0) /* console.debug */;
  65572. content.ionScrollStart
  65573. .takeUntil(this._onDestroy)
  65574. .subscribe(function () { return scrollHideCaret(true); });
  65575. content.ionScrollEnd
  65576. .takeUntil(this._onDestroy)
  65577. .subscribe(function () { return scrollHideCaret(false); });
  65578. this.ionBlur.subscribe(function () { return _this._relocateInput(false); });
  65579. var self = this;
  65580. function scrollHideCaret(shouldHideCaret) {
  65581. // if it does have focus, then do the dom write
  65582. if (self.isFocus()) {
  65583. self._dom.write(function () { return self._relocateInput(shouldHideCaret); });
  65584. }
  65585. }
  65586. };
  65587. TextInput.prototype._enableScrollMove = function () {
  65588. var _this = this;
  65589. (void 0) /* assert */;
  65590. (void 0) /* console.debug */;
  65591. this.ionFocus.subscribe(function () {
  65592. var scrollData = _this._getScrollData();
  65593. if (Math.abs(scrollData.scrollAmount) > 4) {
  65594. _this._content.scrollTo(0, scrollData.scrollTo, scrollData.scrollDuration);
  65595. }
  65596. });
  65597. };
  65598. TextInput.prototype._pointerStart = function (ev) {
  65599. (void 0) /* assert */;
  65600. // input cover touchstart
  65601. if (ev.type === 'touchstart') {
  65602. this._isTouch = true;
  65603. }
  65604. if ((this._isTouch || (!this._isTouch && ev.type === 'mousedown')) && this._app.isEnabled()) {
  65605. // remember where the touchstart/mousedown started
  65606. this._coord = Object(__WEBPACK_IMPORTED_MODULE_7__util_dom__["f" /* pointerCoord */])(ev);
  65607. }
  65608. (void 0) /* console.debug */;
  65609. };
  65610. TextInput.prototype._pointerEnd = function (ev) {
  65611. (void 0) /* assert */;
  65612. // input cover touchend/mouseup
  65613. (void 0) /* console.debug */;
  65614. if ((this._isTouch && ev.type === 'mouseup') || !this._app.isEnabled()) {
  65615. // the app is actively doing something right now
  65616. // don't try to scroll in the input
  65617. ev.preventDefault();
  65618. ev.stopPropagation();
  65619. }
  65620. else if (this._coord) {
  65621. // get where the touchend/mouseup ended
  65622. var endCoord = Object(__WEBPACK_IMPORTED_MODULE_7__util_dom__["f" /* pointerCoord */])(ev);
  65623. // focus this input if the pointer hasn't moved XX pixels
  65624. // and the input doesn't already have focus
  65625. if (!Object(__WEBPACK_IMPORTED_MODULE_7__util_dom__["d" /* hasPointerMoved */])(8, this._coord, endCoord) && !this.isFocus()) {
  65626. ev.preventDefault();
  65627. ev.stopPropagation();
  65628. // begin the input focus process
  65629. this._jsSetFocus();
  65630. }
  65631. }
  65632. this._coord = null;
  65633. };
  65634. TextInput.prototype._jsSetFocus = function () {
  65635. var _this = this;
  65636. (void 0) /* assert */;
  65637. // begin the process of setting focus to the inner input element
  65638. var content = this._content;
  65639. (void 0) /* console.debug */;
  65640. if (!content) {
  65641. // not inside of a scroll view, just focus it
  65642. this.setFocus();
  65643. }
  65644. var scrollData = this._getScrollData();
  65645. if (Math.abs(scrollData.scrollAmount) < 4) {
  65646. // the text input is in a safe position that doesn't
  65647. // require it to be scrolled into view, just set focus now
  65648. this.setFocus();
  65649. return;
  65650. }
  65651. // temporarily move the focus to the focus holder so the browser
  65652. // doesn't freak out while it's trying to get the input in place
  65653. // at this point the native text input still does not have focus
  65654. this._relocateInput(true);
  65655. this.setFocus();
  65656. // scroll the input into place
  65657. content.scrollTo(0, scrollData.scrollTo, scrollData.scrollDuration, function () {
  65658. // the scroll view is in the correct position now
  65659. // give the native text input focus
  65660. _this._relocateInput(false);
  65661. // ensure this is the focused input
  65662. _this.setFocus();
  65663. });
  65664. };
  65665. TextInput.decorators = [
  65666. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  65667. selector: 'ion-input,ion-textarea',
  65668. template: '<input #textInput *ngIf="!_isTextarea" class="text-input" ' +
  65669. '[ngClass]="\'text-input-\' + _mode"' +
  65670. '(input)="onInput($event)" ' +
  65671. '(blur)="onBlur($event)" ' +
  65672. '(focus)="onFocus($event)" ' +
  65673. '(keydown)="onKeydown($event)" ' +
  65674. '[type]="_type" ' +
  65675. 'dir="auto" ' +
  65676. '[attr.aria-labelledby]="_labelId" ' +
  65677. '[attr.min]="min" ' +
  65678. '[attr.max]="max" ' +
  65679. '[attr.step]="step" ' +
  65680. '[attr.autocomplete]="autocomplete" ' +
  65681. '[attr.autocorrect]="autocorrect" ' +
  65682. '[placeholder]="placeholder" ' +
  65683. '[disabled]="_disabled" ' +
  65684. '[readonly]="_readonly">' +
  65685. '<textarea #textInput *ngIf="_isTextarea" class="text-input" ' +
  65686. '[ngClass]="\'text-input-\' + _mode"' +
  65687. '(input)="onInput($event)" ' +
  65688. '(blur)="onBlur($event)" ' +
  65689. '(focus)="onFocus($event)" ' +
  65690. '(keydown)="onKeydown($event)" ' +
  65691. '[attr.aria-labelledby]="_labelId" ' +
  65692. '[attr.autocomplete]="autocomplete" ' +
  65693. '[attr.autocorrect]="autocorrect" ' +
  65694. '[placeholder]="placeholder" ' +
  65695. '[disabled]="_disabled" ' +
  65696. '[readonly]="_readonly"></textarea>' +
  65697. '<button ion-button *ngIf="_clearInput" clear class="text-input-clear-icon" ' +
  65698. 'type="button" ' +
  65699. '(click)="clearTextInput($event)" ' +
  65700. '(mousedown)="clearTextInput($event)" ' +
  65701. 'tabindex="-1"></button>' +
  65702. '<div class="input-cover" *ngIf="_useAssist" ' +
  65703. '(touchstart)="_pointerStart($event)" ' +
  65704. '(touchend)="_pointerEnd($event)" ' +
  65705. '(mousedown)="_pointerStart($event)" ' +
  65706. '(mouseup)="_pointerEnd($event)"></div>',
  65707. encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_11" /* ViewEncapsulation */].None,
  65708. changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["i" /* ChangeDetectionStrategy */].OnPush,
  65709. inputs: ['value']
  65710. },] },
  65711. ];
  65712. /** @nocollapse */
  65713. TextInput.ctorParameters = function () { return [
  65714. { type: __WEBPACK_IMPORTED_MODULE_5__config_config__["a" /* Config */], },
  65715. { type: __WEBPACK_IMPORTED_MODULE_13__platform_platform__["a" /* Platform */], },
  65716. { type: __WEBPACK_IMPORTED_MODULE_9__util_form__["a" /* Form */], },
  65717. { type: __WEBPACK_IMPORTED_MODULE_4__app_app__["a" /* App */], },
  65718. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  65719. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  65720. { type: __WEBPACK_IMPORTED_MODULE_6__content_content__["a" /* Content */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  65721. { type: __WEBPACK_IMPORTED_MODULE_12__item_item__["a" /* Item */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  65722. { type: __WEBPACK_IMPORTED_MODULE_1__angular_forms__["c" /* NgControl */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  65723. { type: __WEBPACK_IMPORTED_MODULE_8__platform_dom_controller__["a" /* DomController */], },
  65724. ]; };
  65725. TextInput.propDecorators = {
  65726. 'clearInput': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  65727. 'type': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  65728. 'readonly': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  65729. 'clearOnEdit': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  65730. '_native': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_8" /* ViewChild */], args: ['textInput', { read: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */] },] },],
  65731. 'autocomplete': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  65732. 'autocorrect': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  65733. 'placeholder': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  65734. 'min': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  65735. 'max': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  65736. 'step': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  65737. 'input': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  65738. 'blur': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  65739. 'focus': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  65740. };
  65741. return TextInput;
  65742. }(__WEBPACK_IMPORTED_MODULE_10__util_base_input__["a" /* BaseInput */]));
  65743. /**
  65744. * @name TextArea
  65745. * @description
  65746. *
  65747. * `ion-textarea` is used for multi-line text inputs. Ionic still
  65748. * uses an actual `<textarea>` HTML element within the component;
  65749. * however, with Ionic wrapping the native HTML text area element, Ionic
  65750. * is able to better handle the user experience and interactivity.
  65751. *
  65752. * Note that `<ion-textarea>` must load its value from the `value` or
  65753. * `[(ngModel)]` attribute. Unlike the native `<textarea>` element,
  65754. * `<ion-textarea>` does not support loading its value from the
  65755. * textarea's inner content.
  65756. *
  65757. * When requiring only a single-line text input, we recommend using
  65758. * `<ion-input>` instead.
  65759. *
  65760. * @usage
  65761. * ```html
  65762. * <ion-item>
  65763. * <ion-label>Comments</ion-label>
  65764. * <ion-textarea></ion-textarea>
  65765. * </ion-item>
  65766. *
  65767. * <ion-item>
  65768. * <ion-label stacked>Message</ion-label>
  65769. * <ion-textarea [(ngModel)]="msg"></ion-textarea>
  65770. * </ion-item>
  65771. *
  65772. * <ion-item>
  65773. * <ion-label floating>Description</ion-label>
  65774. * <ion-textarea></ion-textarea>
  65775. * </ion-item>
  65776. *
  65777. * <ion-item>
  65778. * <ion-label>Long Description</ion-label>
  65779. * <ion-textarea rows="6" placeholder="enter long description here..."></ion-textarea>
  65780. * </ion-item>
  65781. * ```
  65782. *
  65783. * @demo /docs/demos/src/textarea/
  65784. */
  65785. var SCROLL_ASSIST_SPEED = 0.3;
  65786. function newScrollData() {
  65787. return {
  65788. scrollAmount: 0,
  65789. scrollTo: 0,
  65790. scrollPadding: 0,
  65791. scrollDuration: 0,
  65792. inputSafeY: 0
  65793. };
  65794. }
  65795. /**
  65796. * @hidden
  65797. */
  65798. function getScrollData(inputOffsetTop, inputOffsetHeight, scrollViewDimensions, keyboardHeight, plaformHeight) {
  65799. // compute input's Y values relative to the body
  65800. var inputTop = (inputOffsetTop + scrollViewDimensions.contentTop - scrollViewDimensions.scrollTop);
  65801. var inputBottom = (inputTop + inputOffsetHeight);
  65802. // compute the safe area which is the viewable content area when the soft keyboard is up
  65803. var safeAreaTop = scrollViewDimensions.contentTop;
  65804. var safeAreaHeight = (plaformHeight - keyboardHeight - safeAreaTop) / 2;
  65805. var safeAreaBottom = safeAreaTop + safeAreaHeight;
  65806. // figure out if each edge of teh input is within the safe area
  65807. var inputTopWithinSafeArea = (inputTop >= safeAreaTop && inputTop <= safeAreaBottom);
  65808. var inputTopAboveSafeArea = (inputTop < safeAreaTop);
  65809. var inputTopBelowSafeArea = (inputTop > safeAreaBottom);
  65810. var inputBottomWithinSafeArea = (inputBottom >= safeAreaTop && inputBottom <= safeAreaBottom);
  65811. var inputBottomBelowSafeArea = (inputBottom > safeAreaBottom);
  65812. /*
  65813. Text Input Scroll To Scenarios
  65814. ---------------------------------------
  65815. 1) Input top within safe area, bottom within safe area
  65816. 2) Input top within safe area, bottom below safe area, room to scroll
  65817. 3) Input top above safe area, bottom within safe area, room to scroll
  65818. 4) Input top below safe area, no room to scroll, input smaller than safe area
  65819. 5) Input top within safe area, bottom below safe area, no room to scroll, input smaller than safe area
  65820. 6) Input top within safe area, bottom below safe area, no room to scroll, input larger than safe area
  65821. 7) Input top below safe area, no room to scroll, input larger than safe area
  65822. */
  65823. var scrollData = newScrollData();
  65824. // when auto-scrolling, there also needs to be enough
  65825. // content padding at the bottom of the scroll view
  65826. // always add scroll padding when a text input has focus
  65827. // this allows for the content to scroll above of the keyboard
  65828. // content behind the keyboard would be blank
  65829. // some cases may not need it, but when jumping around it's best
  65830. // to have the padding already rendered so there's no jank
  65831. scrollData.scrollPadding = keyboardHeight;
  65832. if (inputTopWithinSafeArea && inputBottomWithinSafeArea) {
  65833. // Input top within safe area, bottom within safe area
  65834. // no need to scroll to a position, it's good as-is
  65835. return scrollData;
  65836. }
  65837. // looks like we'll have to do some auto-scrolling
  65838. if (inputTopBelowSafeArea || inputBottomBelowSafeArea || inputTopAboveSafeArea) {
  65839. // Input top or bottom below safe area
  65840. // auto scroll the input up so at least the top of it shows
  65841. if (safeAreaHeight > inputOffsetHeight) {
  65842. // safe area height is taller than the input height, so we
  65843. // can bring up the input just enough to show the input bottom
  65844. scrollData.scrollAmount = Math.round(safeAreaBottom - inputBottom);
  65845. }
  65846. else {
  65847. // safe area height is smaller than the input height, so we can
  65848. // only scroll it up so the input top is at the top of the safe area
  65849. // however the input bottom will be below the safe area
  65850. scrollData.scrollAmount = Math.round(safeAreaTop - inputTop);
  65851. }
  65852. scrollData.inputSafeY = -(inputTop - safeAreaTop) + 4;
  65853. if (inputTopAboveSafeArea && scrollData.scrollAmount > inputOffsetHeight) {
  65854. // the input top is above the safe area and we're already scrolling it into place
  65855. // don't let it scroll more than the height of the input
  65856. scrollData.scrollAmount = inputOffsetHeight;
  65857. }
  65858. }
  65859. // figure out where it should scroll to for the best position to the input
  65860. scrollData.scrollTo = (scrollViewDimensions.scrollTop - scrollData.scrollAmount);
  65861. // calculate animation duration
  65862. var distance = Math.abs(scrollData.scrollAmount);
  65863. var duration = distance / SCROLL_ASSIST_SPEED;
  65864. scrollData.scrollDuration = Math.min(400, Math.max(150, duration));
  65865. return scrollData;
  65866. }
  65867. function cloneInputComponent(plt, srcComponentEle, srcNativeInputEle) {
  65868. // Make sure we kill all the clones before creating new ones
  65869. // It is a defensive, removeClone() should do nothing
  65870. // removeClone(plt, srcComponentEle, srcNativeInputEle);
  65871. (void 0) /* assert */;
  65872. // given a native <input> or <textarea> element
  65873. // find its parent wrapping component like <ion-input> or <ion-textarea>
  65874. // then clone the entire component
  65875. if (srcComponentEle) {
  65876. // DOM READ
  65877. var srcTop = srcComponentEle.offsetTop;
  65878. var srcLeft = srcComponentEle.offsetLeft;
  65879. var srcWidth = srcComponentEle.offsetWidth;
  65880. var srcHeight = srcComponentEle.offsetHeight;
  65881. // DOM WRITE
  65882. // not using deep clone so we don't pull in unnecessary nodes
  65883. var clonedComponentEle = srcComponentEle.cloneNode(false);
  65884. var clonedStyle = clonedComponentEle.style;
  65885. clonedComponentEle.classList.add('cloned-input');
  65886. clonedComponentEle.setAttribute('aria-hidden', 'true');
  65887. clonedStyle.pointerEvents = 'none';
  65888. clonedStyle.position = 'absolute';
  65889. clonedStyle.top = srcTop + 'px';
  65890. clonedStyle.left = srcLeft + 'px';
  65891. clonedStyle.width = srcWidth + 'px';
  65892. clonedStyle.height = srcHeight + 'px';
  65893. var clonedNativeInputEle = srcNativeInputEle.cloneNode(false);
  65894. clonedNativeInputEle.value = srcNativeInputEle.value;
  65895. clonedNativeInputEle.tabIndex = -1;
  65896. clonedComponentEle.appendChild(clonedNativeInputEle);
  65897. srcComponentEle.parentNode.appendChild(clonedComponentEle);
  65898. srcComponentEle.style.pointerEvents = 'none';
  65899. }
  65900. srcNativeInputEle.style[plt.Css.transform] = 'scale(0)';
  65901. }
  65902. function removeClone(plt, srcComponentEle, srcNativeInputEle) {
  65903. if (srcComponentEle && srcComponentEle.parentElement) {
  65904. var clonedInputEles = srcComponentEle.parentElement.querySelectorAll('.cloned-input');
  65905. for (var i = 0; i < clonedInputEles.length; i++) {
  65906. clonedInputEles[i].parentNode.removeChild(clonedInputEles[i]);
  65907. }
  65908. srcComponentEle.style.pointerEvents = '';
  65909. }
  65910. srcNativeInputEle.style[plt.Css.transform] = '';
  65911. srcNativeInputEle.style.opacity = '';
  65912. }
  65913. //# sourceMappingURL=input.js.map
  65914. /***/ }),
  65915. /* 141 */
  65916. /***/ (function(module, exports, __webpack_require__) {
  65917. "use strict";
  65918. var Observable_1 = __webpack_require__(9);
  65919. var takeUntil_1 = __webpack_require__(242);
  65920. Observable_1.Observable.prototype.takeUntil = takeUntil_1.takeUntil;
  65921. //# sourceMappingURL=takeUntil.js.map
  65922. /***/ }),
  65923. /* 142 */
  65924. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  65925. "use strict";
  65926. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ItemContent; });
  65927. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  65928. /**
  65929. * @hidden
  65930. */
  65931. var ItemContent = (function () {
  65932. function ItemContent() {
  65933. }
  65934. ItemContent.decorators = [
  65935. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  65936. selector: 'ion-item,[ion-item]',
  65937. host: {
  65938. 'class': 'item-block'
  65939. }
  65940. },] },
  65941. ];
  65942. /** @nocollapse */
  65943. ItemContent.ctorParameters = function () { return []; };
  65944. return ItemContent;
  65945. }());
  65946. //# sourceMappingURL=item-content.js.map
  65947. /***/ }),
  65948. /* 143 */
  65949. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  65950. "use strict";
  65951. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ItemDivider; });
  65952. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  65953. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__config_config__ = __webpack_require__(1);
  65954. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ion__ = __webpack_require__(4);
  65955. var __extends = (this && this.__extends) || (function () {
  65956. var extendStatics = Object.setPrototypeOf ||
  65957. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  65958. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  65959. return function (d, b) {
  65960. extendStatics(d, b);
  65961. function __() { this.constructor = d; }
  65962. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  65963. };
  65964. })();
  65965. /**
  65966. * @hidden
  65967. */
  65968. var ItemDivider = (function (_super) {
  65969. __extends(ItemDivider, _super);
  65970. function ItemDivider(config, elementRef, renderer) {
  65971. return _super.call(this, config, elementRef, renderer, 'item-divider') || this;
  65972. }
  65973. ItemDivider.decorators = [
  65974. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  65975. selector: 'ion-item-divider',
  65976. host: {
  65977. 'class': 'item-divider'
  65978. }
  65979. },] },
  65980. ];
  65981. /** @nocollapse */
  65982. ItemDivider.ctorParameters = function () { return [
  65983. { type: __WEBPACK_IMPORTED_MODULE_1__config_config__["a" /* Config */], },
  65984. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  65985. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  65986. ]; };
  65987. return ItemDivider;
  65988. }(__WEBPACK_IMPORTED_MODULE_2__ion__["a" /* Ion */]));
  65989. //# sourceMappingURL=item-divider.js.map
  65990. /***/ }),
  65991. /* 144 */
  65992. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  65993. "use strict";
  65994. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ItemGroup; });
  65995. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  65996. /**
  65997. * @hidden
  65998. */
  65999. var ItemGroup = (function () {
  66000. function ItemGroup() {
  66001. }
  66002. ItemGroup.decorators = [
  66003. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  66004. selector: 'ion-item-group'
  66005. },] },
  66006. ];
  66007. /** @nocollapse */
  66008. ItemGroup.ctorParameters = function () { return []; };
  66009. return ItemGroup;
  66010. }());
  66011. //# sourceMappingURL=item-group.js.map
  66012. /***/ }),
  66013. /* 145 */
  66014. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  66015. "use strict";
  66016. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ItemSliding; });
  66017. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  66018. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_util__ = __webpack_require__(2);
  66019. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__item__ = __webpack_require__(17);
  66020. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__list_list__ = __webpack_require__(71);
  66021. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__platform_platform__ = __webpack_require__(3);
  66022. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__item_options__ = __webpack_require__(70);
  66023. var SWIPE_MARGIN = 30;
  66024. var ELASTIC_FACTOR = 0.55;
  66025. var ITEM_SIDE_FLAG_NONE = 0;
  66026. var ITEM_SIDE_FLAG_LEFT = 1 << 0;
  66027. var ITEM_SIDE_FLAG_RIGHT = 1 << 1;
  66028. var ITEM_SIDE_FLAG_BOTH = ITEM_SIDE_FLAG_LEFT | ITEM_SIDE_FLAG_RIGHT;
  66029. /**
  66030. * @name ItemSliding
  66031. * @description
  66032. * A sliding item is a list item that can be swiped to reveal buttons. It requires
  66033. * an [Item](../Item) component as a child and a [List](../../list/List) component as
  66034. * a parent. All buttons to reveal can be placed in the `<ion-item-options>` element.
  66035. *
  66036. * @usage
  66037. * ```html
  66038. * <ion-list>
  66039. * <ion-item-sliding #item>
  66040. * <ion-item>
  66041. * Item
  66042. * </ion-item>
  66043. * <ion-item-options side="left">
  66044. * <button ion-button (click)="favorite(item)">Favorite</button>
  66045. * <button ion-button color="danger" (click)="share(item)">Share</button>
  66046. * </ion-item-options>
  66047. *
  66048. * <ion-item-options side="right">
  66049. * <button ion-button (click)="unread(item)">Unread</button>
  66050. * </ion-item-options>
  66051. * </ion-item-sliding>
  66052. * </ion-list>
  66053. * ```
  66054. *
  66055. * ### Swipe Direction
  66056. * By default, the buttons are revealed when the sliding item is swiped from right to left,
  66057. * so the buttons are placed in the right side. But it's also possible to reveal them
  66058. * in the right side (sliding from left to right) by setting the `side` attribute
  66059. * on the `ion-item-options` element. Up to 2 `ion-item-options` can used at the same time
  66060. * in order to reveal two different sets of buttons depending the swipping direction.
  66061. *
  66062. * ```html
  66063. * <ion-item-options side="right">
  66064. * <button ion-button (click)="archive(item)">
  66065. * <ion-icon name="archive"></ion-icon>
  66066. * Archive
  66067. * </button>
  66068. * </ion-item-options>
  66069. *
  66070. * <ion-item-options side="left">
  66071. * <button ion-button (click)="archive(item)">
  66072. * <ion-icon name="archive"></ion-icon>
  66073. * Archive
  66074. * </button>
  66075. * </ion-item-options>
  66076. * ```
  66077. *
  66078. * ### Listening for events (ionDrag) and (ionSwipe)
  66079. * It's possible to know the current relative position of the sliding item by subscribing
  66080. * to the (ionDrag)` event.
  66081. *
  66082. * ```html
  66083. * <ion-item-sliding (ionDrag)="logDrag($event)">
  66084. * <ion-item>Item</ion-item>
  66085. * <ion-item-options>
  66086. * <button ion-button>Favorite</button>
  66087. * </ion-item-options>
  66088. * </ion-item-sliding>
  66089. * ```
  66090. *
  66091. * ### Button Layout
  66092. * If an icon is placed with text in the option button, by default it will
  66093. * display the icon on top of the text. This can be changed to display the icon
  66094. * to the left of the text by setting `icon-start` as an attribute on the
  66095. * `<ion-item-options>` element.
  66096. *
  66097. * ```html
  66098. * <ion-item-options icon-start>
  66099. * <button ion-button (click)="archive(item)">
  66100. * <ion-icon name="archive"></ion-icon>
  66101. * Archive
  66102. * </button>
  66103. * </ion-item-options>
  66104. *
  66105. * ```
  66106. *
  66107. * ### Expandable Options
  66108. *
  66109. * Options can be expanded to take up the full width of the item if you swipe past
  66110. * a certain point. This can be combined with the `ionSwipe` event to call methods
  66111. * on the class.
  66112. *
  66113. * ```html
  66114. *
  66115. * <ion-item-sliding (ionSwipe)="delete(item)">
  66116. * <ion-item>Item</ion-item>
  66117. * <ion-item-options>
  66118. * <button ion-button expandable (click)="delete(item)">Delete</button>
  66119. * </ion-item-options>
  66120. * </ion-item-sliding>
  66121. * ```
  66122. *
  66123. * We can call `delete` by either clicking the button, or by doing a full swipe on the item.
  66124. *
  66125. * @demo /docs/demos/src/item-sliding/
  66126. * @see {@link /docs/components#lists List Component Docs}
  66127. * @see {@link ../Item Item API Docs}
  66128. * @see {@link ../../list/List List API Docs}
  66129. */
  66130. var ItemSliding = (function () {
  66131. function ItemSliding(list, _plt, _renderer, _elementRef, _zone) {
  66132. this._plt = _plt;
  66133. this._renderer = _renderer;
  66134. this._elementRef = _elementRef;
  66135. this._zone = _zone;
  66136. this._openAmount = 0;
  66137. this._startX = 0;
  66138. this._optsWidthRightSide = 0;
  66139. this._optsWidthLeftSide = 0;
  66140. this._tmr = null;
  66141. this._optsDirty = true;
  66142. this._state = 2 /* Disabled */;
  66143. /**
  66144. * @output {event} Emitted when the sliding position changes.
  66145. * It reports the relative position.
  66146. *
  66147. * ```ts
  66148. * ondrag(item) {
  66149. * let percent = item.getSlidingPercent();
  66150. * if (percent > 0) {
  66151. * // positive
  66152. * console.log('right side');
  66153. * } else {
  66154. * // negative
  66155. * console.log('left side');
  66156. * }
  66157. * if (Math.abs(percent) > 1) {
  66158. * console.log('overscroll');
  66159. * }
  66160. * }
  66161. * ```
  66162. *
  66163. */
  66164. this.ionDrag = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  66165. list && list.containsSlidingItem(true);
  66166. _elementRef.nativeElement.$ionComponent = this;
  66167. this.setElementClass('item-wrapper', true);
  66168. }
  66169. Object.defineProperty(ItemSliding.prototype, "_itemOptions", {
  66170. set: function (itemOptions) {
  66171. var sides = 0;
  66172. // Reset left and right options in case they were removed
  66173. this._leftOptions = this._rightOptions = null;
  66174. for (var _i = 0, _a = itemOptions.toArray(); _i < _a.length; _i++) {
  66175. var item = _a[_i];
  66176. if (item.isRightSide()) {
  66177. this._rightOptions = item;
  66178. sides |= ITEM_SIDE_FLAG_RIGHT;
  66179. }
  66180. else {
  66181. this._leftOptions = item;
  66182. sides |= ITEM_SIDE_FLAG_LEFT;
  66183. }
  66184. }
  66185. this._optsDirty = true;
  66186. this._sides = sides;
  66187. },
  66188. enumerable: true,
  66189. configurable: true
  66190. });
  66191. /**
  66192. * @hidden
  66193. */
  66194. ItemSliding.prototype.getOpenAmount = function () {
  66195. return this._openAmount;
  66196. };
  66197. /**
  66198. * @hidden
  66199. */
  66200. ItemSliding.prototype.getSlidingPercent = function () {
  66201. var openAmount = this._openAmount;
  66202. if (openAmount > 0) {
  66203. return openAmount / this._optsWidthRightSide;
  66204. }
  66205. else if (openAmount < 0) {
  66206. return openAmount / this._optsWidthLeftSide;
  66207. }
  66208. else {
  66209. return 0;
  66210. }
  66211. };
  66212. /**
  66213. * @hidden
  66214. */
  66215. ItemSliding.prototype.startSliding = function (startX) {
  66216. if (this._tmr) {
  66217. this._plt.cancelTimeout(this._tmr);
  66218. this._tmr = null;
  66219. }
  66220. if (this._openAmount === 0) {
  66221. this._optsDirty = true;
  66222. this._setState(4 /* Enabled */);
  66223. }
  66224. this._startX = startX + this._openAmount;
  66225. this.item.setElementStyle(this._plt.Css.transition, 'none');
  66226. };
  66227. /**
  66228. * @hidden
  66229. */
  66230. ItemSliding.prototype.moveSliding = function (x) {
  66231. if (this._optsDirty) {
  66232. this.calculateOptsWidth();
  66233. return;
  66234. }
  66235. var openAmount = (this._startX - x);
  66236. switch (this._sides) {
  66237. case ITEM_SIDE_FLAG_RIGHT:
  66238. openAmount = Math.max(0, openAmount);
  66239. break;
  66240. case ITEM_SIDE_FLAG_LEFT:
  66241. openAmount = Math.min(0, openAmount);
  66242. break;
  66243. case ITEM_SIDE_FLAG_BOTH: break;
  66244. case ITEM_SIDE_FLAG_NONE: return;
  66245. default:
  66246. (void 0) /* assert */;
  66247. break;
  66248. }
  66249. if (openAmount > this._optsWidthRightSide) {
  66250. var optsWidth = this._optsWidthRightSide;
  66251. openAmount = optsWidth + (openAmount - optsWidth) * ELASTIC_FACTOR;
  66252. }
  66253. else if (openAmount < -this._optsWidthLeftSide) {
  66254. var optsWidth = -this._optsWidthLeftSide;
  66255. openAmount = optsWidth + (openAmount - optsWidth) * ELASTIC_FACTOR;
  66256. }
  66257. this._setOpenAmount(openAmount, false);
  66258. return openAmount;
  66259. };
  66260. /**
  66261. * @hidden
  66262. */
  66263. ItemSliding.prototype.endSliding = function (velocity) {
  66264. var restingPoint = (this._openAmount > 0)
  66265. ? this._optsWidthRightSide
  66266. : -this._optsWidthLeftSide;
  66267. // Check if the drag didn't clear the buttons mid-point
  66268. // and we aren't moving fast enough to swipe open
  66269. var isResetDirection = (this._openAmount > 0) === !(velocity < 0);
  66270. var isMovingFast = Math.abs(velocity) > 0.3;
  66271. var isOnCloseZone = Math.abs(this._openAmount) < Math.abs(restingPoint / 2);
  66272. if (Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["t" /* swipeShouldReset */])(isResetDirection, isMovingFast, isOnCloseZone)) {
  66273. restingPoint = 0;
  66274. }
  66275. this.fireSwipeEvent();
  66276. this._setOpenAmount(restingPoint, true);
  66277. return restingPoint;
  66278. };
  66279. /**
  66280. * @hidden
  66281. */
  66282. ItemSliding.prototype.fireSwipeEvent = function () {
  66283. var _this = this;
  66284. if (this._state & 32 /* SwipeRight */) {
  66285. this._zone.run(function () { return _this._rightOptions.ionSwipe.emit(_this); });
  66286. }
  66287. else if (this._state & 64 /* SwipeLeft */) {
  66288. this._zone.run(function () { return _this._leftOptions.ionSwipe.emit(_this); });
  66289. }
  66290. };
  66291. /**
  66292. * @hidden
  66293. */
  66294. ItemSliding.prototype.calculateOptsWidth = function () {
  66295. if (!this._optsDirty) {
  66296. return;
  66297. }
  66298. this._optsWidthRightSide = 0;
  66299. if (this._rightOptions) {
  66300. this._optsWidthRightSide = this._rightOptions.width();
  66301. (void 0) /* assert */;
  66302. }
  66303. this._optsWidthLeftSide = 0;
  66304. if (this._leftOptions) {
  66305. this._optsWidthLeftSide = this._leftOptions.width();
  66306. (void 0) /* assert */;
  66307. }
  66308. this._optsDirty = false;
  66309. };
  66310. ItemSliding.prototype._setOpenAmount = function (openAmount, isFinal) {
  66311. var _this = this;
  66312. var platform = this._plt;
  66313. if (this._tmr) {
  66314. platform.cancelTimeout(this._tmr);
  66315. this._tmr = null;
  66316. }
  66317. this._openAmount = openAmount;
  66318. if (isFinal) {
  66319. this.item.setElementStyle(platform.Css.transition, '');
  66320. }
  66321. if (openAmount > 0) {
  66322. var state = (openAmount >= (this._optsWidthRightSide + SWIPE_MARGIN))
  66323. ? 8 /* Right */ | 32 /* SwipeRight */
  66324. : 8 /* Right */;
  66325. this._setState(state);
  66326. }
  66327. else if (openAmount < 0) {
  66328. var state_1 = (openAmount <= (-this._optsWidthLeftSide - SWIPE_MARGIN))
  66329. ? 16 /* Left */ | 64 /* SwipeLeft */
  66330. : 16 /* Left */;
  66331. this._setState(state_1);
  66332. }
  66333. else {
  66334. (void 0) /* assert */;
  66335. this._tmr = platform.timeout(function () {
  66336. _this._setState(2 /* Disabled */);
  66337. _this._tmr = null;
  66338. }, 600);
  66339. this.item.setElementStyle(platform.Css.transform, '');
  66340. return;
  66341. }
  66342. this.item.setElementStyle(platform.Css.transform, "translate3d(" + -openAmount + "px,0,0)");
  66343. var ionDrag = this.ionDrag;
  66344. if (ionDrag.observers.length > 0) {
  66345. ionDrag.emit(this);
  66346. }
  66347. };
  66348. ItemSliding.prototype._setState = function (state) {
  66349. if (state === this._state) {
  66350. return;
  66351. }
  66352. this.setElementClass('active-slide', (state !== 2 /* Disabled */));
  66353. this.setElementClass('active-options-right', !!(state & 8 /* Right */));
  66354. this.setElementClass('active-options-left', !!(state & 16 /* Left */));
  66355. this.setElementClass('active-swipe-right', !!(state & 32 /* SwipeRight */));
  66356. this.setElementClass('active-swipe-left', !!(state & 64 /* SwipeLeft */));
  66357. this._state = state;
  66358. };
  66359. /**
  66360. * Close the sliding item. Items can also be closed from the [List](../../list/List).
  66361. *
  66362. * The sliding item can be closed by grabbing a reference to `ItemSliding`. In the
  66363. * below example, the template reference variable `slidingItem` is placed on the element
  66364. * and passed to the `share` method.
  66365. *
  66366. * ```html
  66367. * <ion-list>
  66368. * <ion-item-sliding #slidingItem>
  66369. * <ion-item>
  66370. * Item
  66371. * </ion-item>
  66372. * <ion-item-options>
  66373. * <button ion-button (click)="share(slidingItem)">Share</button>
  66374. * </ion-item-options>
  66375. * </ion-item-sliding>
  66376. * </ion-list>
  66377. * ```
  66378. *
  66379. * ```ts
  66380. * import { Component } from '@angular/core';
  66381. * import { ItemSliding } from 'ionic-angular';
  66382. *
  66383. * @Component({...})
  66384. * export class MyClass {
  66385. * constructor() { }
  66386. *
  66387. * share(slidingItem: ItemSliding) {
  66388. * slidingItem.close();
  66389. * }
  66390. * }
  66391. * ```
  66392. */
  66393. ItemSliding.prototype.close = function () {
  66394. this._setOpenAmount(0, true);
  66395. };
  66396. /**
  66397. * @hidden
  66398. */
  66399. ItemSliding.prototype.setElementClass = function (cssClass, shouldAdd) {
  66400. this._renderer.setElementClass(this._elementRef.nativeElement, cssClass, shouldAdd);
  66401. };
  66402. ItemSliding.decorators = [
  66403. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  66404. selector: 'ion-item-sliding',
  66405. template: "\n <ng-content select=\"ion-item,[ion-item]\"></ng-content>\n <ng-content select=\"ion-item-options\"></ng-content>\n ",
  66406. changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["i" /* ChangeDetectionStrategy */].OnPush,
  66407. encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_11" /* ViewEncapsulation */].None
  66408. },] },
  66409. ];
  66410. /** @nocollapse */
  66411. ItemSliding.ctorParameters = function () { return [
  66412. { type: __WEBPACK_IMPORTED_MODULE_3__list_list__["a" /* List */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  66413. { type: __WEBPACK_IMPORTED_MODULE_4__platform_platform__["a" /* Platform */], },
  66414. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  66415. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  66416. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["M" /* NgZone */], },
  66417. ]; };
  66418. ItemSliding.propDecorators = {
  66419. 'item': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["q" /* ContentChild */], args: [__WEBPACK_IMPORTED_MODULE_2__item__["a" /* Item */],] },],
  66420. 'ionDrag': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  66421. '_itemOptions': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["r" /* ContentChildren */], args: [Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_14" /* forwardRef */])(function () { return __WEBPACK_IMPORTED_MODULE_5__item_options__["a" /* ItemOptions */]; }),] },],
  66422. };
  66423. return ItemSliding;
  66424. }());
  66425. //# sourceMappingURL=item-sliding.js.map
  66426. /***/ }),
  66427. /* 146 */
  66428. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  66429. "use strict";
  66430. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Reorder; });
  66431. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  66432. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__item_reorder_util__ = __webpack_require__(130);
  66433. /**
  66434. * @hidden
  66435. */
  66436. var Reorder = (function () {
  66437. function Reorder(elementRef) {
  66438. this.elementRef = elementRef;
  66439. elementRef.nativeElement['$ionComponent'] = this;
  66440. }
  66441. Reorder.prototype.getReorderNode = function () {
  66442. return Object(__WEBPACK_IMPORTED_MODULE_1__item_reorder_util__["a" /* findReorderItem */])(this.elementRef.nativeElement, null);
  66443. };
  66444. Reorder.prototype.onClick = function (ev) {
  66445. // Stop propagation if click event reaches ion-reorder
  66446. ev.preventDefault();
  66447. ev.stopPropagation();
  66448. };
  66449. Reorder.decorators = [
  66450. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  66451. selector: 'ion-reorder',
  66452. template: "<ion-icon name=\"reorder\"></ion-icon>"
  66453. },] },
  66454. ];
  66455. /** @nocollapse */
  66456. Reorder.ctorParameters = function () { return [
  66457. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  66458. ]; };
  66459. Reorder.propDecorators = {
  66460. 'onClick': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["y" /* HostListener */], args: ['click', ['$event'],] },],
  66461. };
  66462. return Reorder;
  66463. }());
  66464. //# sourceMappingURL=reorder.js.map
  66465. /***/ }),
  66466. /* 147 */
  66467. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  66468. "use strict";
  66469. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Loading; });
  66470. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_util__ = __webpack_require__(2);
  66471. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__app_app_constants__ = __webpack_require__(35);
  66472. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__loading_component__ = __webpack_require__(73);
  66473. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__loading_transitions__ = __webpack_require__(245);
  66474. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__navigation_view_controller__ = __webpack_require__(5);
  66475. var __extends = (this && this.__extends) || (function () {
  66476. var extendStatics = Object.setPrototypeOf ||
  66477. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  66478. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  66479. return function (d, b) {
  66480. extendStatics(d, b);
  66481. function __() { this.constructor = d; }
  66482. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  66483. };
  66484. })();
  66485. /**
  66486. * @hidden
  66487. */
  66488. var Loading = (function (_super) {
  66489. __extends(Loading, _super);
  66490. function Loading(app, opts, config) {
  66491. if (opts === void 0) { opts = {}; }
  66492. var _this = this;
  66493. opts.showBackdrop = Object(__WEBPACK_IMPORTED_MODULE_0__util_util__["l" /* isPresent */])(opts.showBackdrop) ? !!opts.showBackdrop : true;
  66494. opts.enableBackdropDismiss = Object(__WEBPACK_IMPORTED_MODULE_0__util_util__["l" /* isPresent */])(opts.enableBackdropDismiss) ? !!opts.enableBackdropDismiss : false;
  66495. opts.dismissOnPageChange = Object(__WEBPACK_IMPORTED_MODULE_0__util_util__["l" /* isPresent */])(opts.dismissOnPageChange) ? !!opts.dismissOnPageChange : false;
  66496. _this = _super.call(this, __WEBPACK_IMPORTED_MODULE_2__loading_component__["a" /* LoadingCmp */], opts, null) || this;
  66497. _this._app = app;
  66498. _this.isOverlay = true;
  66499. config.setTransition('loading-pop-in', __WEBPACK_IMPORTED_MODULE_3__loading_transitions__["c" /* LoadingPopIn */]);
  66500. config.setTransition('loading-pop-out', __WEBPACK_IMPORTED_MODULE_3__loading_transitions__["d" /* LoadingPopOut */]);
  66501. config.setTransition('loading-md-pop-in', __WEBPACK_IMPORTED_MODULE_3__loading_transitions__["a" /* LoadingMdPopIn */]);
  66502. config.setTransition('loading-md-pop-out', __WEBPACK_IMPORTED_MODULE_3__loading_transitions__["b" /* LoadingMdPopOut */]);
  66503. config.setTransition('loading-wp-pop-in', __WEBPACK_IMPORTED_MODULE_3__loading_transitions__["e" /* LoadingWpPopIn */]);
  66504. config.setTransition('loading-wp-pop-out', __WEBPACK_IMPORTED_MODULE_3__loading_transitions__["f" /* LoadingWpPopOut */]);
  66505. return _this;
  66506. }
  66507. /**
  66508. * @hidden
  66509. */
  66510. Loading.prototype.getTransitionName = function (direction) {
  66511. var key = (direction === 'back' ? 'loadingLeave' : 'loadingEnter');
  66512. return this._nav && this._nav.config.get(key);
  66513. };
  66514. /**
  66515. * @param {string} content sets the html content for the loading indicator.
  66516. */
  66517. Loading.prototype.setContent = function (content) {
  66518. this.data.content = content;
  66519. return this;
  66520. };
  66521. /**
  66522. * @param {string} spinner sets the name of the SVG spinner for the loading indicator.
  66523. */
  66524. Loading.prototype.setSpinner = function (spinner) {
  66525. this.data.spinner = spinner;
  66526. return this;
  66527. };
  66528. /**
  66529. * @param {string} cssClass sets additional classes for custom styles, separated by spaces.
  66530. */
  66531. Loading.prototype.setCssClass = function (cssClass) {
  66532. this.data.cssClass = cssClass;
  66533. return this;
  66534. };
  66535. /**
  66536. * @param {boolean} showBackdrop sets whether to show the backdrop.
  66537. */
  66538. Loading.prototype.setShowBackdrop = function (showBackdrop) {
  66539. this.data.showBackdrop = showBackdrop;
  66540. return this;
  66541. };
  66542. /**
  66543. * @param {number} dur how many milliseconds to wait before hiding the indicator.
  66544. */
  66545. Loading.prototype.setDuration = function (dur) {
  66546. this.data.duration = dur;
  66547. return this;
  66548. };
  66549. /**
  66550. * Present the loading instance.
  66551. *
  66552. * @param {NavOptions} [navOptions={}] Nav options to go with this transition.
  66553. * @returns {Promise} Returns a promise which is resolved when the transition has completed.
  66554. */
  66555. Loading.prototype.present = function (navOptions) {
  66556. if (navOptions === void 0) { navOptions = {}; }
  66557. return this._app.present(this, navOptions, __WEBPACK_IMPORTED_MODULE_1__app_app_constants__["b" /* PORTAL_LOADING */]);
  66558. };
  66559. /**
  66560. * Dismiss all loading components which have been presented.
  66561. */
  66562. Loading.prototype.dismissAll = function () {
  66563. this._nav && this._nav.popAll();
  66564. };
  66565. return Loading;
  66566. }(__WEBPACK_IMPORTED_MODULE_4__navigation_view_controller__["a" /* ViewController */]));
  66567. //# sourceMappingURL=loading.js.map
  66568. /***/ }),
  66569. /* 148 */
  66570. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  66571. "use strict";
  66572. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return LoadingController; });
  66573. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  66574. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__app_app__ = __webpack_require__(6);
  66575. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__config_config__ = __webpack_require__(1);
  66576. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__loading__ = __webpack_require__(147);
  66577. /**
  66578. * @name LoadingController
  66579. * @description
  66580. * An overlay that can be used to indicate activity while blocking user
  66581. * interaction. The loading indicator appears on top of the app's content,
  66582. * and can be dismissed by the app to resume user interaction with
  66583. * the app. It includes an optional backdrop, which can be disabled
  66584. * by setting `showBackdrop: false` upon creation.
  66585. *
  66586. * ### Creating
  66587. * You can pass all of the loading options in the first argument of
  66588. * the create method: `create(opts)`. The spinner name should be
  66589. * passed in the `spinner` property, and any optional HTML can be passed
  66590. * in the `content` property. If you do not pass a value to `spinner`
  66591. * the loading indicator will use the spinner specified by the mode. To
  66592. * set the spinner name across the app, set the value of `loadingSpinner`
  66593. * in your app's config. To hide the spinner, set `loadingSpinner: 'hide'`
  66594. * in the app's config or pass `spinner: 'hide'` in the loading
  66595. * options. See the [create](#create) method below for all available options.
  66596. *
  66597. * ### Dismissing
  66598. * The loading indicator can be dismissed automatically after a specific
  66599. * amount of time by passing the number of milliseconds to display it in
  66600. * the `duration` of the loading options. By default the loading indicator
  66601. * will show even during page changes, but this can be disabled by setting
  66602. * `dismissOnPageChange` to `true`. To dismiss the loading indicator after
  66603. * creation, call the `dismiss()` method on the Loading instance. The
  66604. * `onDidDismiss` function can be called to perform an action after the loading
  66605. * indicator is dismissed.
  66606. *
  66607. * >Note that after the component is dismissed, it will not be usable anymore
  66608. * and another one must be created. This can be avoided by wrapping the
  66609. * creation and presentation of the component in a reusable function as shown
  66610. * in the `usage` section below.
  66611. *
  66612. * ### Limitations
  66613. * The element is styled to appear on top of other content by setting its
  66614. * `z-index` property. You must ensure no element has a stacking context with
  66615. * a higher `z-index` than this element.
  66616. *
  66617. * @usage
  66618. * ```ts
  66619. * import { LoadingController } from 'ionic-angular';
  66620. *
  66621. * constructor(public loadingCtrl: LoadingController) { }
  66622. *
  66623. * presentLoadingDefault() {
  66624. * const loading = this.loadingCtrl.create({
  66625. * content: 'Please wait...'
  66626. * });
  66627. *
  66628. * loading.present();
  66629. *
  66630. * setTimeout(() => {
  66631. * loading.dismiss();
  66632. * }, 5000);
  66633. * }
  66634. *
  66635. * presentLoadingCustom() {
  66636. * const loading = this.loadingCtrl.create({
  66637. * spinner: 'hide',
  66638. * content: `
  66639. * <div class="custom-spinner-container">
  66640. * <div class="custom-spinner-box"></div>
  66641. * </div>`,
  66642. * duration: 5000
  66643. * });
  66644. *
  66645. * loading.onDidDismiss(() => {
  66646. * console.log('Dismissed loading');
  66647. * });
  66648. *
  66649. * loading.present();
  66650. * }
  66651. *
  66652. * presentLoadingText() {
  66653. * const loading = this.loadingCtrl.create({
  66654. * spinner: 'hide',
  66655. * content: 'Loading Please Wait...'
  66656. * });
  66657. *
  66658. * loading.present();
  66659. *
  66660. * setTimeout(() => {
  66661. * this.nav.push(Page2);
  66662. * }, 1000);
  66663. *
  66664. * setTimeout(() => {
  66665. * loading.dismiss();
  66666. * }, 5000);
  66667. * }
  66668. * ```
  66669. * @advanced
  66670. *
  66671. * Loading options
  66672. *
  66673. * | Option | Type | Description |
  66674. * |-----------------------|------------|------------------------------------------------------------------------------------------------------------------|
  66675. * | spinner |`string` | The name of the SVG spinner for the loading indicator. |
  66676. * | content |`string` | The html content for the loading indicator. |
  66677. * | cssClass |`string` | Additional classes for custom styles, separated by spaces. |
  66678. * | showBackdrop |`boolean` | Whether to show the backdrop. Default true. |
  66679. * | enableBackdropDismiss | `boolean` | Whether the loading indicator should be dismissed by tapping the backdrop. Default false. |
  66680. * | dismissOnPageChange |`boolean` | Whether to dismiss the indicator when navigating to a new page. Default false. |
  66681. * | duration |`number` | How many milliseconds to wait before hiding the indicator. By default, it will show until `dismiss()` is called. |
  66682. *
  66683. * @demo /docs/demos/src/loading/
  66684. * @see {@link /docs/api/components/spinner/Spinner Spinner API Docs}
  66685. */
  66686. var LoadingController = (function () {
  66687. function LoadingController(_app, config) {
  66688. this._app = _app;
  66689. this.config = config;
  66690. }
  66691. /**
  66692. * Create a loading indicator. See below for options.
  66693. * @param {LoadingOptions} [opts] Loading options
  66694. * @returns {Loading} Returns a Loading Instance
  66695. */
  66696. LoadingController.prototype.create = function (opts) {
  66697. if (opts === void 0) { opts = {}; }
  66698. return new __WEBPACK_IMPORTED_MODULE_3__loading__["a" /* Loading */](this._app, opts, this.config);
  66699. };
  66700. LoadingController.decorators = [
  66701. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */] },
  66702. ];
  66703. /** @nocollapse */
  66704. LoadingController.ctorParameters = function () { return [
  66705. { type: __WEBPACK_IMPORTED_MODULE_1__app_app__["a" /* App */], },
  66706. { type: __WEBPACK_IMPORTED_MODULE_2__config_config__["a" /* Config */], },
  66707. ]; };
  66708. return LoadingController;
  66709. }());
  66710. //# sourceMappingURL=loading-controller.js.map
  66711. /***/ }),
  66712. /* 149 */
  66713. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  66714. "use strict";
  66715. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Menu; });
  66716. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  66717. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__app_app__ = __webpack_require__(6);
  66718. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__backdrop_backdrop__ = __webpack_require__(61);
  66719. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__config_config__ = __webpack_require__(1);
  66720. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__content_content__ = __webpack_require__(19);
  66721. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__platform_dom_controller__ = __webpack_require__(8);
  66722. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__gestures_gesture_controller__ = __webpack_require__(7);
  66723. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__util_util__ = __webpack_require__(2);
  66724. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__platform_keyboard__ = __webpack_require__(37);
  66725. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__menu_gestures__ = __webpack_require__(246);
  66726. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__app_menu_controller__ = __webpack_require__(26);
  66727. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__nav_nav__ = __webpack_require__(74);
  66728. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__platform_platform__ = __webpack_require__(3);
  66729. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__gestures_ui_event_manager__ = __webpack_require__(23);
  66730. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__split_pane_split_pane__ = __webpack_require__(39);
  66731. /**
  66732. * @name Menu
  66733. * @description
  66734. * The Menu component is a navigation drawer that slides in from the side of the current
  66735. * view. By default, it slides in from the left, but the side can be overridden. The menu
  66736. * will be displayed differently based on the mode, however the display type can be changed
  66737. * to any of the available [menu types](#menu-types). The menu element should be a sibling
  66738. * to the app's content element. There can be any number of menus attached to the content.
  66739. * These can be controlled from the templates, or programmatically using the [MenuController](../../app/MenuController).
  66740. *
  66741. * @usage
  66742. *
  66743. * ```html
  66744. * <ion-menu [content]="mycontent">
  66745. * <ion-content>
  66746. * <ion-list>
  66747. * <p>some menu content, could be list items</p>
  66748. * </ion-list>
  66749. * </ion-content>
  66750. * </ion-menu>
  66751. *
  66752. * <ion-nav #mycontent [root]="rootPage"></ion-nav>
  66753. * ```
  66754. *
  66755. * To add a menu to an app, the `<ion-menu>` element should be added as a sibling to the `ion-nav` it will belongs
  66756. * to. A [local variable](https://angular.io/docs/ts/latest/guide/user-input.html#local-variables)
  66757. * should be added to the `ion-nav` and passed to the `ion-menu`s `content` property.
  66758. *
  66759. * This tells the menu what it is bound to and what element to watch for gestures.
  66760. * In the below example, `content` is using [property binding](https://angular.io/docs/ts/latest/guide/template-syntax.html#!#property-binding)
  66761. * because `mycontent` is a reference to the `<ion-nav>` element, and not a string.
  66762. *
  66763. *
  66764. * ### Opening/Closing Menus
  66765. *
  66766. * There are several ways to open or close a menu. The menu can be **toggled** open or closed
  66767. * from the template using the [MenuToggle](../MenuToggle) directive. It can also be
  66768. * **closed** from the template using the [MenuClose](../MenuClose) directive. To display a menu
  66769. * programmatically, inject the [MenuController](../MenuController) provider and call any of the
  66770. * `MenuController` methods.
  66771. *
  66772. *
  66773. * ### Menu Types
  66774. *
  66775. * The menu supports several display types: `overlay`, `reveal` and `push`. By default,
  66776. * it will use the correct type based on the mode, but this can be changed. The default
  66777. * type for both Material Design and Windows mode is `overlay`, and `reveal` is the default
  66778. * type for iOS mode. The menu type can be changed in the app's [config](../../config/Config)
  66779. * via the `menuType` property, or passed in the `type` property on the `<ion-menu>` element.
  66780. * See [usage](#usage) below for examples of changing the menu type.
  66781. *
  66782. *
  66783. * ### Navigation Bar Behavior
  66784. *
  66785. * If a [MenuToggle](../MenuToggle) button is added to the [Navbar](../../navbar/Navbar) of
  66786. * a page, the button will only appear when the page it's in is currently a root page. The
  66787. * root page is the initial page loaded in the app, or a page that has been set as the root
  66788. * using the [setRoot](../../nav/NavController/#setRoot) method on the [NavController](../../nav/NavController).
  66789. *
  66790. * For example, say the application has two pages, `Page1` and `Page2`, and both have a
  66791. * `MenuToggle` button in their navigation bars. Assume the initial page loaded into the app
  66792. * is `Page1`, making it the root page. `Page1` will display the `MenuToggle` button, but once
  66793. * `Page2` is pushed onto the navigation stack, the `MenuToggle` will not be displayed.
  66794. *
  66795. *
  66796. * ### Persistent Menus
  66797. *
  66798. * Persistent menus display the [MenuToggle](../MenuToggle) button in the [Navbar](../../navbar/Navbar)
  66799. * on all pages in the navigation stack. To make a menu persistent set `persistent` to `true` on the
  66800. * `<ion-menu>` element. Note that this will only affect the `MenuToggle` button in the `Navbar` attached
  66801. * to the `Menu` with `persistent` set to true, any other `MenuToggle` buttons will not be affected.
  66802. * ### Menu Side
  66803. *
  66804. * By default, menus slide in from the left, but this can be overridden by passing `right`
  66805. * to the `side` property:
  66806. *
  66807. * ```html
  66808. * <ion-menu side="right" [content]="mycontent">...</ion-menu>
  66809. * ```
  66810. *
  66811. *
  66812. * ### Menu Type
  66813. *
  66814. * The menu type can be changed by passing the value to `type` on the `<ion-menu>`:
  66815. *
  66816. * ```html
  66817. * <ion-menu type="overlay" [content]="mycontent">...</ion-menu>
  66818. * ```
  66819. *
  66820. * It can also be set in the app's config. The below will set the menu type to
  66821. * `push` for all modes, and then set the type to `overlay` for the `ios` mode.
  66822. *
  66823. * ```ts
  66824. * // in NgModules
  66825. *
  66826. * imports: [
  66827. * IonicModule.forRoot(MyApp,{
  66828. * menuType: 'push',
  66829. * platforms: {
  66830. * ios: {
  66831. * menuType: 'overlay',
  66832. * }
  66833. * }
  66834. * })
  66835. * ],
  66836. * ```
  66837. *
  66838. *
  66839. * ### Displaying the Menu
  66840. *
  66841. * To toggle a menu from the template, add a button with the `menuToggle`
  66842. * directive anywhere in the page's template:
  66843. *
  66844. * ```html
  66845. * <button ion-button menuToggle>Toggle Menu</button>
  66846. * ```
  66847. *
  66848. * To close a menu, add the `menuClose` button. It can be added anywhere
  66849. * in the content, or even the menu itself. Below it is added to the menu's
  66850. * content:
  66851. *
  66852. * ```html
  66853. * <ion-menu [content]="mycontent">
  66854. * <ion-content>
  66855. * <ion-list>
  66856. * <ion-item menuClose detail-none>Close Menu</ion-item>
  66857. * </ion-list>
  66858. * </ion-content>
  66859. * </ion-menu>
  66860. * ```
  66861. *
  66862. * See the [MenuToggle](../MenuToggle) and [MenuClose](../MenuClose) docs
  66863. * for more information on these directives.
  66864. *
  66865. * The menu can also be controlled from the Page by using the `MenuController`.
  66866. * Inject the `MenuController` provider into the page and then call any of its
  66867. * methods. In the below example, the `openMenu` method will open the menu
  66868. * when it is called.
  66869. *
  66870. * ```ts
  66871. * import { Component } from '@angular/core';
  66872. * import { MenuController } from 'ionic-angular';
  66873. *
  66874. * @Component({...})
  66875. * export class MyPage {
  66876. * constructor(public menuCtrl: MenuController) {}
  66877. *
  66878. * openMenu() {
  66879. * this.menuCtrl.open();
  66880. * }
  66881. * }
  66882. * ```
  66883. *
  66884. * See the [MenuController](../../app/MenuController) API docs for all of the methods
  66885. * and usage information.
  66886. *
  66887. *
  66888. * @demo /docs/demos/src/menu/
  66889. *
  66890. * @see {@link /docs/components#menus Menu Component Docs}
  66891. * @see {@link ../../app/MenuController MenuController API Docs}
  66892. * @see {@link ../../nav/Nav Nav API Docs}
  66893. * @see {@link ../../nav/NavController NavController API Docs}
  66894. */
  66895. var Menu = (function () {
  66896. function Menu(_menuCtrl, _elementRef, _config, _plt, _renderer, _keyboard, _gestureCtrl, _domCtrl, _app) {
  66897. this._menuCtrl = _menuCtrl;
  66898. this._elementRef = _elementRef;
  66899. this._config = _config;
  66900. this._plt = _plt;
  66901. this._renderer = _renderer;
  66902. this._keyboard = _keyboard;
  66903. this._gestureCtrl = _gestureCtrl;
  66904. this._domCtrl = _domCtrl;
  66905. this._app = _app;
  66906. this._isSwipeEnabled = true;
  66907. this._isAnimating = false;
  66908. this._isPersistent = false;
  66909. this._init = false;
  66910. this._isPane = false;
  66911. /**
  66912. * @hidden
  66913. */
  66914. this.isOpen = false;
  66915. /**
  66916. * @hidden
  66917. */
  66918. this.isRightSide = false;
  66919. /**
  66920. * @output {event} Emitted when the menu is being dragged open.
  66921. */
  66922. this.ionDrag = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  66923. /**
  66924. * @output {event} Emitted when the menu has been opened.
  66925. */
  66926. this.ionOpen = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  66927. /**
  66928. * @output {event} Emitted when the menu has been closed.
  66929. */
  66930. this.ionClose = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  66931. this._events = new __WEBPACK_IMPORTED_MODULE_13__gestures_ui_event_manager__["a" /* UIEventManager */](_plt);
  66932. this._gestureBlocker = _gestureCtrl.createBlocker({
  66933. disable: [__WEBPACK_IMPORTED_MODULE_6__gestures_gesture_controller__["b" /* GESTURE_GO_BACK_SWIPE */]]
  66934. });
  66935. this.side = 'start';
  66936. }
  66937. Object.defineProperty(Menu.prototype, "enabled", {
  66938. /**
  66939. * @input {boolean} If true, the menu is enabled. Default `true`.
  66940. */
  66941. get: function () {
  66942. return this._isEnabled;
  66943. },
  66944. set: function (val) {
  66945. var isEnabled = Object(__WEBPACK_IMPORTED_MODULE_7__util_util__["o" /* isTrueProperty */])(val);
  66946. this.enable(isEnabled);
  66947. },
  66948. enumerable: true,
  66949. configurable: true
  66950. });
  66951. Object.defineProperty(Menu.prototype, "side", {
  66952. /**
  66953. * @input {string} Which side of the view the menu should be placed. Default `"left"`.
  66954. */
  66955. get: function () {
  66956. return this._side;
  66957. },
  66958. set: function (val) {
  66959. this.isRightSide = Object(__WEBPACK_IMPORTED_MODULE_7__util_util__["m" /* isRightSide */])(val, this._plt.isRTL);
  66960. if (this.isRightSide) {
  66961. this._side = 'right';
  66962. }
  66963. else {
  66964. this._side = 'left';
  66965. }
  66966. },
  66967. enumerable: true,
  66968. configurable: true
  66969. });
  66970. Object.defineProperty(Menu.prototype, "swipeEnabled", {
  66971. /**
  66972. * @input {boolean} If true, swiping the menu is enabled. Default `true`.
  66973. */
  66974. get: function () {
  66975. return this._isSwipeEnabled;
  66976. },
  66977. set: function (val) {
  66978. var isEnabled = Object(__WEBPACK_IMPORTED_MODULE_7__util_util__["o" /* isTrueProperty */])(val);
  66979. this.swipeEnable(isEnabled);
  66980. },
  66981. enumerable: true,
  66982. configurable: true
  66983. });
  66984. Object.defineProperty(Menu.prototype, "persistent", {
  66985. /**
  66986. * @input {boolean} If true, the menu will persist on child pages.
  66987. */
  66988. get: function () {
  66989. return this._isPersistent;
  66990. },
  66991. set: function (val) {
  66992. this._isPersistent = Object(__WEBPACK_IMPORTED_MODULE_7__util_util__["o" /* isTrueProperty */])(val);
  66993. },
  66994. enumerable: true,
  66995. configurable: true
  66996. });
  66997. /**
  66998. * @hidden
  66999. */
  67000. Menu.prototype.ngOnInit = function () {
  67001. var _this = this;
  67002. this._init = true;
  67003. var content = this.content;
  67004. this._cntEle = (content instanceof Node) ? content : content && content.getNativeElement && content.getNativeElement();
  67005. // requires content element
  67006. if (!this._cntEle) {
  67007. return console.error('Menu: must have a [content] element to listen for drag events on. Example:\n\n<ion-menu [content]="content"></ion-menu>\n\n<ion-nav #content></ion-nav>');
  67008. }
  67009. this.setElementAttribute('side', this._side);
  67010. // normalize the "type"
  67011. if (!this.type) {
  67012. this.type = this._config.get('menuType');
  67013. }
  67014. this.setElementAttribute('type', this.type);
  67015. // add the gestures
  67016. this._gesture = new __WEBPACK_IMPORTED_MODULE_9__menu_gestures__["a" /* MenuContentGesture */](this._plt, this, this._gestureCtrl, this._domCtrl);
  67017. // add menu's content classes
  67018. this._cntEle.classList.add('menu-content');
  67019. this._cntEle.classList.add('menu-content-' + this.type);
  67020. var isEnabled = this._isEnabled;
  67021. if (isEnabled === true || typeof isEnabled === 'undefined') {
  67022. // check if more than one menu is on the same side
  67023. isEnabled = !this._menuCtrl.getMenus().some(function (m) {
  67024. return m.side === _this.side && m.enabled;
  67025. });
  67026. }
  67027. // register this menu with the app's menu controller
  67028. this._menuCtrl._register(this);
  67029. // mask it as enabled / disabled
  67030. this.enable(isEnabled);
  67031. };
  67032. /**
  67033. * @hidden
  67034. */
  67035. Menu.prototype.onBackdropClick = function (ev) {
  67036. ev.preventDefault();
  67037. ev.stopPropagation();
  67038. this._menuCtrl.close();
  67039. };
  67040. /**
  67041. * @hidden
  67042. */
  67043. Menu.prototype._getType = function () {
  67044. if (!this._type) {
  67045. this._type = __WEBPACK_IMPORTED_MODULE_10__app_menu_controller__["a" /* MenuController */].create(this.type, this, this._plt);
  67046. if (this._config.get('animate') === false) {
  67047. this._type.ani.duration(0);
  67048. }
  67049. }
  67050. return this._type;
  67051. };
  67052. /**
  67053. * @hidden
  67054. */
  67055. Menu.prototype.setOpen = function (shouldOpen, animated) {
  67056. var _this = this;
  67057. if (animated === void 0) { animated = true; }
  67058. // If the menu is disabled or it is currenly being animated, let's do nothing
  67059. if ((shouldOpen === this.isOpen) || !this._canOpen() || this._isAnimating) {
  67060. return Promise.resolve(this.isOpen);
  67061. }
  67062. return new Promise(function (resolve) {
  67063. _this._before();
  67064. _this._getType().setOpen(shouldOpen, animated, function () {
  67065. _this._after(shouldOpen);
  67066. resolve(_this.isOpen);
  67067. });
  67068. });
  67069. };
  67070. Menu.prototype._forceClosing = function () {
  67071. var _this = this;
  67072. (void 0) /* assert */;
  67073. this._isAnimating = true;
  67074. this._getType().setOpen(false, false, function () {
  67075. _this._after(false);
  67076. });
  67077. };
  67078. /**
  67079. * @hidden
  67080. */
  67081. Menu.prototype.canSwipe = function () {
  67082. return this._isSwipeEnabled &&
  67083. !this._isAnimating &&
  67084. this._canOpen() &&
  67085. this._app.isEnabled();
  67086. };
  67087. /**
  67088. * @hidden
  67089. */
  67090. Menu.prototype.isAnimating = function () {
  67091. return this._isAnimating;
  67092. };
  67093. Menu.prototype._swipeBeforeStart = function () {
  67094. if (!this.canSwipe()) {
  67095. (void 0) /* assert */;
  67096. return;
  67097. }
  67098. this._before();
  67099. };
  67100. Menu.prototype._swipeStart = function () {
  67101. if (!this._isAnimating) {
  67102. (void 0) /* assert */;
  67103. return;
  67104. }
  67105. this._getType().setProgressStart(this.isOpen);
  67106. };
  67107. Menu.prototype._swipeProgress = function (stepValue) {
  67108. if (!this._isAnimating) {
  67109. (void 0) /* assert */;
  67110. return;
  67111. }
  67112. this._getType().setProgessStep(stepValue);
  67113. var ionDrag = this.ionDrag;
  67114. if (ionDrag.observers.length > 0) {
  67115. ionDrag.emit(stepValue);
  67116. }
  67117. };
  67118. Menu.prototype._swipeEnd = function (shouldCompleteLeft, shouldCompleteRight, stepValue, velocity) {
  67119. var _this = this;
  67120. if (!this._isAnimating) {
  67121. (void 0) /* assert */;
  67122. return;
  67123. }
  67124. // user has finished dragging the menu
  67125. var isRightSide = this.isRightSide;
  67126. var isRTL = this._plt.isRTL;
  67127. var opening = !this.isOpen;
  67128. var shouldComplete = (opening)
  67129. ? (isRightSide !== isRTL) ? shouldCompleteLeft : shouldCompleteRight
  67130. : (isRightSide !== isRTL) ? shouldCompleteRight : shouldCompleteLeft;
  67131. this._getType().setProgressEnd(shouldComplete, stepValue, velocity, function (isOpen) {
  67132. (void 0) /* console.debug */;
  67133. _this._after(isOpen);
  67134. });
  67135. };
  67136. Menu.prototype._before = function () {
  67137. (void 0) /* assert */;
  67138. // this places the menu into the correct location before it animates in
  67139. // this css class doesn't actually kick off any animations
  67140. this.setElementClass('show-menu', true);
  67141. this.backdrop.setElementClass('show-backdrop', true);
  67142. this.resize();
  67143. this._keyboard.close();
  67144. this._isAnimating = true;
  67145. };
  67146. Menu.prototype._after = function (isOpen) {
  67147. (void 0) /* assert */;
  67148. this._app.setEnabled(false, 100);
  67149. // keep opening/closing the menu disabled for a touch more yet
  67150. // only add listeners/css if it's enabled and isOpen
  67151. // and only remove listeners/css if it's not open
  67152. // emit opened/closed events
  67153. this.isOpen = isOpen;
  67154. this._isAnimating = false;
  67155. this._events.unlistenAll();
  67156. if (isOpen) {
  67157. // Disable swipe to go back gesture
  67158. this._gestureBlocker.block();
  67159. this._cntEle.classList.add('menu-content-open');
  67160. var callback = this.onBackdropClick.bind(this);
  67161. this._events.listen(this._cntEle, 'click', callback, { capture: true });
  67162. this._events.listen(this.backdrop.getNativeElement(), 'click', callback, { capture: true });
  67163. this.ionOpen.emit(true);
  67164. }
  67165. else {
  67166. // Enable swipe to go back gesture
  67167. this._gestureBlocker.unblock();
  67168. this._cntEle.classList.remove('menu-content-open');
  67169. this.setElementClass('show-menu', false);
  67170. this.backdrop.setElementClass('show-menu', false);
  67171. this.ionClose.emit(true);
  67172. }
  67173. };
  67174. /**
  67175. * @hidden
  67176. */
  67177. Menu.prototype.open = function () {
  67178. return this.setOpen(true);
  67179. };
  67180. /**
  67181. * @hidden
  67182. */
  67183. Menu.prototype.close = function () {
  67184. return this.setOpen(false);
  67185. };
  67186. /**
  67187. * @hidden
  67188. */
  67189. Menu.prototype.resize = function () {
  67190. var content = this.menuContent
  67191. ? this.menuContent
  67192. : this.menuNav;
  67193. content && content.resize();
  67194. };
  67195. /**
  67196. * @hidden
  67197. */
  67198. Menu.prototype.toggle = function () {
  67199. return this.setOpen(!this.isOpen);
  67200. };
  67201. Menu.prototype._canOpen = function () {
  67202. return this._isEnabled && !this._isPane;
  67203. };
  67204. /**
  67205. * @hidden
  67206. */
  67207. Menu.prototype._updateState = function () {
  67208. var canOpen = this._canOpen();
  67209. // Close menu inmediately
  67210. if (!canOpen && this.isOpen) {
  67211. (void 0) /* assert */;
  67212. // close if this menu is open, and should not be enabled
  67213. this._forceClosing();
  67214. }
  67215. if (this._isEnabled && this._menuCtrl) {
  67216. this._menuCtrl._setActiveMenu(this);
  67217. }
  67218. if (!this._init) {
  67219. return;
  67220. }
  67221. var gesture = this._gesture;
  67222. // only listen/unlisten if the menu has initialized
  67223. if (canOpen && this._isSwipeEnabled && !gesture.isListening) {
  67224. // should listen, but is not currently listening
  67225. (void 0) /* console.debug */;
  67226. gesture.listen();
  67227. }
  67228. else if (gesture.isListening && (!canOpen || !this._isSwipeEnabled)) {
  67229. // should not listen, but is currently listening
  67230. (void 0) /* console.debug */;
  67231. gesture.unlisten();
  67232. }
  67233. if (this.isOpen || (this._isPane && this._isEnabled)) {
  67234. this.resize();
  67235. }
  67236. (void 0) /* assert */;
  67237. };
  67238. /**
  67239. * @hidden
  67240. */
  67241. Menu.prototype.enable = function (shouldEnable) {
  67242. this._isEnabled = shouldEnable;
  67243. this.setElementClass('menu-enabled', shouldEnable);
  67244. this._updateState();
  67245. return this;
  67246. };
  67247. /**
  67248. * @internal
  67249. */
  67250. Menu.prototype.initPane = function () {
  67251. return false;
  67252. };
  67253. /**
  67254. * @internal
  67255. */
  67256. Menu.prototype.paneChanged = function (isPane) {
  67257. this._isPane = isPane;
  67258. this._updateState();
  67259. };
  67260. /**
  67261. * @hidden
  67262. */
  67263. Menu.prototype.swipeEnable = function (shouldEnable) {
  67264. this._isSwipeEnabled = shouldEnable;
  67265. this._updateState();
  67266. return this;
  67267. };
  67268. /**
  67269. * @hidden
  67270. */
  67271. Menu.prototype.getNativeElement = function () {
  67272. return this._elementRef.nativeElement;
  67273. };
  67274. /**
  67275. * @hidden
  67276. */
  67277. Menu.prototype.getMenuElement = function () {
  67278. return this.getNativeElement().querySelector('.menu-inner');
  67279. };
  67280. /**
  67281. * @hidden
  67282. */
  67283. Menu.prototype.getContentElement = function () {
  67284. return this._cntEle;
  67285. };
  67286. /**
  67287. * @hidden
  67288. */
  67289. Menu.prototype.getBackdropElement = function () {
  67290. return this.backdrop.getNativeElement();
  67291. };
  67292. /**
  67293. * @hidden
  67294. */
  67295. Menu.prototype.width = function () {
  67296. return this.getMenuElement().offsetWidth;
  67297. };
  67298. /**
  67299. * @hidden
  67300. */
  67301. Menu.prototype.getMenuController = function () {
  67302. return this._menuCtrl;
  67303. };
  67304. /**
  67305. * @hidden
  67306. */
  67307. Menu.prototype.setElementClass = function (className, add) {
  67308. this._renderer.setElementClass(this._elementRef.nativeElement, className, add);
  67309. };
  67310. /**
  67311. * @hidden
  67312. */
  67313. Menu.prototype.setElementAttribute = function (attributeName, value) {
  67314. this._renderer.setElementAttribute(this._elementRef.nativeElement, attributeName, value);
  67315. };
  67316. /**
  67317. * @hidden
  67318. */
  67319. Menu.prototype.getElementRef = function () {
  67320. return this._elementRef;
  67321. };
  67322. /**
  67323. * @hidden
  67324. */
  67325. Menu.prototype.ngOnDestroy = function () {
  67326. this._menuCtrl._unregister(this);
  67327. this._events.destroy();
  67328. this._gesture && this._gesture.destroy();
  67329. this._type && this._type.destroy();
  67330. this._gesture = null;
  67331. this._type = null;
  67332. this._cntEle = null;
  67333. };
  67334. Menu.decorators = [
  67335. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  67336. selector: 'ion-menu',
  67337. template: '<div class="menu-inner"><ng-content></ng-content></div>' +
  67338. '<ion-backdrop></ion-backdrop>',
  67339. host: {
  67340. 'role': 'navigation'
  67341. },
  67342. changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["i" /* ChangeDetectionStrategy */].OnPush,
  67343. encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_11" /* ViewEncapsulation */].None,
  67344. providers: [{ provide: __WEBPACK_IMPORTED_MODULE_14__split_pane_split_pane__["a" /* RootNode */], useExisting: Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_14" /* forwardRef */])(function () { return Menu; }) }]
  67345. },] },
  67346. ];
  67347. /** @nocollapse */
  67348. Menu.ctorParameters = function () { return [
  67349. { type: __WEBPACK_IMPORTED_MODULE_10__app_menu_controller__["a" /* MenuController */], },
  67350. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  67351. { type: __WEBPACK_IMPORTED_MODULE_3__config_config__["a" /* Config */], },
  67352. { type: __WEBPACK_IMPORTED_MODULE_12__platform_platform__["a" /* Platform */], },
  67353. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  67354. { type: __WEBPACK_IMPORTED_MODULE_8__platform_keyboard__["a" /* Keyboard */], },
  67355. { type: __WEBPACK_IMPORTED_MODULE_6__gestures_gesture_controller__["l" /* GestureController */], },
  67356. { type: __WEBPACK_IMPORTED_MODULE_5__platform_dom_controller__["a" /* DomController */], },
  67357. { type: __WEBPACK_IMPORTED_MODULE_1__app_app__["a" /* App */], },
  67358. ]; };
  67359. Menu.propDecorators = {
  67360. 'backdrop': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_8" /* ViewChild */], args: [__WEBPACK_IMPORTED_MODULE_2__backdrop_backdrop__["a" /* Backdrop */],] },],
  67361. 'menuContent': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["q" /* ContentChild */], args: [__WEBPACK_IMPORTED_MODULE_4__content_content__["a" /* Content */],] },],
  67362. 'menuNav': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["q" /* ContentChild */], args: [__WEBPACK_IMPORTED_MODULE_11__nav_nav__["a" /* Nav */],] },],
  67363. 'content': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  67364. 'id': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  67365. 'type': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  67366. 'enabled': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  67367. 'side': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  67368. 'swipeEnabled': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  67369. 'persistent': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  67370. 'maxEdgeStart': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  67371. 'ionDrag': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  67372. 'ionOpen': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  67373. 'ionClose': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  67374. };
  67375. return Menu;
  67376. }());
  67377. //# sourceMappingURL=menu.js.map
  67378. /***/ }),
  67379. /* 150 */
  67380. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67381. "use strict";
  67382. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MenuClose; });
  67383. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  67384. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__app_menu_controller__ = __webpack_require__(26);
  67385. /**
  67386. * @name MenuClose
  67387. * @description
  67388. * The `menuClose` directive can be placed on any button to close an open menu.
  67389. *
  67390. * @usage
  67391. *
  67392. * A simple `menuClose` button can be added using the following markup:
  67393. *
  67394. * ```html
  67395. * <button ion-button menuClose>Close Menu</button>
  67396. * ```
  67397. *
  67398. * To close a certain menu by its id or side, give the `menuClose`
  67399. * directive a value.
  67400. *
  67401. * ```html
  67402. * <button ion-button menuClose="left">Close Left Menu</button>
  67403. * ```
  67404. *
  67405. * @demo /docs/demos/src/menu/
  67406. * @see {@link /docs/components#menus Menu Component Docs}
  67407. * @see {@link ../../menu/Menu Menu API Docs}
  67408. */
  67409. var MenuClose = (function () {
  67410. function MenuClose(_menu) {
  67411. this._menu = _menu;
  67412. }
  67413. /**
  67414. * @hidden
  67415. */
  67416. MenuClose.prototype.close = function () {
  67417. var menu = this._menu.get(this.menuClose);
  67418. menu && menu.close();
  67419. };
  67420. MenuClose.decorators = [
  67421. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  67422. selector: '[menuClose]'
  67423. },] },
  67424. ];
  67425. /** @nocollapse */
  67426. MenuClose.ctorParameters = function () { return [
  67427. { type: __WEBPACK_IMPORTED_MODULE_1__app_menu_controller__["a" /* MenuController */], },
  67428. ]; };
  67429. MenuClose.propDecorators = {
  67430. 'menuClose': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  67431. 'close': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["y" /* HostListener */], args: ['click',] },],
  67432. };
  67433. return MenuClose;
  67434. }());
  67435. //# sourceMappingURL=menu-close.js.map
  67436. /***/ }),
  67437. /* 151 */
  67438. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67439. "use strict";
  67440. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MenuToggle; });
  67441. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  67442. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__button_button__ = __webpack_require__(36);
  67443. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__app_menu_controller__ = __webpack_require__(26);
  67444. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__toolbar_navbar__ = __webpack_require__(40);
  67445. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__navigation_view_controller__ = __webpack_require__(5);
  67446. /**
  67447. * @name MenuToggle
  67448. * @description
  67449. * The `menuToggle` directive can be placed on any button to toggle a menu open or closed.
  67450. * If it is added to the [NavBar](../../toolbar/Navbar) of a page, the button will only appear
  67451. * when the page it's in is currently a root page. See the [Menu Navigation Bar Behavior](../Menu#navigation-bar-behavior)
  67452. * docs for more information.
  67453. *
  67454. *
  67455. * @usage
  67456. *
  67457. * A simple `menuToggle` button can be added using the following markup:
  67458. *
  67459. * ```html
  67460. * <button ion-button menuToggle>Toggle Menu</button>
  67461. * ```
  67462. *
  67463. * To toggle a specific menu by its id or side, give the `menuToggle`
  67464. * directive a value.
  67465. *
  67466. * ```html
  67467. * <button ion-button menuToggle="right">Toggle Right Menu</button>
  67468. * ```
  67469. *
  67470. * If placing the `menuToggle` in a navbar or toolbar, it should be
  67471. * placed as a child of the `<ion-navbar>` or `<ion-toolbar>`, and not in
  67472. * the `<ion-buttons>` element:
  67473. *
  67474. * ```html
  67475. * <ion-header>
  67476. *
  67477. * <ion-navbar>
  67478. * <ion-buttons start>
  67479. * <button ion-button>
  67480. * <ion-icon name="contact"></ion-icon>
  67481. * </button>
  67482. * </ion-buttons>
  67483. * <button ion-button menuToggle>
  67484. * <ion-icon name="menu"></ion-icon>
  67485. * </button>
  67486. * <ion-title>
  67487. * Title
  67488. * </ion-title>
  67489. * <ion-buttons end>
  67490. * <button ion-button (click)="doClick()">
  67491. * <ion-icon name="more"></ion-icon>
  67492. * </button>
  67493. * </ion-buttons>
  67494. * </ion-navbar>
  67495. *
  67496. * </ion-header>
  67497. * ```
  67498. *
  67499. * Similar to `<ion-buttons>`, the `menuToggle` can be positioned using
  67500. * `start`, `end`, `left`, or `right`:
  67501. *
  67502. * ```html
  67503. * <ion-toolbar>
  67504. * <button ion-button menuToggle right>
  67505. * <ion-icon name="menu"></ion-icon>
  67506. * </button>
  67507. * <ion-title>
  67508. * Title
  67509. * </ion-title>
  67510. * <ion-buttons end>
  67511. * <button ion-button (click)="doClick()">
  67512. * <ion-icon name="more"></ion-icon>
  67513. * </button>
  67514. * </ion-buttons>
  67515. * </ion-toolbar>
  67516. * ```
  67517. *
  67518. * See the [Toolbar API docs](../../toolbar/Toolbar) for more information
  67519. * on the different positions.
  67520. *
  67521. * @demo /docs/demos/src/menu/
  67522. * @see {@link /docs/components#menus Menu Component Docs}
  67523. * @see {@link ../../menu/Menu Menu API Docs}
  67524. */
  67525. var MenuToggle = (function () {
  67526. function MenuToggle(_menu, _viewCtrl, _button, _navbar) {
  67527. this._menu = _menu;
  67528. this._viewCtrl = _viewCtrl;
  67529. this._button = _button;
  67530. this._isButton = !!_button;
  67531. this._inNavbar = !!_navbar;
  67532. }
  67533. MenuToggle.prototype.ngAfterContentInit = function () {
  67534. // Add the bar-button-menutoggle / button-menutoggle class
  67535. if (this._isButton) {
  67536. this._button._setClass('menutoggle', true);
  67537. }
  67538. };
  67539. /**
  67540. * @hidden
  67541. */
  67542. MenuToggle.prototype.toggle = function () {
  67543. var menu = this._menu.get(this.menuToggle);
  67544. menu && menu.toggle();
  67545. };
  67546. Object.defineProperty(MenuToggle.prototype, "isHidden", {
  67547. /**
  67548. * @hidden
  67549. */
  67550. get: function () {
  67551. var menu = this._menu.get(this.menuToggle);
  67552. if (this._inNavbar && this._viewCtrl) {
  67553. if (!menu || !menu._canOpen()) {
  67554. return true;
  67555. }
  67556. if (this._viewCtrl.isFirst()) {
  67557. // this is the first view, so it should always show
  67558. return false;
  67559. }
  67560. if (menu) {
  67561. // this is not the root view, so see if this menu
  67562. // is configured to still be enabled if it's not the root view
  67563. return !menu.persistent;
  67564. }
  67565. }
  67566. return false;
  67567. },
  67568. enumerable: true,
  67569. configurable: true
  67570. });
  67571. MenuToggle.decorators = [
  67572. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  67573. selector: '[menuToggle]',
  67574. host: {
  67575. '[hidden]': 'isHidden'
  67576. }
  67577. },] },
  67578. ];
  67579. /** @nocollapse */
  67580. MenuToggle.ctorParameters = function () { return [
  67581. { type: __WEBPACK_IMPORTED_MODULE_2__app_menu_controller__["a" /* MenuController */], },
  67582. { type: __WEBPACK_IMPORTED_MODULE_4__navigation_view_controller__["a" /* ViewController */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  67583. { type: __WEBPACK_IMPORTED_MODULE_1__button_button__["a" /* Button */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  67584. { type: __WEBPACK_IMPORTED_MODULE_3__toolbar_navbar__["a" /* Navbar */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  67585. ]; };
  67586. MenuToggle.propDecorators = {
  67587. 'menuToggle': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  67588. 'toggle': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["y" /* HostListener */], args: ['click',] },],
  67589. };
  67590. return MenuToggle;
  67591. }());
  67592. //# sourceMappingURL=menu-toggle.js.map
  67593. /***/ }),
  67594. /* 152 */
  67595. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67596. "use strict";
  67597. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ToolbarBase; });
  67598. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ion__ = __webpack_require__(4);
  67599. var __extends = (this && this.__extends) || (function () {
  67600. var extendStatics = Object.setPrototypeOf ||
  67601. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  67602. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  67603. return function (d, b) {
  67604. extendStatics(d, b);
  67605. function __() { this.constructor = d; }
  67606. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  67607. };
  67608. })();
  67609. /**
  67610. * @hidden
  67611. */
  67612. var ToolbarBase = (function (_super) {
  67613. __extends(ToolbarBase, _super);
  67614. function ToolbarBase(config, elementRef, renderer) {
  67615. return _super.call(this, config, elementRef, renderer, 'toolbar') || this;
  67616. }
  67617. /**
  67618. * @hidden
  67619. */
  67620. ToolbarBase.prototype._setTitle = function (titleCmp) {
  67621. this._title = titleCmp;
  67622. };
  67623. /**
  67624. * @hidden
  67625. * Returns the toolbar title text if it exists or an empty string
  67626. */
  67627. ToolbarBase.prototype.getTitleText = function () {
  67628. return (this._title && this._title.getTitleText()) || '';
  67629. };
  67630. return ToolbarBase;
  67631. }(__WEBPACK_IMPORTED_MODULE_0__ion__["a" /* Ion */]));
  67632. //# sourceMappingURL=toolbar-base.js.map
  67633. /***/ }),
  67634. /* 153 */
  67635. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67636. "use strict";
  67637. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Modal; });
  67638. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__navigation_overlay_proxy__ = __webpack_require__(154);
  67639. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__modal_impl__ = __webpack_require__(248);
  67640. var __extends = (this && this.__extends) || (function () {
  67641. var extendStatics = Object.setPrototypeOf ||
  67642. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  67643. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  67644. return function (d, b) {
  67645. extendStatics(d, b);
  67646. function __() { this.constructor = d; }
  67647. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  67648. };
  67649. })();
  67650. /**
  67651. * @hidden
  67652. */
  67653. var Modal = (function (_super) {
  67654. __extends(Modal, _super);
  67655. function Modal(app, component, data, opts, config, deepLinker) {
  67656. if (opts === void 0) { opts = {}; }
  67657. var _this = _super.call(this, app, component, config, deepLinker) || this;
  67658. _this.data = data;
  67659. _this.opts = opts;
  67660. _this.isOverlay = true;
  67661. return _this;
  67662. }
  67663. Modal.prototype.getImplementation = function () {
  67664. return new __WEBPACK_IMPORTED_MODULE_1__modal_impl__["a" /* ModalImpl */](this._app, this._component, this.data, this.opts, this._config);
  67665. };
  67666. return Modal;
  67667. }(__WEBPACK_IMPORTED_MODULE_0__navigation_overlay_proxy__["a" /* OverlayProxy */]));
  67668. //# sourceMappingURL=modal.js.map
  67669. /***/ }),
  67670. /* 154 */
  67671. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67672. "use strict";
  67673. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return OverlayProxy; });
  67674. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_util__ = __webpack_require__(2);
  67675. var OverlayProxy = (function () {
  67676. function OverlayProxy(_app, _component, _config, _deepLinker) {
  67677. this._app = _app;
  67678. this._component = _component;
  67679. this._config = _config;
  67680. this._deepLinker = _deepLinker;
  67681. }
  67682. OverlayProxy.prototype.getImplementation = function () {
  67683. throw new Error('Child class must implement "getImplementation" method');
  67684. };
  67685. /**
  67686. * Present the modal instance.
  67687. *
  67688. * @param {NavOptions} [navOptions={}] Nav options to go with this transition.
  67689. * @returns {Promise} Returns a promise which is resolved when the transition has completed.
  67690. */
  67691. OverlayProxy.prototype.present = function (navOptions) {
  67692. var _this = this;
  67693. if (navOptions === void 0) { navOptions = {}; }
  67694. // check if it's a lazy loaded component, or not
  67695. var isLazyLoaded = Object(__WEBPACK_IMPORTED_MODULE_0__util_util__["n" /* isString */])(this._component);
  67696. if (isLazyLoaded) {
  67697. return this._deepLinker.getComponentFromName(this._component).then(function (loadedComponent) {
  67698. _this._component = loadedComponent;
  67699. return _this.createAndPresentOverlay(navOptions);
  67700. });
  67701. }
  67702. else {
  67703. return this.createAndPresentOverlay(navOptions);
  67704. }
  67705. };
  67706. OverlayProxy.prototype.dismiss = function (data, role, navOptions) {
  67707. if (this.overlay) {
  67708. return this.overlay.dismiss(data, role, navOptions);
  67709. }
  67710. };
  67711. /**
  67712. * Called when the current viewController has be successfully dismissed
  67713. */
  67714. OverlayProxy.prototype.onDidDismiss = function (callback) {
  67715. this._onDidDismiss = callback;
  67716. if (this.overlay) {
  67717. this.overlay.onDidDismiss(this._onDidDismiss);
  67718. }
  67719. };
  67720. OverlayProxy.prototype.createAndPresentOverlay = function (navOptions) {
  67721. this.overlay = this.getImplementation();
  67722. this.overlay.onWillDismiss(this._onWillDismiss);
  67723. this.overlay.onDidDismiss(this._onDidDismiss);
  67724. return this.overlay.present(navOptions);
  67725. };
  67726. /**
  67727. * Called when the current viewController will be dismissed
  67728. */
  67729. OverlayProxy.prototype.onWillDismiss = function (callback) {
  67730. this._onWillDismiss = callback;
  67731. if (this.overlay) {
  67732. this.overlay.onWillDismiss(this._onWillDismiss);
  67733. }
  67734. };
  67735. return OverlayProxy;
  67736. }());
  67737. //# sourceMappingURL=overlay-proxy.js.map
  67738. /***/ }),
  67739. /* 155 */
  67740. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67741. "use strict";
  67742. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return NgModuleLoader; });
  67743. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  67744. /**
  67745. * NgModuleFactoryLoader that uses SystemJS to load NgModuleFactory
  67746. */
  67747. var NgModuleLoader = (function () {
  67748. function NgModuleLoader(_compiler) {
  67749. this._compiler = _compiler;
  67750. }
  67751. NgModuleLoader.prototype.load = function (modulePath, ngModuleExport) {
  67752. var offlineMode = this._compiler instanceof __WEBPACK_IMPORTED_MODULE_0__angular_core__["k" /* Compiler */];
  67753. return offlineMode ? loadPrecompiledFactory(modulePath, ngModuleExport) : loadAndCompile(this._compiler, modulePath, ngModuleExport);
  67754. };
  67755. NgModuleLoader.decorators = [
  67756. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */] },
  67757. ];
  67758. /** @nocollapse */
  67759. NgModuleLoader.ctorParameters = function () { return [
  67760. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["k" /* Compiler */], },
  67761. ]; };
  67762. return NgModuleLoader;
  67763. }());
  67764. function loadAndCompile(compiler, modulePath, ngModuleExport) {
  67765. if (!ngModuleExport) {
  67766. ngModuleExport = 'default';
  67767. }
  67768. return __webpack_require__(156)(modulePath)
  67769. .then(function (rawModule) {
  67770. var module = rawModule[ngModuleExport];
  67771. if (!module) {
  67772. throw new Error("Module " + modulePath + " does not export " + ngModuleExport);
  67773. }
  67774. return compiler.compileModuleAsync(module);
  67775. });
  67776. }
  67777. function loadPrecompiledFactory(modulePath, ngModuleExport) {
  67778. return __webpack_require__(156)(modulePath)
  67779. .then(function (rawModule) {
  67780. var ngModuleFactory = rawModule[ngModuleExport];
  67781. if (!ngModuleFactory) {
  67782. throw new Error("Module " + modulePath + " does not export " + ngModuleExport);
  67783. }
  67784. return ngModuleFactory;
  67785. });
  67786. }
  67787. //# sourceMappingURL=ng-module-loader.js.map
  67788. /***/ }),
  67789. /* 156 */,
  67790. /* 157 */,
  67791. /* 158 */,
  67792. /* 159 */
  67793. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67794. "use strict";
  67795. /* unused harmony export HttpBackend */
  67796. /* unused harmony export HttpHandler */
  67797. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return HttpClient; });
  67798. /* unused harmony export HttpHeaders */
  67799. /* unused harmony export HTTP_INTERCEPTORS */
  67800. /* unused harmony export JsonpClientBackend */
  67801. /* unused harmony export JsonpInterceptor */
  67802. /* unused harmony export HttpClientJsonpModule */
  67803. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return HttpClientModule; });
  67804. /* unused harmony export HttpClientXsrfModule */
  67805. /* unused harmony export ɵinterceptingHandler */
  67806. /* unused harmony export HttpParams */
  67807. /* unused harmony export HttpUrlEncodingCodec */
  67808. /* unused harmony export HttpRequest */
  67809. /* unused harmony export HttpErrorResponse */
  67810. /* unused harmony export HttpEventType */
  67811. /* unused harmony export HttpHeaderResponse */
  67812. /* unused harmony export HttpResponse */
  67813. /* unused harmony export HttpResponseBase */
  67814. /* unused harmony export HttpXhrBackend */
  67815. /* unused harmony export XhrFactory */
  67816. /* unused harmony export HttpXsrfTokenExtractor */
  67817. /* unused harmony export ɵa */
  67818. /* unused harmony export ɵb */
  67819. /* unused harmony export ɵc */
  67820. /* unused harmony export ɵd */
  67821. /* unused harmony export ɵe */
  67822. /* unused harmony export ɵh */
  67823. /* unused harmony export ɵi */
  67824. /* unused harmony export ɵf */
  67825. /* unused harmony export ɵg */
  67826. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  67827. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_observable_of__ = __webpack_require__(249);
  67828. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_observable_of___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_rxjs_observable_of__);
  67829. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_operator_concatMap__ = __webpack_require__(250);
  67830. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_operator_concatMap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_operator_concatMap__);
  67831. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_operator_filter__ = __webpack_require__(252);
  67832. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_operator_filter___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_operator_filter__);
  67833. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_map__ = __webpack_require__(127);
  67834. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_map___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_rxjs_operator_map__);
  67835. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_tslib__ = __webpack_require__(25);
  67836. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__angular_common__ = __webpack_require__(34);
  67837. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_rxjs_Observable__ = __webpack_require__(9);
  67838. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_rxjs_Observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_rxjs_Observable__);
  67839. /**
  67840. * @license Angular v5.2.11
  67841. * (c) 2010-2018 Google, Inc. https://angular.io/
  67842. * License: MIT
  67843. */
  67844. /**
  67845. * @fileoverview added by tsickle
  67846. * @suppress {checkTypes} checked by tsc
  67847. */
  67848. /**
  67849. * @license
  67850. * Copyright Google Inc. All Rights Reserved.
  67851. *
  67852. * Use of this source code is governed by an MIT-style license that can be
  67853. * found in the LICENSE file at https://angular.io/license
  67854. */
  67855. /**
  67856. * Transforms an `HttpRequest` into a stream of `HttpEvent`s, one of which will likely be a
  67857. * `HttpResponse`.
  67858. *
  67859. * `HttpHandler` is injectable. When injected, the handler instance dispatches requests to the
  67860. * first interceptor in the chain, which dispatches to the second, etc, eventually reaching the
  67861. * `HttpBackend`.
  67862. *
  67863. * In an `HttpInterceptor`, the `HttpHandler` parameter is the next interceptor in the chain.
  67864. *
  67865. * \@stable
  67866. * @abstract
  67867. */
  67868. var HttpHandler = /** @class */ (function () {
  67869. function HttpHandler() {
  67870. }
  67871. return HttpHandler;
  67872. }());
  67873. /**
  67874. * A final `HttpHandler` which will dispatch the request via browser HTTP APIs to a backend.
  67875. *
  67876. * Interceptors sit between the `HttpClient` interface and the `HttpBackend`.
  67877. *
  67878. * When injected, `HttpBackend` dispatches requests directly to the backend, without going
  67879. * through the interceptor chain.
  67880. *
  67881. * \@stable
  67882. * @abstract
  67883. */
  67884. var HttpBackend = /** @class */ (function () {
  67885. function HttpBackend() {
  67886. }
  67887. return HttpBackend;
  67888. }());
  67889. /**
  67890. * @fileoverview added by tsickle
  67891. * @suppress {checkTypes} checked by tsc
  67892. */
  67893. /**
  67894. * @license
  67895. * Copyright Google Inc. All Rights Reserved.
  67896. *
  67897. * Use of this source code is governed by an MIT-style license that can be
  67898. * found in the LICENSE file at https://angular.io/license
  67899. */
  67900. /**
  67901. * @record
  67902. */
  67903. /**
  67904. * Immutable set of Http headers, with lazy parsing.
  67905. * \@stable
  67906. */
  67907. var HttpHeaders = /** @class */ (function () {
  67908. function HttpHeaders(headers) {
  67909. var _this = this;
  67910. /**
  67911. * Internal map of lowercased header names to the normalized
  67912. * form of the name (the form seen first).
  67913. */
  67914. this.normalizedNames = new Map();
  67915. /**
  67916. * Queued updates to be materialized the next initialization.
  67917. */
  67918. this.lazyUpdate = null;
  67919. if (!headers) {
  67920. this.headers = new Map();
  67921. }
  67922. else if (typeof headers === 'string') {
  67923. this.lazyInit = function () {
  67924. _this.headers = new Map();
  67925. headers.split('\n').forEach(function (line) {
  67926. var /** @type {?} */ index = line.indexOf(':');
  67927. if (index > 0) {
  67928. var /** @type {?} */ name_1 = line.slice(0, index);
  67929. var /** @type {?} */ key = name_1.toLowerCase();
  67930. var /** @type {?} */ value = line.slice(index + 1).trim();
  67931. _this.maybeSetNormalizedName(name_1, key);
  67932. if (_this.headers.has(key)) {
  67933. /** @type {?} */ ((_this.headers.get(key))).push(value);
  67934. }
  67935. else {
  67936. _this.headers.set(key, [value]);
  67937. }
  67938. }
  67939. });
  67940. };
  67941. }
  67942. else {
  67943. this.lazyInit = function () {
  67944. _this.headers = new Map();
  67945. Object.keys(headers).forEach(function (name) {
  67946. var /** @type {?} */ values = headers[name];
  67947. var /** @type {?} */ key = name.toLowerCase();
  67948. if (typeof values === 'string') {
  67949. values = [values];
  67950. }
  67951. if (values.length > 0) {
  67952. _this.headers.set(key, values);
  67953. _this.maybeSetNormalizedName(name, key);
  67954. }
  67955. });
  67956. };
  67957. }
  67958. }
  67959. /**
  67960. * Checks for existence of header by given name.
  67961. */
  67962. /**
  67963. * Checks for existence of header by given name.
  67964. * @param {?} name
  67965. * @return {?}
  67966. */
  67967. HttpHeaders.prototype.has = /**
  67968. * Checks for existence of header by given name.
  67969. * @param {?} name
  67970. * @return {?}
  67971. */
  67972. function (name) {
  67973. this.init();
  67974. return this.headers.has(name.toLowerCase());
  67975. };
  67976. /**
  67977. * Returns first header that matches given name.
  67978. */
  67979. /**
  67980. * Returns first header that matches given name.
  67981. * @param {?} name
  67982. * @return {?}
  67983. */
  67984. HttpHeaders.prototype.get = /**
  67985. * Returns first header that matches given name.
  67986. * @param {?} name
  67987. * @return {?}
  67988. */
  67989. function (name) {
  67990. this.init();
  67991. var /** @type {?} */ values = this.headers.get(name.toLowerCase());
  67992. return values && values.length > 0 ? values[0] : null;
  67993. };
  67994. /**
  67995. * Returns the names of the headers
  67996. */
  67997. /**
  67998. * Returns the names of the headers
  67999. * @return {?}
  68000. */
  68001. HttpHeaders.prototype.keys = /**
  68002. * Returns the names of the headers
  68003. * @return {?}
  68004. */
  68005. function () {
  68006. this.init();
  68007. return Array.from(this.normalizedNames.values());
  68008. };
  68009. /**
  68010. * Returns list of header values for a given name.
  68011. */
  68012. /**
  68013. * Returns list of header values for a given name.
  68014. * @param {?} name
  68015. * @return {?}
  68016. */
  68017. HttpHeaders.prototype.getAll = /**
  68018. * Returns list of header values for a given name.
  68019. * @param {?} name
  68020. * @return {?}
  68021. */
  68022. function (name) {
  68023. this.init();
  68024. return this.headers.get(name.toLowerCase()) || null;
  68025. };
  68026. /**
  68027. * @param {?} name
  68028. * @param {?} value
  68029. * @return {?}
  68030. */
  68031. HttpHeaders.prototype.append = /**
  68032. * @param {?} name
  68033. * @param {?} value
  68034. * @return {?}
  68035. */
  68036. function (name, value) {
  68037. return this.clone({ name: name, value: value, op: 'a' });
  68038. };
  68039. /**
  68040. * @param {?} name
  68041. * @param {?} value
  68042. * @return {?}
  68043. */
  68044. HttpHeaders.prototype.set = /**
  68045. * @param {?} name
  68046. * @param {?} value
  68047. * @return {?}
  68048. */
  68049. function (name, value) {
  68050. return this.clone({ name: name, value: value, op: 's' });
  68051. };
  68052. /**
  68053. * @param {?} name
  68054. * @param {?=} value
  68055. * @return {?}
  68056. */
  68057. HttpHeaders.prototype.delete = /**
  68058. * @param {?} name
  68059. * @param {?=} value
  68060. * @return {?}
  68061. */
  68062. function (name, value) {
  68063. return this.clone({ name: name, value: value, op: 'd' });
  68064. };
  68065. /**
  68066. * @param {?} name
  68067. * @param {?} lcName
  68068. * @return {?}
  68069. */
  68070. HttpHeaders.prototype.maybeSetNormalizedName = /**
  68071. * @param {?} name
  68072. * @param {?} lcName
  68073. * @return {?}
  68074. */
  68075. function (name, lcName) {
  68076. if (!this.normalizedNames.has(lcName)) {
  68077. this.normalizedNames.set(lcName, name);
  68078. }
  68079. };
  68080. /**
  68081. * @return {?}
  68082. */
  68083. HttpHeaders.prototype.init = /**
  68084. * @return {?}
  68085. */
  68086. function () {
  68087. var _this = this;
  68088. if (!!this.lazyInit) {
  68089. if (this.lazyInit instanceof HttpHeaders) {
  68090. this.copyFrom(this.lazyInit);
  68091. }
  68092. else {
  68093. this.lazyInit();
  68094. }
  68095. this.lazyInit = null;
  68096. if (!!this.lazyUpdate) {
  68097. this.lazyUpdate.forEach(function (update) { return _this.applyUpdate(update); });
  68098. this.lazyUpdate = null;
  68099. }
  68100. }
  68101. };
  68102. /**
  68103. * @param {?} other
  68104. * @return {?}
  68105. */
  68106. HttpHeaders.prototype.copyFrom = /**
  68107. * @param {?} other
  68108. * @return {?}
  68109. */
  68110. function (other) {
  68111. var _this = this;
  68112. other.init();
  68113. Array.from(other.headers.keys()).forEach(function (key) {
  68114. _this.headers.set(key, /** @type {?} */ ((other.headers.get(key))));
  68115. _this.normalizedNames.set(key, /** @type {?} */ ((other.normalizedNames.get(key))));
  68116. });
  68117. };
  68118. /**
  68119. * @param {?} update
  68120. * @return {?}
  68121. */
  68122. HttpHeaders.prototype.clone = /**
  68123. * @param {?} update
  68124. * @return {?}
  68125. */
  68126. function (update) {
  68127. var /** @type {?} */ clone = new HttpHeaders();
  68128. clone.lazyInit =
  68129. (!!this.lazyInit && this.lazyInit instanceof HttpHeaders) ? this.lazyInit : this;
  68130. clone.lazyUpdate = (this.lazyUpdate || []).concat([update]);
  68131. return clone;
  68132. };
  68133. /**
  68134. * @param {?} update
  68135. * @return {?}
  68136. */
  68137. HttpHeaders.prototype.applyUpdate = /**
  68138. * @param {?} update
  68139. * @return {?}
  68140. */
  68141. function (update) {
  68142. var /** @type {?} */ key = update.name.toLowerCase();
  68143. switch (update.op) {
  68144. case 'a':
  68145. case 's':
  68146. var /** @type {?} */ value = /** @type {?} */ ((update.value));
  68147. if (typeof value === 'string') {
  68148. value = [value];
  68149. }
  68150. if (value.length === 0) {
  68151. return;
  68152. }
  68153. this.maybeSetNormalizedName(update.name, key);
  68154. var /** @type {?} */ base = (update.op === 'a' ? this.headers.get(key) : undefined) || [];
  68155. base.push.apply(base, value);
  68156. this.headers.set(key, base);
  68157. break;
  68158. case 'd':
  68159. var /** @type {?} */ toDelete_1 = /** @type {?} */ (update.value);
  68160. if (!toDelete_1) {
  68161. this.headers.delete(key);
  68162. this.normalizedNames.delete(key);
  68163. }
  68164. else {
  68165. var /** @type {?} */ existing = this.headers.get(key);
  68166. if (!existing) {
  68167. return;
  68168. }
  68169. existing = existing.filter(function (value) { return toDelete_1.indexOf(value) === -1; });
  68170. if (existing.length === 0) {
  68171. this.headers.delete(key);
  68172. this.normalizedNames.delete(key);
  68173. }
  68174. else {
  68175. this.headers.set(key, existing);
  68176. }
  68177. }
  68178. break;
  68179. }
  68180. };
  68181. /**
  68182. * @internal
  68183. */
  68184. /**
  68185. * \@internal
  68186. * @param {?} fn
  68187. * @return {?}
  68188. */
  68189. HttpHeaders.prototype.forEach = /**
  68190. * \@internal
  68191. * @param {?} fn
  68192. * @return {?}
  68193. */
  68194. function (fn) {
  68195. var _this = this;
  68196. this.init();
  68197. Array.from(this.normalizedNames.keys())
  68198. .forEach(function (key) { return fn(/** @type {?} */ ((_this.normalizedNames.get(key))), /** @type {?} */ ((_this.headers.get(key)))); });
  68199. };
  68200. return HttpHeaders;
  68201. }());
  68202. /**
  68203. * @fileoverview added by tsickle
  68204. * @suppress {checkTypes} checked by tsc
  68205. */
  68206. /**
  68207. * @license
  68208. * Copyright Google Inc. All Rights Reserved.
  68209. *
  68210. * Use of this source code is governed by an MIT-style license that can be
  68211. * found in the LICENSE file at https://angular.io/license
  68212. */
  68213. /**
  68214. * A codec for encoding and decoding parameters in URLs.
  68215. *
  68216. * Used by `HttpParams`.
  68217. *
  68218. * \@stable
  68219. *
  68220. * @record
  68221. */
  68222. /**
  68223. * A `HttpParameterCodec` that uses `encodeURIComponent` and `decodeURIComponent` to
  68224. * serialize and parse URL parameter keys and values.
  68225. *
  68226. * \@stable
  68227. */
  68228. var HttpUrlEncodingCodec = /** @class */ (function () {
  68229. function HttpUrlEncodingCodec() {
  68230. }
  68231. /**
  68232. * @param {?} k
  68233. * @return {?}
  68234. */
  68235. HttpUrlEncodingCodec.prototype.encodeKey = /**
  68236. * @param {?} k
  68237. * @return {?}
  68238. */
  68239. function (k) { return standardEncoding(k); };
  68240. /**
  68241. * @param {?} v
  68242. * @return {?}
  68243. */
  68244. HttpUrlEncodingCodec.prototype.encodeValue = /**
  68245. * @param {?} v
  68246. * @return {?}
  68247. */
  68248. function (v) { return standardEncoding(v); };
  68249. /**
  68250. * @param {?} k
  68251. * @return {?}
  68252. */
  68253. HttpUrlEncodingCodec.prototype.decodeKey = /**
  68254. * @param {?} k
  68255. * @return {?}
  68256. */
  68257. function (k) { return decodeURIComponent(k); };
  68258. /**
  68259. * @param {?} v
  68260. * @return {?}
  68261. */
  68262. HttpUrlEncodingCodec.prototype.decodeValue = /**
  68263. * @param {?} v
  68264. * @return {?}
  68265. */
  68266. function (v) { return decodeURIComponent(v); };
  68267. return HttpUrlEncodingCodec;
  68268. }());
  68269. /**
  68270. * @param {?} rawParams
  68271. * @param {?} codec
  68272. * @return {?}
  68273. */
  68274. function paramParser(rawParams, codec) {
  68275. var /** @type {?} */ map$$1 = new Map();
  68276. if (rawParams.length > 0) {
  68277. var /** @type {?} */ params = rawParams.split('&');
  68278. params.forEach(function (param) {
  68279. var /** @type {?} */ eqIdx = param.indexOf('=');
  68280. var _a = eqIdx == -1 ?
  68281. [codec.decodeKey(param), ''] :
  68282. [codec.decodeKey(param.slice(0, eqIdx)), codec.decodeValue(param.slice(eqIdx + 1))], key = _a[0], val = _a[1];
  68283. var /** @type {?} */ list = map$$1.get(key) || [];
  68284. list.push(val);
  68285. map$$1.set(key, list);
  68286. });
  68287. }
  68288. return map$$1;
  68289. }
  68290. /**
  68291. * @param {?} v
  68292. * @return {?}
  68293. */
  68294. function standardEncoding(v) {
  68295. return encodeURIComponent(v)
  68296. .replace(/%40/gi, '@')
  68297. .replace(/%3A/gi, ':')
  68298. .replace(/%24/gi, '$')
  68299. .replace(/%2C/gi, ',')
  68300. .replace(/%3B/gi, ';')
  68301. .replace(/%2B/gi, '+')
  68302. .replace(/%3D/gi, '=')
  68303. .replace(/%3F/gi, '?')
  68304. .replace(/%2F/gi, '/');
  68305. }
  68306. /**
  68307. * An HTTP request/response body that represents serialized parameters,
  68308. * per the MIME type `application/x-www-form-urlencoded`.
  68309. *
  68310. * This class is immutable - all mutation operations return a new instance.
  68311. *
  68312. * \@stable
  68313. */
  68314. var HttpParams = /** @class */ (function () {
  68315. function HttpParams(options) {
  68316. if (options === void 0) { options = /** @type {?} */ ({}); }
  68317. var _this = this;
  68318. this.updates = null;
  68319. this.cloneFrom = null;
  68320. this.encoder = options.encoder || new HttpUrlEncodingCodec();
  68321. if (!!options.fromString) {
  68322. if (!!options.fromObject) {
  68323. throw new Error("Cannot specify both fromString and fromObject.");
  68324. }
  68325. this.map = paramParser(options.fromString, this.encoder);
  68326. }
  68327. else if (!!options.fromObject) {
  68328. this.map = new Map();
  68329. Object.keys(options.fromObject).forEach(function (key) {
  68330. var /** @type {?} */ value = (/** @type {?} */ (options.fromObject))[key]; /** @type {?} */
  68331. ((_this.map)).set(key, Array.isArray(value) ? value : [value]);
  68332. });
  68333. }
  68334. else {
  68335. this.map = null;
  68336. }
  68337. }
  68338. /**
  68339. * Check whether the body has one or more values for the given parameter name.
  68340. */
  68341. /**
  68342. * Check whether the body has one or more values for the given parameter name.
  68343. * @param {?} param
  68344. * @return {?}
  68345. */
  68346. HttpParams.prototype.has = /**
  68347. * Check whether the body has one or more values for the given parameter name.
  68348. * @param {?} param
  68349. * @return {?}
  68350. */
  68351. function (param) {
  68352. this.init();
  68353. return /** @type {?} */ ((this.map)).has(param);
  68354. };
  68355. /**
  68356. * Get the first value for the given parameter name, or `null` if it's not present.
  68357. */
  68358. /**
  68359. * Get the first value for the given parameter name, or `null` if it's not present.
  68360. * @param {?} param
  68361. * @return {?}
  68362. */
  68363. HttpParams.prototype.get = /**
  68364. * Get the first value for the given parameter name, or `null` if it's not present.
  68365. * @param {?} param
  68366. * @return {?}
  68367. */
  68368. function (param) {
  68369. this.init();
  68370. var /** @type {?} */ res = /** @type {?} */ ((this.map)).get(param);
  68371. return !!res ? res[0] : null;
  68372. };
  68373. /**
  68374. * Get all values for the given parameter name, or `null` if it's not present.
  68375. */
  68376. /**
  68377. * Get all values for the given parameter name, or `null` if it's not present.
  68378. * @param {?} param
  68379. * @return {?}
  68380. */
  68381. HttpParams.prototype.getAll = /**
  68382. * Get all values for the given parameter name, or `null` if it's not present.
  68383. * @param {?} param
  68384. * @return {?}
  68385. */
  68386. function (param) {
  68387. this.init();
  68388. return /** @type {?} */ ((this.map)).get(param) || null;
  68389. };
  68390. /**
  68391. * Get all the parameter names for this body.
  68392. */
  68393. /**
  68394. * Get all the parameter names for this body.
  68395. * @return {?}
  68396. */
  68397. HttpParams.prototype.keys = /**
  68398. * Get all the parameter names for this body.
  68399. * @return {?}
  68400. */
  68401. function () {
  68402. this.init();
  68403. return Array.from(/** @type {?} */ ((this.map)).keys());
  68404. };
  68405. /**
  68406. * Construct a new body with an appended value for the given parameter name.
  68407. */
  68408. /**
  68409. * Construct a new body with an appended value for the given parameter name.
  68410. * @param {?} param
  68411. * @param {?} value
  68412. * @return {?}
  68413. */
  68414. HttpParams.prototype.append = /**
  68415. * Construct a new body with an appended value for the given parameter name.
  68416. * @param {?} param
  68417. * @param {?} value
  68418. * @return {?}
  68419. */
  68420. function (param, value) { return this.clone({ param: param, value: value, op: 'a' }); };
  68421. /**
  68422. * Construct a new body with a new value for the given parameter name.
  68423. */
  68424. /**
  68425. * Construct a new body with a new value for the given parameter name.
  68426. * @param {?} param
  68427. * @param {?} value
  68428. * @return {?}
  68429. */
  68430. HttpParams.prototype.set = /**
  68431. * Construct a new body with a new value for the given parameter name.
  68432. * @param {?} param
  68433. * @param {?} value
  68434. * @return {?}
  68435. */
  68436. function (param, value) { return this.clone({ param: param, value: value, op: 's' }); };
  68437. /**
  68438. * Construct a new body with either the given value for the given parameter
  68439. * removed, if a value is given, or all values for the given parameter removed
  68440. * if not.
  68441. */
  68442. /**
  68443. * Construct a new body with either the given value for the given parameter
  68444. * removed, if a value is given, or all values for the given parameter removed
  68445. * if not.
  68446. * @param {?} param
  68447. * @param {?=} value
  68448. * @return {?}
  68449. */
  68450. HttpParams.prototype.delete = /**
  68451. * Construct a new body with either the given value for the given parameter
  68452. * removed, if a value is given, or all values for the given parameter removed
  68453. * if not.
  68454. * @param {?} param
  68455. * @param {?=} value
  68456. * @return {?}
  68457. */
  68458. function (param, value) { return this.clone({ param: param, value: value, op: 'd' }); };
  68459. /**
  68460. * Serialize the body to an encoded string, where key-value pairs (separated by `=`) are
  68461. * separated by `&`s.
  68462. */
  68463. /**
  68464. * Serialize the body to an encoded string, where key-value pairs (separated by `=`) are
  68465. * separated by `&`s.
  68466. * @return {?}
  68467. */
  68468. HttpParams.prototype.toString = /**
  68469. * Serialize the body to an encoded string, where key-value pairs (separated by `=`) are
  68470. * separated by `&`s.
  68471. * @return {?}
  68472. */
  68473. function () {
  68474. var _this = this;
  68475. this.init();
  68476. return this.keys()
  68477. .map(function (key) {
  68478. var /** @type {?} */ eKey = _this.encoder.encodeKey(key);
  68479. return /** @type {?} */ ((/** @type {?} */ ((_this.map)).get(key))).map(function (value) { return eKey + '=' + _this.encoder.encodeValue(value); }).join('&');
  68480. })
  68481. .join('&');
  68482. };
  68483. /**
  68484. * @param {?} update
  68485. * @return {?}
  68486. */
  68487. HttpParams.prototype.clone = /**
  68488. * @param {?} update
  68489. * @return {?}
  68490. */
  68491. function (update) {
  68492. var /** @type {?} */ clone = new HttpParams({ encoder: this.encoder });
  68493. clone.cloneFrom = this.cloneFrom || this;
  68494. clone.updates = (this.updates || []).concat([update]);
  68495. return clone;
  68496. };
  68497. /**
  68498. * @return {?}
  68499. */
  68500. HttpParams.prototype.init = /**
  68501. * @return {?}
  68502. */
  68503. function () {
  68504. var _this = this;
  68505. if (this.map === null) {
  68506. this.map = new Map();
  68507. }
  68508. if (this.cloneFrom !== null) {
  68509. this.cloneFrom.init();
  68510. this.cloneFrom.keys().forEach(function (key) { return ((_this.map)).set(key, /** @type {?} */ ((/** @type {?} */ ((/** @type {?} */ ((_this.cloneFrom)).map)).get(key)))); }); /** @type {?} */
  68511. ((this.updates)).forEach(function (update) {
  68512. switch (update.op) {
  68513. case 'a':
  68514. case 's':
  68515. var /** @type {?} */ base = (update.op === 'a' ? /** @type {?} */ ((_this.map)).get(update.param) : undefined) || [];
  68516. base.push(/** @type {?} */ ((update.value))); /** @type {?} */
  68517. ((_this.map)).set(update.param, base);
  68518. break;
  68519. case 'd':
  68520. if (update.value !== undefined) {
  68521. var /** @type {?} */ base_1 = /** @type {?} */ ((_this.map)).get(update.param) || [];
  68522. var /** @type {?} */ idx = base_1.indexOf(update.value);
  68523. if (idx !== -1) {
  68524. base_1.splice(idx, 1);
  68525. }
  68526. if (base_1.length > 0) {
  68527. /** @type {?} */ ((_this.map)).set(update.param, base_1);
  68528. }
  68529. else {
  68530. /** @type {?} */ ((_this.map)).delete(update.param);
  68531. }
  68532. }
  68533. else {
  68534. /** @type {?} */ ((_this.map)).delete(update.param);
  68535. break;
  68536. }
  68537. }
  68538. });
  68539. this.cloneFrom = null;
  68540. }
  68541. };
  68542. return HttpParams;
  68543. }());
  68544. /**
  68545. * @fileoverview added by tsickle
  68546. * @suppress {checkTypes} checked by tsc
  68547. */
  68548. /**
  68549. * @license
  68550. * Copyright Google Inc. All Rights Reserved.
  68551. *
  68552. * Use of this source code is governed by an MIT-style license that can be
  68553. * found in the LICENSE file at https://angular.io/license
  68554. */
  68555. /**
  68556. * Determine whether the given HTTP method may include a body.
  68557. * @param {?} method
  68558. * @return {?}
  68559. */
  68560. function mightHaveBody(method) {
  68561. switch (method) {
  68562. case 'DELETE':
  68563. case 'GET':
  68564. case 'HEAD':
  68565. case 'OPTIONS':
  68566. case 'JSONP':
  68567. return false;
  68568. default:
  68569. return true;
  68570. }
  68571. }
  68572. /**
  68573. * Safely assert whether the given value is an ArrayBuffer.
  68574. *
  68575. * In some execution environments ArrayBuffer is not defined.
  68576. * @param {?} value
  68577. * @return {?}
  68578. */
  68579. function isArrayBuffer(value) {
  68580. return typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer;
  68581. }
  68582. /**
  68583. * Safely assert whether the given value is a Blob.
  68584. *
  68585. * In some execution environments Blob is not defined.
  68586. * @param {?} value
  68587. * @return {?}
  68588. */
  68589. function isBlob(value) {
  68590. return typeof Blob !== 'undefined' && value instanceof Blob;
  68591. }
  68592. /**
  68593. * Safely assert whether the given value is a FormData instance.
  68594. *
  68595. * In some execution environments FormData is not defined.
  68596. * @param {?} value
  68597. * @return {?}
  68598. */
  68599. function isFormData(value) {
  68600. return typeof FormData !== 'undefined' && value instanceof FormData;
  68601. }
  68602. /**
  68603. * An outgoing HTTP request with an optional typed body.
  68604. *
  68605. * `HttpRequest` represents an outgoing request, including URL, method,
  68606. * headers, body, and other request configuration options. Instances should be
  68607. * assumed to be immutable. To modify a `HttpRequest`, the `clone`
  68608. * method should be used.
  68609. *
  68610. * \@stable
  68611. * @template T
  68612. */
  68613. var HttpRequest = /** @class */ (function () {
  68614. function HttpRequest(method, url, third, fourth) {
  68615. this.url = url;
  68616. /**
  68617. * The request body, or `null` if one isn't set.
  68618. *
  68619. * Bodies are not enforced to be immutable, as they can include a reference to any
  68620. * user-defined data type. However, interceptors should take care to preserve
  68621. * idempotence by treating them as such.
  68622. */
  68623. this.body = null;
  68624. /**
  68625. * Whether this request should be made in a way that exposes progress events.
  68626. *
  68627. * Progress events are expensive (change detection runs on each event) and so
  68628. * they should only be requested if the consumer intends to monitor them.
  68629. */
  68630. this.reportProgress = false;
  68631. /**
  68632. * Whether this request should be sent with outgoing credentials (cookies).
  68633. */
  68634. this.withCredentials = false;
  68635. /**
  68636. * The expected response type of the server.
  68637. *
  68638. * This is used to parse the response appropriately before returning it to
  68639. * the requestee.
  68640. */
  68641. this.responseType = 'json';
  68642. this.method = method.toUpperCase();
  68643. // Next, need to figure out which argument holds the HttpRequestInit
  68644. // options, if any.
  68645. var /** @type {?} */ options;
  68646. // Check whether a body argument is expected. The only valid way to omit
  68647. // the body argument is to use a known no-body method like GET.
  68648. if (mightHaveBody(this.method) || !!fourth) {
  68649. // Body is the third argument, options are the fourth.
  68650. this.body = (third !== undefined) ? /** @type {?} */ (third) : null;
  68651. options = fourth;
  68652. }
  68653. else {
  68654. // No body required, options are the third argument. The body stays null.
  68655. options = /** @type {?} */ (third);
  68656. }
  68657. // If options have been passed, interpret them.
  68658. if (options) {
  68659. // Normalize reportProgress and withCredentials.
  68660. this.reportProgress = !!options.reportProgress;
  68661. this.withCredentials = !!options.withCredentials;
  68662. // Override default response type of 'json' if one is provided.
  68663. if (!!options.responseType) {
  68664. this.responseType = options.responseType;
  68665. }
  68666. // Override headers if they're provided.
  68667. if (!!options.headers) {
  68668. this.headers = options.headers;
  68669. }
  68670. if (!!options.params) {
  68671. this.params = options.params;
  68672. }
  68673. }
  68674. // If no headers have been passed in, construct a new HttpHeaders instance.
  68675. if (!this.headers) {
  68676. this.headers = new HttpHeaders();
  68677. }
  68678. // If no parameters have been passed in, construct a new HttpUrlEncodedParams instance.
  68679. if (!this.params) {
  68680. this.params = new HttpParams();
  68681. this.urlWithParams = url;
  68682. }
  68683. else {
  68684. // Encode the parameters to a string in preparation for inclusion in the URL.
  68685. var /** @type {?} */ params = this.params.toString();
  68686. if (params.length === 0) {
  68687. // No parameters, the visible URL is just the URL given at creation time.
  68688. this.urlWithParams = url;
  68689. }
  68690. else {
  68691. // Does the URL already have query parameters? Look for '?'.
  68692. var /** @type {?} */ qIdx = url.indexOf('?');
  68693. // There are 3 cases to handle:
  68694. // 1) No existing parameters -> append '?' followed by params.
  68695. // 2) '?' exists and is followed by existing query string ->
  68696. // append '&' followed by params.
  68697. // 3) '?' exists at the end of the url -> append params directly.
  68698. // This basically amounts to determining the character, if any, with
  68699. // which to join the URL and parameters.
  68700. var /** @type {?} */ sep = qIdx === -1 ? '?' : (qIdx < url.length - 1 ? '&' : '');
  68701. this.urlWithParams = url + sep + params;
  68702. }
  68703. }
  68704. }
  68705. /**
  68706. * Transform the free-form body into a serialized format suitable for
  68707. * transmission to the server.
  68708. */
  68709. /**
  68710. * Transform the free-form body into a serialized format suitable for
  68711. * transmission to the server.
  68712. * @return {?}
  68713. */
  68714. HttpRequest.prototype.serializeBody = /**
  68715. * Transform the free-form body into a serialized format suitable for
  68716. * transmission to the server.
  68717. * @return {?}
  68718. */
  68719. function () {
  68720. // If no body is present, no need to serialize it.
  68721. if (this.body === null) {
  68722. return null;
  68723. }
  68724. // Check whether the body is already in a serialized form. If so,
  68725. // it can just be returned directly.
  68726. if (isArrayBuffer(this.body) || isBlob(this.body) || isFormData(this.body) ||
  68727. typeof this.body === 'string') {
  68728. return this.body;
  68729. }
  68730. // Check whether the body is an instance of HttpUrlEncodedParams.
  68731. if (this.body instanceof HttpParams) {
  68732. return this.body.toString();
  68733. }
  68734. // Check whether the body is an object or array, and serialize with JSON if so.
  68735. if (typeof this.body === 'object' || typeof this.body === 'boolean' ||
  68736. Array.isArray(this.body)) {
  68737. return JSON.stringify(this.body);
  68738. }
  68739. // Fall back on toString() for everything else.
  68740. return (/** @type {?} */ (this.body)).toString();
  68741. };
  68742. /**
  68743. * Examine the body and attempt to infer an appropriate MIME type
  68744. * for it.
  68745. *
  68746. * If no such type can be inferred, this method will return `null`.
  68747. */
  68748. /**
  68749. * Examine the body and attempt to infer an appropriate MIME type
  68750. * for it.
  68751. *
  68752. * If no such type can be inferred, this method will return `null`.
  68753. * @return {?}
  68754. */
  68755. HttpRequest.prototype.detectContentTypeHeader = /**
  68756. * Examine the body and attempt to infer an appropriate MIME type
  68757. * for it.
  68758. *
  68759. * If no such type can be inferred, this method will return `null`.
  68760. * @return {?}
  68761. */
  68762. function () {
  68763. // An empty body has no content type.
  68764. if (this.body === null) {
  68765. return null;
  68766. }
  68767. // FormData bodies rely on the browser's content type assignment.
  68768. if (isFormData(this.body)) {
  68769. return null;
  68770. }
  68771. // Blobs usually have their own content type. If it doesn't, then
  68772. // no type can be inferred.
  68773. if (isBlob(this.body)) {
  68774. return this.body.type || null;
  68775. }
  68776. // Array buffers have unknown contents and thus no type can be inferred.
  68777. if (isArrayBuffer(this.body)) {
  68778. return null;
  68779. }
  68780. // Technically, strings could be a form of JSON data, but it's safe enough
  68781. // to assume they're plain strings.
  68782. if (typeof this.body === 'string') {
  68783. return 'text/plain';
  68784. }
  68785. // `HttpUrlEncodedParams` has its own content-type.
  68786. if (this.body instanceof HttpParams) {
  68787. return 'application/x-www-form-urlencoded;charset=UTF-8';
  68788. }
  68789. // Arrays, objects, and numbers will be encoded as JSON.
  68790. if (typeof this.body === 'object' || typeof this.body === 'number' ||
  68791. Array.isArray(this.body)) {
  68792. return 'application/json';
  68793. }
  68794. // No type could be inferred.
  68795. return null;
  68796. };
  68797. /**
  68798. * @param {?=} update
  68799. * @return {?}
  68800. */
  68801. HttpRequest.prototype.clone = /**
  68802. * @param {?=} update
  68803. * @return {?}
  68804. */
  68805. function (update) {
  68806. if (update === void 0) { update = {}; }
  68807. // For method, url, and responseType, take the current value unless
  68808. // it is overridden in the update hash.
  68809. var /** @type {?} */ method = update.method || this.method;
  68810. var /** @type {?} */ url = update.url || this.url;
  68811. var /** @type {?} */ responseType = update.responseType || this.responseType;
  68812. // The body is somewhat special - a `null` value in update.body means
  68813. // whatever current body is present is being overridden with an empty
  68814. // body, whereas an `undefined` value in update.body implies no
  68815. // override.
  68816. var /** @type {?} */ body = (update.body !== undefined) ? update.body : this.body;
  68817. // Carefully handle the boolean options to differentiate between
  68818. // `false` and `undefined` in the update args.
  68819. var /** @type {?} */ withCredentials = (update.withCredentials !== undefined) ? update.withCredentials : this.withCredentials;
  68820. var /** @type {?} */ reportProgress = (update.reportProgress !== undefined) ? update.reportProgress : this.reportProgress;
  68821. // Headers and params may be appended to if `setHeaders` or
  68822. // `setParams` are used.
  68823. var /** @type {?} */ headers = update.headers || this.headers;
  68824. var /** @type {?} */ params = update.params || this.params;
  68825. // Check whether the caller has asked to add headers.
  68826. if (update.setHeaders !== undefined) {
  68827. // Set every requested header.
  68828. headers =
  68829. Object.keys(update.setHeaders)
  68830. .reduce(function (headers, name) { return headers.set(name, /** @type {?} */ ((update.setHeaders))[name]); }, headers);
  68831. }
  68832. // Check whether the caller has asked to set params.
  68833. if (update.setParams) {
  68834. // Set every requested param.
  68835. params = Object.keys(update.setParams)
  68836. .reduce(function (params, param) { return params.set(param, /** @type {?} */ ((update.setParams))[param]); }, params);
  68837. }
  68838. // Finally, construct the new HttpRequest using the pieces from above.
  68839. return new HttpRequest(method, url, body, {
  68840. params: params, headers: headers, reportProgress: reportProgress, responseType: responseType, withCredentials: withCredentials,
  68841. });
  68842. };
  68843. return HttpRequest;
  68844. }());
  68845. /**
  68846. * @fileoverview added by tsickle
  68847. * @suppress {checkTypes} checked by tsc
  68848. */
  68849. /**
  68850. * @license
  68851. * Copyright Google Inc. All Rights Reserved.
  68852. *
  68853. * Use of this source code is governed by an MIT-style license that can be
  68854. * found in the LICENSE file at https://angular.io/license
  68855. */
  68856. /** @enum {number} */
  68857. var HttpEventType = {
  68858. /**
  68859. * The request was sent out over the wire.
  68860. */
  68861. Sent: 0,
  68862. /**
  68863. * An upload progress event was received.
  68864. */
  68865. UploadProgress: 1,
  68866. /**
  68867. * The response status code and headers were received.
  68868. */
  68869. ResponseHeader: 2,
  68870. /**
  68871. * A download progress event was received.
  68872. */
  68873. DownloadProgress: 3,
  68874. /**
  68875. * The full response including the body was received.
  68876. */
  68877. Response: 4,
  68878. /**
  68879. * A custom event from an interceptor or a backend.
  68880. */
  68881. User: 5,
  68882. };
  68883. HttpEventType[HttpEventType.Sent] = "Sent";
  68884. HttpEventType[HttpEventType.UploadProgress] = "UploadProgress";
  68885. HttpEventType[HttpEventType.ResponseHeader] = "ResponseHeader";
  68886. HttpEventType[HttpEventType.DownloadProgress] = "DownloadProgress";
  68887. HttpEventType[HttpEventType.Response] = "Response";
  68888. HttpEventType[HttpEventType.User] = "User";
  68889. /**
  68890. * Base interface for progress events.
  68891. *
  68892. * \@stable
  68893. * @record
  68894. */
  68895. /**
  68896. * A download progress event.
  68897. *
  68898. * \@stable
  68899. * @record
  68900. */
  68901. /**
  68902. * An upload progress event.
  68903. *
  68904. * \@stable
  68905. * @record
  68906. */
  68907. /**
  68908. * An event indicating that the request was sent to the server. Useful
  68909. * when a request may be retried multiple times, to distinguish between
  68910. * retries on the final event stream.
  68911. *
  68912. * \@stable
  68913. * @record
  68914. */
  68915. /**
  68916. * A user-defined event.
  68917. *
  68918. * Grouping all custom events under this type ensures they will be handled
  68919. * and forwarded by all implementations of interceptors.
  68920. *
  68921. * \@stable
  68922. * @record
  68923. * @template T
  68924. */
  68925. /**
  68926. * An error that represents a failed attempt to JSON.parse text coming back
  68927. * from the server.
  68928. *
  68929. * It bundles the Error object with the actual response body that failed to parse.
  68930. *
  68931. * \@stable
  68932. * @record
  68933. */
  68934. /**
  68935. * Base class for both `HttpResponse` and `HttpHeaderResponse`.
  68936. *
  68937. * \@stable
  68938. * @abstract
  68939. */
  68940. var HttpResponseBase = /** @class */ (function () {
  68941. /**
  68942. * Super-constructor for all responses.
  68943. *
  68944. * The single parameter accepted is an initialization hash. Any properties
  68945. * of the response passed there will override the default values.
  68946. */
  68947. function HttpResponseBase(init, defaultStatus, defaultStatusText) {
  68948. if (defaultStatus === void 0) { defaultStatus = 200; }
  68949. if (defaultStatusText === void 0) { defaultStatusText = 'OK'; }
  68950. // If the hash has values passed, use them to initialize the response.
  68951. // Otherwise use the default values.
  68952. this.headers = init.headers || new HttpHeaders();
  68953. this.status = init.status !== undefined ? init.status : defaultStatus;
  68954. this.statusText = init.statusText || defaultStatusText;
  68955. this.url = init.url || null;
  68956. // Cache the ok value to avoid defining a getter.
  68957. this.ok = this.status >= 200 && this.status < 300;
  68958. }
  68959. return HttpResponseBase;
  68960. }());
  68961. /**
  68962. * A partial HTTP response which only includes the status and header data,
  68963. * but no response body.
  68964. *
  68965. * `HttpHeaderResponse` is a `HttpEvent` available on the response
  68966. * event stream, only when progress events are requested.
  68967. *
  68968. * \@stable
  68969. */
  68970. var HttpHeaderResponse = /** @class */ (function (_super) {
  68971. Object(__WEBPACK_IMPORTED_MODULE_5_tslib__["b" /* __extends */])(HttpHeaderResponse, _super);
  68972. /**
  68973. * Create a new `HttpHeaderResponse` with the given parameters.
  68974. */
  68975. function HttpHeaderResponse(init) {
  68976. if (init === void 0) { init = {}; }
  68977. var _this = _super.call(this, init) || this;
  68978. _this.type = HttpEventType.ResponseHeader;
  68979. return _this;
  68980. }
  68981. /**
  68982. * Copy this `HttpHeaderResponse`, overriding its contents with the
  68983. * given parameter hash.
  68984. */
  68985. /**
  68986. * Copy this `HttpHeaderResponse`, overriding its contents with the
  68987. * given parameter hash.
  68988. * @param {?=} update
  68989. * @return {?}
  68990. */
  68991. HttpHeaderResponse.prototype.clone = /**
  68992. * Copy this `HttpHeaderResponse`, overriding its contents with the
  68993. * given parameter hash.
  68994. * @param {?=} update
  68995. * @return {?}
  68996. */
  68997. function (update) {
  68998. if (update === void 0) { update = {}; }
  68999. // Perform a straightforward initialization of the new HttpHeaderResponse,
  69000. // overriding the current parameters with new ones if given.
  69001. return new HttpHeaderResponse({
  69002. headers: update.headers || this.headers,
  69003. status: update.status !== undefined ? update.status : this.status,
  69004. statusText: update.statusText || this.statusText,
  69005. url: update.url || this.url || undefined,
  69006. });
  69007. };
  69008. return HttpHeaderResponse;
  69009. }(HttpResponseBase));
  69010. /**
  69011. * A full HTTP response, including a typed response body (which may be `null`
  69012. * if one was not returned).
  69013. *
  69014. * `HttpResponse` is a `HttpEvent` available on the response event
  69015. * stream.
  69016. *
  69017. * \@stable
  69018. * @template T
  69019. */
  69020. var HttpResponse = /** @class */ (function (_super) {
  69021. Object(__WEBPACK_IMPORTED_MODULE_5_tslib__["b" /* __extends */])(HttpResponse, _super);
  69022. /**
  69023. * Construct a new `HttpResponse`.
  69024. */
  69025. function HttpResponse(init) {
  69026. if (init === void 0) { init = {}; }
  69027. var _this = _super.call(this, init) || this;
  69028. _this.type = HttpEventType.Response;
  69029. _this.body = init.body !== undefined ? init.body : null;
  69030. return _this;
  69031. }
  69032. /**
  69033. * @param {?=} update
  69034. * @return {?}
  69035. */
  69036. HttpResponse.prototype.clone = /**
  69037. * @param {?=} update
  69038. * @return {?}
  69039. */
  69040. function (update) {
  69041. if (update === void 0) { update = {}; }
  69042. return new HttpResponse({
  69043. body: (update.body !== undefined) ? update.body : this.body,
  69044. headers: update.headers || this.headers,
  69045. status: (update.status !== undefined) ? update.status : this.status,
  69046. statusText: update.statusText || this.statusText,
  69047. url: update.url || this.url || undefined,
  69048. });
  69049. };
  69050. return HttpResponse;
  69051. }(HttpResponseBase));
  69052. /**
  69053. * A response that represents an error or failure, either from a
  69054. * non-successful HTTP status, an error while executing the request,
  69055. * or some other failure which occurred during the parsing of the response.
  69056. *
  69057. * Any error returned on the `Observable` response stream will be
  69058. * wrapped in an `HttpErrorResponse` to provide additional context about
  69059. * the state of the HTTP layer when the error occurred. The error property
  69060. * will contain either a wrapped Error object or the error response returned
  69061. * from the server.
  69062. *
  69063. * \@stable
  69064. */
  69065. var HttpErrorResponse = /** @class */ (function (_super) {
  69066. Object(__WEBPACK_IMPORTED_MODULE_5_tslib__["b" /* __extends */])(HttpErrorResponse, _super);
  69067. function HttpErrorResponse(init) {
  69068. var _this =
  69069. // Initialize with a default status of 0 / Unknown Error.
  69070. _super.call(this, init, 0, 'Unknown Error') || this;
  69071. _this.name = 'HttpErrorResponse';
  69072. /**
  69073. * Errors are never okay, even when the status code is in the 2xx success range.
  69074. */
  69075. _this.ok = false;
  69076. // If the response was successful, then this was a parse error. Otherwise, it was
  69077. // a protocol-level failure of some sort. Either the request failed in transit
  69078. // or the server returned an unsuccessful status code.
  69079. if (_this.status >= 200 && _this.status < 300) {
  69080. _this.message = "Http failure during parsing for " + (init.url || '(unknown url)');
  69081. }
  69082. else {
  69083. _this.message =
  69084. "Http failure response for " + (init.url || '(unknown url)') + ": " + init.status + " " + init.statusText;
  69085. }
  69086. _this.error = init.error || null;
  69087. return _this;
  69088. }
  69089. return HttpErrorResponse;
  69090. }(HttpResponseBase));
  69091. /**
  69092. * @fileoverview added by tsickle
  69093. * @suppress {checkTypes} checked by tsc
  69094. */
  69095. /**
  69096. * @license
  69097. * Copyright Google Inc. All Rights Reserved.
  69098. *
  69099. * Use of this source code is governed by an MIT-style license that can be
  69100. * found in the LICENSE file at https://angular.io/license
  69101. */
  69102. /**
  69103. * Construct an instance of `HttpRequestOptions<T>` from a source `HttpMethodOptions` and
  69104. * the given `body`. Basically, this clones the object and adds the body.
  69105. * @template T
  69106. * @param {?} options
  69107. * @param {?} body
  69108. * @return {?}
  69109. */
  69110. function addBody(options, body) {
  69111. return {
  69112. body: body,
  69113. headers: options.headers,
  69114. observe: options.observe,
  69115. params: options.params,
  69116. reportProgress: options.reportProgress,
  69117. responseType: options.responseType,
  69118. withCredentials: options.withCredentials,
  69119. };
  69120. }
  69121. /**
  69122. * Perform HTTP requests.
  69123. *
  69124. * `HttpClient` is available as an injectable class, with methods to perform HTTP requests.
  69125. * Each request method has multiple signatures, and the return type varies according to which
  69126. * signature is called (mainly the values of `observe` and `responseType`).
  69127. *
  69128. * \@stable
  69129. */
  69130. var HttpClient = /** @class */ (function () {
  69131. function HttpClient(handler) {
  69132. this.handler = handler;
  69133. }
  69134. /**
  69135. * Constructs an `Observable` for a particular HTTP request that, when subscribed,
  69136. * fires the request through the chain of registered interceptors and on to the
  69137. * server.
  69138. *
  69139. * This method can be called in one of two ways. Either an `HttpRequest`
  69140. * instance can be passed directly as the only parameter, or a method can be
  69141. * passed as the first parameter, a string URL as the second, and an
  69142. * options hash as the third.
  69143. *
  69144. * If a `HttpRequest` object is passed directly, an `Observable` of the
  69145. * raw `HttpEvent` stream will be returned.
  69146. *
  69147. * If a request is instead built by providing a URL, the options object
  69148. * determines the return type of `request()`. In addition to configuring
  69149. * request parameters such as the outgoing headers and/or the body, the options
  69150. * hash specifies two key pieces of information about the request: the
  69151. * `responseType` and what to `observe`.
  69152. *
  69153. * The `responseType` value determines how a successful response body will be
  69154. * parsed. If `responseType` is the default `json`, a type interface for the
  69155. * resulting object may be passed as a type parameter to `request()`.
  69156. *
  69157. * The `observe` value determines the return type of `request()`, based on what
  69158. * the consumer is interested in observing. A value of `events` will return an
  69159. * `Observable<HttpEvent>` representing the raw `HttpEvent` stream,
  69160. * including progress events by default. A value of `response` will return an
  69161. * `Observable<HttpResponse<T>>` where the `T` parameter of `HttpResponse`
  69162. * depends on the `responseType` and any optionally provided type parameter.
  69163. * A value of `body` will return an `Observable<T>` with the same `T` body type.
  69164. */
  69165. /**
  69166. * Constructs an `Observable` for a particular HTTP request that, when subscribed,
  69167. * fires the request through the chain of registered interceptors and on to the
  69168. * server.
  69169. *
  69170. * This method can be called in one of two ways. Either an `HttpRequest`
  69171. * instance can be passed directly as the only parameter, or a method can be
  69172. * passed as the first parameter, a string URL as the second, and an
  69173. * options hash as the third.
  69174. *
  69175. * If a `HttpRequest` object is passed directly, an `Observable` of the
  69176. * raw `HttpEvent` stream will be returned.
  69177. *
  69178. * If a request is instead built by providing a URL, the options object
  69179. * determines the return type of `request()`. In addition to configuring
  69180. * request parameters such as the outgoing headers and/or the body, the options
  69181. * hash specifies two key pieces of information about the request: the
  69182. * `responseType` and what to `observe`.
  69183. *
  69184. * The `responseType` value determines how a successful response body will be
  69185. * parsed. If `responseType` is the default `json`, a type interface for the
  69186. * resulting object may be passed as a type parameter to `request()`.
  69187. *
  69188. * The `observe` value determines the return type of `request()`, based on what
  69189. * the consumer is interested in observing. A value of `events` will return an
  69190. * `Observable<HttpEvent>` representing the raw `HttpEvent` stream,
  69191. * including progress events by default. A value of `response` will return an
  69192. * `Observable<HttpResponse<T>>` where the `T` parameter of `HttpResponse`
  69193. * depends on the `responseType` and any optionally provided type parameter.
  69194. * A value of `body` will return an `Observable<T>` with the same `T` body type.
  69195. * @param {?} first
  69196. * @param {?=} url
  69197. * @param {?=} options
  69198. * @return {?}
  69199. */
  69200. HttpClient.prototype.request = /**
  69201. * Constructs an `Observable` for a particular HTTP request that, when subscribed,
  69202. * fires the request through the chain of registered interceptors and on to the
  69203. * server.
  69204. *
  69205. * This method can be called in one of two ways. Either an `HttpRequest`
  69206. * instance can be passed directly as the only parameter, or a method can be
  69207. * passed as the first parameter, a string URL as the second, and an
  69208. * options hash as the third.
  69209. *
  69210. * If a `HttpRequest` object is passed directly, an `Observable` of the
  69211. * raw `HttpEvent` stream will be returned.
  69212. *
  69213. * If a request is instead built by providing a URL, the options object
  69214. * determines the return type of `request()`. In addition to configuring
  69215. * request parameters such as the outgoing headers and/or the body, the options
  69216. * hash specifies two key pieces of information about the request: the
  69217. * `responseType` and what to `observe`.
  69218. *
  69219. * The `responseType` value determines how a successful response body will be
  69220. * parsed. If `responseType` is the default `json`, a type interface for the
  69221. * resulting object may be passed as a type parameter to `request()`.
  69222. *
  69223. * The `observe` value determines the return type of `request()`, based on what
  69224. * the consumer is interested in observing. A value of `events` will return an
  69225. * `Observable<HttpEvent>` representing the raw `HttpEvent` stream,
  69226. * including progress events by default. A value of `response` will return an
  69227. * `Observable<HttpResponse<T>>` where the `T` parameter of `HttpResponse`
  69228. * depends on the `responseType` and any optionally provided type parameter.
  69229. * A value of `body` will return an `Observable<T>` with the same `T` body type.
  69230. * @param {?} first
  69231. * @param {?=} url
  69232. * @param {?=} options
  69233. * @return {?}
  69234. */
  69235. function (first, url, options) {
  69236. var _this = this;
  69237. if (options === void 0) { options = {}; }
  69238. var /** @type {?} */ req;
  69239. // Firstly, check whether the primary argument is an instance of `HttpRequest`.
  69240. if (first instanceof HttpRequest) {
  69241. // It is. The other arguments must be undefined (per the signatures) and can be
  69242. // ignored.
  69243. req = /** @type {?} */ (first);
  69244. }
  69245. else {
  69246. // It's a string, so it represents a URL. Construct a request based on it,
  69247. // and incorporate the remaining arguments (assuming GET unless a method is
  69248. // provided.
  69249. // Figure out the headers.
  69250. var /** @type {?} */ headers = undefined;
  69251. if (options.headers instanceof HttpHeaders) {
  69252. headers = options.headers;
  69253. }
  69254. else {
  69255. headers = new HttpHeaders(options.headers);
  69256. }
  69257. // Sort out parameters.
  69258. var /** @type {?} */ params = undefined;
  69259. if (!!options.params) {
  69260. if (options.params instanceof HttpParams) {
  69261. params = options.params;
  69262. }
  69263. else {
  69264. params = new HttpParams({ fromObject: options.params });
  69265. }
  69266. }
  69267. // Construct the request.
  69268. req = new HttpRequest(first, /** @type {?} */ ((url)), (options.body !== undefined ? options.body : null), {
  69269. headers: headers,
  69270. params: params,
  69271. reportProgress: options.reportProgress,
  69272. // By default, JSON is assumed to be returned for all calls.
  69273. responseType: options.responseType || 'json',
  69274. withCredentials: options.withCredentials,
  69275. });
  69276. }
  69277. // Start with an Observable.of() the initial request, and run the handler (which
  69278. // includes all interceptors) inside a concatMap(). This way, the handler runs
  69279. // inside an Observable chain, which causes interceptors to be re-run on every
  69280. // subscription (this also makes retries re-run the handler, including interceptors).
  69281. var /** @type {?} */ events$ = __WEBPACK_IMPORTED_MODULE_2_rxjs_operator_concatMap__["concatMap"].call(Object(__WEBPACK_IMPORTED_MODULE_1_rxjs_observable_of__["of"])(req), function (req) { return _this.handler.handle(req); });
  69282. // If coming via the API signature which accepts a previously constructed HttpRequest,
  69283. // the only option is to get the event stream. Otherwise, return the event stream if
  69284. // that is what was requested.
  69285. if (first instanceof HttpRequest || options.observe === 'events') {
  69286. return events$;
  69287. }
  69288. // The requested stream contains either the full response or the body. In either
  69289. // case, the first step is to filter the event stream to extract a stream of
  69290. // responses(s).
  69291. var /** @type {?} */ res$ = __WEBPACK_IMPORTED_MODULE_3_rxjs_operator_filter__["filter"].call(events$, function (event) { return event instanceof HttpResponse; });
  69292. // Decide which stream to return.
  69293. switch (options.observe || 'body') {
  69294. case 'body':
  69295. // The requested stream is the body. Map the response stream to the response
  69296. // body. This could be done more simply, but a misbehaving interceptor might
  69297. // transform the response body into a different format and ignore the requested
  69298. // responseType. Guard against this by validating that the response is of the
  69299. // requested type.
  69300. switch (req.responseType) {
  69301. case 'arraybuffer':
  69302. return __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_map__["map"].call(res$, function (res) {
  69303. // Validate that the body is an ArrayBuffer.
  69304. if (res.body !== null && !(res.body instanceof ArrayBuffer)) {
  69305. throw new Error('Response is not an ArrayBuffer.');
  69306. }
  69307. return res.body;
  69308. });
  69309. case 'blob':
  69310. return __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_map__["map"].call(res$, function (res) {
  69311. // Validate that the body is a Blob.
  69312. if (res.body !== null && !(res.body instanceof Blob)) {
  69313. throw new Error('Response is not a Blob.');
  69314. }
  69315. return res.body;
  69316. });
  69317. case 'text':
  69318. return __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_map__["map"].call(res$, function (res) {
  69319. // Validate that the body is a string.
  69320. if (res.body !== null && typeof res.body !== 'string') {
  69321. throw new Error('Response is not a string.');
  69322. }
  69323. return res.body;
  69324. });
  69325. case 'json':
  69326. default:
  69327. // No validation needed for JSON responses, as they can be of any type.
  69328. return __WEBPACK_IMPORTED_MODULE_4_rxjs_operator_map__["map"].call(res$, function (res) { return res.body; });
  69329. }
  69330. case 'response':
  69331. // The response stream was requested directly, so return it.
  69332. return res$;
  69333. default:
  69334. // Guard against new future observe types being added.
  69335. throw new Error("Unreachable: unhandled observe type " + options.observe + "}");
  69336. }
  69337. };
  69338. /**
  69339. * Constructs an `Observable` which, when subscribed, will cause the configured
  69340. * DELETE request to be executed on the server. See the individual overloads for
  69341. * details of `delete()`'s return type based on the provided options.
  69342. */
  69343. /**
  69344. * Constructs an `Observable` which, when subscribed, will cause the configured
  69345. * DELETE request to be executed on the server. See the individual overloads for
  69346. * details of `delete()`'s return type based on the provided options.
  69347. * @param {?} url
  69348. * @param {?=} options
  69349. * @return {?}
  69350. */
  69351. HttpClient.prototype.delete = /**
  69352. * Constructs an `Observable` which, when subscribed, will cause the configured
  69353. * DELETE request to be executed on the server. See the individual overloads for
  69354. * details of `delete()`'s return type based on the provided options.
  69355. * @param {?} url
  69356. * @param {?=} options
  69357. * @return {?}
  69358. */
  69359. function (url, options) {
  69360. if (options === void 0) { options = {}; }
  69361. return this.request('DELETE', url, /** @type {?} */ (options));
  69362. };
  69363. /**
  69364. * Constructs an `Observable` which, when subscribed, will cause the configured
  69365. * GET request to be executed on the server. See the individual overloads for
  69366. * details of `get()`'s return type based on the provided options.
  69367. */
  69368. /**
  69369. * Constructs an `Observable` which, when subscribed, will cause the configured
  69370. * GET request to be executed on the server. See the individual overloads for
  69371. * details of `get()`'s return type based on the provided options.
  69372. * @param {?} url
  69373. * @param {?=} options
  69374. * @return {?}
  69375. */
  69376. HttpClient.prototype.get = /**
  69377. * Constructs an `Observable` which, when subscribed, will cause the configured
  69378. * GET request to be executed on the server. See the individual overloads for
  69379. * details of `get()`'s return type based on the provided options.
  69380. * @param {?} url
  69381. * @param {?=} options
  69382. * @return {?}
  69383. */
  69384. function (url, options) {
  69385. if (options === void 0) { options = {}; }
  69386. return this.request('GET', url, /** @type {?} */ (options));
  69387. };
  69388. /**
  69389. * Constructs an `Observable` which, when subscribed, will cause the configured
  69390. * HEAD request to be executed on the server. See the individual overloads for
  69391. * details of `head()`'s return type based on the provided options.
  69392. */
  69393. /**
  69394. * Constructs an `Observable` which, when subscribed, will cause the configured
  69395. * HEAD request to be executed on the server. See the individual overloads for
  69396. * details of `head()`'s return type based on the provided options.
  69397. * @param {?} url
  69398. * @param {?=} options
  69399. * @return {?}
  69400. */
  69401. HttpClient.prototype.head = /**
  69402. * Constructs an `Observable` which, when subscribed, will cause the configured
  69403. * HEAD request to be executed on the server. See the individual overloads for
  69404. * details of `head()`'s return type based on the provided options.
  69405. * @param {?} url
  69406. * @param {?=} options
  69407. * @return {?}
  69408. */
  69409. function (url, options) {
  69410. if (options === void 0) { options = {}; }
  69411. return this.request('HEAD', url, /** @type {?} */ (options));
  69412. };
  69413. /**
  69414. * Constructs an `Observable` which, when subscribed, will cause a request
  69415. * with the special method `JSONP` to be dispatched via the interceptor pipeline.
  69416. *
  69417. * A suitable interceptor must be installed (e.g. via the `HttpClientJsonpModule`).
  69418. * If no such interceptor is reached, then the `JSONP` request will likely be
  69419. * rejected by the configured backend.
  69420. */
  69421. /**
  69422. * Constructs an `Observable` which, when subscribed, will cause a request
  69423. * with the special method `JSONP` to be dispatched via the interceptor pipeline.
  69424. *
  69425. * A suitable interceptor must be installed (e.g. via the `HttpClientJsonpModule`).
  69426. * If no such interceptor is reached, then the `JSONP` request will likely be
  69427. * rejected by the configured backend.
  69428. * @template T
  69429. * @param {?} url
  69430. * @param {?} callbackParam
  69431. * @return {?}
  69432. */
  69433. HttpClient.prototype.jsonp = /**
  69434. * Constructs an `Observable` which, when subscribed, will cause a request
  69435. * with the special method `JSONP` to be dispatched via the interceptor pipeline.
  69436. *
  69437. * A suitable interceptor must be installed (e.g. via the `HttpClientJsonpModule`).
  69438. * If no such interceptor is reached, then the `JSONP` request will likely be
  69439. * rejected by the configured backend.
  69440. * @template T
  69441. * @param {?} url
  69442. * @param {?} callbackParam
  69443. * @return {?}
  69444. */
  69445. function (url, callbackParam) {
  69446. return this.request('JSONP', url, {
  69447. params: new HttpParams().append(callbackParam, 'JSONP_CALLBACK'),
  69448. observe: 'body',
  69449. responseType: 'json',
  69450. });
  69451. };
  69452. /**
  69453. * Constructs an `Observable` which, when subscribed, will cause the configured
  69454. * OPTIONS request to be executed on the server. See the individual overloads for
  69455. * details of `options()`'s return type based on the provided options.
  69456. */
  69457. /**
  69458. * Constructs an `Observable` which, when subscribed, will cause the configured
  69459. * OPTIONS request to be executed on the server. See the individual overloads for
  69460. * details of `options()`'s return type based on the provided options.
  69461. * @param {?} url
  69462. * @param {?=} options
  69463. * @return {?}
  69464. */
  69465. HttpClient.prototype.options = /**
  69466. * Constructs an `Observable` which, when subscribed, will cause the configured
  69467. * OPTIONS request to be executed on the server. See the individual overloads for
  69468. * details of `options()`'s return type based on the provided options.
  69469. * @param {?} url
  69470. * @param {?=} options
  69471. * @return {?}
  69472. */
  69473. function (url, options) {
  69474. if (options === void 0) { options = {}; }
  69475. return this.request('OPTIONS', url, /** @type {?} */ (options));
  69476. };
  69477. /**
  69478. * Constructs an `Observable` which, when subscribed, will cause the configured
  69479. * PATCH request to be executed on the server. See the individual overloads for
  69480. * details of `patch()`'s return type based on the provided options.
  69481. */
  69482. /**
  69483. * Constructs an `Observable` which, when subscribed, will cause the configured
  69484. * PATCH request to be executed on the server. See the individual overloads for
  69485. * details of `patch()`'s return type based on the provided options.
  69486. * @param {?} url
  69487. * @param {?} body
  69488. * @param {?=} options
  69489. * @return {?}
  69490. */
  69491. HttpClient.prototype.patch = /**
  69492. * Constructs an `Observable` which, when subscribed, will cause the configured
  69493. * PATCH request to be executed on the server. See the individual overloads for
  69494. * details of `patch()`'s return type based on the provided options.
  69495. * @param {?} url
  69496. * @param {?} body
  69497. * @param {?=} options
  69498. * @return {?}
  69499. */
  69500. function (url, body, options) {
  69501. if (options === void 0) { options = {}; }
  69502. return this.request('PATCH', url, addBody(options, body));
  69503. };
  69504. /**
  69505. * Constructs an `Observable` which, when subscribed, will cause the configured
  69506. * POST request to be executed on the server. See the individual overloads for
  69507. * details of `post()`'s return type based on the provided options.
  69508. */
  69509. /**
  69510. * Constructs an `Observable` which, when subscribed, will cause the configured
  69511. * POST request to be executed on the server. See the individual overloads for
  69512. * details of `post()`'s return type based on the provided options.
  69513. * @param {?} url
  69514. * @param {?} body
  69515. * @param {?=} options
  69516. * @return {?}
  69517. */
  69518. HttpClient.prototype.post = /**
  69519. * Constructs an `Observable` which, when subscribed, will cause the configured
  69520. * POST request to be executed on the server. See the individual overloads for
  69521. * details of `post()`'s return type based on the provided options.
  69522. * @param {?} url
  69523. * @param {?} body
  69524. * @param {?=} options
  69525. * @return {?}
  69526. */
  69527. function (url, body, options) {
  69528. if (options === void 0) { options = {}; }
  69529. return this.request('POST', url, addBody(options, body));
  69530. };
  69531. /**
  69532. * Constructs an `Observable` which, when subscribed, will cause the configured
  69533. * POST request to be executed on the server. See the individual overloads for
  69534. * details of `post()`'s return type based on the provided options.
  69535. */
  69536. /**
  69537. * Constructs an `Observable` which, when subscribed, will cause the configured
  69538. * POST request to be executed on the server. See the individual overloads for
  69539. * details of `post()`'s return type based on the provided options.
  69540. * @param {?} url
  69541. * @param {?} body
  69542. * @param {?=} options
  69543. * @return {?}
  69544. */
  69545. HttpClient.prototype.put = /**
  69546. * Constructs an `Observable` which, when subscribed, will cause the configured
  69547. * POST request to be executed on the server. See the individual overloads for
  69548. * details of `post()`'s return type based on the provided options.
  69549. * @param {?} url
  69550. * @param {?} body
  69551. * @param {?=} options
  69552. * @return {?}
  69553. */
  69554. function (url, body, options) {
  69555. if (options === void 0) { options = {}; }
  69556. return this.request('PUT', url, addBody(options, body));
  69557. };
  69558. HttpClient.decorators = [
  69559. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */] },
  69560. ];
  69561. /** @nocollapse */
  69562. HttpClient.ctorParameters = function () { return [
  69563. { type: HttpHandler, },
  69564. ]; };
  69565. return HttpClient;
  69566. }());
  69567. /**
  69568. * @fileoverview added by tsickle
  69569. * @suppress {checkTypes} checked by tsc
  69570. */
  69571. /**
  69572. * @license
  69573. * Copyright Google Inc. All Rights Reserved.
  69574. *
  69575. * Use of this source code is governed by an MIT-style license that can be
  69576. * found in the LICENSE file at https://angular.io/license
  69577. */
  69578. /**
  69579. * Intercepts `HttpRequest` and handles them.
  69580. *
  69581. * Most interceptors will transform the outgoing request before passing it to the
  69582. * next interceptor in the chain, by calling `next.handle(transformedReq)`.
  69583. *
  69584. * In rare cases, interceptors may wish to completely handle a request themselves,
  69585. * and not delegate to the remainder of the chain. This behavior is allowed.
  69586. *
  69587. * \@stable
  69588. * @record
  69589. */
  69590. /**
  69591. * `HttpHandler` which applies an `HttpInterceptor` to an `HttpRequest`.
  69592. *
  69593. * \@stable
  69594. */
  69595. var HttpInterceptorHandler = /** @class */ (function () {
  69596. function HttpInterceptorHandler(next, interceptor) {
  69597. this.next = next;
  69598. this.interceptor = interceptor;
  69599. }
  69600. /**
  69601. * @param {?} req
  69602. * @return {?}
  69603. */
  69604. HttpInterceptorHandler.prototype.handle = /**
  69605. * @param {?} req
  69606. * @return {?}
  69607. */
  69608. function (req) {
  69609. return this.interceptor.intercept(req, this.next);
  69610. };
  69611. return HttpInterceptorHandler;
  69612. }());
  69613. /**
  69614. * A multi-provider token which represents the array of `HttpInterceptor`s that
  69615. * are registered.
  69616. *
  69617. * \@stable
  69618. */
  69619. var HTTP_INTERCEPTORS = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["B" /* InjectionToken */]('HTTP_INTERCEPTORS');
  69620. var NoopInterceptor = /** @class */ (function () {
  69621. function NoopInterceptor() {
  69622. }
  69623. /**
  69624. * @param {?} req
  69625. * @param {?} next
  69626. * @return {?}
  69627. */
  69628. NoopInterceptor.prototype.intercept = /**
  69629. * @param {?} req
  69630. * @param {?} next
  69631. * @return {?}
  69632. */
  69633. function (req, next) {
  69634. return next.handle(req);
  69635. };
  69636. NoopInterceptor.decorators = [
  69637. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */] },
  69638. ];
  69639. /** @nocollapse */
  69640. NoopInterceptor.ctorParameters = function () { return []; };
  69641. return NoopInterceptor;
  69642. }());
  69643. /**
  69644. * @fileoverview added by tsickle
  69645. * @suppress {checkTypes} checked by tsc
  69646. */
  69647. /**
  69648. * @license
  69649. * Copyright Google Inc. All Rights Reserved.
  69650. *
  69651. * Use of this source code is governed by an MIT-style license that can be
  69652. * found in the LICENSE file at https://angular.io/license
  69653. */
  69654. // Every request made through JSONP needs a callback name that's unique across the
  69655. // whole page. Each request is assigned an id and the callback name is constructed
  69656. // from that. The next id to be assigned is tracked in a global variable here that
  69657. // is shared among all applications on the page.
  69658. var nextRequestId = 0;
  69659. // Error text given when a JSONP script is injected, but doesn't invoke the callback
  69660. // passed in its URL.
  69661. var JSONP_ERR_NO_CALLBACK = 'JSONP injected script did not invoke callback.';
  69662. // Error text given when a request is passed to the JsonpClientBackend that doesn't
  69663. // have a request method JSONP.
  69664. var JSONP_ERR_WRONG_METHOD = 'JSONP requests must use JSONP request method.';
  69665. var JSONP_ERR_WRONG_RESPONSE_TYPE = 'JSONP requests must use Json response type.';
  69666. /**
  69667. * DI token/abstract type representing a map of JSONP callbacks.
  69668. *
  69669. * In the browser, this should always be the `window` object.
  69670. *
  69671. * \@stable
  69672. * @abstract
  69673. */
  69674. var JsonpCallbackContext = /** @class */ (function () {
  69675. function JsonpCallbackContext() {
  69676. }
  69677. return JsonpCallbackContext;
  69678. }());
  69679. /**
  69680. * `HttpBackend` that only processes `HttpRequest` with the JSONP method,
  69681. * by performing JSONP style requests.
  69682. *
  69683. * \@stable
  69684. */
  69685. var JsonpClientBackend = /** @class */ (function () {
  69686. function JsonpClientBackend(callbackMap, document) {
  69687. this.callbackMap = callbackMap;
  69688. this.document = document;
  69689. }
  69690. /**
  69691. * Get the name of the next callback method, by incrementing the global `nextRequestId`.
  69692. * @return {?}
  69693. */
  69694. JsonpClientBackend.prototype.nextCallback = /**
  69695. * Get the name of the next callback method, by incrementing the global `nextRequestId`.
  69696. * @return {?}
  69697. */
  69698. function () { return "ng_jsonp_callback_" + nextRequestId++; };
  69699. /**
  69700. * Process a JSONP request and return an event stream of the results.
  69701. */
  69702. /**
  69703. * Process a JSONP request and return an event stream of the results.
  69704. * @param {?} req
  69705. * @return {?}
  69706. */
  69707. JsonpClientBackend.prototype.handle = /**
  69708. * Process a JSONP request and return an event stream of the results.
  69709. * @param {?} req
  69710. * @return {?}
  69711. */
  69712. function (req) {
  69713. var _this = this;
  69714. // Firstly, check both the method and response type. If either doesn't match
  69715. // then the request was improperly routed here and cannot be handled.
  69716. if (req.method !== 'JSONP') {
  69717. throw new Error(JSONP_ERR_WRONG_METHOD);
  69718. }
  69719. else if (req.responseType !== 'json') {
  69720. throw new Error(JSONP_ERR_WRONG_RESPONSE_TYPE);
  69721. }
  69722. // Everything else happens inside the Observable boundary.
  69723. return new __WEBPACK_IMPORTED_MODULE_7_rxjs_Observable__["Observable"](function (observer) {
  69724. // The first step to make a request is to generate the callback name, and replace the
  69725. // callback placeholder in the URL with the name. Care has to be taken here to ensure
  69726. // a trailing &, if matched, gets inserted back into the URL in the correct place.
  69727. var /** @type {?} */ callback = _this.nextCallback();
  69728. var /** @type {?} */ url = req.urlWithParams.replace(/=JSONP_CALLBACK(&|$)/, "=" + callback + "$1");
  69729. // Construct the <script> tag and point it at the URL.
  69730. var /** @type {?} */ node = _this.document.createElement('script');
  69731. node.src = url;
  69732. // A JSONP request requires waiting for multiple callbacks. These variables
  69733. // are closed over and track state across those callbacks.
  69734. // The response object, if one has been received, or null otherwise.
  69735. var /** @type {?} */ body = null;
  69736. // Whether the response callback has been called.
  69737. var /** @type {?} */ finished = false;
  69738. // Whether the request has been cancelled (and thus any other callbacks)
  69739. // should be ignored.
  69740. var /** @type {?} */ cancelled = false;
  69741. // Set the response callback in this.callbackMap (which will be the window
  69742. // object in the browser. The script being loaded via the <script> tag will
  69743. // eventually call this callback.
  69744. // Set the response callback in this.callbackMap (which will be the window
  69745. // object in the browser. The script being loaded via the <script> tag will
  69746. // eventually call this callback.
  69747. _this.callbackMap[callback] = function (data) {
  69748. // Data has been received from the JSONP script. Firstly, delete this callback.
  69749. delete _this.callbackMap[callback];
  69750. // Next, make sure the request wasn't cancelled in the meantime.
  69751. if (cancelled) {
  69752. return;
  69753. }
  69754. // Set state to indicate data was received.
  69755. body = data;
  69756. finished = true;
  69757. };
  69758. // cleanup() is a utility closure that removes the <script> from the page and
  69759. // the response callback from the window. This logic is used in both the
  69760. // success, error, and cancellation paths, so it's extracted out for convenience.
  69761. var /** @type {?} */ cleanup = function () {
  69762. // Remove the <script> tag if it's still on the page.
  69763. if (node.parentNode) {
  69764. node.parentNode.removeChild(node);
  69765. }
  69766. // Remove the response callback from the callbackMap (window object in the
  69767. // browser).
  69768. delete _this.callbackMap[callback];
  69769. };
  69770. // onLoad() is the success callback which runs after the response callback
  69771. // if the JSONP script loads successfully. The event itself is unimportant.
  69772. // If something went wrong, onLoad() may run without the response callback
  69773. // having been invoked.
  69774. var /** @type {?} */ onLoad = function (event) {
  69775. // Do nothing if the request has been cancelled.
  69776. if (cancelled) {
  69777. return;
  69778. }
  69779. // Cleanup the page.
  69780. cleanup();
  69781. // Check whether the response callback has run.
  69782. if (!finished) {
  69783. // It hasn't, something went wrong with the request. Return an error via
  69784. // the Observable error path. All JSONP errors have status 0.
  69785. observer.error(new HttpErrorResponse({
  69786. url: url,
  69787. status: 0,
  69788. statusText: 'JSONP Error',
  69789. error: new Error(JSONP_ERR_NO_CALLBACK),
  69790. }));
  69791. return;
  69792. }
  69793. // Success. body either contains the response body or null if none was
  69794. // returned.
  69795. observer.next(new HttpResponse({
  69796. body: body,
  69797. status: 200,
  69798. statusText: 'OK', url: url,
  69799. }));
  69800. // Complete the stream, the response is over.
  69801. observer.complete();
  69802. };
  69803. // onError() is the error callback, which runs if the script returned generates
  69804. // a Javascript error. It emits the error via the Observable error channel as
  69805. // a HttpErrorResponse.
  69806. var /** @type {?} */ onError = function (error) {
  69807. // If the request was already cancelled, no need to emit anything.
  69808. if (cancelled) {
  69809. return;
  69810. }
  69811. cleanup();
  69812. // Wrap the error in a HttpErrorResponse.
  69813. observer.error(new HttpErrorResponse({
  69814. error: error,
  69815. status: 0,
  69816. statusText: 'JSONP Error', url: url,
  69817. }));
  69818. };
  69819. // Subscribe to both the success (load) and error events on the <script> tag,
  69820. // and add it to the page.
  69821. node.addEventListener('load', onLoad);
  69822. node.addEventListener('error', onError);
  69823. _this.document.body.appendChild(node);
  69824. // The request has now been successfully sent.
  69825. observer.next({ type: HttpEventType.Sent });
  69826. // Cancellation handler.
  69827. return function () {
  69828. // Track the cancellation so event listeners won't do anything even if already scheduled.
  69829. cancelled = true;
  69830. // Remove the event listeners so they won't run if the events later fire.
  69831. node.removeEventListener('load', onLoad);
  69832. node.removeEventListener('error', onError);
  69833. // And finally, clean up the page.
  69834. cleanup();
  69835. };
  69836. });
  69837. };
  69838. JsonpClientBackend.decorators = [
  69839. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */] },
  69840. ];
  69841. /** @nocollapse */
  69842. JsonpClientBackend.ctorParameters = function () { return [
  69843. { type: JsonpCallbackContext, },
  69844. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["z" /* Inject */], args: [__WEBPACK_IMPORTED_MODULE_6__angular_common__["c" /* DOCUMENT */],] },] },
  69845. ]; };
  69846. return JsonpClientBackend;
  69847. }());
  69848. /**
  69849. * An `HttpInterceptor` which identifies requests with the method JSONP and
  69850. * shifts them to the `JsonpClientBackend`.
  69851. *
  69852. * \@stable
  69853. */
  69854. var JsonpInterceptor = /** @class */ (function () {
  69855. function JsonpInterceptor(jsonp) {
  69856. this.jsonp = jsonp;
  69857. }
  69858. /**
  69859. * @param {?} req
  69860. * @param {?} next
  69861. * @return {?}
  69862. */
  69863. JsonpInterceptor.prototype.intercept = /**
  69864. * @param {?} req
  69865. * @param {?} next
  69866. * @return {?}
  69867. */
  69868. function (req, next) {
  69869. if (req.method === 'JSONP') {
  69870. return this.jsonp.handle(/** @type {?} */ (req));
  69871. }
  69872. // Fall through for normal HTTP requests.
  69873. return next.handle(req);
  69874. };
  69875. JsonpInterceptor.decorators = [
  69876. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */] },
  69877. ];
  69878. /** @nocollapse */
  69879. JsonpInterceptor.ctorParameters = function () { return [
  69880. { type: JsonpClientBackend, },
  69881. ]; };
  69882. return JsonpInterceptor;
  69883. }());
  69884. /**
  69885. * @fileoverview added by tsickle
  69886. * @suppress {checkTypes} checked by tsc
  69887. */
  69888. /**
  69889. * @license
  69890. * Copyright Google Inc. All Rights Reserved.
  69891. *
  69892. * Use of this source code is governed by an MIT-style license that can be
  69893. * found in the LICENSE file at https://angular.io/license
  69894. */
  69895. var XSSI_PREFIX = /^\)\]\}',?\n/;
  69896. /**
  69897. * Determine an appropriate URL for the response, by checking either
  69898. * XMLHttpRequest.responseURL or the X-Request-URL header.
  69899. * @param {?} xhr
  69900. * @return {?}
  69901. */
  69902. function getResponseUrl(xhr) {
  69903. if ('responseURL' in xhr && xhr.responseURL) {
  69904. return xhr.responseURL;
  69905. }
  69906. if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {
  69907. return xhr.getResponseHeader('X-Request-URL');
  69908. }
  69909. return null;
  69910. }
  69911. /**
  69912. * A wrapper around the `XMLHttpRequest` constructor.
  69913. *
  69914. * \@stable
  69915. * @abstract
  69916. */
  69917. var XhrFactory = /** @class */ (function () {
  69918. function XhrFactory() {
  69919. }
  69920. return XhrFactory;
  69921. }());
  69922. /**
  69923. * A factory for \@{link HttpXhrBackend} that uses the `XMLHttpRequest` browser API.
  69924. *
  69925. * \@stable
  69926. */
  69927. var BrowserXhr = /** @class */ (function () {
  69928. function BrowserXhr() {
  69929. }
  69930. /**
  69931. * @return {?}
  69932. */
  69933. BrowserXhr.prototype.build = /**
  69934. * @return {?}
  69935. */
  69936. function () { return /** @type {?} */ ((new XMLHttpRequest())); };
  69937. BrowserXhr.decorators = [
  69938. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */] },
  69939. ];
  69940. /** @nocollapse */
  69941. BrowserXhr.ctorParameters = function () { return []; };
  69942. return BrowserXhr;
  69943. }());
  69944. /**
  69945. * An `HttpBackend` which uses the XMLHttpRequest API to send
  69946. * requests to a backend server.
  69947. *
  69948. * \@stable
  69949. */
  69950. var HttpXhrBackend = /** @class */ (function () {
  69951. function HttpXhrBackend(xhrFactory) {
  69952. this.xhrFactory = xhrFactory;
  69953. }
  69954. /**
  69955. * Process a request and return a stream of response events.
  69956. */
  69957. /**
  69958. * Process a request and return a stream of response events.
  69959. * @param {?} req
  69960. * @return {?}
  69961. */
  69962. HttpXhrBackend.prototype.handle = /**
  69963. * Process a request and return a stream of response events.
  69964. * @param {?} req
  69965. * @return {?}
  69966. */
  69967. function (req) {
  69968. var _this = this;
  69969. // Quick check to give a better error message when a user attempts to use
  69970. // HttpClient.jsonp() without installing the JsonpClientModule
  69971. if (req.method === 'JSONP') {
  69972. throw new Error("Attempted to construct Jsonp request without JsonpClientModule installed.");
  69973. }
  69974. // Everything happens on Observable subscription.
  69975. return new __WEBPACK_IMPORTED_MODULE_7_rxjs_Observable__["Observable"](function (observer) {
  69976. // Start by setting up the XHR object with request method, URL, and withCredentials flag.
  69977. var /** @type {?} */ xhr = _this.xhrFactory.build();
  69978. xhr.open(req.method, req.urlWithParams);
  69979. if (!!req.withCredentials) {
  69980. xhr.withCredentials = true;
  69981. }
  69982. // Add all the requested headers.
  69983. req.headers.forEach(function (name, values) { return xhr.setRequestHeader(name, values.join(',')); });
  69984. // Add an Accept header if one isn't present already.
  69985. if (!req.headers.has('Accept')) {
  69986. xhr.setRequestHeader('Accept', 'application/json, text/plain, */*');
  69987. }
  69988. // Auto-detect the Content-Type header if one isn't present already.
  69989. if (!req.headers.has('Content-Type')) {
  69990. var /** @type {?} */ detectedType = req.detectContentTypeHeader();
  69991. // Sometimes Content-Type detection fails.
  69992. if (detectedType !== null) {
  69993. xhr.setRequestHeader('Content-Type', detectedType);
  69994. }
  69995. }
  69996. // Set the responseType if one was requested.
  69997. if (req.responseType) {
  69998. var /** @type {?} */ responseType = req.responseType.toLowerCase();
  69999. // JSON responses need to be processed as text. This is because if the server
  70000. // returns an XSSI-prefixed JSON response, the browser will fail to parse it,
  70001. // xhr.response will be null, and xhr.responseText cannot be accessed to
  70002. // retrieve the prefixed JSON data in order to strip the prefix. Thus, all JSON
  70003. // is parsed by first requesting text and then applying JSON.parse.
  70004. xhr.responseType = /** @type {?} */ (((responseType !== 'json') ? responseType : 'text'));
  70005. }
  70006. // Serialize the request body if one is present. If not, this will be set to null.
  70007. var /** @type {?} */ reqBody = req.serializeBody();
  70008. // If progress events are enabled, response headers will be delivered
  70009. // in two events - the HttpHeaderResponse event and the full HttpResponse
  70010. // event. However, since response headers don't change in between these
  70011. // two events, it doesn't make sense to parse them twice. So headerResponse
  70012. // caches the data extracted from the response whenever it's first parsed,
  70013. // to ensure parsing isn't duplicated.
  70014. var /** @type {?} */ headerResponse = null;
  70015. // partialFromXhr extracts the HttpHeaderResponse from the current XMLHttpRequest
  70016. // state, and memoizes it into headerResponse.
  70017. var /** @type {?} */ partialFromXhr = function () {
  70018. if (headerResponse !== null) {
  70019. return headerResponse;
  70020. }
  70021. // Read status and normalize an IE9 bug (http://bugs.jquery.com/ticket/1450).
  70022. var /** @type {?} */ status = xhr.status === 1223 ? 204 : xhr.status;
  70023. var /** @type {?} */ statusText = xhr.statusText || 'OK';
  70024. // Parse headers from XMLHttpRequest - this step is lazy.
  70025. var /** @type {?} */ headers = new HttpHeaders(xhr.getAllResponseHeaders());
  70026. // Read the response URL from the XMLHttpResponse instance and fall back on the
  70027. // request URL.
  70028. var /** @type {?} */ url = getResponseUrl(xhr) || req.url;
  70029. // Construct the HttpHeaderResponse and memoize it.
  70030. headerResponse = new HttpHeaderResponse({ headers: headers, status: status, statusText: statusText, url: url });
  70031. return headerResponse;
  70032. };
  70033. // Next, a few closures are defined for the various events which XMLHttpRequest can
  70034. // emit. This allows them to be unregistered as event listeners later.
  70035. // First up is the load event, which represents a response being fully available.
  70036. var /** @type {?} */ onLoad = function () {
  70037. // Read response state from the memoized partial data.
  70038. var _a = partialFromXhr(), headers = _a.headers, status = _a.status, statusText = _a.statusText, url = _a.url;
  70039. // The body will be read out if present.
  70040. var /** @type {?} */ body = null;
  70041. if (status !== 204) {
  70042. // Use XMLHttpRequest.response if set, responseText otherwise.
  70043. body = (typeof xhr.response === 'undefined') ? xhr.responseText : xhr.response;
  70044. }
  70045. // Normalize another potential bug (this one comes from CORS).
  70046. if (status === 0) {
  70047. status = !!body ? 200 : 0;
  70048. }
  70049. // ok determines whether the response will be transmitted on the event or
  70050. // error channel. Unsuccessful status codes (not 2xx) will always be errors,
  70051. // but a successful status code can still result in an error if the user
  70052. // asked for JSON data and the body cannot be parsed as such.
  70053. var /** @type {?} */ ok = status >= 200 && status < 300;
  70054. // Check whether the body needs to be parsed as JSON (in many cases the browser
  70055. // will have done that already).
  70056. if (req.responseType === 'json' && typeof body === 'string') {
  70057. // Save the original body, before attempting XSSI prefix stripping.
  70058. var /** @type {?} */ originalBody = body;
  70059. body = body.replace(XSSI_PREFIX, '');
  70060. try {
  70061. // Attempt the parse. If it fails, a parse error should be delivered to the user.
  70062. body = body !== '' ? JSON.parse(body) : null;
  70063. }
  70064. catch (/** @type {?} */ error) {
  70065. // Since the JSON.parse failed, it's reasonable to assume this might not have been a
  70066. // JSON response. Restore the original body (including any XSSI prefix) to deliver
  70067. // a better error response.
  70068. body = originalBody;
  70069. // If this was an error request to begin with, leave it as a string, it probably
  70070. // just isn't JSON. Otherwise, deliver the parsing error to the user.
  70071. if (ok) {
  70072. // Even though the response status was 2xx, this is still an error.
  70073. ok = false;
  70074. // The parse error contains the text of the body that failed to parse.
  70075. body = /** @type {?} */ ({ error: error, text: body });
  70076. }
  70077. }
  70078. }
  70079. if (ok) {
  70080. // A successful response is delivered on the event stream.
  70081. observer.next(new HttpResponse({
  70082. body: body,
  70083. headers: headers,
  70084. status: status,
  70085. statusText: statusText,
  70086. url: url || undefined,
  70087. }));
  70088. // The full body has been received and delivered, no further events
  70089. // are possible. This request is complete.
  70090. observer.complete();
  70091. }
  70092. else {
  70093. // An unsuccessful request is delivered on the error channel.
  70094. observer.error(new HttpErrorResponse({
  70095. // The error in this case is the response body (error from the server).
  70096. error: body,
  70097. headers: headers,
  70098. status: status,
  70099. statusText: statusText,
  70100. url: url || undefined,
  70101. }));
  70102. }
  70103. };
  70104. // The onError callback is called when something goes wrong at the network level.
  70105. // Connection timeout, DNS error, offline, etc. These are actual errors, and are
  70106. // transmitted on the error channel.
  70107. var /** @type {?} */ onError = function (error) {
  70108. var /** @type {?} */ res = new HttpErrorResponse({
  70109. error: error,
  70110. status: xhr.status || 0,
  70111. statusText: xhr.statusText || 'Unknown Error',
  70112. });
  70113. observer.error(res);
  70114. };
  70115. // The sentHeaders flag tracks whether the HttpResponseHeaders event
  70116. // has been sent on the stream. This is necessary to track if progress
  70117. // is enabled since the event will be sent on only the first download
  70118. // progerss event.
  70119. var /** @type {?} */ sentHeaders = false;
  70120. // The download progress event handler, which is only registered if
  70121. // progress events are enabled.
  70122. var /** @type {?} */ onDownProgress = function (event) {
  70123. // Send the HttpResponseHeaders event if it hasn't been sent already.
  70124. if (!sentHeaders) {
  70125. observer.next(partialFromXhr());
  70126. sentHeaders = true;
  70127. }
  70128. // Start building the download progress event to deliver on the response
  70129. // event stream.
  70130. var /** @type {?} */ progressEvent = {
  70131. type: HttpEventType.DownloadProgress,
  70132. loaded: event.loaded,
  70133. };
  70134. // Set the total number of bytes in the event if it's available.
  70135. if (event.lengthComputable) {
  70136. progressEvent.total = event.total;
  70137. }
  70138. // If the request was for text content and a partial response is
  70139. // available on XMLHttpRequest, include it in the progress event
  70140. // to allow for streaming reads.
  70141. if (req.responseType === 'text' && !!xhr.responseText) {
  70142. progressEvent.partialText = xhr.responseText;
  70143. }
  70144. // Finally, fire the event.
  70145. observer.next(progressEvent);
  70146. };
  70147. // The upload progress event handler, which is only registered if
  70148. // progress events are enabled.
  70149. var /** @type {?} */ onUpProgress = function (event) {
  70150. // Upload progress events are simpler. Begin building the progress
  70151. // event.
  70152. var /** @type {?} */ progress = {
  70153. type: HttpEventType.UploadProgress,
  70154. loaded: event.loaded,
  70155. };
  70156. // If the total number of bytes being uploaded is available, include
  70157. // it.
  70158. if (event.lengthComputable) {
  70159. progress.total = event.total;
  70160. }
  70161. // Send the event.
  70162. observer.next(progress);
  70163. };
  70164. // By default, register for load and error events.
  70165. xhr.addEventListener('load', onLoad);
  70166. xhr.addEventListener('error', onError);
  70167. // Progress events are only enabled if requested.
  70168. if (req.reportProgress) {
  70169. // Download progress is always enabled if requested.
  70170. xhr.addEventListener('progress', onDownProgress);
  70171. // Upload progress depends on whether there is a body to upload.
  70172. if (reqBody !== null && xhr.upload) {
  70173. xhr.upload.addEventListener('progress', onUpProgress);
  70174. }
  70175. }
  70176. // Fire the request, and notify the event stream that it was fired.
  70177. xhr.send(reqBody);
  70178. observer.next({ type: HttpEventType.Sent });
  70179. // This is the return from the Observable function, which is the
  70180. // request cancellation handler.
  70181. return function () {
  70182. // On a cancellation, remove all registered event listeners.
  70183. xhr.removeEventListener('error', onError);
  70184. xhr.removeEventListener('load', onLoad);
  70185. if (req.reportProgress) {
  70186. xhr.removeEventListener('progress', onDownProgress);
  70187. if (reqBody !== null && xhr.upload) {
  70188. xhr.upload.removeEventListener('progress', onUpProgress);
  70189. }
  70190. }
  70191. // Finally, abort the in-flight request.
  70192. xhr.abort();
  70193. };
  70194. });
  70195. };
  70196. HttpXhrBackend.decorators = [
  70197. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */] },
  70198. ];
  70199. /** @nocollapse */
  70200. HttpXhrBackend.ctorParameters = function () { return [
  70201. { type: XhrFactory, },
  70202. ]; };
  70203. return HttpXhrBackend;
  70204. }());
  70205. /**
  70206. * @fileoverview added by tsickle
  70207. * @suppress {checkTypes} checked by tsc
  70208. */
  70209. /**
  70210. * @license
  70211. * Copyright Google Inc. All Rights Reserved.
  70212. *
  70213. * Use of this source code is governed by an MIT-style license that can be
  70214. * found in the LICENSE file at https://angular.io/license
  70215. */
  70216. var XSRF_COOKIE_NAME = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["B" /* InjectionToken */]('XSRF_COOKIE_NAME');
  70217. var XSRF_HEADER_NAME = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["B" /* InjectionToken */]('XSRF_HEADER_NAME');
  70218. /**
  70219. * Retrieves the current XSRF token to use with the next outgoing request.
  70220. *
  70221. * \@stable
  70222. * @abstract
  70223. */
  70224. var HttpXsrfTokenExtractor = /** @class */ (function () {
  70225. function HttpXsrfTokenExtractor() {
  70226. }
  70227. return HttpXsrfTokenExtractor;
  70228. }());
  70229. /**
  70230. * `HttpXsrfTokenExtractor` which retrieves the token from a cookie.
  70231. */
  70232. var HttpXsrfCookieExtractor = /** @class */ (function () {
  70233. function HttpXsrfCookieExtractor(doc, platform, cookieName) {
  70234. this.doc = doc;
  70235. this.platform = platform;
  70236. this.cookieName = cookieName;
  70237. this.lastCookieString = '';
  70238. this.lastToken = null;
  70239. /**
  70240. * \@internal for testing
  70241. */
  70242. this.parseCount = 0;
  70243. }
  70244. /**
  70245. * @return {?}
  70246. */
  70247. HttpXsrfCookieExtractor.prototype.getToken = /**
  70248. * @return {?}
  70249. */
  70250. function () {
  70251. if (this.platform === 'server') {
  70252. return null;
  70253. }
  70254. var /** @type {?} */ cookieString = this.doc.cookie || '';
  70255. if (cookieString !== this.lastCookieString) {
  70256. this.parseCount++;
  70257. this.lastToken = Object(__WEBPACK_IMPORTED_MODULE_6__angular_common__["j" /* ɵparseCookieValue */])(cookieString, this.cookieName);
  70258. this.lastCookieString = cookieString;
  70259. }
  70260. return this.lastToken;
  70261. };
  70262. HttpXsrfCookieExtractor.decorators = [
  70263. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */] },
  70264. ];
  70265. /** @nocollapse */
  70266. HttpXsrfCookieExtractor.ctorParameters = function () { return [
  70267. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["z" /* Inject */], args: [__WEBPACK_IMPORTED_MODULE_6__angular_common__["c" /* DOCUMENT */],] },] },
  70268. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["z" /* Inject */], args: [__WEBPACK_IMPORTED_MODULE_0__angular_core__["Q" /* PLATFORM_ID */],] },] },
  70269. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["z" /* Inject */], args: [XSRF_COOKIE_NAME,] },] },
  70270. ]; };
  70271. return HttpXsrfCookieExtractor;
  70272. }());
  70273. /**
  70274. * `HttpInterceptor` which adds an XSRF token to eligible outgoing requests.
  70275. */
  70276. var HttpXsrfInterceptor = /** @class */ (function () {
  70277. function HttpXsrfInterceptor(tokenService, headerName) {
  70278. this.tokenService = tokenService;
  70279. this.headerName = headerName;
  70280. }
  70281. /**
  70282. * @param {?} req
  70283. * @param {?} next
  70284. * @return {?}
  70285. */
  70286. HttpXsrfInterceptor.prototype.intercept = /**
  70287. * @param {?} req
  70288. * @param {?} next
  70289. * @return {?}
  70290. */
  70291. function (req, next) {
  70292. var /** @type {?} */ lcUrl = req.url.toLowerCase();
  70293. // Skip both non-mutating requests and absolute URLs.
  70294. // Non-mutating requests don't require a token, and absolute URLs require special handling
  70295. // anyway as the cookie set
  70296. // on our origin is not the same as the token expected by another origin.
  70297. if (req.method === 'GET' || req.method === 'HEAD' || lcUrl.startsWith('http://') ||
  70298. lcUrl.startsWith('https://')) {
  70299. return next.handle(req);
  70300. }
  70301. var /** @type {?} */ token = this.tokenService.getToken();
  70302. // Be careful not to overwrite an existing header of the same name.
  70303. if (token !== null && !req.headers.has(this.headerName)) {
  70304. req = req.clone({ headers: req.headers.set(this.headerName, token) });
  70305. }
  70306. return next.handle(req);
  70307. };
  70308. HttpXsrfInterceptor.decorators = [
  70309. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */] },
  70310. ];
  70311. /** @nocollapse */
  70312. HttpXsrfInterceptor.ctorParameters = function () { return [
  70313. { type: HttpXsrfTokenExtractor, },
  70314. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["z" /* Inject */], args: [XSRF_HEADER_NAME,] },] },
  70315. ]; };
  70316. return HttpXsrfInterceptor;
  70317. }());
  70318. /**
  70319. * @fileoverview added by tsickle
  70320. * @suppress {checkTypes} checked by tsc
  70321. */
  70322. /**
  70323. * @license
  70324. * Copyright Google Inc. All Rights Reserved.
  70325. *
  70326. * Use of this source code is governed by an MIT-style license that can be
  70327. * found in the LICENSE file at https://angular.io/license
  70328. */
  70329. /**
  70330. * An `HttpHandler` that applies a bunch of `HttpInterceptor`s
  70331. * to a request before passing it to the given `HttpBackend`.
  70332. *
  70333. * The interceptors are loaded lazily from the injector, to allow
  70334. * interceptors to themselves inject classes depending indirectly
  70335. * on `HttpInterceptingHandler` itself.
  70336. */
  70337. var HttpInterceptingHandler = /** @class */ (function () {
  70338. function HttpInterceptingHandler(backend, injector) {
  70339. this.backend = backend;
  70340. this.injector = injector;
  70341. this.chain = null;
  70342. }
  70343. /**
  70344. * @param {?} req
  70345. * @return {?}
  70346. */
  70347. HttpInterceptingHandler.prototype.handle = /**
  70348. * @param {?} req
  70349. * @return {?}
  70350. */
  70351. function (req) {
  70352. if (this.chain === null) {
  70353. var /** @type {?} */ interceptors = this.injector.get(HTTP_INTERCEPTORS, []);
  70354. this.chain = interceptors.reduceRight(function (next, interceptor) { return new HttpInterceptorHandler(next, interceptor); }, this.backend);
  70355. }
  70356. return this.chain.handle(req);
  70357. };
  70358. HttpInterceptingHandler.decorators = [
  70359. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */] },
  70360. ];
  70361. /** @nocollapse */
  70362. HttpInterceptingHandler.ctorParameters = function () { return [
  70363. { type: HttpBackend, },
  70364. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["C" /* Injector */], },
  70365. ]; };
  70366. return HttpInterceptingHandler;
  70367. }());
  70368. /**
  70369. * Constructs an `HttpHandler` that applies a bunch of `HttpInterceptor`s
  70370. * to a request before passing it to the given `HttpBackend`.
  70371. *
  70372. * Meant to be used as a factory function within `HttpClientModule`.
  70373. *
  70374. * \@stable
  70375. * @param {?} backend
  70376. * @param {?=} interceptors
  70377. * @return {?}
  70378. */
  70379. function interceptingHandler(backend, interceptors) {
  70380. if (interceptors === void 0) { interceptors = []; }
  70381. if (!interceptors) {
  70382. return backend;
  70383. }
  70384. return interceptors.reduceRight(function (next, interceptor) { return new HttpInterceptorHandler(next, interceptor); }, backend);
  70385. }
  70386. /**
  70387. * Factory function that determines where to store JSONP callbacks.
  70388. *
  70389. * Ordinarily JSONP callbacks are stored on the `window` object, but this may not exist
  70390. * in test environments. In that case, callbacks are stored on an anonymous object instead.
  70391. *
  70392. * \@stable
  70393. * @return {?}
  70394. */
  70395. function jsonpCallbackContext() {
  70396. if (typeof window === 'object') {
  70397. return window;
  70398. }
  70399. return {};
  70400. }
  70401. /**
  70402. * `NgModule` which adds XSRF protection support to outgoing requests.
  70403. *
  70404. * Provided the server supports a cookie-based XSRF protection system, this
  70405. * module can be used directly to configure XSRF protection with the correct
  70406. * cookie and header names.
  70407. *
  70408. * If no such names are provided, the default is to use `X-XSRF-TOKEN` for
  70409. * the header name and `XSRF-TOKEN` for the cookie name.
  70410. *
  70411. * \@stable
  70412. */
  70413. var HttpClientXsrfModule = /** @class */ (function () {
  70414. function HttpClientXsrfModule() {
  70415. }
  70416. /**
  70417. * Disable the default XSRF protection.
  70418. */
  70419. /**
  70420. * Disable the default XSRF protection.
  70421. * @return {?}
  70422. */
  70423. HttpClientXsrfModule.disable = /**
  70424. * Disable the default XSRF protection.
  70425. * @return {?}
  70426. */
  70427. function () {
  70428. return {
  70429. ngModule: HttpClientXsrfModule,
  70430. providers: [
  70431. { provide: HttpXsrfInterceptor, useClass: NoopInterceptor },
  70432. ],
  70433. };
  70434. };
  70435. /**
  70436. * Configure XSRF protection to use the given cookie name or header name,
  70437. * or the default names (as described above) if not provided.
  70438. */
  70439. /**
  70440. * Configure XSRF protection to use the given cookie name or header name,
  70441. * or the default names (as described above) if not provided.
  70442. * @param {?=} options
  70443. * @return {?}
  70444. */
  70445. HttpClientXsrfModule.withOptions = /**
  70446. * Configure XSRF protection to use the given cookie name or header name,
  70447. * or the default names (as described above) if not provided.
  70448. * @param {?=} options
  70449. * @return {?}
  70450. */
  70451. function (options) {
  70452. if (options === void 0) { options = {}; }
  70453. return {
  70454. ngModule: HttpClientXsrfModule,
  70455. providers: [
  70456. options.cookieName ? { provide: XSRF_COOKIE_NAME, useValue: options.cookieName } : [],
  70457. options.headerName ? { provide: XSRF_HEADER_NAME, useValue: options.headerName } : [],
  70458. ],
  70459. };
  70460. };
  70461. HttpClientXsrfModule.decorators = [
  70462. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["I" /* NgModule */], args: [{
  70463. providers: [
  70464. HttpXsrfInterceptor,
  70465. { provide: HTTP_INTERCEPTORS, useExisting: HttpXsrfInterceptor, multi: true },
  70466. { provide: HttpXsrfTokenExtractor, useClass: HttpXsrfCookieExtractor },
  70467. { provide: XSRF_COOKIE_NAME, useValue: 'XSRF-TOKEN' },
  70468. { provide: XSRF_HEADER_NAME, useValue: 'X-XSRF-TOKEN' },
  70469. ],
  70470. },] },
  70471. ];
  70472. /** @nocollapse */
  70473. HttpClientXsrfModule.ctorParameters = function () { return []; };
  70474. return HttpClientXsrfModule;
  70475. }());
  70476. /**
  70477. * `NgModule` which provides the `HttpClient` and associated services.
  70478. *
  70479. * Interceptors can be added to the chain behind `HttpClient` by binding them
  70480. * to the multiprovider for `HTTP_INTERCEPTORS`.
  70481. *
  70482. * \@stable
  70483. */
  70484. var HttpClientModule = /** @class */ (function () {
  70485. function HttpClientModule() {
  70486. }
  70487. HttpClientModule.decorators = [
  70488. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["I" /* NgModule */], args: [{
  70489. imports: [
  70490. HttpClientXsrfModule.withOptions({
  70491. cookieName: 'XSRF-TOKEN',
  70492. headerName: 'X-XSRF-TOKEN',
  70493. }),
  70494. ],
  70495. providers: [
  70496. HttpClient,
  70497. { provide: HttpHandler, useClass: HttpInterceptingHandler },
  70498. HttpXhrBackend,
  70499. { provide: HttpBackend, useExisting: HttpXhrBackend },
  70500. BrowserXhr,
  70501. { provide: XhrFactory, useExisting: BrowserXhr },
  70502. ],
  70503. },] },
  70504. ];
  70505. /** @nocollapse */
  70506. HttpClientModule.ctorParameters = function () { return []; };
  70507. return HttpClientModule;
  70508. }());
  70509. /**
  70510. * `NgModule` which enables JSONP support in `HttpClient`.
  70511. *
  70512. * Without this module, Jsonp requests will reach the backend
  70513. * with method JSONP, where they'll be rejected.
  70514. *
  70515. * \@stable
  70516. */
  70517. var HttpClientJsonpModule = /** @class */ (function () {
  70518. function HttpClientJsonpModule() {
  70519. }
  70520. HttpClientJsonpModule.decorators = [
  70521. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["I" /* NgModule */], args: [{
  70522. providers: [
  70523. JsonpClientBackend,
  70524. { provide: JsonpCallbackContext, useFactory: jsonpCallbackContext },
  70525. { provide: HTTP_INTERCEPTORS, useClass: JsonpInterceptor, multi: true },
  70526. ],
  70527. },] },
  70528. ];
  70529. /** @nocollapse */
  70530. HttpClientJsonpModule.ctorParameters = function () { return []; };
  70531. return HttpClientJsonpModule;
  70532. }());
  70533. /**
  70534. * @fileoverview added by tsickle
  70535. * @suppress {checkTypes} checked by tsc
  70536. */
  70537. /**
  70538. * @license
  70539. * Copyright Google Inc. All Rights Reserved.
  70540. *
  70541. * Use of this source code is governed by an MIT-style license that can be
  70542. * found in the LICENSE file at https://angular.io/license
  70543. */
  70544. /**
  70545. * @fileoverview added by tsickle
  70546. * @suppress {checkTypes} checked by tsc
  70547. */
  70548. /**
  70549. * Generated bundle index. Do not edit.
  70550. */
  70551. //# sourceMappingURL=http.js.map
  70552. /***/ }),
  70553. /* 160 */
  70554. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  70555. "use strict";
  70556. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ModalController; });
  70557. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  70558. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__app_app__ = __webpack_require__(6);
  70559. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__config_config__ = __webpack_require__(1);
  70560. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__modal__ = __webpack_require__(153);
  70561. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__navigation_deep_linker__ = __webpack_require__(14);
  70562. /**
  70563. * @name ModalController
  70564. * @description
  70565. * A Modal is a content pane that goes over the user's current page.
  70566. * Usually it is used for making a choice or editing an item. A modal uses the
  70567. * `NavController` to
  70568. * {@link /docs/api/components/nav/NavController/#present present}
  70569. * itself in the root nav stack. It is added to the stack similar to how
  70570. * {@link /docs/api/components/nav/NavController/#push NavController.push}
  70571. * works.
  70572. *
  70573. * When a modal (or any other overlay such as an alert or actionsheet) is
  70574. * "presented" to a nav controller, the overlay is added to the app's root nav.
  70575. * After the modal has been presented, from within the component instance, the
  70576. * modal can later be closed or "dismissed" by using the ViewController's
  70577. * `dismiss` method. Additionally, you can dismiss any overlay by using `pop`
  70578. * on the root nav controller. Modals are not reusable. When a modal is dismissed
  70579. * it is destroyed.
  70580. *
  70581. * Data can be passed to a new modal through `Modal.create()` as the second
  70582. * argument. The data can then be accessed from the opened page by injecting
  70583. * `NavParams`. Note that the page, which opened as a modal, has no special
  70584. * "modal" logic within it, but uses `NavParams` no differently than a
  70585. * standard page.
  70586. *
  70587. * @usage
  70588. * ```ts
  70589. * import { ModalController, NavParams } from 'ionic-angular';
  70590. *
  70591. * @Component(...)
  70592. * class HomePage {
  70593. *
  70594. * constructor(public modalCtrl: ModalController) { }
  70595. *
  70596. * presentProfileModal() {
  70597. * const profileModal = this.modalCtrl.create(Profile, { userId: 8675309 });
  70598. * profileModal.present();
  70599. * }
  70600. *
  70601. * }
  70602. *
  70603. * @Component(...)
  70604. * class Profile {
  70605. *
  70606. * constructor(params: NavParams) {
  70607. * console.log('UserId', params.get('userId'));
  70608. * }
  70609. *
  70610. * }
  70611. * ```
  70612. *
  70613. * @advanced
  70614. *
  70615. * | Option | Type | Description |
  70616. * |-----------------------|------------|------------------------------------------------------------------------------------------------------------------|
  70617. * | showBackdrop |`boolean` | Whether to show the backdrop. Default true. |
  70618. * | enableBackdropDismiss |`boolean` | Whether the popover should be dismissed by tapping the backdrop. Default true. |
  70619. * | cssClass |`string` | Additional classes for custom styles, separated by spaces. |
  70620. *
  70621. * A modal can also emit data, which is useful when it is used to add or edit
  70622. * data. For example, a profile page could slide up in a modal, and on submit,
  70623. * the submit button could pass the updated profile data, then dismiss the
  70624. * modal.
  70625. *
  70626. * ```ts
  70627. * import { Component } from '@angular/core';
  70628. * import { ModalController, ViewController } from 'ionic-angular';
  70629. *
  70630. * @Component(...)
  70631. * class HomePage {
  70632. *
  70633. * constructor(public modalCtrl: ModalController) {
  70634. *
  70635. * }
  70636. *
  70637. * presentContactModal() {
  70638. * let contactModal = this.modalCtrl.create(ContactUs);
  70639. * contactModal.present();
  70640. * }
  70641. *
  70642. * presentProfileModal() {
  70643. * let profileModal = this.modalCtrl.create(Profile, { userId: 8675309 });
  70644. * profileModal.onDidDismiss(data => {
  70645. * console.log(data);
  70646. * });
  70647. * profileModal.present();
  70648. * }
  70649. *
  70650. * }
  70651. *
  70652. * @Component(...)
  70653. * class Profile {
  70654. *
  70655. * constructor(public viewCtrl: ViewController) {
  70656. *
  70657. * }
  70658. *
  70659. * dismiss() {
  70660. * let data = { 'foo': 'bar' };
  70661. * this.viewCtrl.dismiss(data);
  70662. * }
  70663. *
  70664. * }
  70665. * ```
  70666. *
  70667. * A common issue is that a developer may try to implement navigation in a modal, but when you try NavController.push(),
  70668. * you will notice that the status bar on iOS gets cut off. The proper way to implement navigation in a modal is to
  70669. * make the modal component a navigation container, and set the root page to the page you want to show in your modal.
  70670. *
  70671. * ```ts
  70672. * @Component({
  70673. * template: '<ion-nav [root]="rootPage" [rootParams]="rootParams"></ion-nav>'
  70674. * })
  70675. * export class MyModalWrapper {
  70676. * rootPage = 'MyModalContentPage'; // This is the page you want your modal to display
  70677. * rootParams;
  70678. *
  70679. * constructor(navParams: NavParams, private viewCtrl: ViewController) {
  70680. * this.rootParams = Object.assign({}, navParams.data, {viewCtrl: viewCtrl});
  70681. * // This line will send the view controller into your child views, so you can dismiss the modals from there.
  70682. * }
  70683. * }
  70684. * ```
  70685. * @demo /docs/demos/src/modal/
  70686. * @see {@link /docs/components#modals Modal Component Docs}
  70687. */
  70688. var ModalController = (function () {
  70689. function ModalController(_app, config, deepLinker) {
  70690. this._app = _app;
  70691. this.config = config;
  70692. this.deepLinker = deepLinker;
  70693. }
  70694. /**
  70695. * Create a modal to display. See below for options.
  70696. *
  70697. * @param {object} component The Modal view
  70698. * @param {object} data Any data to pass to the Modal view
  70699. * @param {object} opts Modal options
  70700. */
  70701. ModalController.prototype.create = function (component, data, opts) {
  70702. if (data === void 0) { data = {}; }
  70703. if (opts === void 0) { opts = {}; }
  70704. return new __WEBPACK_IMPORTED_MODULE_3__modal__["a" /* Modal */](this._app, component, data, opts, this.config, this.deepLinker);
  70705. };
  70706. ModalController.decorators = [
  70707. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */] },
  70708. ];
  70709. /** @nocollapse */
  70710. ModalController.ctorParameters = function () { return [
  70711. { type: __WEBPACK_IMPORTED_MODULE_1__app_app__["a" /* App */], },
  70712. { type: __WEBPACK_IMPORTED_MODULE_2__config_config__["a" /* Config */], },
  70713. { type: __WEBPACK_IMPORTED_MODULE_4__navigation_deep_linker__["a" /* DeepLinker */], },
  70714. ]; };
  70715. return ModalController;
  70716. }());
  70717. //# sourceMappingURL=modal-controller.js.map
  70718. /***/ }),
  70719. /* 161 */
  70720. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  70721. "use strict";
  70722. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return NavPopAnchor; });
  70723. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  70724. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__navigation_deep_linker__ = __webpack_require__(14);
  70725. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__navigation_view_controller__ = __webpack_require__(5);
  70726. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__nav_pop__ = __webpack_require__(77);
  70727. /**
  70728. * @hidden
  70729. */
  70730. var NavPopAnchor = (function () {
  70731. function NavPopAnchor(host, linker, viewCtrl) {
  70732. this.host = host;
  70733. this.linker = linker;
  70734. this.viewCtrl = viewCtrl;
  70735. }
  70736. NavPopAnchor.prototype.updateHref = function () {
  70737. if (this.host && this.viewCtrl) {
  70738. var previousView = this.host._nav.getPrevious(this.viewCtrl);
  70739. this._href = (previousView && this.linker.createUrl(this.host._nav, this.viewCtrl.component, this.viewCtrl.data)) || '#';
  70740. }
  70741. else {
  70742. this._href = '#';
  70743. }
  70744. };
  70745. NavPopAnchor.prototype.ngAfterContentInit = function () {
  70746. this.updateHref();
  70747. };
  70748. NavPopAnchor.decorators = [
  70749. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  70750. selector: 'a[navPop]',
  70751. host: {
  70752. '[attr.href]': '_href'
  70753. }
  70754. },] },
  70755. ];
  70756. /** @nocollapse */
  70757. NavPopAnchor.ctorParameters = function () { return [
  70758. { type: __WEBPACK_IMPORTED_MODULE_3__nav_pop__["a" /* NavPop */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  70759. { type: __WEBPACK_IMPORTED_MODULE_1__navigation_deep_linker__["a" /* DeepLinker */], },
  70760. { type: __WEBPACK_IMPORTED_MODULE_2__navigation_view_controller__["a" /* ViewController */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  70761. ]; };
  70762. return NavPopAnchor;
  70763. }());
  70764. //# sourceMappingURL=nav-pop-anchor.js.map
  70765. /***/ }),
  70766. /* 162 */
  70767. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  70768. "use strict";
  70769. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return NavPushAnchor; });
  70770. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  70771. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__navigation_deep_linker__ = __webpack_require__(14);
  70772. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__nav_push__ = __webpack_require__(78);
  70773. /**
  70774. * @hidden
  70775. */
  70776. var NavPushAnchor = (function () {
  70777. function NavPushAnchor(host, linker) {
  70778. this.host = host;
  70779. this.linker = linker;
  70780. }
  70781. NavPushAnchor.prototype.updateHref = function () {
  70782. if (this.host && this.linker) {
  70783. this._href = this.linker.createUrl(this.host._nav, this.host.navPush, this.host.navParams) || '#';
  70784. }
  70785. else {
  70786. this._href = '#';
  70787. }
  70788. };
  70789. NavPushAnchor.prototype.ngAfterContentInit = function () {
  70790. this.updateHref();
  70791. };
  70792. NavPushAnchor.decorators = [
  70793. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  70794. selector: 'a[navPush]',
  70795. host: {
  70796. '[attr.href]': '_href'
  70797. }
  70798. },] },
  70799. ];
  70800. /** @nocollapse */
  70801. NavPushAnchor.ctorParameters = function () { return [
  70802. { type: __WEBPACK_IMPORTED_MODULE_2__nav_push__["a" /* NavPush */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["w" /* Host */] },] },
  70803. { type: __WEBPACK_IMPORTED_MODULE_1__navigation_deep_linker__["a" /* DeepLinker */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  70804. ]; };
  70805. return NavPushAnchor;
  70806. }());
  70807. //# sourceMappingURL=nav-push-anchor.js.map
  70808. /***/ }),
  70809. /* 163 */
  70810. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  70811. "use strict";
  70812. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Note; });
  70813. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  70814. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__config_config__ = __webpack_require__(1);
  70815. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ion__ = __webpack_require__(4);
  70816. var __extends = (this && this.__extends) || (function () {
  70817. var extendStatics = Object.setPrototypeOf ||
  70818. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  70819. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  70820. return function (d, b) {
  70821. extendStatics(d, b);
  70822. function __() { this.constructor = d; }
  70823. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  70824. };
  70825. })();
  70826. /**
  70827. * @name Note
  70828. * @module ionic
  70829. * @description
  70830. * A note is detailed item in an ion-item. It creates greyed out element that can be on the left or right side of an item.
  70831. * @usage
  70832. *
  70833. * ```html
  70834. * <ion-content>
  70835. * <ion-list>
  70836. * <ion-item>
  70837. * <ion-note item-start>
  70838. * Left Note
  70839. * </ion-note>
  70840. * My Item
  70841. * <ion-note item-end>
  70842. * Right Note
  70843. * </ion-note>
  70844. * </ion-item>
  70845. * </ion-list>
  70846. * </ion-content>
  70847. *```
  70848. * {@link /docs/api/components/api/components/item/item ion-item}
  70849. */
  70850. var Note = (function (_super) {
  70851. __extends(Note, _super);
  70852. function Note(config, elementRef, renderer) {
  70853. return _super.call(this, config, elementRef, renderer, 'note') || this;
  70854. }
  70855. Note.decorators = [
  70856. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  70857. selector: 'ion-note'
  70858. },] },
  70859. ];
  70860. /** @nocollapse */
  70861. Note.ctorParameters = function () { return [
  70862. { type: __WEBPACK_IMPORTED_MODULE_1__config_config__["a" /* Config */], },
  70863. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  70864. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  70865. ]; };
  70866. return Note;
  70867. }(__WEBPACK_IMPORTED_MODULE_2__ion__["a" /* Ion */]));
  70868. //# sourceMappingURL=note.js.map
  70869. /***/ }),
  70870. /* 164 */
  70871. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  70872. "use strict";
  70873. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PopoverController; });
  70874. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  70875. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__app_app__ = __webpack_require__(6);
  70876. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__config_config__ = __webpack_require__(1);
  70877. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__popover__ = __webpack_require__(80);
  70878. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__navigation_deep_linker__ = __webpack_require__(14);
  70879. /**
  70880. * @name PopoverController
  70881. * @description
  70882. * A Popover is a dialog that appears on top of the current page.
  70883. * It can be used for anything, but generally it is used for overflow
  70884. * actions that don't fit in the navigation bar.
  70885. *
  70886. * ### Creating
  70887. * A popover can be created by calling the `create` method. The view
  70888. * to display in the popover should be passed as the first argument.
  70889. * Any data to pass to the popover view can optionally be passed in
  70890. * the second argument. Options for the popover can optionally be
  70891. * passed in the third argument. See the [create](#create) method
  70892. * below for all available options.
  70893. *
  70894. * ### Presenting
  70895. * To present a popover, call the `present` method on a PopoverController instance.
  70896. * In order to position the popover relative to the element clicked, a click event
  70897. * needs to be passed into the options of the the `present method. If the event
  70898. * is not passed, the popover will be positioned in the center of the current
  70899. * view. See the [usage](#usage) section for an example of passing this event.
  70900. *
  70901. * ### Dismissing
  70902. * To dismiss the popover after creation, call the `dismiss()` method on the
  70903. * `Popover` instance. The popover can also be dismissed from within the popover's
  70904. * view by calling the `dismiss()` method on the [ViewController](../../navigation/ViewController).
  70905. * The `dismiss()` call accepts an optional parameter that will be passed to the callback described
  70906. * as follows. The `onDidDismiss(<func>)` function can be called to set up a callback action that will
  70907. * be performed after the popover is dismissed, receiving the parameter passed to `dismiss()`.
  70908. * The popover will dismiss when the backdrop is clicked by implicitly performing `dismiss(null)`,
  70909. * but this can be disabled by setting `enableBackdropDismiss` to `false` in the popover options.
  70910. *
  70911. * > Note that after the component is dismissed, it will not be usable anymore and
  70912. * another one must be created. This can be avoided by wrapping the creation and
  70913. * presentation of the component in a reusable function as shown in the [usage](#usage)
  70914. * section below.
  70915. *
  70916. * @usage
  70917. *
  70918. * To open a popover on the click of a button, pass `$event` to the method
  70919. * which creates and presents the popover:
  70920. *
  70921. * ```html
  70922. * <button ion-button icon-only (click)="presentPopover($event)">
  70923. * <ion-icon name="more"></ion-icon>
  70924. * </button>
  70925. * ```
  70926. *
  70927. * ```ts
  70928. * import { PopoverController } from 'ionic-angular';
  70929. *
  70930. * @Component({})
  70931. * class MyPage {
  70932. * constructor(public popoverCtrl: PopoverController) {}
  70933. *
  70934. * presentPopover(myEvent) {
  70935. * let popover = this.popoverCtrl.create(PopoverPage);
  70936. * popover.present({
  70937. * ev: myEvent
  70938. * });
  70939. * }
  70940. * }
  70941. * ```
  70942. *
  70943. * The `PopoverPage` will display inside of the popover, and
  70944. * can be anything. Below is an example of a page with items
  70945. * that close the popover on click.
  70946. *
  70947. * ```ts
  70948. * @Component({
  70949. * template: `
  70950. * <ion-list>
  70951. * <ion-list-header>Ionic</ion-list-header>
  70952. * <button ion-item (click)="close()">Learn Ionic</button>
  70953. * <button ion-item (click)="close()">Documentation</button>
  70954. * <button ion-item (click)="close()">Showcase</button>
  70955. * <button ion-item (click)="close()">GitHub Repo</button>
  70956. * </ion-list>
  70957. * `
  70958. * })
  70959. * class PopoverPage {
  70960. * constructor(public viewCtrl: ViewController) {}
  70961. *
  70962. * close() {
  70963. * this.viewCtrl.dismiss();
  70964. * }
  70965. * }
  70966. * ```
  70967. * @advanced
  70968. * Popover Options
  70969. *
  70970. * | Option | Type | Description |
  70971. * |-----------------------|------------|------------------------------------------------------------------------------------------------------------------|
  70972. * | cssClass |`string` | Additional classes for custom styles, separated by spaces. |
  70973. * | showBackdrop |`boolean` | Whether to show the backdrop. Default true. |
  70974. * | enableBackdropDismiss |`boolean` | Whether the popover should be dismissed by tapping the backdrop. Default true. |
  70975. *
  70976. *
  70977. *
  70978. * @demo /docs/demos/src/popover/
  70979. */
  70980. var PopoverController = (function () {
  70981. function PopoverController(_app, config, _deepLinker) {
  70982. this._app = _app;
  70983. this.config = config;
  70984. this._deepLinker = _deepLinker;
  70985. }
  70986. /**
  70987. * Present a popover. See below for options
  70988. * @param {object} component The Popover
  70989. * @param {object} data Any data to pass to the Popover view
  70990. * @param {PopoverOptions} opts Popover options
  70991. */
  70992. PopoverController.prototype.create = function (component, data, opts) {
  70993. if (data === void 0) { data = {}; }
  70994. if (opts === void 0) { opts = {}; }
  70995. return new __WEBPACK_IMPORTED_MODULE_3__popover__["a" /* Popover */](this._app, component, data, opts, this.config, this._deepLinker);
  70996. };
  70997. PopoverController.decorators = [
  70998. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */] },
  70999. ];
  71000. /** @nocollapse */
  71001. PopoverController.ctorParameters = function () { return [
  71002. { type: __WEBPACK_IMPORTED_MODULE_1__app_app__["a" /* App */], },
  71003. { type: __WEBPACK_IMPORTED_MODULE_2__config_config__["a" /* Config */], },
  71004. { type: __WEBPACK_IMPORTED_MODULE_4__navigation_deep_linker__["a" /* DeepLinker */], },
  71005. ]; };
  71006. return PopoverController;
  71007. }());
  71008. //# sourceMappingURL=popover-controller.js.map
  71009. /***/ }),
  71010. /* 165 */
  71011. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  71012. "use strict";
  71013. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return RadioButton; });
  71014. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  71015. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__config_config__ = __webpack_require__(1);
  71016. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_form__ = __webpack_require__(16);
  71017. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ion__ = __webpack_require__(4);
  71018. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_util__ = __webpack_require__(2);
  71019. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__item_item__ = __webpack_require__(17);
  71020. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__radio_group__ = __webpack_require__(82);
  71021. var __extends = (this && this.__extends) || (function () {
  71022. var extendStatics = Object.setPrototypeOf ||
  71023. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  71024. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  71025. return function (d, b) {
  71026. extendStatics(d, b);
  71027. function __() { this.constructor = d; }
  71028. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  71029. };
  71030. })();
  71031. /**
  71032. * @description
  71033. * A radio button is a button that can be either checked or unchecked. A user can tap
  71034. * the button to check or uncheck it. It can also be checked from the template using
  71035. * the `checked` property.
  71036. *
  71037. * Use an element with a `radio-group` attribute to group a set of radio buttons. When
  71038. * radio buttons are inside a [radio group](../RadioGroup), exactly one radio button
  71039. * in the group can be checked at any time. If a radio button is not placed in a group,
  71040. * they will all have the ability to be checked at the same time.
  71041. *
  71042. * See the [Angular Forms Docs](https://angular.io/docs/ts/latest/guide/forms.html) for
  71043. * more information on forms and input.
  71044. *
  71045. * @usage
  71046. * ```html
  71047. * <ion-list radio-group [(ngModel)]="relationship">
  71048. * <ion-item>
  71049. * <ion-label>Friends</ion-label>
  71050. * <ion-radio value="friends" checked></ion-radio>
  71051. * </ion-item>
  71052. * <ion-item>
  71053. * <ion-label>Family</ion-label>
  71054. * <ion-radio value="family"></ion-radio>
  71055. * </ion-item>
  71056. * <ion-item>
  71057. * <ion-label>Enemies</ion-label>
  71058. * <ion-radio value="enemies" [disabled]="isDisabled"></ion-radio>
  71059. * </ion-item>
  71060. * </ion-list>
  71061. * ```
  71062. * @demo /docs/demos/src/radio/
  71063. * @see {@link /docs/components#radio Radio Component Docs}
  71064. * @see {@link ../RadioGroup RadioGroup API Docs}
  71065. */
  71066. var RadioButton = (function (_super) {
  71067. __extends(RadioButton, _super);
  71068. function RadioButton(_form, config, elementRef, renderer, _item, _group) {
  71069. var _this = _super.call(this, config, elementRef, renderer, 'radio') || this;
  71070. _this._form = _form;
  71071. _this._item = _item;
  71072. _this._group = _group;
  71073. /**
  71074. * @internal
  71075. */
  71076. _this._checked = false;
  71077. /**
  71078. * @internal
  71079. */
  71080. _this._disabled = false;
  71081. /**
  71082. * @internal
  71083. */
  71084. _this._value = null;
  71085. /**
  71086. * @output {any} Emitted when the radio button is selected.
  71087. */
  71088. _this.ionSelect = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  71089. _form.register(_this);
  71090. if (_group) {
  71091. // register with the radiogroup
  71092. _this.id = 'rb-' + _group.add(_this);
  71093. }
  71094. if (_item) {
  71095. // register the input inside of the item
  71096. // reset to the item's id instead of the radiogroup id
  71097. _this.id = 'rb-' + _item.registerInput('radio');
  71098. _this._labelId = 'lbl-' + _item.id;
  71099. _this._item.setElementClass('item-radio', true);
  71100. }
  71101. return _this;
  71102. }
  71103. Object.defineProperty(RadioButton.prototype, "color", {
  71104. /**
  71105. * @input {string} The color to use from your Sass `$colors` map.
  71106. * Default options are: `"primary"`, `"secondary"`, `"danger"`, `"light"`, and `"dark"`.
  71107. * For more information, see [Theming your App](/docs/theming/theming-your-app).
  71108. */
  71109. set: function (val) {
  71110. this._setColor(val);
  71111. if (this._item) {
  71112. this._item._updateColor(val, 'item-radio');
  71113. }
  71114. },
  71115. enumerable: true,
  71116. configurable: true
  71117. });
  71118. Object.defineProperty(RadioButton.prototype, "value", {
  71119. /**
  71120. * @input {any} The value of the radio button. Defaults to the generated id.
  71121. */
  71122. get: function () {
  71123. // if the value is not defined then use it's unique id
  71124. return Object(__WEBPACK_IMPORTED_MODULE_4__util_util__["f" /* isBlank */])(this._value) ? this.id : this._value;
  71125. },
  71126. set: function (val) {
  71127. this._value = val;
  71128. },
  71129. enumerable: true,
  71130. configurable: true
  71131. });
  71132. Object.defineProperty(RadioButton.prototype, "checked", {
  71133. /**
  71134. * @input {boolean} If true, the element is selected, and other buttons in the group are unselected.
  71135. */
  71136. get: function () {
  71137. return this._checked;
  71138. },
  71139. set: function (val) {
  71140. this._checked = Object(__WEBPACK_IMPORTED_MODULE_4__util_util__["o" /* isTrueProperty */])(val);
  71141. if (this._item) {
  71142. this._item.setElementClass('item-radio-checked', this._checked);
  71143. }
  71144. },
  71145. enumerable: true,
  71146. configurable: true
  71147. });
  71148. Object.defineProperty(RadioButton.prototype, "disabled", {
  71149. /**
  71150. * @input {boolean} If true, the user cannot interact with this element.
  71151. */
  71152. get: function () {
  71153. return this._disabled || (this._group != null && this._group.disabled);
  71154. },
  71155. set: function (val) {
  71156. this._disabled = Object(__WEBPACK_IMPORTED_MODULE_4__util_util__["o" /* isTrueProperty */])(val);
  71157. this._item && this._item.setElementClass('item-radio-disabled', this._disabled);
  71158. },
  71159. enumerable: true,
  71160. configurable: true
  71161. });
  71162. /**
  71163. * @hidden
  71164. */
  71165. RadioButton.prototype.initFocus = function () {
  71166. this._elementRef.nativeElement.querySelector('button').focus();
  71167. };
  71168. /**
  71169. * @internal
  71170. */
  71171. RadioButton.prototype._click = function (ev) {
  71172. (void 0) /* console.debug */;
  71173. ev.preventDefault();
  71174. ev.stopPropagation();
  71175. this.checked = true;
  71176. this.ionSelect.emit(this.value);
  71177. };
  71178. /**
  71179. * @internal
  71180. */
  71181. RadioButton.prototype.ngOnInit = function () {
  71182. if (this._group && Object(__WEBPACK_IMPORTED_MODULE_4__util_util__["l" /* isPresent */])(this._group.value)) {
  71183. this.checked = Object(__WEBPACK_IMPORTED_MODULE_4__util_util__["g" /* isCheckedProperty */])(this._group.value, this.value);
  71184. }
  71185. if (this._group && this._group.disabled) {
  71186. this.disabled = this._group.disabled;
  71187. }
  71188. };
  71189. /**
  71190. * @internal
  71191. */
  71192. RadioButton.prototype.ngOnDestroy = function () {
  71193. this._form.deregister(this);
  71194. this._group && this._group.remove(this);
  71195. };
  71196. RadioButton.decorators = [
  71197. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  71198. selector: 'ion-radio',
  71199. template: '<div class="radio-icon" [class.radio-checked]="_checked"> ' +
  71200. '<div class="radio-inner"></div> ' +
  71201. '</div> ' +
  71202. '<button role="radio" ' +
  71203. 'type="button" ' +
  71204. 'ion-button="item-cover" ' +
  71205. '[id]="id" ' +
  71206. '[attr.aria-checked]="_checked" ' +
  71207. '[attr.aria-labelledby]="_labelId" ' +
  71208. '[attr.aria-disabled]="_disabled" ' +
  71209. 'class="item-cover"> ' +
  71210. '</button>',
  71211. host: {
  71212. '[class.radio-disabled]': '_disabled'
  71213. },
  71214. encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_11" /* ViewEncapsulation */].None,
  71215. },] },
  71216. ];
  71217. /** @nocollapse */
  71218. RadioButton.ctorParameters = function () { return [
  71219. { type: __WEBPACK_IMPORTED_MODULE_2__util_form__["a" /* Form */], },
  71220. { type: __WEBPACK_IMPORTED_MODULE_1__config_config__["a" /* Config */], },
  71221. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  71222. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  71223. { type: __WEBPACK_IMPORTED_MODULE_5__item_item__["a" /* Item */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  71224. { type: __WEBPACK_IMPORTED_MODULE_6__radio_group__["a" /* RadioGroup */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  71225. ]; };
  71226. RadioButton.propDecorators = {
  71227. 'color': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  71228. 'ionSelect': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  71229. 'value': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  71230. 'checked': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  71231. 'disabled': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  71232. '_click': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["y" /* HostListener */], args: ['click', ['$event'],] },],
  71233. };
  71234. return RadioButton;
  71235. }(__WEBPACK_IMPORTED_MODULE_3__ion__["a" /* Ion */]));
  71236. //# sourceMappingURL=radio-button.js.map
  71237. /***/ }),
  71238. /* 166 */
  71239. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  71240. "use strict";
  71241. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Range; });
  71242. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  71243. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_forms__ = __webpack_require__(15);
  71244. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_util__ = __webpack_require__(2);
  71245. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__config_config__ = __webpack_require__(1);
  71246. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__platform_dom_controller__ = __webpack_require__(8);
  71247. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_form__ = __webpack_require__(16);
  71248. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__tap_click_haptic__ = __webpack_require__(38);
  71249. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__util_base_input__ = __webpack_require__(24);
  71250. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__item_item__ = __webpack_require__(17);
  71251. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__platform_platform__ = __webpack_require__(3);
  71252. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__util_dom__ = __webpack_require__(10);
  71253. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__gestures_ui_event_manager__ = __webpack_require__(23);
  71254. var __extends = (this && this.__extends) || (function () {
  71255. var extendStatics = Object.setPrototypeOf ||
  71256. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  71257. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  71258. return function (d, b) {
  71259. extendStatics(d, b);
  71260. function __() { this.constructor = d; }
  71261. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  71262. };
  71263. })();
  71264. /**
  71265. * @name Range
  71266. * @description
  71267. * The Range slider lets users select from a range of values by moving
  71268. * the slider knob. It can accept dual knobs, but by default one knob
  71269. * controls the value of the range.
  71270. *
  71271. * ### Range Labels
  71272. * Labels can be placed on either side of the range by adding the
  71273. * `range-left` or `range-right` property to the element. The element
  71274. * doesn't have to be an `ion-label`, it can be added to any element
  71275. * to place it to the left or right of the range. See [usage](#usage)
  71276. * below for examples.
  71277. *
  71278. *
  71279. * ### Minimum and Maximum Values
  71280. * Minimum and maximum values can be passed to the range through the `min`
  71281. * and `max` properties, respectively. By default, the range sets the `min`
  71282. * to `0` and the `max` to `100`.
  71283. *
  71284. *
  71285. * ### Steps and Snaps
  71286. * The `step` property specifies the value granularity of the range's value.
  71287. * It can be useful to set the `step` when the value isn't in increments of `1`.
  71288. * Setting the `step` property will show tick marks on the range for each step.
  71289. * The `snaps` property can be set to automatically move the knob to the nearest
  71290. * tick mark based on the step property value.
  71291. *
  71292. *
  71293. * ### Dual Knobs
  71294. * Setting the `dualKnobs` property to `true` on the range component will
  71295. * enable two knobs on the range. If the range has two knobs, the value will
  71296. * be an object containing two properties: `lower` and `upper`.
  71297. *
  71298. *
  71299. * @usage
  71300. * ```html
  71301. * <ion-list>
  71302. * <ion-item>
  71303. * <ion-range [(ngModel)]="singleValue" color="danger" pin="true"></ion-range>
  71304. * </ion-item>
  71305. *
  71306. * <ion-item>
  71307. * <ion-range min="-200" max="200" [(ngModel)]="saturation" color="secondary">
  71308. * <ion-label range-left>-200</ion-label>
  71309. * <ion-label range-right>200</ion-label>
  71310. * </ion-range>
  71311. * </ion-item>
  71312. *
  71313. * <ion-item>
  71314. * <ion-range min="20" max="80" step="2" [(ngModel)]="brightness">
  71315. * <ion-icon small range-left name="sunny"></ion-icon>
  71316. * <ion-icon range-right name="sunny"></ion-icon>
  71317. * </ion-range>
  71318. * </ion-item>
  71319. *
  71320. * <ion-item>
  71321. * <ion-label>step=100, snaps, {{singleValue4}}</ion-label>
  71322. * <ion-range min="1000" max="2000" step="100" snaps="true" color="secondary" [(ngModel)]="singleValue4"></ion-range>
  71323. * </ion-item>
  71324. *
  71325. * <ion-item>
  71326. * <ion-label>dual, step=3, snaps, {{dualValue2 | json}}</ion-label>
  71327. * <ion-range dualKnobs="true" [(ngModel)]="dualValue2" min="21" max="72" step="3" snaps="true"></ion-range>
  71328. * </ion-item>
  71329. * </ion-list>
  71330. * ```
  71331. *
  71332. *
  71333. * @demo /docs/demos/src/range/
  71334. */
  71335. var Range = (function (_super) {
  71336. __extends(Range, _super);
  71337. function Range(form, _haptic, item, config, _plt, elementRef, renderer, _dom, _cd) {
  71338. var _this = _super.call(this, config, elementRef, renderer, 'range', 0, form, item, null) || this;
  71339. _this._haptic = _haptic;
  71340. _this._plt = _plt;
  71341. _this._dom = _dom;
  71342. _this._cd = _cd;
  71343. _this._min = 0;
  71344. _this._max = 100;
  71345. _this._step = 1;
  71346. _this._valA = 0;
  71347. _this._valB = 0;
  71348. _this._ratioA = 0;
  71349. _this._ratioB = 0;
  71350. _this._events = new __WEBPACK_IMPORTED_MODULE_11__gestures_ui_event_manager__["a" /* UIEventManager */](_plt);
  71351. return _this;
  71352. }
  71353. Object.defineProperty(Range.prototype, "min", {
  71354. /**
  71355. * @input {number} Minimum integer value of the range. Defaults to `0`.
  71356. */
  71357. get: function () {
  71358. return this._min;
  71359. },
  71360. set: function (val) {
  71361. val = Math.round(val);
  71362. if (!isNaN(val)) {
  71363. this._min = val;
  71364. this._inputUpdated();
  71365. }
  71366. },
  71367. enumerable: true,
  71368. configurable: true
  71369. });
  71370. Object.defineProperty(Range.prototype, "max", {
  71371. /**
  71372. * @input {number} Maximum integer value of the range. Defaults to `100`.
  71373. */
  71374. get: function () {
  71375. return this._max;
  71376. },
  71377. set: function (val) {
  71378. val = Math.round(val);
  71379. if (!isNaN(val)) {
  71380. this._max = val;
  71381. this._inputUpdated();
  71382. }
  71383. },
  71384. enumerable: true,
  71385. configurable: true
  71386. });
  71387. Object.defineProperty(Range.prototype, "step", {
  71388. /**
  71389. * @input {number} Specifies the value granularity. Defaults to `1`.
  71390. */
  71391. get: function () {
  71392. return this._step;
  71393. },
  71394. set: function (val) {
  71395. val = Math.round(val);
  71396. if (!isNaN(val) && val > 0) {
  71397. this._step = val;
  71398. }
  71399. },
  71400. enumerable: true,
  71401. configurable: true
  71402. });
  71403. Object.defineProperty(Range.prototype, "snaps", {
  71404. /**
  71405. * @input {boolean} If true, the knob snaps to tick marks evenly spaced based
  71406. * on the step property value. Defaults to `false`.
  71407. */
  71408. get: function () {
  71409. return this._snaps;
  71410. },
  71411. set: function (val) {
  71412. this._snaps = Object(__WEBPACK_IMPORTED_MODULE_2__util_util__["o" /* isTrueProperty */])(val);
  71413. },
  71414. enumerable: true,
  71415. configurable: true
  71416. });
  71417. Object.defineProperty(Range.prototype, "pin", {
  71418. /**
  71419. * @input {boolean} If true, a pin with integer value is shown when the knob
  71420. * is pressed. Defaults to `false`.
  71421. */
  71422. get: function () {
  71423. return this._pin;
  71424. },
  71425. set: function (val) {
  71426. this._pin = Object(__WEBPACK_IMPORTED_MODULE_2__util_util__["o" /* isTrueProperty */])(val);
  71427. },
  71428. enumerable: true,
  71429. configurable: true
  71430. });
  71431. Object.defineProperty(Range.prototype, "debounce", {
  71432. /**
  71433. * @input {number} How long, in milliseconds, to wait to trigger the
  71434. * `ionChange` event after each change in the range value. Default `0`.
  71435. */
  71436. get: function () {
  71437. return this._debouncer.wait;
  71438. },
  71439. set: function (val) {
  71440. this._debouncer.wait = val;
  71441. },
  71442. enumerable: true,
  71443. configurable: true
  71444. });
  71445. Object.defineProperty(Range.prototype, "dualKnobs", {
  71446. /**
  71447. * @input {boolean} Show two knobs. Defaults to `false`.
  71448. */
  71449. get: function () {
  71450. return this._dual;
  71451. },
  71452. set: function (val) {
  71453. this._dual = Object(__WEBPACK_IMPORTED_MODULE_2__util_util__["o" /* isTrueProperty */])(val);
  71454. },
  71455. enumerable: true,
  71456. configurable: true
  71457. });
  71458. Object.defineProperty(Range.prototype, "ratio", {
  71459. /**
  71460. * Returns the ratio of the knob's is current location, which is a number
  71461. * between `0` and `1`. If two knobs are used, this property represents
  71462. * the lower value.
  71463. */
  71464. get: function () {
  71465. if (this._dual) {
  71466. return Math.min(this._ratioA, this._ratioB);
  71467. }
  71468. return this._ratioA;
  71469. },
  71470. enumerable: true,
  71471. configurable: true
  71472. });
  71473. Object.defineProperty(Range.prototype, "ratioUpper", {
  71474. /**
  71475. * Returns the ratio of the upper value's is current location, which is
  71476. * a number between `0` and `1`. If there is only one knob, then this
  71477. * will return `null`.
  71478. */
  71479. get: function () {
  71480. if (this._dual) {
  71481. return Math.max(this._ratioA, this._ratioB);
  71482. }
  71483. return null;
  71484. },
  71485. enumerable: true,
  71486. configurable: true
  71487. });
  71488. /**
  71489. * @hidden
  71490. */
  71491. Range.prototype.ngAfterContentInit = function () {
  71492. this._initialize();
  71493. // add touchstart/mousedown listeners
  71494. this._events.pointerEvents({
  71495. element: this._slider.nativeElement,
  71496. pointerDown: this._pointerDown.bind(this),
  71497. pointerMove: this._pointerMove.bind(this),
  71498. pointerUp: this._pointerUp.bind(this),
  71499. zone: true
  71500. });
  71501. // build all the ticks if there are any to show
  71502. this._createTicks();
  71503. };
  71504. /** @internal */
  71505. Range.prototype._pointerDown = function (ev) {
  71506. // TODO: we could stop listening for events instead of checking this._disabled.
  71507. // since there are a lot of events involved, this solution is
  71508. // enough for the moment
  71509. if (this._disabled) {
  71510. return false;
  71511. }
  71512. // trigger ionFocus event
  71513. this._fireFocus();
  71514. // prevent default so scrolling does not happen
  71515. ev.preventDefault();
  71516. ev.stopPropagation();
  71517. // get the start coordinates
  71518. var current = Object(__WEBPACK_IMPORTED_MODULE_10__util_dom__["f" /* pointerCoord */])(ev);
  71519. // get the full dimensions of the slider element
  71520. var rect = this._rect = this._plt.getElementBoundingClientRect(this._slider.nativeElement);
  71521. // figure out which knob they started closer to
  71522. var ratio = Object(__WEBPACK_IMPORTED_MODULE_2__util_util__["a" /* clamp */])(0, (current.x - rect.left) / (rect.width), 1);
  71523. this._activeB = this._dual && (Math.abs(ratio - this._ratioA) > Math.abs(ratio - this._ratioB));
  71524. // update the active knob's position
  71525. this._update(current, rect, true);
  71526. // trigger a haptic start
  71527. this._haptic.gestureSelectionStart();
  71528. // return true so the pointer events
  71529. // know everything's still valid
  71530. return true;
  71531. };
  71532. /** @internal */
  71533. Range.prototype._pointerMove = function (ev) {
  71534. if (this._disabled) {
  71535. return;
  71536. }
  71537. // prevent default so scrolling does not happen
  71538. ev.preventDefault();
  71539. ev.stopPropagation();
  71540. // update the active knob's position
  71541. var hasChanged = this._update(Object(__WEBPACK_IMPORTED_MODULE_10__util_dom__["f" /* pointerCoord */])(ev), this._rect, true);
  71542. if (hasChanged && this._snaps) {
  71543. // trigger a haptic selection changed event
  71544. // if this is a snap range
  71545. this._haptic.gestureSelectionChanged();
  71546. }
  71547. };
  71548. /** @internal */
  71549. Range.prototype._pointerUp = function (ev) {
  71550. if (this._disabled) {
  71551. return;
  71552. }
  71553. // prevent default so scrolling does not happen
  71554. ev.preventDefault();
  71555. ev.stopPropagation();
  71556. // update the active knob's position
  71557. this._update(Object(__WEBPACK_IMPORTED_MODULE_10__util_dom__["f" /* pointerCoord */])(ev), this._rect, false);
  71558. // trigger a haptic end
  71559. this._haptic.gestureSelectionEnd();
  71560. // trigger ionBlur event
  71561. this._fireBlur();
  71562. };
  71563. /** @internal */
  71564. Range.prototype._update = function (current, rect, isPressed) {
  71565. // figure out where the pointer is currently at
  71566. // update the knob being interacted with
  71567. var ratio = Object(__WEBPACK_IMPORTED_MODULE_2__util_util__["a" /* clamp */])(0, (current.x - rect.left) / (rect.width), 1);
  71568. var val = this._ratioToValue(ratio);
  71569. if (this._snaps) {
  71570. // snaps the ratio to the current value
  71571. ratio = this._valueToRatio(val);
  71572. }
  71573. // update which knob is pressed
  71574. this._pressed = isPressed;
  71575. var valChanged = false;
  71576. if (this._activeB) {
  71577. // when the pointer down started it was determined
  71578. // that knob B was the one they were interacting with
  71579. this._pressedB = isPressed;
  71580. this._pressedA = false;
  71581. this._ratioB = ratio;
  71582. valChanged = val === this._valB;
  71583. this._valB = val;
  71584. }
  71585. else {
  71586. // interacting with knob A
  71587. this._pressedA = isPressed;
  71588. this._pressedB = false;
  71589. this._ratioA = ratio;
  71590. valChanged = val === this._valA;
  71591. this._valA = val;
  71592. }
  71593. this._updateBar();
  71594. if (valChanged) {
  71595. return false;
  71596. }
  71597. // value has been updated
  71598. var value;
  71599. if (this._dual) {
  71600. // dual knobs have an lower and upper value
  71601. value = {
  71602. lower: Math.min(this._valA, this._valB),
  71603. upper: Math.max(this._valA, this._valB)
  71604. };
  71605. (void 0) /* console.debug */;
  71606. }
  71607. else {
  71608. // single knob only has one value
  71609. value = this._valA;
  71610. (void 0) /* console.debug */;
  71611. }
  71612. // Update input value
  71613. this.value = value;
  71614. return true;
  71615. };
  71616. /** @internal */
  71617. Range.prototype._updateBar = function () {
  71618. var ratioA = this._ratioA;
  71619. var ratioB = this._ratioB;
  71620. if (this._dual) {
  71621. this._barL = (Math.min(ratioA, ratioB) * 100) + "%";
  71622. this._barR = 100 - (Math.max(ratioA, ratioB) * 100) + "%";
  71623. }
  71624. else {
  71625. this._barL = '';
  71626. this._barR = 100 - (ratioA * 100) + "%";
  71627. }
  71628. this._updateTicks();
  71629. };
  71630. /** @internal */
  71631. Range.prototype._createTicks = function () {
  71632. var _this = this;
  71633. if (this._snaps) {
  71634. this._dom.write(function () {
  71635. // TODO: Fix to not use RAF
  71636. _this._ticks = [];
  71637. for (var value = _this._min; value <= _this._max; value += _this._step) {
  71638. var ratio = _this._valueToRatio(value);
  71639. _this._ticks.push({
  71640. ratio: ratio,
  71641. left: ratio * 100 + "%",
  71642. });
  71643. }
  71644. _this._updateTicks();
  71645. });
  71646. }
  71647. };
  71648. /** @internal */
  71649. Range.prototype._updateTicks = function () {
  71650. var ticks = this._ticks;
  71651. var ratio = this.ratio;
  71652. if (this._snaps && ticks) {
  71653. if (this._dual) {
  71654. var upperRatio = this.ratioUpper;
  71655. ticks.forEach(function (t) {
  71656. t.active = (t.ratio >= ratio && t.ratio <= upperRatio);
  71657. });
  71658. }
  71659. else {
  71660. ticks.forEach(function (t) {
  71661. t.active = (t.ratio <= ratio);
  71662. });
  71663. }
  71664. }
  71665. };
  71666. /** @hidden */
  71667. Range.prototype._keyChg = function (isIncrease, isKnobB) {
  71668. var step = this._step;
  71669. if (isKnobB) {
  71670. if (isIncrease) {
  71671. this._valB += step;
  71672. }
  71673. else {
  71674. this._valB -= step;
  71675. }
  71676. this._valB = Object(__WEBPACK_IMPORTED_MODULE_2__util_util__["a" /* clamp */])(this._min, this._valB, this._max);
  71677. this._ratioB = this._valueToRatio(this._valB);
  71678. }
  71679. else {
  71680. if (isIncrease) {
  71681. this._valA += step;
  71682. }
  71683. else {
  71684. this._valA -= step;
  71685. }
  71686. this._valA = Object(__WEBPACK_IMPORTED_MODULE_2__util_util__["a" /* clamp */])(this._min, this._valA, this._max);
  71687. this._ratioA = this._valueToRatio(this._valA);
  71688. }
  71689. this._updateBar();
  71690. };
  71691. /** @internal */
  71692. Range.prototype._ratioToValue = function (ratio) {
  71693. ratio = Math.round(((this._max - this._min) * ratio));
  71694. ratio = Math.round(ratio / this._step) * this._step + this._min;
  71695. return Object(__WEBPACK_IMPORTED_MODULE_2__util_util__["a" /* clamp */])(this._min, ratio, this._max);
  71696. };
  71697. /** @internal */
  71698. Range.prototype._valueToRatio = function (value) {
  71699. value = Math.round((value - this._min) / this._step) * this._step;
  71700. value = value / (this._max - this._min);
  71701. return Object(__WEBPACK_IMPORTED_MODULE_2__util_util__["a" /* clamp */])(0, value, 1);
  71702. };
  71703. Range.prototype._inputNormalize = function (val) {
  71704. if (this._dual) {
  71705. return val;
  71706. }
  71707. else {
  71708. val = parseFloat(val);
  71709. return isNaN(val) ? undefined : val;
  71710. }
  71711. };
  71712. /**
  71713. * @hidden
  71714. */
  71715. Range.prototype._inputUpdated = function () {
  71716. var val = this.value;
  71717. if (this._dual) {
  71718. this._valA = val.lower;
  71719. this._valB = val.upper;
  71720. this._ratioA = this._valueToRatio(val.lower);
  71721. this._ratioB = this._valueToRatio(val.upper);
  71722. }
  71723. else {
  71724. this._valA = val;
  71725. this._ratioA = this._valueToRatio(val);
  71726. }
  71727. this._updateBar();
  71728. this._cd.detectChanges();
  71729. };
  71730. /**
  71731. * @hidden
  71732. */
  71733. Range.prototype.ngOnDestroy = function () {
  71734. _super.prototype.ngOnDestroy.call(this);
  71735. this._events.destroy();
  71736. };
  71737. Range.decorators = [
  71738. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  71739. selector: 'ion-range',
  71740. template: '<ng-content select="[range-left]"></ng-content>' +
  71741. '<div class="range-slider" #slider>' +
  71742. '<div class="range-tick" *ngFor="let t of _ticks" [style.left]="t.left" [class.range-tick-active]="t.active" role="presentation"></div>' +
  71743. '<div class="range-bar" role="presentation"></div>' +
  71744. '<div class="range-bar range-bar-active" [style.left]="_barL" [style.right]="_barR" #bar role="presentation"></div>' +
  71745. '<div class="range-knob-handle" (ionIncrease)="_keyChg(true, false)" (ionDecrease)="_keyChg(false, false)" [ratio]="_ratioA" [val]="_valA" [pin]="_pin" [pressed]="_pressedA" [min]="_min" [max]="_max" [disabled]="_disabled" [labelId]="_labelId"></div>' +
  71746. '<div class="range-knob-handle" (ionIncrease)="_keyChg(true, true)" (ionDecrease)="_keyChg(false, true)" [ratio]="_ratioB" [val]="_valB" [pin]="_pin" [pressed]="_pressedB" [min]="_min" [max]="_max" [disabled]="_disabled" [labelId]="_labelId" *ngIf="_dual"></div>' +
  71747. '</div>' +
  71748. '<ng-content select="[range-right]"></ng-content>',
  71749. host: {
  71750. '[class.range-disabled]': '_disabled',
  71751. '[class.range-pressed]': '_pressed',
  71752. '[class.range-has-pin]': '_pin'
  71753. },
  71754. providers: [{ provide: __WEBPACK_IMPORTED_MODULE_1__angular_forms__["b" /* NG_VALUE_ACCESSOR */], useExisting: Range, multi: true }],
  71755. encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_11" /* ViewEncapsulation */].None,
  71756. },] },
  71757. ];
  71758. /** @nocollapse */
  71759. Range.ctorParameters = function () { return [
  71760. { type: __WEBPACK_IMPORTED_MODULE_5__util_form__["a" /* Form */], },
  71761. { type: __WEBPACK_IMPORTED_MODULE_6__tap_click_haptic__["a" /* Haptic */], },
  71762. { type: __WEBPACK_IMPORTED_MODULE_8__item_item__["a" /* Item */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  71763. { type: __WEBPACK_IMPORTED_MODULE_3__config_config__["a" /* Config */], },
  71764. { type: __WEBPACK_IMPORTED_MODULE_9__platform_platform__["a" /* Platform */], },
  71765. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  71766. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  71767. { type: __WEBPACK_IMPORTED_MODULE_4__platform_dom_controller__["a" /* DomController */], },
  71768. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["j" /* ChangeDetectorRef */], },
  71769. ]; };
  71770. Range.propDecorators = {
  71771. '_slider': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_8" /* ViewChild */], args: ['slider',] },],
  71772. 'min': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  71773. 'max': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  71774. 'step': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  71775. 'snaps': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  71776. 'pin': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  71777. 'debounce': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  71778. 'dualKnobs': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  71779. };
  71780. return Range;
  71781. }(__WEBPACK_IMPORTED_MODULE_7__util_base_input__["a" /* BaseInput */]));
  71782. //# sourceMappingURL=range.js.map
  71783. /***/ }),
  71784. /* 167 */
  71785. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  71786. "use strict";
  71787. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return RangeKnob; });
  71788. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  71789. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__platform_key__ = __webpack_require__(18);
  71790. /**
  71791. * @hidden
  71792. */
  71793. var RangeKnob = (function () {
  71794. function RangeKnob() {
  71795. this.ionIncrease = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  71796. this.ionDecrease = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  71797. }
  71798. Object.defineProperty(RangeKnob.prototype, "ratio", {
  71799. set: function (r) {
  71800. this._x = r * 100 + "%";
  71801. },
  71802. enumerable: true,
  71803. configurable: true
  71804. });
  71805. RangeKnob.prototype._keyup = function (ev) {
  71806. var keyCode = ev.keyCode;
  71807. if (keyCode === __WEBPACK_IMPORTED_MODULE_1__platform_key__["d" /* KEY_LEFT */] || keyCode === __WEBPACK_IMPORTED_MODULE_1__platform_key__["a" /* KEY_DOWN */]) {
  71808. (void 0) /* console.debug */;
  71809. this.ionDecrease.emit();
  71810. ev.preventDefault();
  71811. ev.stopPropagation();
  71812. }
  71813. else if (keyCode === __WEBPACK_IMPORTED_MODULE_1__platform_key__["e" /* KEY_RIGHT */] || keyCode === __WEBPACK_IMPORTED_MODULE_1__platform_key__["h" /* KEY_UP */]) {
  71814. (void 0) /* console.debug */;
  71815. this.ionIncrease.emit();
  71816. ev.preventDefault();
  71817. ev.stopPropagation();
  71818. }
  71819. };
  71820. RangeKnob.decorators = [
  71821. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  71822. selector: '.range-knob-handle',
  71823. template: '<div class="range-pin" *ngIf="pin" role="presentation">{{val}}</div>' +
  71824. '<div class="range-knob" role="presentation"></div>',
  71825. host: {
  71826. '[class.range-knob-pressed]': 'pressed',
  71827. '[class.range-knob-min]': 'val===min||val===undefined',
  71828. '[class.range-knob-max]': 'val===max',
  71829. '[style.left]': '_x',
  71830. '[attr.aria-valuenow]': 'val',
  71831. '[attr.aria-valuemin]': 'min',
  71832. '[attr.aria-valuemax]': 'max',
  71833. '[attr.aria-disabled]': 'disabled',
  71834. '[attr.aria-labelledby]': 'labelId',
  71835. '[tabindex]': 'disabled?-1:0',
  71836. 'role': 'slider'
  71837. }
  71838. },] },
  71839. ];
  71840. /** @nocollapse */
  71841. RangeKnob.ctorParameters = function () { return []; };
  71842. RangeKnob.propDecorators = {
  71843. 'ratio': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  71844. 'pressed': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  71845. 'pin': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  71846. 'min': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  71847. 'max': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  71848. 'val': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  71849. 'disabled': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  71850. 'labelId': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  71851. 'ionIncrease': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  71852. 'ionDecrease': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  71853. '_keyup': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["y" /* HostListener */], args: ['keydown', ['$event'],] },],
  71854. };
  71855. return RangeKnob;
  71856. }());
  71857. //# sourceMappingURL=range-knob.js.map
  71858. /***/ }),
  71859. /* 168 */
  71860. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  71861. "use strict";
  71862. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return RefresherContent; });
  71863. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  71864. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__config_config__ = __webpack_require__(1);
  71865. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__refresher__ = __webpack_require__(83);
  71866. /**
  71867. * @hidden
  71868. */
  71869. var RefresherContent = (function () {
  71870. function RefresherContent(r, _config) {
  71871. this.r = r;
  71872. this._config = _config;
  71873. }
  71874. /**
  71875. * @hidden
  71876. */
  71877. RefresherContent.prototype.ngOnInit = function () {
  71878. if (!this.pullingIcon) {
  71879. this.pullingIcon = this._config.get('ionPullIcon', 'arrow-down');
  71880. }
  71881. if (!this.refreshingSpinner) {
  71882. this.refreshingSpinner = this._config.get('ionRefreshingSpinner', this._config.get('spinner', 'ios'));
  71883. }
  71884. };
  71885. RefresherContent.decorators = [
  71886. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  71887. selector: 'ion-refresher-content',
  71888. template: '<div class="refresher-pulling">' +
  71889. '<div class="refresher-pulling-icon" *ngIf="pullingIcon">' +
  71890. '<ion-icon [name]="pullingIcon"></ion-icon>' +
  71891. '</div>' +
  71892. '<div class="refresher-pulling-text" [innerHTML]="pullingText" *ngIf="pullingText"></div>' +
  71893. '</div>' +
  71894. '<div class="refresher-refreshing">' +
  71895. '<div class="refresher-refreshing-icon">' +
  71896. '<ion-spinner [name]="refreshingSpinner"></ion-spinner>' +
  71897. '</div>' +
  71898. '<div class="refresher-refreshing-text" [innerHTML]="refreshingText" *ngIf="refreshingText"></div>' +
  71899. '</div>',
  71900. host: {
  71901. '[attr.state]': 'r.state'
  71902. },
  71903. encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_11" /* ViewEncapsulation */].None,
  71904. },] },
  71905. ];
  71906. /** @nocollapse */
  71907. RefresherContent.ctorParameters = function () { return [
  71908. { type: __WEBPACK_IMPORTED_MODULE_2__refresher__["a" /* Refresher */], },
  71909. { type: __WEBPACK_IMPORTED_MODULE_1__config_config__["a" /* Config */], },
  71910. ]; };
  71911. RefresherContent.propDecorators = {
  71912. 'pullingIcon': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  71913. 'pullingText': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  71914. 'refreshingSpinner': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  71915. 'refreshingText': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  71916. };
  71917. return RefresherContent;
  71918. }());
  71919. //# sourceMappingURL=refresher-content.js.map
  71920. /***/ }),
  71921. /* 169 */
  71922. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  71923. "use strict";
  71924. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Scroll; });
  71925. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  71926. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_util__ = __webpack_require__(2);
  71927. /**
  71928. * @name Scroll
  71929. * @description
  71930. * Scroll is a non-flexboxed scroll area that can scroll horizontally or vertically. `ion-Scroll` Can be used in places where you may not need a full page scroller, but a highly customized one, such as image scubber or comment scroller.
  71931. * @usage
  71932. * ```html
  71933. * <ion-scroll scrollX="true">
  71934. * </ion-scroll>
  71935. *
  71936. * <ion-scroll scrollY="true">
  71937. * </ion-scroll>
  71938. *
  71939. * <ion-scroll scrollX="true" scrollY="true">
  71940. * </ion-scroll>
  71941. * ```
  71942. * @demo /docs/demos/src/scroll/
  71943. */
  71944. var Scroll = (function () {
  71945. function Scroll() {
  71946. this._scrollX = false;
  71947. this._scrollY = false;
  71948. this._zoom = false;
  71949. this._maxZoom = 1;
  71950. /**
  71951. * @hidden
  71952. */
  71953. this.maxScale = 3;
  71954. /**
  71955. * @hidden
  71956. */
  71957. this.zoomDuration = 250;
  71958. }
  71959. Object.defineProperty(Scroll.prototype, "scrollX", {
  71960. /**
  71961. * @input {boolean} If true, scrolling along the X axis is enabled.
  71962. */
  71963. get: function () {
  71964. return this._scrollX;
  71965. },
  71966. set: function (val) {
  71967. this._scrollX = Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["o" /* isTrueProperty */])(val);
  71968. },
  71969. enumerable: true,
  71970. configurable: true
  71971. });
  71972. Object.defineProperty(Scroll.prototype, "scrollY", {
  71973. /**
  71974. * @input {boolean} If true, scrolling along the Y axis is enabled; requires the following CSS declaration: ion-scroll { white-space: nowrap; }
  71975. */
  71976. get: function () {
  71977. return this._scrollY;
  71978. },
  71979. set: function (val) {
  71980. this._scrollY = Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["o" /* isTrueProperty */])(val);
  71981. },
  71982. enumerable: true,
  71983. configurable: true
  71984. });
  71985. Object.defineProperty(Scroll.prototype, "zoom", {
  71986. /**
  71987. * @input {boolean} If true, zooming is enabled.
  71988. */
  71989. get: function () {
  71990. return this._zoom;
  71991. },
  71992. set: function (val) {
  71993. this._zoom = Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["o" /* isTrueProperty */])(val);
  71994. },
  71995. enumerable: true,
  71996. configurable: true
  71997. });
  71998. Object.defineProperty(Scroll.prototype, "maxZoom", {
  71999. /**
  72000. * @input {number} Set the max zoom amount.
  72001. */
  72002. get: function () {
  72003. return this._maxZoom;
  72004. },
  72005. set: function (val) {
  72006. this._maxZoom = val;
  72007. },
  72008. enumerable: true,
  72009. configurable: true
  72010. });
  72011. /**
  72012. * @hidden
  72013. * Add a scroll event handler to the scroll element if it exists.
  72014. * @param {Function} handler The scroll handler to add to the scroll element.
  72015. * @returns {?Function} a function to remove the specified handler, otherwise
  72016. * undefined if the scroll element doesn't exist.
  72017. */
  72018. Scroll.prototype.addScrollEventListener = function (handler) {
  72019. (void 0) /* assert */;
  72020. var ele = this._scrollContent.nativeElement;
  72021. ele.addEventListener('scroll', handler);
  72022. return function () {
  72023. ele.removeEventListener('scroll', handler);
  72024. };
  72025. };
  72026. Scroll.decorators = [
  72027. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  72028. selector: 'ion-scroll',
  72029. template: '<div class="scroll-content" #scrollContent>' +
  72030. '<div class="scroll-zoom-wrapper">' +
  72031. '<ng-content></ng-content>' +
  72032. '</div>' +
  72033. '</div>',
  72034. host: {
  72035. '[class.scroll-x]': 'scrollX',
  72036. '[class.scroll-y]': 'scrollY'
  72037. },
  72038. changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["i" /* ChangeDetectionStrategy */].OnPush,
  72039. encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_11" /* ViewEncapsulation */].None,
  72040. },] },
  72041. ];
  72042. /** @nocollapse */
  72043. Scroll.ctorParameters = function () { return []; };
  72044. Scroll.propDecorators = {
  72045. 'scrollX': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  72046. 'scrollY': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  72047. 'zoom': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  72048. 'maxZoom': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  72049. '_scrollContent': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_8" /* ViewChild */], args: ['scrollContent', { read: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */] },] },],
  72050. };
  72051. return Scroll;
  72052. }());
  72053. //# sourceMappingURL=scroll.js.map
  72054. /***/ }),
  72055. /* 170 */
  72056. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  72057. "use strict";
  72058. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Searchbar; });
  72059. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  72060. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_forms__ = __webpack_require__(15);
  72061. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__config_config__ = __webpack_require__(1);
  72062. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_base_input__ = __webpack_require__(24);
  72063. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_util__ = __webpack_require__(2);
  72064. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_debouncer__ = __webpack_require__(128);
  72065. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__platform_platform__ = __webpack_require__(3);
  72066. var __extends = (this && this.__extends) || (function () {
  72067. var extendStatics = Object.setPrototypeOf ||
  72068. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  72069. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  72070. return function (d, b) {
  72071. extendStatics(d, b);
  72072. function __() { this.constructor = d; }
  72073. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  72074. };
  72075. })();
  72076. /**
  72077. * @name Searchbar
  72078. * @module ionic
  72079. * @description
  72080. * Manages the display of a Searchbar which can be used to search or filter items.
  72081. *
  72082. * @usage
  72083. * ```html
  72084. * <ion-searchbar
  72085. * [(ngModel)]="myInput"
  72086. * [showCancelButton]="shouldShowCancel"
  72087. * (ionInput)="onInput($event)"
  72088. * (ionCancel)="onCancel($event)">
  72089. * </ion-searchbar>
  72090. * ```
  72091. *
  72092. * @demo /docs/demos/src/searchbar/
  72093. * @see {@link /docs/components#searchbar Searchbar Component Docs}
  72094. */
  72095. var Searchbar = (function (_super) {
  72096. __extends(Searchbar, _super);
  72097. function Searchbar(config, _plt, elementRef, renderer, ngControl) {
  72098. var _this = _super.call(this, config, elementRef, renderer, 'searchbar', '', null, null, ngControl) || this;
  72099. _this._plt = _plt;
  72100. _this._shouldBlur = true;
  72101. _this._shouldAlignLeft = true;
  72102. _this._isCancelVisible = false;
  72103. _this._spellcheck = false;
  72104. _this._autocomplete = 'off';
  72105. _this._autocorrect = 'off';
  72106. _this._isActive = false;
  72107. _this._showCancelButton = false;
  72108. _this._animated = false;
  72109. _this._inputDebouncer = new __WEBPACK_IMPORTED_MODULE_5__util_debouncer__["a" /* TimeoutDebouncer */](0);
  72110. /**
  72111. * @input {string} Set the the cancel button text. Default: `"Cancel"`.
  72112. */
  72113. _this.cancelButtonText = 'Cancel';
  72114. /**
  72115. * @input {string} Set the input's placeholder. Default `"Search"`.
  72116. */
  72117. _this.placeholder = 'Search';
  72118. /**
  72119. * @input {string} Set the type of the input. Values: `"text"`, `"password"`, `"email"`, `"number"`, `"search"`, `"tel"`, `"url"`. Default `"search"`.
  72120. */
  72121. _this.type = 'search';
  72122. /**
  72123. * @output {event} Emitted when the Searchbar input has changed, including when it's cleared.
  72124. */
  72125. _this.ionInput = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  72126. /**
  72127. * @output {event} Emitted when the cancel button is clicked.
  72128. */
  72129. _this.ionCancel = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  72130. /**
  72131. * @output {event} Emitted when the clear input button is clicked.
  72132. */
  72133. _this.ionClear = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  72134. _this.debounce = 250;
  72135. return _this;
  72136. }
  72137. Object.defineProperty(Searchbar.prototype, "showCancelButton", {
  72138. /**
  72139. * @input {boolean} If true, show the cancel button. Default `false`.
  72140. */
  72141. get: function () {
  72142. return this._showCancelButton;
  72143. },
  72144. set: function (val) {
  72145. this._showCancelButton = Object(__WEBPACK_IMPORTED_MODULE_4__util_util__["o" /* isTrueProperty */])(val);
  72146. },
  72147. enumerable: true,
  72148. configurable: true
  72149. });
  72150. Object.defineProperty(Searchbar.prototype, "debounce", {
  72151. /**
  72152. * @input {number} How long, in milliseconds, to wait to trigger the `ionInput` event after each keystroke. Default `250`.
  72153. */
  72154. get: function () {
  72155. return this._debouncer.wait;
  72156. },
  72157. set: function (val) {
  72158. this._debouncer.wait = val;
  72159. this._inputDebouncer.wait = val;
  72160. },
  72161. enumerable: true,
  72162. configurable: true
  72163. });
  72164. Object.defineProperty(Searchbar.prototype, "autocomplete", {
  72165. /**
  72166. * @input {string} Set the input's autocomplete property. Values: `"on"`, `"off"`. Default `"off"`.
  72167. */
  72168. set: function (val) {
  72169. this._autocomplete = (val === '' || val === 'on') ? 'on' : this._config.get('autocomplete', 'off');
  72170. },
  72171. enumerable: true,
  72172. configurable: true
  72173. });
  72174. Object.defineProperty(Searchbar.prototype, "autocorrect", {
  72175. /**
  72176. * @input {string} Set the input's autocorrect property. Values: `"on"`, `"off"`. Default `"off"`.
  72177. */
  72178. set: function (val) {
  72179. this._autocorrect = (val === '' || val === 'on') ? 'on' : this._config.get('autocorrect', 'off');
  72180. },
  72181. enumerable: true,
  72182. configurable: true
  72183. });
  72184. Object.defineProperty(Searchbar.prototype, "spellcheck", {
  72185. /**
  72186. * @input {string|boolean} Set the input's spellcheck property. Values: `true`, `false`. Default `false`.
  72187. */
  72188. set: function (val) {
  72189. this._spellcheck = (val === '' || val === 'true' || val === true) ? true : this._config.getBoolean('spellcheck', false);
  72190. },
  72191. enumerable: true,
  72192. configurable: true
  72193. });
  72194. Object.defineProperty(Searchbar.prototype, "animated", {
  72195. /**
  72196. * @input {boolean} If true, enable searchbar animation. Default `false`.
  72197. */
  72198. get: function () {
  72199. return this._animated;
  72200. },
  72201. set: function (val) {
  72202. this._animated = Object(__WEBPACK_IMPORTED_MODULE_4__util_util__["o" /* isTrueProperty */])(val);
  72203. },
  72204. enumerable: true,
  72205. configurable: true
  72206. });
  72207. /**
  72208. * @hidden
  72209. * On Initialization check for attributes
  72210. */
  72211. Searchbar.prototype.ngOnInit = function () {
  72212. var showCancelButton = this.showCancelButton;
  72213. if (typeof showCancelButton === 'string') {
  72214. this.showCancelButton = (showCancelButton === '' || showCancelButton === 'true');
  72215. }
  72216. };
  72217. /**
  72218. * @hidden
  72219. */
  72220. Searchbar.prototype._inputUpdated = function () {
  72221. var ele = this._searchbarInput.nativeElement;
  72222. var value = this._value;
  72223. // It is important not to re-assign the value if it is the same, because,
  72224. // otherwise, the caret is moved to the end of the input
  72225. if (ele.value !== value) {
  72226. ele.value = value;
  72227. }
  72228. this.positionElements();
  72229. };
  72230. /**
  72231. * @hidden
  72232. * Positions the input search icon, placeholder, and the cancel button
  72233. * based on the input value and if it is focused. (ios only)
  72234. */
  72235. Searchbar.prototype.positionElements = function () {
  72236. var isAnimated = this._animated;
  72237. var prevAlignLeft = this._shouldAlignLeft;
  72238. var shouldAlignLeft = (!isAnimated || (this._value && this._value.toString().trim() !== '') || this._isFocus === true);
  72239. this._shouldAlignLeft = shouldAlignLeft;
  72240. if (this._mode !== 'ios') {
  72241. return;
  72242. }
  72243. if (prevAlignLeft !== shouldAlignLeft) {
  72244. this.positionPlaceholder();
  72245. }
  72246. if (isAnimated) {
  72247. this.positionCancelButton();
  72248. }
  72249. };
  72250. Searchbar.prototype.positionPlaceholder = function () {
  72251. var inputEle = this._searchbarInput.nativeElement;
  72252. var iconEle = this._searchbarIcon.nativeElement;
  72253. if (this._shouldAlignLeft) {
  72254. inputEle.removeAttribute('style');
  72255. iconEle.removeAttribute('style');
  72256. }
  72257. else {
  72258. // Create a dummy span to get the placeholder width
  72259. var doc = this._plt.doc();
  72260. var tempSpan = doc.createElement('span');
  72261. tempSpan.innerHTML = this.placeholder;
  72262. doc.body.appendChild(tempSpan);
  72263. // Get the width of the span then remove it
  72264. var textWidth = tempSpan.offsetWidth;
  72265. doc.body.removeChild(tempSpan);
  72266. // Set the input padding start
  72267. var inputLeft = 'calc(50% - ' + (textWidth / 2) + 'px)';
  72268. if (this._plt.isRTL) {
  72269. inputEle.style.paddingRight = inputLeft;
  72270. }
  72271. else {
  72272. inputEle.style.paddingLeft = inputLeft;
  72273. }
  72274. // Set the icon margin start
  72275. var iconLeft = 'calc(50% - ' + ((textWidth / 2) + 30) + 'px)';
  72276. if (this._plt.isRTL) {
  72277. iconEle.style.marginRight = iconLeft;
  72278. }
  72279. else {
  72280. iconEle.style.marginLeft = iconLeft;
  72281. }
  72282. }
  72283. };
  72284. /**
  72285. * @hidden
  72286. * Show the iOS Cancel button on focus, hide it offscreen otherwise
  72287. */
  72288. Searchbar.prototype.positionCancelButton = function () {
  72289. var showShowCancel = this._isFocus;
  72290. if (showShowCancel !== this._isCancelVisible) {
  72291. var cancelStyleEle = this._cancelButton.nativeElement;
  72292. var cancelStyle = cancelStyleEle.style;
  72293. this._isCancelVisible = showShowCancel;
  72294. if (showShowCancel) {
  72295. if (this._plt.isRTL) {
  72296. cancelStyle.marginLeft = '0';
  72297. }
  72298. else {
  72299. cancelStyle.marginRight = '0';
  72300. }
  72301. }
  72302. else {
  72303. var offset = cancelStyleEle.offsetWidth;
  72304. if (offset > 0) {
  72305. if (this._plt.isRTL) {
  72306. cancelStyle.marginLeft = -offset + 'px';
  72307. }
  72308. else {
  72309. cancelStyle.marginRight = -offset + 'px';
  72310. }
  72311. }
  72312. }
  72313. }
  72314. };
  72315. /**
  72316. * @hidden
  72317. * Update the Searchbar input value when the input changes
  72318. */
  72319. Searchbar.prototype.inputChanged = function (ev) {
  72320. var _this = this;
  72321. this.value = ev.target.value;
  72322. this._inputDebouncer.debounce(function () {
  72323. _this.ionInput.emit(ev);
  72324. });
  72325. };
  72326. /**
  72327. * @hidden
  72328. * Sets the Searchbar to focused and active on input focus.
  72329. */
  72330. Searchbar.prototype.inputFocused = function () {
  72331. this._isActive = true;
  72332. this._fireFocus();
  72333. this.positionElements();
  72334. };
  72335. /**
  72336. * @hidden
  72337. * Sets the Searchbar to not focused and checks if it should align left
  72338. * based on whether there is a value in the searchbar or not.
  72339. */
  72340. Searchbar.prototype.inputBlurred = function () {
  72341. // _shouldBlur determines if it should blur
  72342. // if we are clearing the input we still want to stay focused in the input
  72343. if (this._shouldBlur === false) {
  72344. this._searchbarInput.nativeElement.focus();
  72345. this._shouldBlur = true;
  72346. return;
  72347. }
  72348. this._fireBlur();
  72349. this.positionElements();
  72350. };
  72351. /**
  72352. * @hidden
  72353. * Clears the input field and triggers the control change.
  72354. */
  72355. Searchbar.prototype.clearInput = function (ev) {
  72356. var _this = this;
  72357. this.ionClear.emit(ev);
  72358. // setTimeout() fixes https://github.com/ionic-team/ionic/issues/7527
  72359. // wait for 4 frames
  72360. setTimeout(function () {
  72361. var value = _this._value;
  72362. if (Object(__WEBPACK_IMPORTED_MODULE_4__util_util__["l" /* isPresent */])(value) && value !== '') {
  72363. _this.value = ''; // DOM WRITE
  72364. _this.ionInput.emit(ev);
  72365. }
  72366. }, 16 * 4);
  72367. this._shouldBlur = false;
  72368. };
  72369. /**
  72370. * @hidden
  72371. * Clears the input field and tells the input to blur since
  72372. * the clearInput function doesn't want the input to blur
  72373. * then calls the custom cancel function if the user passed one in.
  72374. */
  72375. Searchbar.prototype.cancelSearchbar = function (ev) {
  72376. this.ionCancel.emit(ev);
  72377. this.clearInput(ev);
  72378. this._shouldBlur = true;
  72379. this._isActive = false;
  72380. };
  72381. Searchbar.prototype.setFocus = function () {
  72382. this._renderer.invokeElementMethod(this._searchbarInput.nativeElement, 'focus');
  72383. };
  72384. Searchbar.decorators = [
  72385. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  72386. selector: 'ion-searchbar',
  72387. template: '<div class="searchbar-input-container">' +
  72388. '<button ion-button mode="md" (click)="cancelSearchbar($event)" (mousedown)="cancelSearchbar($event)" clear color="dark" class="searchbar-md-cancel" type="button">' +
  72389. '<ion-icon name="md-arrow-back"></ion-icon>' +
  72390. '</button>' +
  72391. '<div #searchbarIcon class="searchbar-search-icon"></div>' +
  72392. '<input #searchbarInput class="searchbar-input" (input)="inputChanged($event)" (blur)="inputBlurred()" (focus)="inputFocused()" ' +
  72393. 'dir="auto" ' +
  72394. '[attr.placeholder]="placeholder" ' +
  72395. '[attr.type]="type" ' +
  72396. '[attr.autocomplete]="_autocomplete" ' +
  72397. '[attr.autocorrect]="_autocorrect" ' +
  72398. '[attr.spellcheck]="_spellcheck">' +
  72399. '<button ion-button clear class="searchbar-clear-icon" [mode]="_mode" (click)="clearInput($event)" (mousedown)="clearInput($event)" type="button"></button>' +
  72400. '</div>' +
  72401. '<button ion-button #cancelButton mode="ios" [tabindex]="_isActive ? 1 : -1" clear (click)="cancelSearchbar($event)" (mousedown)="cancelSearchbar($event)" class="searchbar-ios-cancel" type="button">{{cancelButtonText}}</button>',
  72402. host: {
  72403. '[class.searchbar-animated]': '_animated',
  72404. '[class.searchbar-has-value]': '_value',
  72405. '[class.searchbar-active]': '_isActive',
  72406. '[class.searchbar-show-cancel]': '_showCancelButton',
  72407. '[class.searchbar-left-aligned]': '_shouldAlignLeft',
  72408. '[class.searchbar-has-focus]': '_isFocus'
  72409. },
  72410. encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_11" /* ViewEncapsulation */].None
  72411. },] },
  72412. ];
  72413. /** @nocollapse */
  72414. Searchbar.ctorParameters = function () { return [
  72415. { type: __WEBPACK_IMPORTED_MODULE_2__config_config__["a" /* Config */], },
  72416. { type: __WEBPACK_IMPORTED_MODULE_6__platform_platform__["a" /* Platform */], },
  72417. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  72418. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  72419. { type: __WEBPACK_IMPORTED_MODULE_1__angular_forms__["c" /* NgControl */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  72420. ]; };
  72421. Searchbar.propDecorators = {
  72422. 'cancelButtonText': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  72423. 'showCancelButton': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  72424. 'debounce': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  72425. 'placeholder': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  72426. 'autocomplete': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  72427. 'autocorrect': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  72428. 'spellcheck': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  72429. 'type': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  72430. 'animated': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  72431. 'ionInput': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  72432. 'ionCancel': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  72433. 'ionClear': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  72434. '_searchbarInput': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_8" /* ViewChild */], args: ['searchbarInput',] },],
  72435. '_searchbarIcon': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_8" /* ViewChild */], args: ['searchbarIcon',] },],
  72436. '_cancelButton': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_8" /* ViewChild */], args: ['cancelButton', { read: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */] },] },],
  72437. };
  72438. return Searchbar;
  72439. }(__WEBPACK_IMPORTED_MODULE_3__util_base_input__["a" /* BaseInput */]));
  72440. //# sourceMappingURL=searchbar.js.map
  72441. /***/ }),
  72442. /* 171 */
  72443. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  72444. "use strict";
  72445. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Segment; });
  72446. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  72447. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_forms__ = __webpack_require__(15);
  72448. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__config_config__ = __webpack_require__(1);
  72449. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_base_input__ = __webpack_require__(24);
  72450. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__segment_button__ = __webpack_require__(84);
  72451. var __extends = (this && this.__extends) || (function () {
  72452. var extendStatics = Object.setPrototypeOf ||
  72453. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  72454. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  72455. return function (d, b) {
  72456. extendStatics(d, b);
  72457. function __() { this.constructor = d; }
  72458. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  72459. };
  72460. })();
  72461. /**
  72462. * @name Segment
  72463. * @description
  72464. * A Segment is a group of buttons, sometimes known as Segmented Controls, that allow the user to interact with a compact group of a number of controls.
  72465. * Segments provide functionality similar to tabs, selecting one will unselect all others. You should use a tab bar instead of a segmented control when you want to let the user move back and forth between distinct pages in your app.
  72466. * You could use Angular's `ngModel` or `FormBuilder` API. For an overview on how `FormBuilder` works, checkout [Angular Forms](http://learnangular2.com/forms/), or [Angular FormBuilder](https://angular.io/docs/ts/latest/api/forms/index/FormBuilder-class.html)
  72467. *
  72468. *
  72469. * ```html
  72470. * <!-- Segment in a header -->
  72471. * <ion-header>
  72472. * <ion-toolbar>
  72473. * <ion-segment [(ngModel)]="icons" color="secondary">
  72474. * <ion-segment-button value="camera">
  72475. * <ion-icon name="camera"></ion-icon>
  72476. * </ion-segment-button>
  72477. * <ion-segment-button value="bookmark">
  72478. * <ion-icon name="bookmark"></ion-icon>
  72479. * </ion-segment-button>
  72480. * </ion-segment>
  72481. * </ion-toolbar>
  72482. * </ion-header>
  72483. *
  72484. * <ion-content>
  72485. * <!-- Segment in content -->
  72486. * <ion-segment [(ngModel)]="relationship" color="primary" (ionChange)="segmentChanged($event)">
  72487. * <ion-segment-button value="friends">
  72488. * Friends
  72489. * </ion-segment-button>
  72490. * <ion-segment-button value="enemies">
  72491. * Enemies
  72492. * </ion-segment-button>
  72493. * </ion-segment>
  72494. *
  72495. * <!-- Segment in a form -->
  72496. * <form [formGroup]="myForm">
  72497. * <ion-segment formControlName="mapStyle" color="danger">
  72498. * <ion-segment-button value="standard">
  72499. * Standard
  72500. * </ion-segment-button>
  72501. * <ion-segment-button value="hybrid">
  72502. * Hybrid
  72503. * </ion-segment-button>
  72504. * <ion-segment-button value="sat">
  72505. * Satellite
  72506. * </ion-segment-button>
  72507. * </ion-segment>
  72508. * </form>
  72509. * </ion-content>
  72510. * ```
  72511. *
  72512. *
  72513. * @demo /docs/demos/src/segment/
  72514. * @see {@link /docs/components#segment Segment Component Docs}
  72515. * @see [Angular Forms](http://learnangular2.com/forms/)
  72516. */
  72517. var Segment = (function (_super) {
  72518. __extends(Segment, _super);
  72519. function Segment(config, elementRef, renderer, ngControl) {
  72520. return _super.call(this, config, elementRef, renderer, 'segment', null, null, null, ngControl) || this;
  72521. }
  72522. /**
  72523. * @hidden
  72524. */
  72525. Segment.prototype.ngAfterContentInit = function () {
  72526. var _this = this;
  72527. this._initialize();
  72528. this._buttons.forEach(function (button) {
  72529. button.ionSelect.subscribe(function (selectedButton) {
  72530. _this.value = selectedButton.value;
  72531. _this._fireTouched();
  72532. });
  72533. });
  72534. };
  72535. /**
  72536. * @hidden
  72537. * Write a new value to the element.
  72538. */
  72539. Segment.prototype._inputUpdated = function () {
  72540. if (!this._buttons) {
  72541. (void 0) /* assert */;
  72542. return;
  72543. }
  72544. var buttons = this._buttons.toArray();
  72545. var value = this.value;
  72546. for (var _i = 0, buttons_1 = buttons; _i < buttons_1.length; _i++) {
  72547. var button = buttons_1[_i];
  72548. button.isActive = (button.value === value);
  72549. }
  72550. };
  72551. Segment.decorators = [
  72552. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  72553. selector: 'ion-segment',
  72554. host: {
  72555. '[class.segment-disabled]': '_disabled'
  72556. }
  72557. },] },
  72558. ];
  72559. /** @nocollapse */
  72560. Segment.ctorParameters = function () { return [
  72561. { type: __WEBPACK_IMPORTED_MODULE_2__config_config__["a" /* Config */], },
  72562. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  72563. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  72564. { type: __WEBPACK_IMPORTED_MODULE_1__angular_forms__["c" /* NgControl */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  72565. ]; };
  72566. Segment.propDecorators = {
  72567. '_buttons': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["r" /* ContentChildren */], args: [__WEBPACK_IMPORTED_MODULE_4__segment_button__["a" /* SegmentButton */],] },],
  72568. };
  72569. return Segment;
  72570. }(__WEBPACK_IMPORTED_MODULE_3__util_base_input__["a" /* BaseInput */]));
  72571. //# sourceMappingURL=segment.js.map
  72572. /***/ }),
  72573. /* 172 */
  72574. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  72575. "use strict";
  72576. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Select; });
  72577. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  72578. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_forms__ = __webpack_require__(15);
  72579. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__action_sheet_action_sheet__ = __webpack_require__(57);
  72580. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__alert_alert__ = __webpack_require__(59);
  72581. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__popover_popover__ = __webpack_require__(80);
  72582. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__app_app__ = __webpack_require__(6);
  72583. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__config_config__ = __webpack_require__(1);
  72584. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__navigation_deep_linker__ = __webpack_require__(14);
  72585. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__util_form__ = __webpack_require__(16);
  72586. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__util_base_input__ = __webpack_require__(24);
  72587. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__util_util__ = __webpack_require__(2);
  72588. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__item_item__ = __webpack_require__(17);
  72589. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__option_option__ = __webpack_require__(79);
  72590. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__select_popover_component__ = __webpack_require__(85);
  72591. var __extends = (this && this.__extends) || (function () {
  72592. var extendStatics = Object.setPrototypeOf ||
  72593. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  72594. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  72595. return function (d, b) {
  72596. extendStatics(d, b);
  72597. function __() { this.constructor = d; }
  72598. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  72599. };
  72600. })();
  72601. /**
  72602. * @name Select
  72603. * @description
  72604. * The `ion-select` component is similar to an HTML `<select>` element, however,
  72605. * Ionic's select component makes it easier for users to sort through and select
  72606. * the preferred option or options. When users tap the select component, a
  72607. * dialog will appear with all of the options in a large, easy to select list
  72608. * for users.
  72609. *
  72610. * The select component takes child `ion-option` components. If `ion-option` is not
  72611. * given a `value` attribute then it will use its text as the value.
  72612. *
  72613. * If `ngModel` is bound to `ion-select`, the selected value will be based on the
  72614. * bound value of the model. Otherwise, the `selected` attribute can be used on
  72615. * `ion-option` components.
  72616. *
  72617. * ### Interfaces
  72618. *
  72619. * By default, the `ion-select` uses the {@link ../../alert/AlertController AlertController API}
  72620. * to open up the overlay of options in an alert. The interface can be changed to use the
  72621. * {@link ../../action-sheet/ActionSheetController ActionSheetController API} or
  72622. * {@link ../../popover/PopoverController PopoverController API} by passing `action-sheet` or `popover`,
  72623. * respectively, to the `interface` property. Read on to the other sections for the limitations
  72624. * of the different interfaces.
  72625. *
  72626. * ### Single Value: Radio Buttons
  72627. *
  72628. * The standard `ion-select` component allows the user to select only one
  72629. * option. When selecting only one option the alert interface presents users with
  72630. * a radio button styled list of options. The action sheet interface can only be
  72631. * used with a single value select. If the number of options exceed 6, it will
  72632. * use the `alert` interface even if `action-sheet` is passed. The `ion-select`
  72633. * component's value receives the value of the selected option's value.
  72634. *
  72635. * ```html
  72636. * <ion-item>
  72637. * <ion-label>Gender</ion-label>
  72638. * <ion-select [(ngModel)]="gender">
  72639. * <ion-option value="f">Female</ion-option>
  72640. * <ion-option value="m">Male</ion-option>
  72641. * </ion-select>
  72642. * </ion-item>
  72643. * ```
  72644. *
  72645. * ### Multiple Value: Checkboxes
  72646. *
  72647. * By adding the `multiple="true"` attribute to `ion-select`, users are able
  72648. * to select multiple options. When multiple options can be selected, the alert
  72649. * overlay presents users with a checkbox styled list of options. The
  72650. * `ion-select multiple="true"` component's value receives an array of all the
  72651. * selected option values. In the example below, because each option is not given
  72652. * a `value`, then it'll use its text as the value instead.
  72653. *
  72654. * Note: the `action-sheet` and `popover` interfaces will not work with a multi-value select.
  72655. *
  72656. * ```html
  72657. * <ion-item>
  72658. * <ion-label>Toppings</ion-label>
  72659. * <ion-select [(ngModel)]="toppings" multiple="true">
  72660. * <ion-option>Bacon</ion-option>
  72661. * <ion-option>Black Olives</ion-option>
  72662. * <ion-option>Extra Cheese</ion-option>
  72663. * <ion-option>Mushrooms</ion-option>
  72664. * <ion-option>Pepperoni</ion-option>
  72665. * <ion-option>Sausage</ion-option>
  72666. * </ion-select>
  72667. * </ion-item>
  72668. * ```
  72669. *
  72670. * ### Select Buttons
  72671. * By default, the two buttons read `Cancel` and `OK`. Each button's text
  72672. * can be customized using the `cancelText` and `okText` attributes:
  72673. *
  72674. * ```html
  72675. * <ion-select okText="Okay" cancelText="Dismiss">
  72676. * ...
  72677. * </ion-select>
  72678. * ```
  72679. *
  72680. * The `action-sheet` and `popover` interfaces do not have an `OK` button, clicking
  72681. * on any of the options will automatically close the overlay and select
  72682. * that value.
  72683. *
  72684. * ### Select Options
  72685. *
  72686. * Since `ion-select` uses the `Alert`, `Action Sheet` and `Popover` interfaces, options can be
  72687. * passed to these components through the `selectOptions` property. This can be used
  72688. * to pass a custom title, subtitle, css class, and more. See the
  72689. * {@link ../../alert/AlertController/#create AlertController API docs},
  72690. * {@link ../../action-sheet/ActionSheetController/#create ActionSheetController API docs}, and
  72691. * {@link ../../popover/PopoverController/#create PopoverController API docs}
  72692. * for the properties that each interface accepts.
  72693. *
  72694. * For example, to change the `mode` of the overlay, pass it into `selectOptions`.
  72695. *
  72696. * ```html
  72697. * <ion-select [selectOptions]="selectOptions">
  72698. * ...
  72699. * </ion-select>
  72700. * ```
  72701. *
  72702. * ```ts
  72703. * this.selectOptions = {
  72704. * title: 'Pizza Toppings',
  72705. * subTitle: 'Select your toppings',
  72706. * mode: 'md'
  72707. * };
  72708. * ```
  72709. *
  72710. * ### Object Value References
  72711. *
  72712. * When using objects for select values, it is possible for the identities of these objects to
  72713. * change if they are coming from a server or database, while the selected value's identity
  72714. * remains the same. For example, this can occur when an existing record with the desired object value
  72715. * is loaded into the select, but the newly retrieved select options now have different identities. This will
  72716. * result in the select appearing to have no value at all, even though the original selection in still intact.
  72717. *
  72718. * Using the `compareWith` `Input` is the solution to this problem
  72719. *
  72720. * ```html
  72721. * <ion-item>
  72722. * <ion-label>Employee</ion-label>
  72723. * <ion-select [(ngModel)]="employee" [compareWith]="compareFn">
  72724. * <ion-option *ngFor="let employee of employees" [value]="employee">{{employee.name}}</ion-option>
  72725. * </ion-select>
  72726. * </ion-item>
  72727. * ```
  72728. *
  72729. * ```ts
  72730. * compareFn(e1: Employee, e2: Employee): boolean {
  72731. * return e1 && e2 ? e1.id === e2.id : e1 === e2;
  72732. * }
  72733. * ```
  72734. *
  72735. * @demo /docs/demos/src/select/
  72736. */
  72737. var Select = (function (_super) {
  72738. __extends(Select, _super);
  72739. function Select(_app, form, config, elementRef, renderer, item, deepLinker) {
  72740. var _this = _super.call(this, config, elementRef, renderer, 'select', [], form, item, null) || this;
  72741. _this._app = _app;
  72742. _this.config = config;
  72743. _this.deepLinker = deepLinker;
  72744. _this._multi = false;
  72745. _this._texts = [];
  72746. _this._text = '';
  72747. _this._compareWith = __WEBPACK_IMPORTED_MODULE_10__util_util__["g" /* isCheckedProperty */];
  72748. /**
  72749. * @input {string} The text to display on the cancel button. Default: `Cancel`.
  72750. */
  72751. _this.cancelText = 'Cancel';
  72752. /**
  72753. * @input {string} The text to display on the ok button. Default: `OK`.
  72754. */
  72755. _this.okText = 'OK';
  72756. /**
  72757. * @input {any} Any additional options that the `alert` or `action-sheet` interface can take.
  72758. * See the [AlertController API docs](../../alert/AlertController/#create) and the
  72759. * [ActionSheetController API docs](../../action-sheet/ActionSheetController/#create) for the
  72760. * create options for each interface.
  72761. */
  72762. _this.selectOptions = {};
  72763. /**
  72764. * @input {string} The interface the select should use: `action-sheet`, `popover` or `alert`. Default: `alert`.
  72765. */
  72766. _this.interface = '';
  72767. /**
  72768. * @input {string} The text to display instead of the selected option's value.
  72769. */
  72770. _this.selectedText = '';
  72771. /**
  72772. * @output {any} Emitted when the selection was cancelled.
  72773. */
  72774. _this.ionCancel = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  72775. return _this;
  72776. }
  72777. Object.defineProperty(Select.prototype, "compareWith", {
  72778. /**
  72779. * @input {Function} The function that will be called to compare object values
  72780. */
  72781. set: function (fn) {
  72782. if (typeof fn !== 'function') {
  72783. throw new Error("compareWith must be a function, but received " + JSON.stringify(fn));
  72784. }
  72785. this._compareWith = fn;
  72786. },
  72787. enumerable: true,
  72788. configurable: true
  72789. });
  72790. Select.prototype._click = function (ev) {
  72791. ev.preventDefault();
  72792. ev.stopPropagation();
  72793. this.open(ev);
  72794. };
  72795. Select.prototype._keyup = function () {
  72796. this.open();
  72797. };
  72798. /**
  72799. * @hidden
  72800. */
  72801. Select.prototype.getValues = function () {
  72802. var values = Array.isArray(this._value) ? this._value : [this._value];
  72803. (void 0) /* assert */;
  72804. return values;
  72805. };
  72806. /**
  72807. * Open the select interface.
  72808. */
  72809. Select.prototype.open = function (ev) {
  72810. var _this = this;
  72811. if (this.isFocus() || this._disabled) {
  72812. return;
  72813. }
  72814. (void 0) /* console.debug */;
  72815. // the user may have assigned some options specifically for the alert
  72816. var selectOptions = Object(__WEBPACK_IMPORTED_MODULE_10__util_util__["b" /* deepCopy */])(this.selectOptions);
  72817. // make sure their buttons array is removed from the options
  72818. // and we create a new array for the alert's two buttons
  72819. selectOptions.buttons = [{
  72820. text: this.cancelText,
  72821. role: 'cancel',
  72822. handler: function () {
  72823. _this.ionCancel.emit(_this);
  72824. }
  72825. }];
  72826. // if the selectOptions didn't provide a title then use the label's text
  72827. if (!selectOptions.title && this._item) {
  72828. selectOptions.title = this._item.getLabelText();
  72829. }
  72830. var options = this._options.toArray();
  72831. if ((this.interface === 'action-sheet' || this.interface === 'popover') && this._multi) {
  72832. console.warn('Interface cannot be "' + this.interface + '" with a multi-value select. Using the "alert" interface.');
  72833. this.interface = 'alert';
  72834. }
  72835. if (this.interface === 'popover' && !ev) {
  72836. console.warn('Interface cannot be "popover" without UIEvent.');
  72837. this.interface = 'alert';
  72838. }
  72839. var overlay;
  72840. if (this.interface === 'action-sheet') {
  72841. selectOptions.buttons = selectOptions.buttons.concat(options.map(function (input) {
  72842. return {
  72843. role: (input.selected ? 'selected' : ''),
  72844. text: input.text,
  72845. handler: function () {
  72846. _this.value = input.value;
  72847. input.ionSelect.emit(input.value);
  72848. }
  72849. };
  72850. }));
  72851. var selectCssClass = 'select-action-sheet';
  72852. // If the user passed a cssClass for the select, add it
  72853. selectCssClass += selectOptions.cssClass ? ' ' + selectOptions.cssClass : '';
  72854. selectOptions.cssClass = selectCssClass;
  72855. overlay = new __WEBPACK_IMPORTED_MODULE_2__action_sheet_action_sheet__["a" /* ActionSheet */](this._app, selectOptions, this.config);
  72856. }
  72857. else if (this.interface === 'popover') {
  72858. var popoverOptions = options.map(function (input) { return ({
  72859. text: input.text,
  72860. checked: input.selected,
  72861. disabled: input.disabled,
  72862. value: input.value,
  72863. handler: function () {
  72864. _this.value = input.value;
  72865. input.ionSelect.emit(input.value);
  72866. }
  72867. }); });
  72868. var popoverCssClass = 'select-popover';
  72869. // If the user passed a cssClass for the select, add it
  72870. popoverCssClass += selectOptions.cssClass ? ' ' + selectOptions.cssClass : '';
  72871. overlay = new __WEBPACK_IMPORTED_MODULE_4__popover_popover__["a" /* Popover */](this._app, __WEBPACK_IMPORTED_MODULE_13__select_popover_component__["a" /* SelectPopover */], {
  72872. options: popoverOptions
  72873. }, {
  72874. cssClass: popoverCssClass
  72875. }, this.config, this.deepLinker);
  72876. // ev.target is readonly.
  72877. // place popover regarding to ion-select instead of .button-inner
  72878. Object.defineProperty(ev, 'target', { value: ev.currentTarget });
  72879. selectOptions.ev = ev;
  72880. }
  72881. else {
  72882. // default to use the alert interface
  72883. this.interface = 'alert';
  72884. // user cannot provide inputs from selectOptions
  72885. // alert inputs must be created by ionic from ion-options
  72886. selectOptions.inputs = this._options.map(function (input) {
  72887. return {
  72888. type: (_this._multi ? 'checkbox' : 'radio'),
  72889. label: input.text,
  72890. value: input.value,
  72891. checked: input.selected,
  72892. disabled: input.disabled,
  72893. handler: function (selectedOption) {
  72894. // Only emit the select event if it is being checked
  72895. // For multi selects this won't emit when unchecking
  72896. if (selectedOption.checked) {
  72897. input.ionSelect.emit(input.value);
  72898. }
  72899. }
  72900. };
  72901. });
  72902. var selectCssClass_1 = 'select-alert';
  72903. // create the alert instance from our built up selectOptions
  72904. overlay = new __WEBPACK_IMPORTED_MODULE_3__alert_alert__["a" /* Alert */](this._app, selectOptions, this.config);
  72905. if (this._multi) {
  72906. // use checkboxes
  72907. selectCssClass_1 += ' multiple-select-alert';
  72908. }
  72909. else {
  72910. // use radio buttons
  72911. selectCssClass_1 += ' single-select-alert';
  72912. }
  72913. // If the user passed a cssClass for the select, add it
  72914. selectCssClass_1 += selectOptions.cssClass ? ' ' + selectOptions.cssClass : '';
  72915. overlay.setCssClass(selectCssClass_1);
  72916. overlay.addButton({
  72917. text: this.okText,
  72918. handler: function (selectedValues) { return _this.value = selectedValues; }
  72919. });
  72920. }
  72921. overlay.present(selectOptions);
  72922. this._fireFocus();
  72923. overlay.onDidDismiss(function () {
  72924. _this._fireBlur();
  72925. _this._overlay = undefined;
  72926. });
  72927. this._overlay = overlay;
  72928. };
  72929. /**
  72930. * Close the select interface.
  72931. */
  72932. Select.prototype.close = function () {
  72933. if (!this._overlay || !this.isFocus()) {
  72934. return;
  72935. }
  72936. return this._overlay.dismiss();
  72937. };
  72938. Object.defineProperty(Select.prototype, "multiple", {
  72939. /**
  72940. * @input {boolean} If true, the element can accept multiple values.
  72941. */
  72942. get: function () {
  72943. return this._multi;
  72944. },
  72945. set: function (val) {
  72946. this._multi = Object(__WEBPACK_IMPORTED_MODULE_10__util_util__["o" /* isTrueProperty */])(val);
  72947. },
  72948. enumerable: true,
  72949. configurable: true
  72950. });
  72951. Object.defineProperty(Select.prototype, "text", {
  72952. /**
  72953. * @hidden
  72954. */
  72955. get: function () {
  72956. return (this._multi ? this._texts : this._texts.join());
  72957. },
  72958. enumerable: true,
  72959. configurable: true
  72960. });
  72961. Object.defineProperty(Select.prototype, "options", {
  72962. /**
  72963. * @private
  72964. */
  72965. set: function (val) {
  72966. this._options = val;
  72967. var values = this.getValues();
  72968. if (values.length === 0) {
  72969. // there are no values set at this point
  72970. // so check to see who should be selected
  72971. // we use writeValue() because we don't want to update ngModel
  72972. this.writeValue(val.filter(function (o) { return o.selected; }).map(function (o) { return o.value; }));
  72973. }
  72974. else {
  72975. this._updateText();
  72976. }
  72977. },
  72978. enumerable: true,
  72979. configurable: true
  72980. });
  72981. Select.prototype._inputShouldChange = function (val) {
  72982. return !Object(__WEBPACK_IMPORTED_MODULE_10__util_util__["c" /* deepEqual */])(this._value, val);
  72983. };
  72984. /**
  72985. * TODO: REMOVE THIS
  72986. * @hidden
  72987. */
  72988. Select.prototype._inputChangeEvent = function () {
  72989. return this.value;
  72990. };
  72991. /**
  72992. * @hidden
  72993. */
  72994. Select.prototype._updateText = function () {
  72995. var _this = this;
  72996. this._texts.length = 0;
  72997. if (this._options) {
  72998. this._options.forEach(function (option) {
  72999. // check this option if the option's value is in the values array
  73000. option.selected = _this.getValues().some(function (selectValue) {
  73001. return _this._compareWith(selectValue, option.value);
  73002. });
  73003. if (option.selected) {
  73004. _this._texts.push(option.text);
  73005. }
  73006. });
  73007. }
  73008. this._text = this._texts.join(', ');
  73009. };
  73010. /**
  73011. * @hidden
  73012. */
  73013. Select.prototype._inputUpdated = function () {
  73014. this._updateText();
  73015. _super.prototype._inputUpdated.call(this);
  73016. };
  73017. Select.decorators = [
  73018. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  73019. selector: 'ion-select',
  73020. template: '<div *ngIf="!_text" class="select-placeholder select-text">{{placeholder}}</div>' +
  73021. '<div *ngIf="_text" class="select-text">{{selectedText || _text}}</div>' +
  73022. '<div class="select-icon">' +
  73023. '<div class="select-icon-inner"></div>' +
  73024. '</div>' +
  73025. '<button aria-haspopup="true" ' +
  73026. 'type="button" ' +
  73027. '[id]="id" ' +
  73028. 'ion-button="item-cover" ' +
  73029. '[attr.aria-labelledby]="_labelId" ' +
  73030. '[attr.aria-disabled]="_disabled" ' +
  73031. 'class="item-cover">' +
  73032. '</button>',
  73033. host: {
  73034. '[class.select-disabled]': '_disabled'
  73035. },
  73036. providers: [{ provide: __WEBPACK_IMPORTED_MODULE_1__angular_forms__["b" /* NG_VALUE_ACCESSOR */], useExisting: Select, multi: true }],
  73037. encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_11" /* ViewEncapsulation */].None,
  73038. },] },
  73039. ];
  73040. /** @nocollapse */
  73041. Select.ctorParameters = function () { return [
  73042. { type: __WEBPACK_IMPORTED_MODULE_5__app_app__["a" /* App */], },
  73043. { type: __WEBPACK_IMPORTED_MODULE_8__util_form__["a" /* Form */], },
  73044. { type: __WEBPACK_IMPORTED_MODULE_6__config_config__["a" /* Config */], },
  73045. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  73046. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  73047. { type: __WEBPACK_IMPORTED_MODULE_11__item_item__["a" /* Item */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  73048. { type: __WEBPACK_IMPORTED_MODULE_7__navigation_deep_linker__["a" /* DeepLinker */], },
  73049. ]; };
  73050. Select.propDecorators = {
  73051. 'cancelText': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  73052. 'okText': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  73053. 'placeholder': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  73054. 'selectOptions': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  73055. 'interface': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  73056. 'selectedText': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  73057. 'compareWith': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  73058. 'ionCancel': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  73059. '_click': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["y" /* HostListener */], args: ['click', ['$event'],] },],
  73060. '_keyup': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["y" /* HostListener */], args: ['keyup.space',] },],
  73061. 'multiple': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  73062. 'options': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["r" /* ContentChildren */], args: [__WEBPACK_IMPORTED_MODULE_12__option_option__["a" /* Option */],] },],
  73063. };
  73064. return Select;
  73065. }(__WEBPACK_IMPORTED_MODULE_9__util_base_input__["a" /* BaseInput */]));
  73066. //# sourceMappingURL=select.js.map
  73067. /***/ }),
  73068. /* 173 */
  73069. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  73070. "use strict";
  73071. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ShowWhen; });
  73072. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  73073. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__display_when__ = __webpack_require__(86);
  73074. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__platform_platform__ = __webpack_require__(3);
  73075. var __extends = (this && this.__extends) || (function () {
  73076. var extendStatics = Object.setPrototypeOf ||
  73077. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  73078. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  73079. return function (d, b) {
  73080. extendStatics(d, b);
  73081. function __() { this.constructor = d; }
  73082. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  73083. };
  73084. })();
  73085. /**
  73086. *
  73087. * @name ShowWhen
  73088. * @description
  73089. * The `showWhen` attribute takes a string that represents a platform or screen orientation.
  73090. * The element the attribute is added to will only be shown when that platform or screen orientation is active.
  73091. *
  73092. * Complements the [hideWhen attribute](../HideWhen). If the `showWhen` attribute is used on an
  73093. * element that also has the `hideWhen` attribute, the element will not show if `hideWhen` evaluates
  73094. * to `true` or `showWhen` evaluates to `false`. If the `hidden` attribute is also added, the element
  73095. * will not show if `hidden` evaluates to `true`.
  73096. *
  73097. * View the [Platform API docs](../../../platform/Platform) for more information on the different
  73098. * platforms you can use.
  73099. *
  73100. * @usage
  73101. * ```html
  73102. * <div showWhen="android">
  73103. * I am visible on Android!
  73104. * </div>
  73105. *
  73106. * <div showWhen="ios">
  73107. * I am visible on iOS!
  73108. * </div>
  73109. *
  73110. * <div showWhen="android,ios">
  73111. * I am visible on Android and iOS!
  73112. * </div>
  73113. *
  73114. * <div showWhen="portrait">
  73115. * I am visible on Portrait!
  73116. * </div>
  73117. *
  73118. * <div showWhen="landscape">
  73119. * I am visible on Landscape!
  73120. * </div>
  73121. * ```
  73122. * @demo /docs/demos/src/show-when/
  73123. * @see {@link ../HideWhen HideWhen API Docs}
  73124. * @see {@link ../../../platform/Platform Platform API Docs}
  73125. */
  73126. var ShowWhen = (function (_super) {
  73127. __extends(ShowWhen, _super);
  73128. function ShowWhen(showWhen, plt, zone) {
  73129. return _super.call(this, showWhen, plt, zone) || this;
  73130. }
  73131. // ngOnDestroy is implemented in DisplayWhen
  73132. ShowWhen.decorators = [
  73133. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  73134. selector: '[showWhen]',
  73135. host: {
  73136. '[class.hidden-show-when]': '!isMatch'
  73137. }
  73138. },] },
  73139. ];
  73140. /** @nocollapse */
  73141. ShowWhen.ctorParameters = function () { return [
  73142. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["g" /* Attribute */], args: ['showWhen',] },] },
  73143. { type: __WEBPACK_IMPORTED_MODULE_2__platform_platform__["a" /* Platform */], },
  73144. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["M" /* NgZone */], },
  73145. ]; };
  73146. return ShowWhen;
  73147. }(__WEBPACK_IMPORTED_MODULE_1__display_when__["a" /* DisplayWhen */]));
  73148. //# sourceMappingURL=show-when.js.map
  73149. /***/ }),
  73150. /* 174 */
  73151. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  73152. "use strict";
  73153. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return HideWhen; });
  73154. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  73155. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__platform_platform__ = __webpack_require__(3);
  73156. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__display_when__ = __webpack_require__(86);
  73157. var __extends = (this && this.__extends) || (function () {
  73158. var extendStatics = Object.setPrototypeOf ||
  73159. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  73160. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  73161. return function (d, b) {
  73162. extendStatics(d, b);
  73163. function __() { this.constructor = d; }
  73164. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  73165. };
  73166. })();
  73167. /**
  73168. * @name HideWhen
  73169. * @description
  73170. * The `hideWhen` attribute takes a string that represents a plaform or screen orientation.
  73171. * The element the attribute is added to will only be hidden when that platform or screen orientation is active.
  73172. *
  73173. * Complements the [showWhen attribute](../ShowWhen). If the `hideWhen` attribute is used on an
  73174. * element that also has the `showWhen` attribute, the element will not show if `hideWhen` evaluates
  73175. * to `true` or `showWhen` evaluates to `false`. If the `hidden` attribute is also added, the element
  73176. * will not show if `hidden` evaluates to `true`.
  73177. *
  73178. * View the [Platform API docs](../../../platform/Platform) for more information on the different
  73179. * platforms you can use.
  73180. *
  73181. * @usage
  73182. * ```html
  73183. * <div hideWhen="android">
  73184. * I am hidden on Android!
  73185. * </div>
  73186. *
  73187. * <div hideWhen="ios">
  73188. * I am hidden on iOS!
  73189. * </div>
  73190. *
  73191. * <div hideWhen="android,ios">
  73192. * I am hidden on Android and iOS!
  73193. * </div>
  73194. *
  73195. * <div hideWhen="portrait">
  73196. * I am hidden on Portrait!
  73197. * </div>
  73198. *
  73199. * <div hideWhen="landscape">
  73200. * I am hidden on Landscape!
  73201. * </div>
  73202. * ```
  73203. *
  73204. * @demo /docs/demos/src/hide-when/
  73205. * @see {@link ../ShowWhen ShowWhen API Docs}
  73206. * @see {@link ../../../platform/Platform Platform API Docs}
  73207. */
  73208. var HideWhen = (function (_super) {
  73209. __extends(HideWhen, _super);
  73210. function HideWhen(hideWhen, plt, zone) {
  73211. return _super.call(this, hideWhen, plt, zone) || this;
  73212. }
  73213. HideWhen.decorators = [
  73214. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  73215. selector: '[hideWhen]',
  73216. host: {
  73217. '[class.hidden-hide-when]': 'isMatch'
  73218. }
  73219. },] },
  73220. ];
  73221. /** @nocollapse */
  73222. HideWhen.ctorParameters = function () { return [
  73223. { type: undefined, decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["g" /* Attribute */], args: ['hideWhen',] },] },
  73224. { type: __WEBPACK_IMPORTED_MODULE_1__platform_platform__["a" /* Platform */], },
  73225. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["M" /* NgZone */], },
  73226. ]; };
  73227. return HideWhen;
  73228. }(__WEBPACK_IMPORTED_MODULE_2__display_when__["a" /* DisplayWhen */]));
  73229. //# sourceMappingURL=hide-when.js.map
  73230. /***/ }),
  73231. /* 175 */
  73232. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  73233. "use strict";
  73234. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Slide; });
  73235. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  73236. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__slides__ = __webpack_require__(87);
  73237. /**
  73238. * @name Slide
  73239. * @description
  73240. * The Slide component is a child component of [Slides](../Slides). The template
  73241. * should be written as `ion-slide`. Any slide content should be written
  73242. * in this component and it should be used in conjunction with [Slides](../Slides).
  73243. *
  73244. * See the [Slides API Docs](../Slides) for more usage information.
  73245. *
  73246. * @demo /docs/demos/src/slides/
  73247. * @see {@link /docs/api/components/slides/Slides/ Slides API Docs}
  73248. */
  73249. var Slide = (function () {
  73250. function Slide(elementRef, renderer, _slides) {
  73251. this._slides = _slides;
  73252. renderer.setElementClass(elementRef.nativeElement, 'swiper-slide', true);
  73253. _slides.update(10);
  73254. }
  73255. /**
  73256. * @hidden
  73257. */
  73258. Slide.prototype.ngOnDestroy = function () {
  73259. this._slides.update(10);
  73260. };
  73261. Slide.decorators = [
  73262. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  73263. selector: 'ion-slide',
  73264. template: '<div class="slide-zoom">' +
  73265. '<ng-content></ng-content>' +
  73266. '</div>',
  73267. changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["i" /* ChangeDetectionStrategy */].OnPush,
  73268. encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_11" /* ViewEncapsulation */].None,
  73269. },] },
  73270. ];
  73271. /** @nocollapse */
  73272. Slide.ctorParameters = function () { return [
  73273. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  73274. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  73275. { type: __WEBPACK_IMPORTED_MODULE_1__slides__["a" /* Slides */], },
  73276. ]; };
  73277. return Slide;
  73278. }());
  73279. //# sourceMappingURL=slide.js.map
  73280. /***/ }),
  73281. /* 176 */
  73282. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  73283. "use strict";
  73284. /* harmony export (immutable) */ __webpack_exports__["b"] = parallaxSetTranslate;
  73285. /* harmony export (immutable) */ __webpack_exports__["a"] = parallaxSetTransition;
  73286. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__swiper_utils__ = __webpack_require__(12);
  73287. /*=========================
  73288. Parallax
  73289. ===========================*/
  73290. function setParallaxTransform(s, el, progress) {
  73291. var p;
  73292. var pX;
  73293. var pY;
  73294. var rtlFactor = s._rtl ? -1 : 1;
  73295. p = el.getAttribute('data-swiper-parallax') || '0';
  73296. pX = el.getAttribute('data-swiper-parallax-x');
  73297. pY = el.getAttribute('data-swiper-parallax-y');
  73298. if (pX || pY) {
  73299. pX = pX || '0';
  73300. pY = pY || '0';
  73301. }
  73302. else {
  73303. if (Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s)) {
  73304. pX = p;
  73305. pY = '0';
  73306. }
  73307. else {
  73308. pY = p;
  73309. pX = '0';
  73310. }
  73311. }
  73312. if ((pX).indexOf('%') >= 0) {
  73313. pX = parseInt(pX, 10) * progress * rtlFactor + '%';
  73314. }
  73315. else {
  73316. pX = pX * progress * rtlFactor + 'px';
  73317. }
  73318. if ((pY).indexOf('%') >= 0) {
  73319. pY = parseInt(pY, 10) * progress + '%';
  73320. }
  73321. else {
  73322. pY = pY * progress + 'px';
  73323. }
  73324. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["n" /* transform */])(el, 'translate3d(' + pX + ', ' + pY + ',0px)');
  73325. }
  73326. function parallaxSetTranslate(s) {
  73327. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["c" /* eachChild */])(s.container, '[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]', function (el) {
  73328. setParallaxTransform(s, el, s.progress);
  73329. });
  73330. for (var i = 0; i < s._slides.length; i++) {
  73331. var slide = s._slides[i];
  73332. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["c" /* eachChild */])(slide, '[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]', function () {
  73333. var progress = Math.min(Math.max(slide.progress, -1), 1);
  73334. setParallaxTransform(s, slide, progress);
  73335. });
  73336. }
  73337. }
  73338. function parallaxSetTransition(s, duration) {
  73339. if (typeof duration === 'undefined')
  73340. duration = s.speed;
  73341. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["c" /* eachChild */])(s.container, '[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]', function (el) {
  73342. var parallaxDuration = parseInt(el.getAttribute('data-swiper-parallax-duration'), 10) || duration;
  73343. if (duration === 0)
  73344. parallaxDuration = 0;
  73345. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["o" /* transition */])(el, parallaxDuration);
  73346. });
  73347. }
  73348. //# sourceMappingURL=swiper-parallax.js.map
  73349. /***/ }),
  73350. /* 177 */
  73351. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  73352. "use strict";
  73353. /* harmony export (immutable) */ __webpack_exports__["a"] = isCordova;
  73354. /* harmony export (immutable) */ __webpack_exports__["b"] = isElectron;
  73355. /* harmony export (immutable) */ __webpack_exports__["c"] = isIos;
  73356. /* harmony export (immutable) */ __webpack_exports__["e"] = isSafari;
  73357. /* unused harmony export isWKWebView */
  73358. /* harmony export (immutable) */ __webpack_exports__["d"] = isIosUIWebView;
  73359. function isCordova(plt) {
  73360. var win = plt.win();
  73361. return !!(win['cordova'] || win['PhoneGap'] || win['phonegap']);
  73362. }
  73363. function isElectron(plt) {
  73364. return plt.testUserAgent('Electron');
  73365. }
  73366. function isIos(plt) {
  73367. // shortcut function to be reused internally
  73368. // checks navigator.platform to see if it's an actual iOS device
  73369. // this does not use the user-agent string because it is often spoofed
  73370. // an actual iPad will return true, a chrome dev tools iPad will return false
  73371. return plt.testNavigatorPlatform('iphone|ipad|ipod');
  73372. }
  73373. function isSafari(plt) {
  73374. return plt.testUserAgent('Safari');
  73375. }
  73376. function isWKWebView(plt) {
  73377. return isIos(plt) && !!plt.win()['webkit'];
  73378. }
  73379. function isIosUIWebView(plt) {
  73380. return isIos(plt) && !isWKWebView(plt) && !isSafari(plt);
  73381. }
  73382. //# sourceMappingURL=platform-utils.js.map
  73383. /***/ }),
  73384. /* 178 */
  73385. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  73386. "use strict";
  73387. /* harmony export (immutable) */ __webpack_exports__["a"] = initZoom;
  73388. /* harmony export (immutable) */ __webpack_exports__["b"] = resetZoomEvents;
  73389. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__swiper_utils__ = __webpack_require__(12);
  73390. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__swiper_transition__ = __webpack_require__(88);
  73391. function initZoom(s, plt) {
  73392. s._supportGestures = ('ongesturestart' in plt.win());
  73393. s._zoom = {
  73394. // "Global" Props
  73395. scale: 1,
  73396. currentScale: 1,
  73397. isScaling: false,
  73398. gesture: {
  73399. slide: undefined,
  73400. slideWidth: undefined,
  73401. slideHeight: undefined,
  73402. image: undefined,
  73403. imageWrap: undefined,
  73404. zoomMax: s.zoomMax
  73405. },
  73406. image: {
  73407. isTouched: undefined,
  73408. isMoved: undefined,
  73409. currentX: undefined,
  73410. currentY: undefined,
  73411. minX: undefined,
  73412. minY: undefined,
  73413. maxX: undefined,
  73414. maxY: undefined,
  73415. width: undefined,
  73416. height: undefined,
  73417. startX: undefined,
  73418. startY: undefined,
  73419. touchesStart: {},
  73420. touchesCurrent: {}
  73421. },
  73422. velocity: {
  73423. x: undefined,
  73424. y: undefined,
  73425. prevPositionX: undefined,
  73426. prevPositionY: undefined,
  73427. prevTime: undefined
  73428. },
  73429. unRegs: []
  73430. };
  73431. resetZoomEvents(s, plt);
  73432. return function () {
  73433. detachZoomEvents(s);
  73434. };
  73435. }
  73436. // Calc Scale From Multi-touches
  73437. function getDistanceBetweenTouches(ev) {
  73438. if (ev.targetTouches.length < 2)
  73439. return 1;
  73440. var x1 = ev.targetTouches[0].pageX, y1 = ev.targetTouches[0].pageY, x2 = ev.targetTouches[1].pageX, y2 = ev.targetTouches[1].pageY;
  73441. return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
  73442. }
  73443. // Events
  73444. function onGestureStart(s, _plt, ev) {
  73445. var z = s._zoom;
  73446. s.originalEvent = ev;
  73447. if (!s._supportGestures) {
  73448. if (ev.type !== 'touchstart' || ev.type === 'touchstart' && ev.targetTouches.length < 2) {
  73449. return;
  73450. }
  73451. z.gesture.scaleStart = getDistanceBetweenTouches(ev);
  73452. }
  73453. if (!z.gesture.slide) {
  73454. if (ev.currentTarget && ev.currentTarget.classList.contains(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].slide)) {
  73455. z.gesture.slide = ev.currentTarget;
  73456. }
  73457. if (!z.gesture.slide) {
  73458. z.gesture.slide = s._slides[s._activeIndex];
  73459. }
  73460. z.gesture.image = z.gesture.slide.querySelector('img, svg, canvas, ion-img');
  73461. if (z.gesture.image) {
  73462. z.gesture.imageWrap = z.gesture.image.closest('.' + __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].zoomContainer);
  73463. if (!z.gesture.imageWrap) {
  73464. z.gesture.image = undefined;
  73465. return;
  73466. }
  73467. z.gesture.zoomMax = parseInt(z.gesture.imageWrap.getAttribute('data-swiper-zoom') || s.zoomMax, 10);
  73468. }
  73469. }
  73470. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["o" /* transition */])(z.gesture.image, 0);
  73471. z.isScaling = true;
  73472. }
  73473. function onGestureChange(s, _plt, ev) {
  73474. var z = s._zoom;
  73475. s.originalEvent = ev;
  73476. if (!s._supportGestures) {
  73477. if (ev.type !== 'touchmove' || ev.type === 'touchmove' && ev.targetTouches.length < 2) {
  73478. return;
  73479. }
  73480. z.gesture.scaleMove = getDistanceBetweenTouches(ev);
  73481. }
  73482. if (!z.gesture.image)
  73483. return;
  73484. if (s._supportGestures) {
  73485. z.scale = ev.scale * z.currentScale;
  73486. }
  73487. else {
  73488. z.scale = (z.gesture.scaleMove / z.gesture.scaleStart) * z.currentScale;
  73489. }
  73490. if (z.scale > z.gesture.zoomMax) {
  73491. z.scale = z.gesture.zoomMax - 1 + Math.pow((z.scale - z.gesture.zoomMax + 1), 0.5);
  73492. }
  73493. if (z.scale < s.zoomMin) {
  73494. z.scale = s.zoomMin + 1 - Math.pow((s.zoomMin - z.scale + 1), 0.5);
  73495. }
  73496. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["n" /* transform */])(z.gesture.image, 'translate3d(0,0,0) scale(' + z.scale + ')');
  73497. }
  73498. function onGestureEnd(s, _plt, ev) {
  73499. var z = s._zoom;
  73500. s.originalEvent = ev;
  73501. if (!s._supportGestures) {
  73502. if (ev.type !== 'touchend' || ev.type === 'touchend' && ev.changedTouches.length < 2) {
  73503. return;
  73504. }
  73505. }
  73506. if (!z.gesture.image)
  73507. return;
  73508. z.scale = Math.max(Math.min(z.scale, z.gesture.zoomMax), s.zoomMin);
  73509. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["o" /* transition */])(z.gesture.image, s.speed);
  73510. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["n" /* transform */])(z.gesture.image, 'translate3d(0,0,0) scale(' + z.scale + ')');
  73511. z.currentScale = z.scale;
  73512. z.isScaling = false;
  73513. if (z.scale === 1) {
  73514. z.gesture.slide = undefined;
  73515. }
  73516. }
  73517. function onTouchStart(s, plt, ev) {
  73518. var z = s._zoom;
  73519. s.originalEvent = ev;
  73520. if (!z.gesture.image || z.image.isTouched)
  73521. return;
  73522. if (plt.is('android')) {
  73523. ev.preventDefault();
  73524. }
  73525. z.image.isTouched = true;
  73526. z.image.touchesStart.x = ev.type === 'touchstart' ? ev.targetTouches[0].pageX : ev.pageX;
  73527. z.image.touchesStart.y = ev.type === 'touchstart' ? ev.targetTouches[0].pageY : ev.pageY;
  73528. }
  73529. function onTouchMove(s, plt, ev) {
  73530. var z = s._zoom;
  73531. s.originalEvent = ev;
  73532. if (!z.gesture.image)
  73533. return;
  73534. s._allowClick = false;
  73535. if (!z.image.isTouched || !z.gesture.slide)
  73536. return;
  73537. if (!z.image.isMoved) {
  73538. z.image.width = z.gesture.image.offsetWidth;
  73539. z.image.height = z.gesture.image.offsetHeight;
  73540. z.image.startX = Object(__WEBPACK_IMPORTED_MODULE_1__swiper_transition__["a" /* getTranslate */])(s, plt, z.gesture.imageWrap, 'x') || 0;
  73541. z.image.startY = Object(__WEBPACK_IMPORTED_MODULE_1__swiper_transition__["a" /* getTranslate */])(s, plt, z.gesture.imageWrap, 'y') || 0;
  73542. z.gesture.slideWidth = z.gesture.slide.offsetWidth;
  73543. z.gesture.slideHeight = z.gesture.slide.offsetHeight;
  73544. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["o" /* transition */])(z.gesture.imageWrap, 0);
  73545. if (s._rtl) {
  73546. z.image.startX = -z.image.startX;
  73547. z.image.startY = -z.image.startY;
  73548. }
  73549. }
  73550. // Define if we need image drag
  73551. var scaledWidth = z.image.width * z.scale;
  73552. var scaledHeight = z.image.height * z.scale;
  73553. if (scaledWidth < z.gesture.slideWidth && scaledHeight < z.gesture.slideHeight) {
  73554. return;
  73555. }
  73556. z.image.minX = Math.min((z.gesture.slideWidth / 2 - scaledWidth / 2), 0);
  73557. z.image.maxX = -z.image.minX;
  73558. z.image.minY = Math.min((z.gesture.slideHeight / 2 - scaledHeight / 2), 0);
  73559. z.image.maxY = -z.image.minY;
  73560. z.image.touchesCurrent.x = ev.type === 'touchmove' ? ev.targetTouches[0].pageX : ev.pageX;
  73561. z.image.touchesCurrent.y = ev.type === 'touchmove' ? ev.targetTouches[0].pageY : ev.pageY;
  73562. if (!z.image.isMoved && !z.isScaling) {
  73563. if (Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) &&
  73564. (Math.floor(z.image.minX) === Math.floor(z.image.startX) && z.image.touchesCurrent.x < z.image.touchesStart.x) ||
  73565. (Math.floor(z.image.maxX) === Math.floor(z.image.startX) && z.image.touchesCurrent.x > z.image.touchesStart.x)) {
  73566. z.image.isTouched = false;
  73567. return;
  73568. }
  73569. else if (!Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) &&
  73570. (Math.floor(z.image.minY) === Math.floor(z.image.startY) && z.image.touchesCurrent.y < z.image.touchesStart.y) ||
  73571. (Math.floor(z.image.maxY) === Math.floor(z.image.startY) && z.image.touchesCurrent.y > z.image.touchesStart.y)) {
  73572. z.image.isTouched = false;
  73573. return;
  73574. }
  73575. }
  73576. ev.preventDefault();
  73577. ev.stopPropagation();
  73578. z.image.isMoved = true;
  73579. z.image.currentX = z.image.touchesCurrent.x - z.image.touchesStart.x + z.image.startX;
  73580. z.image.currentY = z.image.touchesCurrent.y - z.image.touchesStart.y + z.image.startY;
  73581. if (z.image.currentX < z.image.minX) {
  73582. z.image.currentX = z.image.minX + 1 - Math.pow((z.image.minX - z.image.currentX + 1), 0.8);
  73583. }
  73584. if (z.image.currentX > z.image.maxX) {
  73585. z.image.currentX = z.image.maxX - 1 + Math.pow((z.image.currentX - z.image.maxX + 1), 0.8);
  73586. }
  73587. if (z.image.currentY < z.image.minY) {
  73588. z.image.currentY = z.image.minY + 1 - Math.pow((z.image.minY - z.image.currentY + 1), 0.8);
  73589. }
  73590. if (z.image.currentY > z.image.maxY) {
  73591. z.image.currentY = z.image.maxY - 1 + Math.pow((z.image.currentY - z.image.maxY + 1), 0.8);
  73592. }
  73593. // Velocity
  73594. if (!z.velocity.prevPositionX)
  73595. z.velocity.prevPositionX = z.image.touchesCurrent.x;
  73596. if (!z.velocity.prevPositionY)
  73597. z.velocity.prevPositionY = z.image.touchesCurrent.y;
  73598. if (!z.velocity.prevTime)
  73599. z.velocity.prevTime = Date.now();
  73600. z.velocity.x = (z.image.touchesCurrent.x - z.velocity.prevPositionX) / (Date.now() - z.velocity.prevTime) / 2;
  73601. z.velocity.y = (z.image.touchesCurrent.y - z.velocity.prevPositionY) / (Date.now() - z.velocity.prevTime) / 2;
  73602. if (Math.abs(z.image.touchesCurrent.x - z.velocity.prevPositionX) < 2)
  73603. z.velocity.x = 0;
  73604. if (Math.abs(z.image.touchesCurrent.y - z.velocity.prevPositionY) < 2)
  73605. z.velocity.y = 0;
  73606. z.velocity.prevPositionX = z.image.touchesCurrent.x;
  73607. z.velocity.prevPositionY = z.image.touchesCurrent.y;
  73608. z.velocity.prevTime = Date.now();
  73609. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["n" /* transform */])(z.gesture.imageWrap, 'translate3d(' + z.image.currentX + 'px, ' + z.image.currentY + 'px,0)');
  73610. }
  73611. function onTouchEnd(s) {
  73612. var z = s._zoom;
  73613. if (!z.gesture.image)
  73614. return;
  73615. if (!z.image.isTouched || !z.image.isMoved) {
  73616. z.image.isTouched = false;
  73617. z.image.isMoved = false;
  73618. return;
  73619. }
  73620. z.image.isTouched = false;
  73621. z.image.isMoved = false;
  73622. var momentumDurationX = 300;
  73623. var momentumDurationY = 300;
  73624. var momentumDistanceX = z.velocity.x * momentumDurationX;
  73625. var newPositionX = z.image.currentX + momentumDistanceX;
  73626. var momentumDistanceY = z.velocity.y * momentumDurationY;
  73627. var newPositionY = z.image.currentY + momentumDistanceY;
  73628. // Fix duration
  73629. if (z.velocity.x !== 0)
  73630. momentumDurationX = Math.abs((newPositionX - z.image.currentX) / z.velocity.x);
  73631. if (z.velocity.y !== 0)
  73632. momentumDurationY = Math.abs((newPositionY - z.image.currentY) / z.velocity.y);
  73633. var momentumDuration = Math.max(momentumDurationX, momentumDurationY);
  73634. z.image.currentX = newPositionX;
  73635. z.image.currentY = newPositionY;
  73636. // Define if we need image drag
  73637. var scaledWidth = z.image.width * z.scale;
  73638. var scaledHeight = z.image.height * z.scale;
  73639. z.image.minX = Math.min((z.gesture.slideWidth / 2 - scaledWidth / 2), 0);
  73640. z.image.maxX = -z.image.minX;
  73641. z.image.minY = Math.min((z.gesture.slideHeight / 2 - scaledHeight / 2), 0);
  73642. z.image.maxY = -z.image.minY;
  73643. z.image.currentX = Math.max(Math.min(z.image.currentX, z.image.maxX), z.image.minX);
  73644. z.image.currentY = Math.max(Math.min(z.image.currentY, z.image.maxY), z.image.minY);
  73645. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["o" /* transition */])(z.gesture.imageWrap, momentumDuration);
  73646. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["n" /* transform */])(z.gesture.imageWrap, 'translate3d(' + z.image.currentX + 'px, ' + z.image.currentY + 'px,0)');
  73647. }
  73648. function onTransitionEnd(s) {
  73649. var z = s._zoom;
  73650. if (z.gesture.slide && s._previousIndex !== s._activeIndex) {
  73651. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["n" /* transform */])(z.gesture.image, 'translate3d(0,0,0) scale(1)');
  73652. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["n" /* transform */])(z.gesture.imageWrap, 'translate3d(0,0,0)');
  73653. z.gesture.slide = z.gesture.image = z.gesture.imageWrap = undefined;
  73654. z.scale = z.currentScale = 1;
  73655. }
  73656. }
  73657. function toggleZoom(s, plt) {
  73658. var z = s._zoom;
  73659. var ev = s.originalEvent;
  73660. if (!z.gesture.slide) {
  73661. z.gesture.slide = s.clickedSlide ? s.clickedSlide : s._slides[s._activeIndex];
  73662. z.gesture.image = z.gesture.slide.querySelector('img, svg, canvas, ion-img');
  73663. z.gesture.imageWrap = z.gesture.image && z.gesture.image.closest('.' + __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].zoomContainer);
  73664. }
  73665. if (!z.gesture.imageWrap)
  73666. return;
  73667. var touchX;
  73668. var touchY;
  73669. var offsetX;
  73670. var offsetY;
  73671. var diffX;
  73672. var diffY;
  73673. var translateX;
  73674. var translateY;
  73675. var imageWidth;
  73676. var imageHeight;
  73677. var scaledWidth;
  73678. var scaledHeight;
  73679. var translateMinX;
  73680. var translateMinY;
  73681. var translateMaxX;
  73682. var translateMaxY;
  73683. var slideWidth;
  73684. var slideHeight;
  73685. if (typeof z.image.touchesStart.x === 'undefined' && ev) {
  73686. touchX = ev.type === 'touchend' ? ev.changedTouches[0].pageX : ev.pageX;
  73687. touchY = ev.type === 'touchend' ? ev.changedTouches[0].pageY : ev.pageY;
  73688. }
  73689. else {
  73690. touchX = z.image.touchesStart.x;
  73691. touchY = z.image.touchesStart.y;
  73692. }
  73693. if (z.scale && z.scale !== 1) {
  73694. // Zoom Out
  73695. z.scale = z.currentScale = 1;
  73696. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["o" /* transition */])(z.gesture.imageWrap, 300);
  73697. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["n" /* transform */])(z.gesture.imageWrap, 'translate3d(0,0,0)');
  73698. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["o" /* transition */])(z.gesture.image, 300);
  73699. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["n" /* transform */])(z.gesture.image, 'translate3d(0,0,0) scale(1)');
  73700. z.gesture.slide = undefined;
  73701. }
  73702. else {
  73703. // Zoom In
  73704. z.scale = z.currentScale = parseInt(z.gesture.imageWrap.getAttribute('data-swiper-zoom') || s.zoomMax, 10);
  73705. if (ev) {
  73706. slideWidth = z.gesture.slide.offsetWidth;
  73707. slideHeight = z.gesture.slide.offsetHeight;
  73708. var slideOffsets = Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["j" /* offset */])(z.gesture.slide, plt);
  73709. offsetX = slideOffsets.left;
  73710. offsetY = slideOffsets.top;
  73711. diffX = offsetX + slideWidth / 2 - touchX;
  73712. diffY = offsetY + slideHeight / 2 - touchY;
  73713. imageWidth = z.gesture.image.offsetWidth;
  73714. imageHeight = z.gesture.image.offsetHeight;
  73715. scaledWidth = imageWidth * z.scale;
  73716. scaledHeight = imageHeight * z.scale;
  73717. translateMinX = Math.min((slideWidth / 2 - scaledWidth / 2), 0);
  73718. translateMinY = Math.min((slideHeight / 2 - scaledHeight / 2), 0);
  73719. translateMaxX = -translateMinX;
  73720. translateMaxY = -translateMinY;
  73721. translateX = diffX * z.scale;
  73722. translateY = diffY * z.scale;
  73723. if (translateX < translateMinX) {
  73724. translateX = translateMinX;
  73725. }
  73726. if (translateX > translateMaxX) {
  73727. translateX = translateMaxX;
  73728. }
  73729. if (translateY < translateMinY) {
  73730. translateY = translateMinY;
  73731. }
  73732. if (translateY > translateMaxY) {
  73733. translateY = translateMaxY;
  73734. }
  73735. }
  73736. else {
  73737. translateX = 0;
  73738. translateY = 0;
  73739. }
  73740. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["o" /* transition */])(z.gesture.imageWrap, 300);
  73741. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["n" /* transform */])(z.gesture.imageWrap, 'translate3d(' + translateX + 'px, ' + translateY + 'px,0)');
  73742. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["o" /* transition */])(z.gesture.image, 300);
  73743. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["n" /* transform */])(z.gesture.image, 'translate3d(0,0,0) scale(' + z.scale + ')');
  73744. }
  73745. }
  73746. function resetZoomEvents(s, plt) {
  73747. detachZoomEvents(s);
  73748. var unRegs = s._zoom.unRegs;
  73749. var evtOpts = { passive: s._touchEvents.start === 'touchstart', zone: false };
  73750. var slides = s._slides;
  73751. var slide;
  73752. // Scale image
  73753. if (s._supportGestures) {
  73754. for (var i = 0; i < slides.length; i++) {
  73755. slide = slides[i];
  73756. // gesturestart
  73757. plt.registerListener(slide, 'gesturestart', function (ev) {
  73758. onGestureStart(s, plt, ev);
  73759. }, evtOpts, unRegs);
  73760. // gesturechange
  73761. plt.registerListener(slide, 'gesturechange', function (ev) {
  73762. onGestureChange(s, plt, ev);
  73763. }, evtOpts, unRegs);
  73764. // gestureend
  73765. plt.registerListener(slide, 'gestureend', function (ev) {
  73766. onGestureEnd(s, plt, ev);
  73767. }, evtOpts, unRegs);
  73768. }
  73769. }
  73770. else if (s._touchEvents.start === 'touchstart') {
  73771. for (var i = 0; i < slides.length; i++) {
  73772. slide = slides[i];
  73773. // touchstart
  73774. plt.registerListener(slide, s._touchEvents.start, function (ev) {
  73775. onGestureStart(s, plt, ev);
  73776. }, evtOpts, unRegs);
  73777. // touchmove
  73778. plt.registerListener(slide, s._touchEvents.move, function (ev) {
  73779. onGestureChange(s, plt, ev);
  73780. }, evtOpts, unRegs);
  73781. // touchend
  73782. plt.registerListener(slide, s._touchEvents.end, function (ev) {
  73783. onGestureEnd(s, plt, ev);
  73784. }, evtOpts, unRegs);
  73785. }
  73786. }
  73787. // Move image
  73788. var touchStartSub = s.ionSlideTouchStart.subscribe(function (ev) {
  73789. onTouchStart(s, plt, ev);
  73790. });
  73791. unRegs.push(function () { touchStartSub.unsubscribe(); });
  73792. for (var i = 0; i < slides.length; i++) {
  73793. slide = slides[i];
  73794. if (slide.querySelector('.' + __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].zoomContainer)) {
  73795. plt.registerListener(slide, 's.touchEvents.move', function (ev) {
  73796. onTouchMove(s, plt, ev);
  73797. }, evtOpts, unRegs);
  73798. }
  73799. }
  73800. var touchEndSub = s.ionSlideTouchEnd.subscribe(function () {
  73801. onTouchEnd(s);
  73802. });
  73803. unRegs.push(function () { touchEndSub.unsubscribe(); });
  73804. // Scale Out
  73805. var transEndSub = s.ionSlideTouchEnd.subscribe(function () {
  73806. onTransitionEnd(s);
  73807. });
  73808. unRegs.push(function () { transEndSub.unsubscribe(); });
  73809. if (s.zoomToggle) {
  73810. var doubleTapSub = s.ionSlideDoubleTap.subscribe(function () {
  73811. toggleZoom(s, plt);
  73812. });
  73813. unRegs.push(function () { doubleTapSub.unsubscribe(); });
  73814. }
  73815. }
  73816. function detachZoomEvents(s) {
  73817. s._zoom.unRegs.forEach(function (unReg) {
  73818. unReg();
  73819. });
  73820. s._zoom.unRegs.length = 0;
  73821. }
  73822. //# sourceMappingURL=swiper-zoom.js.map
  73823. /***/ }),
  73824. /* 179 */
  73825. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  73826. "use strict";
  73827. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Spinner; });
  73828. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  73829. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__config_config__ = __webpack_require__(1);
  73830. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ion__ = __webpack_require__(4);
  73831. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_util__ = __webpack_require__(2);
  73832. var __extends = (this && this.__extends) || (function () {
  73833. var extendStatics = Object.setPrototypeOf ||
  73834. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  73835. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  73836. return function (d, b) {
  73837. extendStatics(d, b);
  73838. function __() { this.constructor = d; }
  73839. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  73840. };
  73841. })();
  73842. /**
  73843. * @name Spinner
  73844. * @description
  73845. * The `ion-spinner` component provides a variety of animated SVG spinners.
  73846. * Spinners enables you to give users feedback that the app is actively
  73847. * processing/thinking/waiting/chillin’ out, or whatever you’d like it to indicate.
  73848. * By default, the `ion-refresher` feature uses this spinner component while it's
  73849. * the refresher is in the `refreshing` state.
  73850. *
  73851. * Ionic offers a handful of spinners out of the box, and by default, it will use
  73852. * the appropriate spinner for the platform on which it’s running.
  73853. *
  73854. * <table class="table spinner-table">
  73855. * <tr>
  73856. * <th>
  73857. * <code>ios</code>
  73858. * </th>
  73859. * <td>
  73860. * <ion-spinner name="ios"></ion-spinner>
  73861. * </td>
  73862. * </tr>
  73863. * <tr>
  73864. * <th>
  73865. * <code>ios-small</code>
  73866. * </th>
  73867. * <td>
  73868. * <ion-spinner name="ios-small"></ion-spinner>
  73869. * </td>
  73870. * </tr>
  73871. * <tr>
  73872. * <th>
  73873. * <code>bubbles</code>
  73874. * </th>
  73875. * <td>
  73876. * <ion-spinner name="bubbles"></ion-spinner>
  73877. * </td>
  73878. * </tr>
  73879. * <tr>
  73880. * <th>
  73881. * <code>circles</code>
  73882. * </th>
  73883. * <td>
  73884. * <ion-spinner name="circles"></ion-spinner>
  73885. * </td>
  73886. * </tr>
  73887. * <tr>
  73888. * <th>
  73889. * <code>crescent</code>
  73890. * </th>
  73891. * <td>
  73892. * <ion-spinner name="crescent"></ion-spinner>
  73893. * </td>
  73894. * </tr>
  73895. * <tr>
  73896. * <th>
  73897. * <code>dots</code>
  73898. * </th>
  73899. * <td>
  73900. * <ion-spinner name="dots"></ion-spinner>
  73901. * </td>
  73902. * </tr>
  73903. * </table>
  73904. *
  73905. * @usage
  73906. * The following code would use the default spinner for the platform it's
  73907. * running from. If it's neither iOS or Android, it'll default to use `ios`.
  73908. *
  73909. * ```html
  73910. * <ion-spinner></ion-spinner>
  73911. * ```
  73912. *
  73913. * By setting the `name` property, you can specify which predefined spinner to
  73914. * use, no matter what the platform is.
  73915. *
  73916. * ```html
  73917. * <ion-spinner name="bubbles"></ion-spinner>
  73918. * ```
  73919. *
  73920. * ## Styling SVG with CSS
  73921. * One cool thing about SVG is its ability to be styled with CSS! One thing to note
  73922. * is that some of the CSS properties on an SVG element have different names. For
  73923. * example, SVG uses the term `stroke` instead of `border`, and `fill` instead
  73924. * of `background-color`.
  73925. *
  73926. * ```css
  73927. * ion-spinner * {
  73928. * width: 28px;
  73929. * height: 28px;
  73930. * stroke: #444;
  73931. * fill: #222;
  73932. * }
  73933. * ```
  73934. */
  73935. var Spinner = (function (_super) {
  73936. __extends(Spinner, _super);
  73937. function Spinner(config, elementRef, renderer) {
  73938. var _this = _super.call(this, config, elementRef, renderer, 'spinner') || this;
  73939. _this._dur = null;
  73940. _this._paused = false;
  73941. return _this;
  73942. }
  73943. Object.defineProperty(Spinner.prototype, "name", {
  73944. /**
  73945. * @input {string} SVG spinner name.
  73946. */
  73947. get: function () {
  73948. return this._name;
  73949. },
  73950. set: function (val) {
  73951. this._name = val;
  73952. this.load();
  73953. },
  73954. enumerable: true,
  73955. configurable: true
  73956. });
  73957. Object.defineProperty(Spinner.prototype, "duration", {
  73958. /**
  73959. * @input {string} How long it takes it to do one loop.
  73960. */
  73961. get: function () {
  73962. return this._dur;
  73963. },
  73964. set: function (val) {
  73965. this._dur = val;
  73966. this.load();
  73967. },
  73968. enumerable: true,
  73969. configurable: true
  73970. });
  73971. Object.defineProperty(Spinner.prototype, "paused", {
  73972. /**
  73973. * @input {boolean} If true, pause the animation.
  73974. */
  73975. get: function () {
  73976. return this._paused;
  73977. },
  73978. set: function (val) {
  73979. this._paused = Object(__WEBPACK_IMPORTED_MODULE_3__util_util__["o" /* isTrueProperty */])(val);
  73980. },
  73981. enumerable: true,
  73982. configurable: true
  73983. });
  73984. /**
  73985. * @hidden
  73986. */
  73987. Spinner.prototype.ngOnInit = function () {
  73988. this._init = true;
  73989. this.load();
  73990. };
  73991. /**
  73992. * @hidden
  73993. */
  73994. Spinner.prototype.load = function () {
  73995. if (this._init) {
  73996. this._l = [];
  73997. this._c = [];
  73998. var name = this._name || this._config.get('spinner', 'ios');
  73999. var spinner = SPINNERS[name];
  74000. if (spinner) {
  74001. if (spinner.lines) {
  74002. for (var i = 0, l = spinner.lines; i < l; i++) {
  74003. this._l.push(this._loadEle(spinner, i, l));
  74004. }
  74005. }
  74006. else if (spinner.circles) {
  74007. for (var i = 0, l = spinner.circles; i < l; i++) {
  74008. this._c.push(this._loadEle(spinner, i, l));
  74009. }
  74010. }
  74011. this.setElementClass("spinner-" + name, true);
  74012. this.setElementClass("spinner-" + this._mode + "-" + name, true);
  74013. }
  74014. }
  74015. };
  74016. Spinner.prototype._loadEle = function (spinner, index, total) {
  74017. var duration = this._dur || spinner.dur;
  74018. var data = spinner.fn(duration, index, total);
  74019. data.style.animationDuration = duration + 'ms';
  74020. return data;
  74021. };
  74022. Spinner.decorators = [
  74023. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  74024. selector: 'ion-spinner',
  74025. template: '<svg viewBox="0 0 64 64" *ngFor="let i of _c" [ngStyle]="i.style">' +
  74026. '<circle [attr.r]="i.r" transform="translate(32,32)"></circle>' +
  74027. '</svg>' +
  74028. '<svg viewBox="0 0 64 64" *ngFor="let i of _l" [ngStyle]="i.style">' +
  74029. '<line [attr.y1]="i.y1" [attr.y2]="i.y2" transform="translate(32,32)"></line>' +
  74030. '</svg>',
  74031. host: {
  74032. '[class.spinner-paused]': '_paused'
  74033. },
  74034. changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["i" /* ChangeDetectionStrategy */].OnPush,
  74035. encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_11" /* ViewEncapsulation */].None,
  74036. },] },
  74037. ];
  74038. /** @nocollapse */
  74039. Spinner.ctorParameters = function () { return [
  74040. { type: __WEBPACK_IMPORTED_MODULE_1__config_config__["a" /* Config */], },
  74041. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  74042. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  74043. ]; };
  74044. Spinner.propDecorators = {
  74045. 'name': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  74046. 'duration': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  74047. 'paused': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  74048. };
  74049. return Spinner;
  74050. }(__WEBPACK_IMPORTED_MODULE_2__ion__["a" /* Ion */]));
  74051. var SPINNERS = {
  74052. ios: {
  74053. dur: 1000,
  74054. lines: 12,
  74055. fn: function (dur, index, total) {
  74056. var transform = 'rotate(' + (30 * index + (index < 6 ? 180 : -180)) + 'deg)';
  74057. var animationDelay = -(dur - ((dur / total) * index)) + 'ms';
  74058. return {
  74059. y1: 17,
  74060. y2: 29,
  74061. style: {
  74062. transform: transform,
  74063. webkitTransform: transform,
  74064. animationDelay: animationDelay,
  74065. webkitAnimationDelay: animationDelay
  74066. }
  74067. };
  74068. }
  74069. },
  74070. 'ios-small': {
  74071. dur: 1000,
  74072. lines: 12,
  74073. fn: function (dur, index, total) {
  74074. var transform = 'rotate(' + (30 * index + (index < 6 ? 180 : -180)) + 'deg)';
  74075. var animationDelay = -(dur - ((dur / total) * index)) + 'ms';
  74076. return {
  74077. y1: 12,
  74078. y2: 20,
  74079. style: {
  74080. transform: transform,
  74081. webkitTransform: transform,
  74082. animationDelay: animationDelay,
  74083. webkitAnimationDelay: animationDelay
  74084. }
  74085. };
  74086. }
  74087. },
  74088. bubbles: {
  74089. dur: 1000,
  74090. circles: 9,
  74091. fn: function (dur, index, total) {
  74092. var animationDelay = -(dur - ((dur / total) * index)) + 'ms';
  74093. return {
  74094. r: 5,
  74095. style: {
  74096. top: (9 * Math.sin(2 * Math.PI * index / total)) + 'px',
  74097. left: (9 * Math.cos(2 * Math.PI * index / total)) + 'px',
  74098. animationDelay: animationDelay,
  74099. webkitAnimationDelay: animationDelay
  74100. }
  74101. };
  74102. }
  74103. },
  74104. circles: {
  74105. dur: 1000,
  74106. circles: 8,
  74107. fn: function (dur, index, total) {
  74108. var animationDelay = -(dur - ((dur / total) * index)) + 'ms';
  74109. return {
  74110. r: 5,
  74111. style: {
  74112. top: (9 * Math.sin(2 * Math.PI * index / total)) + 'px',
  74113. left: (9 * Math.cos(2 * Math.PI * index / total)) + 'px',
  74114. animationDelay: animationDelay,
  74115. webkitAnimationDelay: animationDelay
  74116. }
  74117. };
  74118. }
  74119. },
  74120. crescent: {
  74121. dur: 750,
  74122. circles: 1,
  74123. fn: function () {
  74124. return {
  74125. r: 26,
  74126. style: {}
  74127. };
  74128. }
  74129. },
  74130. dots: {
  74131. dur: 750,
  74132. circles: 3,
  74133. fn: function (_dur, index) {
  74134. var animationDelay = -(110 * index) + 'ms';
  74135. return {
  74136. r: 6,
  74137. style: {
  74138. left: (9 - (9 * index)) + 'px',
  74139. animationDelay: animationDelay,
  74140. webkitAnimationDelay: animationDelay
  74141. }
  74142. };
  74143. }
  74144. }
  74145. };
  74146. //# sourceMappingURL=spinner.js.map
  74147. /***/ }),
  74148. /* 180 */
  74149. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  74150. "use strict";
  74151. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Tab; });
  74152. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  74153. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__app_app__ = __webpack_require__(6);
  74154. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__config_config__ = __webpack_require__(1);
  74155. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__navigation_deep_linker__ = __webpack_require__(14);
  74156. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__platform_dom_controller__ = __webpack_require__(8);
  74157. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__gestures_gesture_controller__ = __webpack_require__(7);
  74158. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__util_util__ = __webpack_require__(2);
  74159. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__navigation_nav_controller_base__ = __webpack_require__(42);
  74160. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__platform_platform__ = __webpack_require__(3);
  74161. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__tabs__ = __webpack_require__(92);
  74162. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__transitions_transition_controller__ = __webpack_require__(44);
  74163. var __extends = (this && this.__extends) || (function () {
  74164. var extendStatics = Object.setPrototypeOf ||
  74165. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  74166. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  74167. return function (d, b) {
  74168. extendStatics(d, b);
  74169. function __() { this.constructor = d; }
  74170. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  74171. };
  74172. })();
  74173. /**
  74174. * @name Tab
  74175. * @description
  74176. * The Tab component, written `<ion-tab>`, is styled based on the mode and should
  74177. * be used in conjunction with the [Tabs](../Tabs/) component.
  74178. *
  74179. * Each `ion-tab` is a declarative component for a [NavController](../../../navigation/NavController/).
  74180. * Basically, each tab is a `NavController`. For more information on using
  74181. * navigation controllers take a look at the [NavController API Docs](../../../navigation/NavController/).
  74182. *
  74183. * See the [Tabs API Docs](../Tabs/) for more details on configuring Tabs.
  74184. *
  74185. * @usage
  74186. *
  74187. * To add a basic tab, you can use the following markup where the `root` property
  74188. * is the page you want to load for that tab, `tabTitle` is the optional text to
  74189. * display on the tab, and `tabIcon` is the optional [icon](../../icon/Icon/).
  74190. *
  74191. * ```html
  74192. * <ion-tabs>
  74193. * <ion-tab [root]="chatRoot" tabTitle="Chat" tabIcon="chat"></ion-tab>
  74194. * </ion-tabs>
  74195. * ```
  74196. *
  74197. * Then, in your class you can set `chatRoot` to an imported class:
  74198. *
  74199. * ```ts
  74200. * import { ChatPage } from '../chat/chat';
  74201. *
  74202. * export class Tabs {
  74203. * // here we'll set the property of chatRoot to
  74204. * // the imported class of ChatPage
  74205. * chatRoot = ChatPage;
  74206. *
  74207. * constructor() {
  74208. *
  74209. * }
  74210. * }
  74211. * ```
  74212. *
  74213. * You can also pass some parameters to the root page of the tab through
  74214. * `rootParams`. Below we pass `chatParams` to the Chat tab:
  74215. *
  74216. * ```html
  74217. * <ion-tabs>
  74218. * <ion-tab [root]="chatRoot" [rootParams]="chatParams" tabTitle="Chat" tabIcon="chat"></ion-tab>
  74219. * </ion-tabs>
  74220. * ```
  74221. *
  74222. * ```ts
  74223. * export class Tabs {
  74224. * chatRoot = ChatPage;
  74225. *
  74226. * // set some user information on chatParams
  74227. * chatParams = {
  74228. * user1: 'admin',
  74229. * user2: 'ionic'
  74230. * };
  74231. *
  74232. * constructor() {
  74233. *
  74234. * }
  74235. * }
  74236. * ```
  74237. *
  74238. * And in `ChatPage` you can get the data from `NavParams`:
  74239. *
  74240. * ```ts
  74241. * export class ChatPage {
  74242. * constructor(navParams: NavParams) {
  74243. * console.log('Passed params', navParams.data);
  74244. * }
  74245. * }
  74246. * ```
  74247. *
  74248. * Sometimes you may want to call a method instead of navigating to a new
  74249. * page. You can use the `(ionSelect)` event to call a method on your class when
  74250. * the tab is selected. Below is an example of presenting a modal from one of
  74251. * the tabs.
  74252. *
  74253. * ```html
  74254. * <ion-tabs>
  74255. * <ion-tab (ionSelect)="chat()" tabTitle="Show Modal"></ion-tab>
  74256. * </ion-tabs>pop
  74257. * ```
  74258. *
  74259. * ```ts
  74260. * export class Tabs {
  74261. * constructor(public modalCtrl: ModalController) {
  74262. *
  74263. * }
  74264. *
  74265. * chat() {
  74266. * let modal = this.modalCtrl.create(ChatPage);
  74267. * modal.present();
  74268. * }
  74269. * }
  74270. * ```
  74271. *
  74272. *
  74273. * @demo /docs/demos/src/tabs/
  74274. * @see {@link /docs/components#tabs Tabs Component Docs}
  74275. * @see {@link ../../tabs/Tabs Tabs API Docs}
  74276. * @see {@link ../../nav/Nav Nav API Docs}
  74277. * @see {@link ../../nav/NavController NavController API Docs}
  74278. */
  74279. var Tab = (function (_super) {
  74280. __extends(Tab, _super);
  74281. function Tab(parent, app, config, plt, elementRef, zone, renderer, cfr, _cd, gestureCtrl, transCtrl, linker, _dom, errHandler) {
  74282. var _this =
  74283. // A Tab is a NavController for its child pages
  74284. _super.call(this, parent, app, config, plt, elementRef, zone, renderer, cfr, gestureCtrl, transCtrl, linker, _dom, errHandler) || this;
  74285. _this._cd = _cd;
  74286. _this.linker = linker;
  74287. _this._dom = _dom;
  74288. /**
  74289. * @hidden
  74290. */
  74291. _this._isEnabled = true;
  74292. /**
  74293. * @hidden
  74294. */
  74295. _this._isShown = true;
  74296. /**
  74297. * @output {Tab} Emitted when the current tab is selected.
  74298. */
  74299. _this.ionSelect = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  74300. _this.id = parent.add(_this);
  74301. _this._tabsHideOnSubPages = config.getBoolean('tabsHideOnSubPages');
  74302. _this._tabId = 'tabpanel-' + _this.id;
  74303. _this._btnId = 'tab-' + _this.id;
  74304. return _this;
  74305. }
  74306. Object.defineProperty(Tab.prototype, "enabled", {
  74307. /**
  74308. * @input {boolean} If true, enable the tab. If false,
  74309. * the user cannot interact with this element.
  74310. * Default: `true`.
  74311. */
  74312. get: function () {
  74313. return this._isEnabled;
  74314. },
  74315. set: function (val) {
  74316. this._isEnabled = Object(__WEBPACK_IMPORTED_MODULE_6__util_util__["o" /* isTrueProperty */])(val);
  74317. },
  74318. enumerable: true,
  74319. configurable: true
  74320. });
  74321. Object.defineProperty(Tab.prototype, "show", {
  74322. /**
  74323. * @input {boolean} If true, the tab button is visible within the
  74324. * tabbar. Default: `true`.
  74325. */
  74326. get: function () {
  74327. return this._isShown;
  74328. },
  74329. set: function (val) {
  74330. this._isShown = Object(__WEBPACK_IMPORTED_MODULE_6__util_util__["o" /* isTrueProperty */])(val);
  74331. },
  74332. enumerable: true,
  74333. configurable: true
  74334. });
  74335. Object.defineProperty(Tab.prototype, "tabsHideOnSubPages", {
  74336. /**
  74337. * @input {boolean} If true, hide the tabs on child pages.
  74338. */
  74339. get: function () {
  74340. return this._tabsHideOnSubPages;
  74341. },
  74342. set: function (val) {
  74343. this._tabsHideOnSubPages = Object(__WEBPACK_IMPORTED_MODULE_6__util_util__["o" /* isTrueProperty */])(val);
  74344. },
  74345. enumerable: true,
  74346. configurable: true
  74347. });
  74348. Object.defineProperty(Tab.prototype, "_vp", {
  74349. /**
  74350. * @hidden
  74351. */
  74352. set: function (val) {
  74353. this.setViewport(val);
  74354. },
  74355. enumerable: true,
  74356. configurable: true
  74357. });
  74358. /**
  74359. * @hidden
  74360. */
  74361. Tab.prototype.ngOnInit = function () {
  74362. this.tabBadgeStyle = this.tabBadgeStyle ? this.tabBadgeStyle : 'default';
  74363. };
  74364. /**
  74365. * @hidden
  74366. */
  74367. Tab.prototype.load = function (opts) {
  74368. var _this = this;
  74369. var segment = this._segment;
  74370. if (segment || (!this._loaded && this.root)) {
  74371. this.setElementClass('show-tab', true);
  74372. // okay, first thing we need to do if check if the view already exists
  74373. var nameToUse = segment && segment.name ? segment.name : this.root;
  74374. var dataToUse = segment ? segment.data : this.rootParams;
  74375. var numViews = this.length() - 1;
  74376. for (var i = numViews; i >= 0; i--) {
  74377. var viewController = this.getByIndex(i);
  74378. if (viewController && (viewController.id === nameToUse || viewController.component === nameToUse)) {
  74379. if (i === numViews) {
  74380. // this is the last view in the stack and it's the same
  74381. // as the segment so there's no change needed
  74382. return Promise.resolve();
  74383. }
  74384. else {
  74385. // it's not the exact view as the end
  74386. // let's have this nav go back to this exact view
  74387. return this.popTo(viewController, {
  74388. animate: false,
  74389. updateUrl: false,
  74390. });
  74391. }
  74392. }
  74393. }
  74394. var promise = null;
  74395. if (segment && segment.defaultHistory && segment.defaultHistory.length && this._views.length === 0) {
  74396. promise = this.linker.initViews(segment).then(function (views) {
  74397. return _this.setPages(views, opts);
  74398. });
  74399. }
  74400. else {
  74401. promise = this.push(nameToUse, dataToUse, opts);
  74402. }
  74403. return promise.then(function () {
  74404. _this._segment = null;
  74405. _this._loaded = true;
  74406. });
  74407. }
  74408. else {
  74409. // if this is not the Tab's initial load then we need
  74410. // to refresh the tabbar and content dimensions to be sure
  74411. // they're lined up correctly
  74412. this._dom.read(function () {
  74413. _this.resize();
  74414. });
  74415. return Promise.resolve();
  74416. }
  74417. };
  74418. /**
  74419. * @hidden
  74420. */
  74421. Tab.prototype.resize = function () {
  74422. var active = this.getActive();
  74423. if (!active) {
  74424. return;
  74425. }
  74426. var content = active.getIONContent();
  74427. content && content.resize();
  74428. };
  74429. /**
  74430. * @hidden
  74431. */
  74432. Tab.prototype._viewAttachToDOM = function (viewCtrl, componentRef, viewport) {
  74433. var isTabSubPage = (this._tabsHideOnSubPages && viewCtrl.index > 0);
  74434. if (isTabSubPage) {
  74435. viewport = this.parent.portal;
  74436. }
  74437. _super.prototype._viewAttachToDOM.call(this, viewCtrl, componentRef, viewport);
  74438. if (isTabSubPage) {
  74439. // add the .tab-subpage css class to tabs pages that should act like subpages
  74440. var pageEleRef = viewCtrl.pageRef();
  74441. if (pageEleRef) {
  74442. this._renderer.setElementClass(pageEleRef.nativeElement, 'tab-subpage', true);
  74443. }
  74444. }
  74445. };
  74446. /**
  74447. * @hidden
  74448. */
  74449. Tab.prototype.setSelected = function (isSelected) {
  74450. this.isSelected = isSelected;
  74451. this.setElementClass('show-tab', isSelected);
  74452. this.setElementAttribute('aria-hidden', (!isSelected).toString());
  74453. if (isSelected) {
  74454. // this is the selected tab, detect changes
  74455. this._cd.reattach();
  74456. }
  74457. else {
  74458. // this tab is not selected, do not detect changes
  74459. this._cd.detach();
  74460. }
  74461. };
  74462. Object.defineProperty(Tab.prototype, "index", {
  74463. /**
  74464. * @hidden
  74465. */
  74466. get: function () {
  74467. return this.parent.getIndex(this);
  74468. },
  74469. enumerable: true,
  74470. configurable: true
  74471. });
  74472. /**
  74473. * @hidden
  74474. */
  74475. Tab.prototype.updateHref = function (component, data) {
  74476. if (this.btn && this.linker) {
  74477. var href = this.linker.createUrl(this.parent, component, data) || '#';
  74478. this.btn.updateHref(href);
  74479. }
  74480. };
  74481. /**
  74482. * @hidden
  74483. */
  74484. Tab.prototype.ngOnDestroy = function () {
  74485. this.destroy();
  74486. };
  74487. /**
  74488. * @hidden
  74489. */
  74490. Tab.prototype.getType = function () {
  74491. return 'tab';
  74492. };
  74493. Tab.prototype.goToRoot = function (opts) {
  74494. return this.setRoot(this.root, this.rootParams, opts, null);
  74495. };
  74496. Tab.decorators = [
  74497. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  74498. selector: 'ion-tab',
  74499. template: '<div #viewport></div><div class="nav-decor"></div>',
  74500. host: {
  74501. '[attr.id]': '_tabId',
  74502. '[attr.aria-labelledby]': '_btnId',
  74503. 'role': 'tabpanel'
  74504. },
  74505. encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_11" /* ViewEncapsulation */].None,
  74506. },] },
  74507. ];
  74508. /** @nocollapse */
  74509. Tab.ctorParameters = function () { return [
  74510. { type: __WEBPACK_IMPORTED_MODULE_9__tabs__["a" /* Tabs */], },
  74511. { type: __WEBPACK_IMPORTED_MODULE_1__app_app__["a" /* App */], },
  74512. { type: __WEBPACK_IMPORTED_MODULE_2__config_config__["a" /* Config */], },
  74513. { type: __WEBPACK_IMPORTED_MODULE_8__platform_platform__["a" /* Platform */], },
  74514. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  74515. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["M" /* NgZone */], },
  74516. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  74517. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["o" /* ComponentFactoryResolver */], },
  74518. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["j" /* ChangeDetectorRef */], },
  74519. { type: __WEBPACK_IMPORTED_MODULE_5__gestures_gesture_controller__["l" /* GestureController */], },
  74520. { type: __WEBPACK_IMPORTED_MODULE_10__transitions_transition_controller__["a" /* TransitionController */], },
  74521. { type: __WEBPACK_IMPORTED_MODULE_3__navigation_deep_linker__["a" /* DeepLinker */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  74522. { type: __WEBPACK_IMPORTED_MODULE_4__platform_dom_controller__["a" /* DomController */], },
  74523. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["u" /* ErrorHandler */], },
  74524. ]; };
  74525. Tab.propDecorators = {
  74526. 'root': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  74527. 'rootParams': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  74528. 'tabUrlPath': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  74529. 'tabTitle': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  74530. 'tabIcon': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  74531. 'tabBadge': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  74532. 'tabBadgeStyle': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  74533. 'enabled': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  74534. 'show': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  74535. 'tabsHideOnSubPages': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  74536. 'ionSelect': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  74537. '_vp': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_8" /* ViewChild */], args: ['viewport', { read: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_10" /* ViewContainerRef */] },] },],
  74538. };
  74539. return Tab;
  74540. }(__WEBPACK_IMPORTED_MODULE_7__navigation_nav_controller_base__["a" /* NavControllerBase */]));
  74541. //# sourceMappingURL=tab.js.map
  74542. /***/ }),
  74543. /* 181 */
  74544. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  74545. "use strict";
  74546. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TabButton; });
  74547. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  74548. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__config_config__ = __webpack_require__(1);
  74549. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ion__ = __webpack_require__(4);
  74550. var __extends = (this && this.__extends) || (function () {
  74551. var extendStatics = Object.setPrototypeOf ||
  74552. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  74553. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  74554. return function (d, b) {
  74555. extendStatics(d, b);
  74556. function __() { this.constructor = d; }
  74557. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  74558. };
  74559. })();
  74560. /**
  74561. * @hidden
  74562. */
  74563. var TabButton = (function (_super) {
  74564. __extends(TabButton, _super);
  74565. function TabButton(config, elementRef, renderer) {
  74566. var _this = _super.call(this, config, elementRef, renderer) || this;
  74567. _this.ionSelect = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["v" /* EventEmitter */]();
  74568. _this.disHover = (config.get('hoverCSS') === false);
  74569. _this.layout = config.get('tabsLayout');
  74570. return _this;
  74571. }
  74572. TabButton.prototype.ngOnInit = function () {
  74573. this.tab.btn = this;
  74574. this.layout = this.tab.parent.tabsLayout || this.layout;
  74575. this.hasTitle = !!this.tab.tabTitle;
  74576. this.hasIcon = !!this.tab.tabIcon && this.layout !== 'icon-hide';
  74577. this.hasTitleOnly = (this.hasTitle && !this.hasIcon);
  74578. this.hasIconOnly = (this.hasIcon && !this.hasTitle);
  74579. this.hasBadge = !!this.tab.tabBadge;
  74580. };
  74581. TabButton.prototype.onClick = function () {
  74582. this.ionSelect.emit(this.tab);
  74583. return false;
  74584. };
  74585. TabButton.prototype.updateHref = function (href) {
  74586. this.setElementAttribute('href', href);
  74587. };
  74588. TabButton.decorators = [
  74589. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  74590. selector: '.tab-button',
  74591. template: '<ion-icon *ngIf="tab.tabIcon" [name]="tab.tabIcon" [isActive]="tab.isSelected" class="tab-button-icon"></ion-icon>' +
  74592. '<span *ngIf="tab.tabTitle" class="tab-button-text">{{tab.tabTitle}}</span>' +
  74593. '<ion-badge *ngIf="tab.tabBadge" class="tab-badge" [color]="tab.tabBadgeStyle">{{tab.tabBadge}}</ion-badge>' +
  74594. '<div class="button-effect"></div>',
  74595. host: {
  74596. '[attr.id]': 'tab._btnId',
  74597. '[attr.aria-controls]': 'tab._tabId',
  74598. '[attr.aria-selected]': 'tab.isSelected',
  74599. '[class.has-title]': 'hasTitle',
  74600. '[class.has-icon]': 'hasIcon',
  74601. '[class.has-title-only]': 'hasTitleOnly',
  74602. '[class.icon-only]': 'hasIconOnly',
  74603. '[class.has-badge]': 'hasBadge',
  74604. '[class.disable-hover]': 'disHover',
  74605. '[class.tab-disabled]': '!tab.enabled',
  74606. '[class.tab-hidden]': '!tab.show',
  74607. }
  74608. },] },
  74609. ];
  74610. /** @nocollapse */
  74611. TabButton.ctorParameters = function () { return [
  74612. { type: __WEBPACK_IMPORTED_MODULE_1__config_config__["a" /* Config */], },
  74613. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  74614. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  74615. ]; };
  74616. TabButton.propDecorators = {
  74617. 'tab': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  74618. 'ionSelect': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["O" /* Output */] },],
  74619. 'onClick': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["y" /* HostListener */], args: ['click',] },],
  74620. };
  74621. return TabButton;
  74622. }(__WEBPACK_IMPORTED_MODULE_2__ion__["a" /* Ion */]));
  74623. //# sourceMappingURL=tab-button.js.map
  74624. /***/ }),
  74625. /* 182 */
  74626. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  74627. "use strict";
  74628. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Toast; });
  74629. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_util__ = __webpack_require__(2);
  74630. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__app_app_constants__ = __webpack_require__(35);
  74631. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__toast_component__ = __webpack_require__(94);
  74632. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__toast_transitions__ = __webpack_require__(261);
  74633. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__navigation_view_controller__ = __webpack_require__(5);
  74634. var __extends = (this && this.__extends) || (function () {
  74635. var extendStatics = Object.setPrototypeOf ||
  74636. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  74637. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  74638. return function (d, b) {
  74639. extendStatics(d, b);
  74640. function __() { this.constructor = d; }
  74641. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  74642. };
  74643. })();
  74644. /**
  74645. * @hidden
  74646. */
  74647. var Toast = (function (_super) {
  74648. __extends(Toast, _super);
  74649. function Toast(app, opts, config) {
  74650. if (opts === void 0) { opts = {}; }
  74651. var _this = this;
  74652. opts.dismissOnPageChange = Object(__WEBPACK_IMPORTED_MODULE_0__util_util__["l" /* isPresent */])(opts.dismissOnPageChange) ? !!opts.dismissOnPageChange : false;
  74653. _this = _super.call(this, __WEBPACK_IMPORTED_MODULE_2__toast_component__["a" /* ToastCmp */], opts, null) || this;
  74654. _this._app = app;
  74655. // set the position to the bottom if not provided
  74656. if (!opts.position || !_this.isValidPosition(opts.position)) {
  74657. opts.position = TOAST_POSITION_BOTTOM;
  74658. }
  74659. _this.isOverlay = true;
  74660. config.setTransition('toast-slide-in', __WEBPACK_IMPORTED_MODULE_3__toast_transitions__["c" /* ToastSlideIn */]);
  74661. config.setTransition('toast-slide-out', __WEBPACK_IMPORTED_MODULE_3__toast_transitions__["d" /* ToastSlideOut */]);
  74662. config.setTransition('toast-md-slide-in', __WEBPACK_IMPORTED_MODULE_3__toast_transitions__["a" /* ToastMdSlideIn */]);
  74663. config.setTransition('toast-md-slide-out', __WEBPACK_IMPORTED_MODULE_3__toast_transitions__["b" /* ToastMdSlideOut */]);
  74664. config.setTransition('toast-wp-slide-out', __WEBPACK_IMPORTED_MODULE_3__toast_transitions__["f" /* ToastWpPopOut */]);
  74665. config.setTransition('toast-wp-slide-in', __WEBPACK_IMPORTED_MODULE_3__toast_transitions__["e" /* ToastWpPopIn */]);
  74666. return _this;
  74667. }
  74668. /**
  74669. * @hidden
  74670. */
  74671. Toast.prototype.getTransitionName = function (direction) {
  74672. var key = 'toast' + (direction === 'back' ? 'Leave' : 'Enter');
  74673. return this._nav && this._nav.config.get(key);
  74674. };
  74675. /**
  74676. * @hidden
  74677. */
  74678. Toast.prototype.isValidPosition = function (position) {
  74679. return position === TOAST_POSITION_TOP || position === TOAST_POSITION_MIDDLE || position === TOAST_POSITION_BOTTOM;
  74680. };
  74681. /**
  74682. * @param {string} message Toast message content
  74683. */
  74684. Toast.prototype.setMessage = function (message) {
  74685. this.data.message = message;
  74686. return this;
  74687. };
  74688. /**
  74689. * @param {number} dur Toast message duration
  74690. */
  74691. Toast.prototype.setDuration = function (dur) {
  74692. this.data.duration = dur;
  74693. return this;
  74694. };
  74695. /**
  74696. * @param {'top'|'middle'|'bottom'} pos Toast message position
  74697. */
  74698. Toast.prototype.setPosition = function (pos) {
  74699. this.data.position = pos;
  74700. return this;
  74701. };
  74702. /**
  74703. * @param {string} cssClass Toast message CSS class
  74704. */
  74705. Toast.prototype.setCssClass = function (cssClass) {
  74706. this.data.cssClass = cssClass;
  74707. return this;
  74708. };
  74709. /**
  74710. * @param {boolean} closeButton Toast message close button
  74711. */
  74712. Toast.prototype.setShowCloseButton = function (closeButton) {
  74713. this.data.showCloseButton = closeButton;
  74714. return this;
  74715. };
  74716. /**
  74717. * Present the toast instance.
  74718. *
  74719. * @param {NavOptions} [navOptions={}] Nav options to go with this transition.
  74720. * @returns {Promise} Returns a promise which is resolved when the transition has completed.
  74721. */
  74722. Toast.prototype.present = function (navOptions) {
  74723. if (navOptions === void 0) { navOptions = {}; }
  74724. navOptions.disableApp = false;
  74725. navOptions.keyboardClose = false;
  74726. return this._app.present(this, navOptions, __WEBPACK_IMPORTED_MODULE_1__app_app_constants__["d" /* PORTAL_TOAST */]);
  74727. };
  74728. /**
  74729. * Dismiss all toast components which have been presented.
  74730. */
  74731. Toast.prototype.dismissAll = function () {
  74732. this._nav && this._nav.popAll();
  74733. };
  74734. return Toast;
  74735. }(__WEBPACK_IMPORTED_MODULE_4__navigation_view_controller__["a" /* ViewController */]));
  74736. var TOAST_POSITION_TOP = 'top';
  74737. var TOAST_POSITION_MIDDLE = 'middle';
  74738. var TOAST_POSITION_BOTTOM = 'bottom';
  74739. //# sourceMappingURL=toast.js.map
  74740. /***/ }),
  74741. /* 183 */
  74742. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  74743. "use strict";
  74744. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ToastController; });
  74745. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  74746. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__app_app__ = __webpack_require__(6);
  74747. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__config_config__ = __webpack_require__(1);
  74748. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__toast__ = __webpack_require__(182);
  74749. /**
  74750. * @name ToastController
  74751. * @description
  74752. * A Toast is a subtle notification commonly used in modern applications.
  74753. * It can be used to provide feedback about an operation or to
  74754. * display a system message. The toast appears on top of the app's content,
  74755. * and can be dismissed by the app to resume user interaction with
  74756. * the app.
  74757. *
  74758. * ### Creating
  74759. * All of the toast options should be passed in the first argument of
  74760. * the create method: `create(opts)`. The message to display should be
  74761. * passed in the `message` property. The `showCloseButton` option can be set to
  74762. * true in order to display a close button on the toast. See the [create](#create)
  74763. * method below for all available options.
  74764. *
  74765. * ### Positioning
  74766. * Toasts can be positioned at the top, bottom or middle of the
  74767. * view port. The position can be passed to the `Toast.create(opts)` method.
  74768. * The position option is a string, and the values accepted are `top`, `bottom` and `middle`.
  74769. * If the position is not specified, the toast will be displayed at the bottom of the view port.
  74770. *
  74771. * ### Dismissing
  74772. * The toast can be dismissed automatically after a specific amount of time
  74773. * by passing the number of milliseconds to display it in the `duration` of
  74774. * the toast options. If `showCloseButton` is set to true, then the close button
  74775. * will dismiss the toast. To dismiss the toast after creation, call the `dismiss()`
  74776. * method on the Toast instance. The `onDidDismiss` function can be called to perform an action after the toast
  74777. * is dismissed.
  74778. *
  74779. * @usage
  74780. * ```ts
  74781. * import { ToastController } from 'ionic-angular';
  74782. *
  74783. * constructor(public toastCtrl: ToastController) { }
  74784. *
  74785. * presentToast() {
  74786. * const toast = this.toastCtrl.create({
  74787. * message: 'User was added successfully',
  74788. * duration: 3000,
  74789. * position: 'top'
  74790. * });
  74791. *
  74792. * toast.onDidDismiss(() => {
  74793. * console.log('Dismissed toast');
  74794. * });
  74795. *
  74796. * toast.present();
  74797. * }
  74798. * ```
  74799. * @advanced
  74800. * | Property | Type | Default | Description |
  74801. * |-----------------------|-----------|-----------------|---------------------------------------------------------------------------------------------------------------|
  74802. * | message | `string` | - | The message for the toast. Long strings will wrap and the toast container will expand. |
  74803. * | duration | `number` | - | How many milliseconds to wait before hiding the toast. By default, it will show until `dismiss()` is called. |
  74804. * | position | `string` | "bottom" | The position of the toast on the screen. Accepted values: "top", "middle", "bottom". |
  74805. * | cssClass | `string` | - | Additional classes for custom styles, separated by spaces. |
  74806. * | showCloseButton | `boolean` | false | Whether or not to show a button to close the toast. |
  74807. * | closeButtonText | `string` | "Close" | Text to display in the close button. |
  74808. * | dismissOnPageChange | `boolean` | false | Whether to dismiss the toast when navigating to a new page. |
  74809. *
  74810. * @demo /docs/demos/src/toast/
  74811. */
  74812. var ToastController = (function () {
  74813. function ToastController(_app, config) {
  74814. this._app = _app;
  74815. this.config = config;
  74816. }
  74817. /**
  74818. * Create a new toast component. See options below
  74819. * @param {ToastOptions} opts Toast options. See the below table for available options.
  74820. */
  74821. ToastController.prototype.create = function (opts) {
  74822. if (opts === void 0) { opts = {}; }
  74823. return new __WEBPACK_IMPORTED_MODULE_3__toast__["a" /* Toast */](this._app, opts, this.config);
  74824. };
  74825. ToastController.decorators = [
  74826. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */] },
  74827. ];
  74828. /** @nocollapse */
  74829. ToastController.ctorParameters = function () { return [
  74830. { type: __WEBPACK_IMPORTED_MODULE_1__app_app__["a" /* App */], },
  74831. { type: __WEBPACK_IMPORTED_MODULE_2__config_config__["a" /* Config */], },
  74832. ]; };
  74833. return ToastController;
  74834. }());
  74835. //# sourceMappingURL=toast-controller.js.map
  74836. /***/ }),
  74837. /* 184 */
  74838. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  74839. "use strict";
  74840. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Toggle; });
  74841. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  74842. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_forms__ = __webpack_require__(15);
  74843. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__config_config__ = __webpack_require__(1);
  74844. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__platform_dom_controller__ = __webpack_require__(8);
  74845. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_form__ = __webpack_require__(16);
  74846. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__gestures_gesture_controller__ = __webpack_require__(7);
  74847. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__tap_click_haptic__ = __webpack_require__(38);
  74848. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__util_util__ = __webpack_require__(2);
  74849. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__util_base_input__ = __webpack_require__(24);
  74850. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__item_item__ = __webpack_require__(17);
  74851. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__platform_key__ = __webpack_require__(18);
  74852. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__platform_platform__ = __webpack_require__(3);
  74853. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__toggle_gesture__ = __webpack_require__(262);
  74854. var __extends = (this && this.__extends) || (function () {
  74855. var extendStatics = Object.setPrototypeOf ||
  74856. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  74857. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  74858. return function (d, b) {
  74859. extendStatics(d, b);
  74860. function __() { this.constructor = d; }
  74861. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  74862. };
  74863. })();
  74864. /**
  74865. * @name Toggle
  74866. * @description
  74867. * A toggle technically is the same thing as an HTML checkbox input,
  74868. * except it looks different and is easier to use on a touch device.
  74869. * Toggles can also have colors assigned to them, by adding any color
  74870. * attribute.
  74871. *
  74872. * See the [Angular Docs](https://angular.io/docs/ts/latest/guide/forms.html)
  74873. * for more info on forms and inputs.
  74874. *
  74875. * @usage
  74876. * ```html
  74877. *
  74878. * <ion-list>
  74879. *
  74880. * <ion-item>
  74881. * <ion-label>Pepperoni</ion-label>
  74882. * <ion-toggle [(ngModel)]="pepperoni"></ion-toggle>
  74883. * </ion-item>
  74884. *
  74885. * <ion-item>
  74886. * <ion-label>Sausage</ion-label>
  74887. * <ion-toggle [(ngModel)]="sausage" disabled="true"></ion-toggle>
  74888. * </ion-item>
  74889. *
  74890. * <ion-item>
  74891. * <ion-label>Mushrooms</ion-label>
  74892. * <ion-toggle [(ngModel)]="mushrooms"></ion-toggle>
  74893. * </ion-item>
  74894. *
  74895. * </ion-list>
  74896. * ```
  74897. *
  74898. * @demo /docs/demos/src/toggle/
  74899. * @see {@link /docs/components#toggle Toggle Component Docs}
  74900. */
  74901. var Toggle = (function (_super) {
  74902. __extends(Toggle, _super);
  74903. function Toggle(form, config, _plt, elementRef, renderer, _haptic, item, _gestureCtrl, _domCtrl, _zone) {
  74904. var _this = _super.call(this, config, elementRef, renderer, 'toggle', false, form, item, null) || this;
  74905. _this._plt = _plt;
  74906. _this._haptic = _haptic;
  74907. _this._gestureCtrl = _gestureCtrl;
  74908. _this._domCtrl = _domCtrl;
  74909. _this._zone = _zone;
  74910. _this._activated = false;
  74911. return _this;
  74912. }
  74913. Object.defineProperty(Toggle.prototype, "checked", {
  74914. /**
  74915. * @input {boolean} If true, the element is selected.
  74916. */
  74917. get: function () {
  74918. return this.value;
  74919. },
  74920. set: function (val) {
  74921. this.value = val;
  74922. },
  74923. enumerable: true,
  74924. configurable: true
  74925. });
  74926. /**
  74927. * @hidden
  74928. */
  74929. Toggle.prototype.ngAfterContentInit = function () {
  74930. this._initialize();
  74931. this._gesture = new __WEBPACK_IMPORTED_MODULE_12__toggle_gesture__["a" /* ToggleGesture */](this._plt, this, this._gestureCtrl, this._domCtrl);
  74932. this._gesture.listen();
  74933. };
  74934. /**
  74935. * @hidden
  74936. */
  74937. Toggle.prototype._inputUpdated = function () { };
  74938. /**
  74939. * @hidden
  74940. */
  74941. Toggle.prototype._inputNormalize = function (val) {
  74942. return Object(__WEBPACK_IMPORTED_MODULE_7__util_util__["o" /* isTrueProperty */])(val);
  74943. };
  74944. /**
  74945. * @hidden
  74946. */
  74947. Toggle.prototype._onDragStart = function (startX) {
  74948. var _this = this;
  74949. (void 0) /* assert */;
  74950. (void 0) /* console.debug */;
  74951. this._zone.run(function () {
  74952. _this._startX = startX;
  74953. _this._fireFocus();
  74954. _this._activated = true;
  74955. });
  74956. };
  74957. /**
  74958. * @hidden
  74959. */
  74960. Toggle.prototype._onDragMove = function (currentX) {
  74961. var _this = this;
  74962. if (!this._startX) {
  74963. (void 0) /* assert */;
  74964. return;
  74965. }
  74966. if (this._shouldToggle(currentX, -15)) {
  74967. this._zone.run(function () {
  74968. _this.value = !_this.value;
  74969. _this._startX = currentX;
  74970. _this._haptic.selection();
  74971. });
  74972. }
  74973. };
  74974. /**
  74975. * @hidden
  74976. */
  74977. Toggle.prototype._onDragEnd = function (endX) {
  74978. var _this = this;
  74979. if (!this._startX) {
  74980. (void 0) /* assert */;
  74981. return;
  74982. }
  74983. (void 0) /* console.debug */;
  74984. this._zone.run(function () {
  74985. if (_this._shouldToggle(endX, 4)) {
  74986. _this.value = !_this.value;
  74987. _this._haptic.selection();
  74988. }
  74989. _this._activated = false;
  74990. _this._fireBlur();
  74991. _this._startX = null;
  74992. });
  74993. };
  74994. /**
  74995. * @hidden
  74996. */
  74997. Toggle.prototype._shouldToggle = function (currentX, margin) {
  74998. var isLTR = !this._plt.isRTL;
  74999. var startX = this._startX;
  75000. if (this._value) {
  75001. return (isLTR && (startX + margin > currentX)) ||
  75002. (!isLTR && (startX - margin < currentX));
  75003. }
  75004. else {
  75005. return (isLTR && (startX - margin < currentX)) ||
  75006. (!isLTR && (startX + margin > currentX));
  75007. }
  75008. };
  75009. /**
  75010. * @hidden
  75011. */
  75012. Toggle.prototype._keyup = function (ev) {
  75013. if (ev.keyCode === __WEBPACK_IMPORTED_MODULE_10__platform_key__["f" /* KEY_SPACE */] || ev.keyCode === __WEBPACK_IMPORTED_MODULE_10__platform_key__["b" /* KEY_ENTER */]) {
  75014. (void 0) /* console.debug */;
  75015. ev.preventDefault();
  75016. ev.stopPropagation();
  75017. this.value = !this.value;
  75018. }
  75019. };
  75020. /**
  75021. * @hidden
  75022. */
  75023. Toggle.prototype.ngOnDestroy = function () {
  75024. _super.prototype.ngOnDestroy.call(this);
  75025. this._gesture && this._gesture.destroy();
  75026. };
  75027. Toggle.decorators = [
  75028. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  75029. selector: 'ion-toggle',
  75030. template: '<div class="toggle-icon">' +
  75031. '<div class="toggle-inner"></div>' +
  75032. '</div>' +
  75033. '<button role="checkbox" ' +
  75034. 'type="button" ' +
  75035. 'ion-button="item-cover" ' +
  75036. '[id]="id" ' +
  75037. '[attr.aria-checked]="_value" ' +
  75038. '[attr.aria-labelledby]="_labelId" ' +
  75039. '[attr.aria-disabled]="_disabled" ' +
  75040. 'class="item-cover" disable-activated>' +
  75041. '</button>',
  75042. host: {
  75043. '[class.toggle-disabled]': '_disabled',
  75044. '[class.toggle-checked]': '_value',
  75045. '[class.toggle-activated]': '_activated',
  75046. },
  75047. providers: [{ provide: __WEBPACK_IMPORTED_MODULE_1__angular_forms__["b" /* NG_VALUE_ACCESSOR */], useExisting: Toggle, multi: true }],
  75048. encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_11" /* ViewEncapsulation */].None,
  75049. },] },
  75050. ];
  75051. /** @nocollapse */
  75052. Toggle.ctorParameters = function () { return [
  75053. { type: __WEBPACK_IMPORTED_MODULE_4__util_form__["a" /* Form */], },
  75054. { type: __WEBPACK_IMPORTED_MODULE_2__config_config__["a" /* Config */], },
  75055. { type: __WEBPACK_IMPORTED_MODULE_11__platform_platform__["a" /* Platform */], },
  75056. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  75057. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  75058. { type: __WEBPACK_IMPORTED_MODULE_6__tap_click_haptic__["a" /* Haptic */], },
  75059. { type: __WEBPACK_IMPORTED_MODULE_9__item_item__["a" /* Item */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  75060. { type: __WEBPACK_IMPORTED_MODULE_5__gestures_gesture_controller__["l" /* GestureController */], },
  75061. { type: __WEBPACK_IMPORTED_MODULE_3__platform_dom_controller__["a" /* DomController */], },
  75062. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["M" /* NgZone */], },
  75063. ]; };
  75064. Toggle.propDecorators = {
  75065. 'checked': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  75066. '_keyup': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["y" /* HostListener */], args: ['keyup', ['$event'],] },],
  75067. };
  75068. return Toggle;
  75069. }(__WEBPACK_IMPORTED_MODULE_8__util_base_input__["a" /* BaseInput */]));
  75070. //# sourceMappingURL=toggle.js.map
  75071. /***/ }),
  75072. /* 185 */
  75073. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  75074. "use strict";
  75075. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Footer; });
  75076. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  75077. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__config_config__ = __webpack_require__(1);
  75078. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ion__ = __webpack_require__(4);
  75079. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__navigation_view_controller__ = __webpack_require__(5);
  75080. var __extends = (this && this.__extends) || (function () {
  75081. var extendStatics = Object.setPrototypeOf ||
  75082. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  75083. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  75084. return function (d, b) {
  75085. extendStatics(d, b);
  75086. function __() { this.constructor = d; }
  75087. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  75088. };
  75089. })();
  75090. /**
  75091. * @name Footer
  75092. * @description
  75093. * Footer is a root component of a page that sits at the bottom of the page.
  75094. * Footer can be a wrapper for `ion-toolbar` to make sure the content area is sized correctly.
  75095. *
  75096. * @usage
  75097. *
  75098. * ```html
  75099. * <ion-content></ion-content>
  75100. *
  75101. * <ion-footer>
  75102. * <ion-toolbar>
  75103. * <ion-title>Footer</ion-title>
  75104. * </ion-toolbar>
  75105. * </ion-footer>
  75106. * ```
  75107. *
  75108. */
  75109. var Footer = (function (_super) {
  75110. __extends(Footer, _super);
  75111. function Footer(config, elementRef, renderer, viewCtrl) {
  75112. var _this = _super.call(this, config, elementRef, renderer, 'footer') || this;
  75113. viewCtrl && viewCtrl._setFooter(_this);
  75114. return _this;
  75115. }
  75116. Footer.decorators = [
  75117. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  75118. selector: 'ion-footer'
  75119. },] },
  75120. ];
  75121. /** @nocollapse */
  75122. Footer.ctorParameters = function () { return [
  75123. { type: __WEBPACK_IMPORTED_MODULE_1__config_config__["a" /* Config */], },
  75124. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  75125. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  75126. { type: __WEBPACK_IMPORTED_MODULE_3__navigation_view_controller__["a" /* ViewController */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  75127. ]; };
  75128. return Footer;
  75129. }(__WEBPACK_IMPORTED_MODULE_2__ion__["a" /* Ion */]));
  75130. //# sourceMappingURL=toolbar-footer.js.map
  75131. /***/ }),
  75132. /* 186 */
  75133. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  75134. "use strict";
  75135. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Header; });
  75136. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  75137. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__config_config__ = __webpack_require__(1);
  75138. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ion__ = __webpack_require__(4);
  75139. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__navigation_view_controller__ = __webpack_require__(5);
  75140. var __extends = (this && this.__extends) || (function () {
  75141. var extendStatics = Object.setPrototypeOf ||
  75142. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  75143. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  75144. return function (d, b) {
  75145. extendStatics(d, b);
  75146. function __() { this.constructor = d; }
  75147. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  75148. };
  75149. })();
  75150. /**
  75151. * @name Header
  75152. * @description
  75153. * Header is a parent component that holds the navbar and toolbar component.
  75154. * It's important to note that `ion-header` needs to be one of the three root elements of a page
  75155. *
  75156. * @usage
  75157. *
  75158. * ```html
  75159. * <ion-header>
  75160. * <ion-navbar>
  75161. * <ion-title>Page1</ion-title>
  75162. * </ion-navbar>
  75163. *
  75164. * <ion-toolbar>
  75165. * <ion-title>Subheader</ion-title>
  75166. * </ion-toolbar>
  75167. * </ion-header>
  75168. *
  75169. * <ion-content></ion-content>
  75170. * ```
  75171. *
  75172. */
  75173. var Header = (function (_super) {
  75174. __extends(Header, _super);
  75175. function Header(config, elementRef, renderer, viewCtrl) {
  75176. var _this = _super.call(this, config, elementRef, renderer, 'header') || this;
  75177. viewCtrl && viewCtrl._setHeader(_this);
  75178. return _this;
  75179. }
  75180. Header.decorators = [
  75181. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  75182. selector: 'ion-header'
  75183. },] },
  75184. ];
  75185. /** @nocollapse */
  75186. Header.ctorParameters = function () { return [
  75187. { type: __WEBPACK_IMPORTED_MODULE_1__config_config__["a" /* Config */], },
  75188. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  75189. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  75190. { type: __WEBPACK_IMPORTED_MODULE_3__navigation_view_controller__["a" /* ViewController */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  75191. ]; };
  75192. return Header;
  75193. }(__WEBPACK_IMPORTED_MODULE_2__ion__["a" /* Ion */]));
  75194. //# sourceMappingURL=toolbar-header.js.map
  75195. /***/ }),
  75196. /* 187 */
  75197. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  75198. "use strict";
  75199. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ToolbarItem; });
  75200. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  75201. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__button_button__ = __webpack_require__(36);
  75202. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__config_config__ = __webpack_require__(1);
  75203. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ion__ = __webpack_require__(4);
  75204. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__navbar__ = __webpack_require__(40);
  75205. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__toolbar__ = __webpack_require__(49);
  75206. var __extends = (this && this.__extends) || (function () {
  75207. var extendStatics = Object.setPrototypeOf ||
  75208. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  75209. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  75210. return function (d, b) {
  75211. extendStatics(d, b);
  75212. function __() { this.constructor = d; }
  75213. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  75214. };
  75215. })();
  75216. /**
  75217. * @hidden
  75218. */
  75219. var ToolbarItem = (function (_super) {
  75220. __extends(ToolbarItem, _super);
  75221. function ToolbarItem(config, elementRef, renderer, toolbar, navbar) {
  75222. var _this = _super.call(this, config, elementRef, renderer, 'bar-buttons') || this;
  75223. _this.inToolbar = !!(toolbar || navbar);
  75224. return _this;
  75225. }
  75226. Object.defineProperty(ToolbarItem.prototype, "_buttons", {
  75227. set: function (buttons) {
  75228. if (this.inToolbar) {
  75229. buttons.forEach(function (button) {
  75230. button.setRole('bar-button');
  75231. });
  75232. }
  75233. },
  75234. enumerable: true,
  75235. configurable: true
  75236. });
  75237. ToolbarItem.decorators = [
  75238. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  75239. selector: 'ion-buttons,[menuToggle]'
  75240. },] },
  75241. ];
  75242. /** @nocollapse */
  75243. ToolbarItem.ctorParameters = function () { return [
  75244. { type: __WEBPACK_IMPORTED_MODULE_2__config_config__["a" /* Config */], },
  75245. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  75246. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  75247. { type: __WEBPACK_IMPORTED_MODULE_5__toolbar__["a" /* Toolbar */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  75248. { type: __WEBPACK_IMPORTED_MODULE_4__navbar__["a" /* Navbar */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["z" /* Inject */], args: [Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_14" /* forwardRef */])(function () { return __WEBPACK_IMPORTED_MODULE_4__navbar__["a" /* Navbar */]; }),] },] },
  75249. ]; };
  75250. ToolbarItem.propDecorators = {
  75251. '_buttons': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["r" /* ContentChildren */], args: [__WEBPACK_IMPORTED_MODULE_1__button_button__["a" /* Button */],] },],
  75252. };
  75253. return ToolbarItem;
  75254. }(__WEBPACK_IMPORTED_MODULE_3__ion__["a" /* Ion */]));
  75255. //# sourceMappingURL=toolbar-item.js.map
  75256. /***/ }),
  75257. /* 188 */
  75258. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  75259. "use strict";
  75260. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ToolbarTitle; });
  75261. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  75262. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__config_config__ = __webpack_require__(1);
  75263. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ion__ = __webpack_require__(4);
  75264. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__navbar__ = __webpack_require__(40);
  75265. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__toolbar__ = __webpack_require__(49);
  75266. var __extends = (this && this.__extends) || (function () {
  75267. var extendStatics = Object.setPrototypeOf ||
  75268. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  75269. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  75270. return function (d, b) {
  75271. extendStatics(d, b);
  75272. function __() { this.constructor = d; }
  75273. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  75274. };
  75275. })();
  75276. /**
  75277. * @name Title
  75278. * @description
  75279. * `ion-title` is a component that sets the title of the `Toolbar` or `Navbar`
  75280. *
  75281. * @usage
  75282. *
  75283. * ```html
  75284. * <ion-header>
  75285. *
  75286. * <ion-navbar>
  75287. * <ion-title>Settings</ion-title>
  75288. * </ion-navbar>
  75289. *
  75290. * </ion-header>
  75291. * ```
  75292. *
  75293. * Or to create a navbar with a toolbar as a subheader:
  75294. *
  75295. * ```html
  75296. * <ion-header>
  75297. *
  75298. * <ion-navbar>
  75299. * <ion-title>Main Header</ion-title>
  75300. * </ion-navbar>
  75301. *
  75302. * <ion-toolbar>
  75303. * <ion-title>Subheader</ion-title>
  75304. * </ion-toolbar>
  75305. *
  75306. * </ion-header>
  75307. * ```
  75308. *
  75309. * @demo /docs/demos/src/title/
  75310. */
  75311. var ToolbarTitle = (function (_super) {
  75312. __extends(ToolbarTitle, _super);
  75313. function ToolbarTitle(config, elementRef, renderer, toolbar, navbar) {
  75314. var _this = _super.call(this, config, elementRef, renderer, 'title') || this;
  75315. toolbar && toolbar._setTitle(_this);
  75316. navbar && navbar._setTitle(_this);
  75317. return _this;
  75318. }
  75319. /**
  75320. * @hidden
  75321. */
  75322. ToolbarTitle.prototype.getTitleText = function () {
  75323. return this._elementRef.nativeElement.textContent;
  75324. };
  75325. ToolbarTitle.decorators = [
  75326. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */], args: [{
  75327. selector: 'ion-title',
  75328. template: '<div class="toolbar-title" [ngClass]="\'toolbar-title-\' + _mode">' +
  75329. '<ng-content></ng-content>' +
  75330. '</div>',
  75331. changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["i" /* ChangeDetectionStrategy */].OnPush,
  75332. encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_11" /* ViewEncapsulation */].None,
  75333. },] },
  75334. ];
  75335. /** @nocollapse */
  75336. ToolbarTitle.ctorParameters = function () { return [
  75337. { type: __WEBPACK_IMPORTED_MODULE_1__config_config__["a" /* Config */], },
  75338. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  75339. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  75340. { type: __WEBPACK_IMPORTED_MODULE_4__toolbar__["a" /* Toolbar */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] },] },
  75341. { type: __WEBPACK_IMPORTED_MODULE_3__navbar__["a" /* Navbar */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */] }, { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["z" /* Inject */], args: [Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_14" /* forwardRef */])(function () { return __WEBPACK_IMPORTED_MODULE_3__navbar__["a" /* Navbar */]; }),] },] },
  75342. ]; };
  75343. return ToolbarTitle;
  75344. }(__WEBPACK_IMPORTED_MODULE_2__ion__["a" /* Ion */]));
  75345. //# sourceMappingURL=toolbar-title.js.map
  75346. /***/ }),
  75347. /* 189 */
  75348. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  75349. "use strict";
  75350. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Thumbnail; });
  75351. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  75352. /**
  75353. * @name Thumbnail
  75354. * @module ionic
  75355. * @description
  75356. * A Thumbnail is a component that creates a squared image for an item.
  75357. * Thumbnails can be place on the left or right side of an item with the `item-start` or `item-end` directive.
  75358. * @see {@link /docs/components/#thumbnail-list Thumbnail Component Docs}
  75359. */
  75360. var Thumbnail = (function () {
  75361. function Thumbnail() {
  75362. }
  75363. Thumbnail.decorators = [
  75364. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  75365. selector: 'ion-thumbnail'
  75366. },] },
  75367. ];
  75368. /** @nocollapse */
  75369. Thumbnail.ctorParameters = function () { return []; };
  75370. return Thumbnail;
  75371. }());
  75372. //# sourceMappingURL=thumbnail.js.map
  75373. /***/ }),
  75374. /* 190 */
  75375. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  75376. "use strict";
  75377. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Typography; });
  75378. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  75379. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__config_config__ = __webpack_require__(1);
  75380. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ion__ = __webpack_require__(4);
  75381. var __extends = (this && this.__extends) || (function () {
  75382. var extendStatics = Object.setPrototypeOf ||
  75383. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  75384. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  75385. return function (d, b) {
  75386. extendStatics(d, b);
  75387. function __() { this.constructor = d; }
  75388. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  75389. };
  75390. })();
  75391. /**
  75392. * @name Typography
  75393. * @module ionic
  75394. * @description
  75395. *
  75396. * The Typography component is a simple component that can be used to style the text color of any element.
  75397. * The `ion-text` attribute should be added to the element in order to pass a color from the Sass `$colors`
  75398. * map and change the text color of that element.
  75399. *
  75400. * @usage
  75401. *
  75402. * ```html
  75403. * <h1 ion-text color="secondary">H1: The quick brown fox jumps over the lazy dog</h1>
  75404. *
  75405. * <h2 ion-text color="primary">H2: The quick brown fox jumps over the lazy dog</h2>
  75406. *
  75407. * <h3 ion-text color="light">H3: The quick brown fox jumps over the lazy dog</h3>
  75408. *
  75409. * <h4 ion-text color="danger">H4: The quick brown fox jumps over the lazy dog</h4>
  75410. *
  75411. * <h5 ion-text color="dark">H5: The quick brown fox jumps over the lazy dog</h5>
  75412. *
  75413. * <h6 ion-text [color]="dynamicColor">H6: The quick brown fox jumps over the lazy dog</h6>
  75414. *
  75415. * <p>
  75416. * I saw a werewolf with a Chinese menu in his hand.
  75417. * Walking through the <sub ion-text color="danger">streets</sub> of Soho in the rain.
  75418. * He <i ion-text color="primary">was</i> looking for a place called Lee Ho Fook's.
  75419. * Gonna get a <a ion-text color="secondary">big dish of beef chow mein.</a>
  75420. * </p>
  75421. *
  75422. * <p>
  75423. * He's the hairy-handed gent who ran amuck in Kent.
  75424. * Lately he's <sup ion-text color="primary">been</sup> overheard in Mayfair.
  75425. * Better stay away from him.
  75426. * He'll rip your lungs out, Jim.
  75427. * I'd like to meet his tailor.
  75428. * </p>
  75429. * ```
  75430. *
  75431. */
  75432. var Typography = (function (_super) {
  75433. __extends(Typography, _super);
  75434. function Typography(config, elementRef, renderer) {
  75435. return _super.call(this, config, elementRef, renderer, 'text') || this;
  75436. }
  75437. Typography.decorators = [
  75438. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  75439. selector: '[ion-text]'
  75440. },] },
  75441. ];
  75442. /** @nocollapse */
  75443. Typography.ctorParameters = function () { return [
  75444. { type: __WEBPACK_IMPORTED_MODULE_1__config_config__["a" /* Config */], },
  75445. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  75446. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  75447. ]; };
  75448. return Typography;
  75449. }(__WEBPACK_IMPORTED_MODULE_2__ion__["a" /* Ion */]));
  75450. //# sourceMappingURL=typography.js.map
  75451. /***/ }),
  75452. /* 191 */
  75453. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  75454. "use strict";
  75455. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VirtualScroll; });
  75456. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  75457. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__virtual_util__ = __webpack_require__(263);
  75458. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__config_config__ = __webpack_require__(1);
  75459. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__content_content__ = __webpack_require__(19);
  75460. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__platform_dom_controller__ = __webpack_require__(8);
  75461. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_util__ = __webpack_require__(2);
  75462. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__platform_platform__ = __webpack_require__(3);
  75463. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__navigation_view_controller__ = __webpack_require__(5);
  75464. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__virtual_item__ = __webpack_require__(97);
  75465. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__virtual_footer__ = __webpack_require__(95);
  75466. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__virtual_header__ = __webpack_require__(96);
  75467. /**
  75468. * @name VirtualScroll
  75469. * @description
  75470. * Virtual Scroll displays a virtual, "infinite" list. An array of records
  75471. * is passed to the virtual scroll containing the data to create templates
  75472. * for. The template created for each record, referred to as a cell, can
  75473. * consist of items, headers, and footers.
  75474. *
  75475. * For performance reasons, not every record in the list is rendered at once;
  75476. * instead a small subset of records (enough to fill the viewport) are rendered
  75477. * and reused as the user scrolls.
  75478. *
  75479. * ### The Basics
  75480. *
  75481. * The array of records should be passed to the `virtualScroll` property.
  75482. * The data given to the `virtualScroll` property must be an array. An item
  75483. * template with the `*virtualItem` property is required in the `virtualScroll`.
  75484. * The `virtualScroll` and `*virtualItem` properties can be added to any element.
  75485. *
  75486. * ```html
  75487. * <ion-list [virtualScroll]="items">
  75488. *
  75489. * <ion-item *virtualItem="let item">
  75490. * {% raw %}{{ item }}{% endraw %}
  75491. * </ion-item>
  75492. *
  75493. * </ion-list>
  75494. * ```
  75495. *
  75496. *
  75497. * ### Section Headers and Footers
  75498. *
  75499. * Section headers and footers are optional. They can be dynamically created
  75500. * from developer-defined functions. For example, a large list of contacts
  75501. * usually has a divider for each letter in the alphabet. Developers provide
  75502. * their own custom function to be called on each record. The logic in the
  75503. * custom function should determine whether to create the section template
  75504. * and what data to provide to the template. The custom function should
  75505. * return `null` if a template shouldn't be created.
  75506. *
  75507. * ```html
  75508. * <ion-list [virtualScroll]="items" [headerFn]="myHeaderFn">
  75509. *
  75510. * <ion-item-divider *virtualHeader="let header">
  75511. * Header: {% raw %}{{ header }}{% endraw %}
  75512. * </ion-item-divider>
  75513. *
  75514. * <ion-item *virtualItem="let item">
  75515. * Item: {% raw %}{{ item }}{% endraw %}
  75516. * </ion-item>
  75517. *
  75518. * </ion-list>
  75519. * ```
  75520. *
  75521. * Below is an example of a custom function called on every record. It
  75522. * gets passed the individual record, the record's index number,
  75523. * and the entire array of records. In this example, after every 20
  75524. * records a header will be inserted. So between the 19th and 20th records,
  75525. * between the 39th and 40th, and so on, a `<ion-item-divider>` will
  75526. * be created and the template's data will come from the function's
  75527. * returned data.
  75528. *
  75529. * ```ts
  75530. * myHeaderFn(record, recordIndex, records) {
  75531. * if (recordIndex % 20 === 0) {
  75532. * return 'Header ' + recordIndex;
  75533. * }
  75534. * return null;
  75535. * }
  75536. * ```
  75537. *
  75538. *
  75539. * ### Approximate Widths and Heights
  75540. *
  75541. * If the height of items in the virtual scroll are not close to the
  75542. * default size of 40px, it is extremely important to provide a value for
  75543. * approxItemHeight height. An exact pixel-perfect size is not necessary,
  75544. * but without an estimate the virtual scroll will not render correctly.
  75545. *
  75546. * The approximate width and height of each template is used to help
  75547. * determine how many cells should be created, and to help calculate
  75548. * the height of the scrollable area. Note that the actual rendered size
  75549. * of each cell comes from the app's CSS, whereas this approximation
  75550. * is only used to help calculate initial dimensions.
  75551. *
  75552. * It's also important to know that Ionic's default item sizes have
  75553. * slightly different heights between platforms, which is perfectly fine.
  75554. *
  75555. *
  75556. * ### Images Within Virtual Scroll
  75557. *
  75558. * HTTP requests, image decoding, and image rendering can cause jank while
  75559. * scrolling. In order to better control images, Ionic provides `<ion-img>`
  75560. * to manage HTTP requests and image rendering. While scrolling through items
  75561. * quickly, `<ion-img>` knows when and when not to make requests, when and
  75562. * when not to render images, and only loads the images that are viewable
  75563. * after scrolling. [Read more about `ion-img`.](../../img/Img/)
  75564. *
  75565. * It's also important for app developers to ensure image sizes are locked in,
  75566. * and after images have fully loaded they do not change size and affect any
  75567. * other element sizes. Simply put, to ensure rendering bugs are not introduced,
  75568. * it's vital that elements within a virtual item does not dynamically change.
  75569. *
  75570. * For virtual scrolling, the natural effects of the `<img>` are not desirable
  75571. * features. We recommend using the `<ion-img>` component over the native
  75572. * `<img>` element because when an `<img>` element is added to the DOM, it
  75573. * immediately makes a HTTP request for the image file. Additionally, `<img>`
  75574. * renders whenever it wants which could be while the user is scrolling. However,
  75575. * `<ion-img>` is governed by the containing `ion-content` and does not render
  75576. * images while scrolling quickly.
  75577. *
  75578. * ```html
  75579. * <ion-list [virtualScroll]="items">
  75580. *
  75581. * <ion-item *virtualItem="let item">
  75582. * <ion-avatar item-start>
  75583. * <ion-img [src]="item.avatarUrl"></ion-img>
  75584. * </ion-avatar>
  75585. * {% raw %} {{ item.firstName }} {{ item.lastName }}{% endraw %}
  75586. * </ion-item>
  75587. *
  75588. * </ion-list>
  75589. * ```
  75590. *
  75591. *
  75592. * ### Custom Components
  75593. *
  75594. * If a custom component is going to be used within Virtual Scroll, it's best
  75595. * to wrap it with a good old `<div>` to ensure the component is rendered
  75596. * correctly. Since each custom component's implementation and internals can be
  75597. * quite different, wrapping within a `<div>` is a safe way to make sure
  75598. * dimensions are measured correctly.
  75599. *
  75600. * ```html
  75601. * <ion-list [virtualScroll]="items">
  75602. *
  75603. * <div *virtualItem="let item">
  75604. * <my-custom-item [item]="item">
  75605. * {% raw %} {{ item }}{% endraw %}
  75606. * </my-custom-item>
  75607. * </div>
  75608. *
  75609. * </ion-list>
  75610. * ```
  75611. *
  75612. *
  75613. * ## Virtual Scroll Performance Tips
  75614. *
  75615. * #### iOS Cordova WKWebView
  75616. *
  75617. * When deploying to iOS with Cordova, it's highly recommended to use the
  75618. * [WKWebView plugin](http://blog.ionic.io/cordova-ios-performance-improvements-drop-in-speed-with-wkwebview/)
  75619. * in order to take advantage of iOS's higher performimg webview. Additionally,
  75620. * WKWebView is superior at scrolling efficiently in comparision to the older
  75621. * UIWebView.
  75622. *
  75623. * #### Lock in element dimensions and locations
  75624. *
  75625. * In order for virtual scroll to efficiently size and locate every item, it's
  75626. * very important every element within each virtual item does not dynamically
  75627. * change its dimensions or location. The best way to ensure size and location
  75628. * does not change, it's recommended each virtual item has locked in its size
  75629. * via CSS.
  75630. *
  75631. * #### Use `ion-img` for images
  75632. *
  75633. * When including images within Virtual Scroll, be sure to use
  75634. * [`ion-img`](../img/Img/) rather than the standard `<img>` HTML element.
  75635. * With `ion-img`, images are lazy loaded so only the viewable ones are
  75636. * rendered, and HTTP requests are efficiently controlled while scrolling.
  75637. *
  75638. * #### Set Approximate Widths and Heights
  75639. *
  75640. * As mentioned above, all elements should lock in their dimensions. However,
  75641. * virtual scroll isn't aware of the dimensions until after they have been
  75642. * rendered. For the initial render, virtual scroll still needs to set
  75643. * how many items should be built. With "approx" property inputs, such as
  75644. * `approxItemHeight`, we're able to give virtual scroll an approximate size,
  75645. * therefore allowing virtual scroll to decide how many items should be
  75646. * created.
  75647. *
  75648. * #### Changing dataset should use `virtualTrackBy`
  75649. *
  75650. * It is possible for the identities of elements in the iterator to change
  75651. * while the data does not. This can happen, for example, if the iterator
  75652. * produced from an RPC to the server, and that RPC is re-run. Even if the
  75653. * "data" hasn't changed, the second response will produce objects with
  75654. * different identities, and Ionic will tear down the entire DOM and rebuild
  75655. * it. This is an expensive operation and should be avoided if possible.
  75656. *
  75657. * #### Efficient headers and footer functions
  75658. *
  75659. * Each virtual item must stay extremely efficient, but one way to really
  75660. * kill its performance is to perform any DOM operations within section header
  75661. * and footer functions. These functions are called for every record in the
  75662. * dataset, so please make sure they're performant.
  75663. *
  75664. */
  75665. var VirtualScroll = (function () {
  75666. function VirtualScroll(_iterableDiffers, _elementRef, _renderer, _zone, _cd, _content, _plt, _ctrl, _config, _dom) {
  75667. var _this = this;
  75668. this._iterableDiffers = _iterableDiffers;
  75669. this._elementRef = _elementRef;
  75670. this._renderer = _renderer;
  75671. this._zone = _zone;
  75672. this._cd = _cd;
  75673. this._content = _content;
  75674. this._plt = _plt;
  75675. this._ctrl = _ctrl;
  75676. this._config = _config;
  75677. this._dom = _dom;
  75678. this._init = false;
  75679. this._lastEle = false;
  75680. this._records = [];
  75681. this._cells = [];
  75682. this._nodes = [];
  75683. this._vHeight = 0;
  75684. this._lastCheck = 0;
  75685. this._recordSize = 0;
  75686. this._data = {
  75687. scrollTop: 0,
  75688. };
  75689. this._queue = 1 /* NoChanges */;
  75690. /**
  75691. * @input {number} The buffer ratio is used to decide how many cells
  75692. * should get created when initially rendered. The number is a
  75693. * multiplier against the viewable area's height. For example, if it
  75694. * takes `20` cells to fill up the height of the viewable area, then
  75695. * with a buffer ratio of `3` it will create `60` cells that are
  75696. * available for reuse while scrolling. For better performance, it's
  75697. * better to have more cells than what are required to fill the
  75698. * viewable area. Default is `3`.
  75699. */
  75700. this.bufferRatio = 3;
  75701. /**
  75702. * @input {string} The approximate width of each item template's cell.
  75703. * This dimension is used to help determine how many cells should
  75704. * be created when initialized, and to help calculate the height of
  75705. * the scrollable area. This value can use either `px` or `%` units.
  75706. * Note that the actual rendered size of each cell comes from the
  75707. * app's CSS, whereas this approximation is used to help calculate
  75708. * initial dimensions before the item has been rendered. Default is
  75709. * `100%`.
  75710. */
  75711. this.approxItemWidth = '100%';
  75712. /**
  75713. * @input {string} The approximate width of each header template's cell.
  75714. * This dimension is used to help determine how many cells should
  75715. * be created when initialized, and to help calculate the height of
  75716. * the scrollable area. This value can use either `px` or `%` units.
  75717. * Note that the actual rendered size of each cell comes from the
  75718. * app's CSS, whereas this approximation is used to help calculate
  75719. * initial dimensions. Default is `100%`.
  75720. */
  75721. this.approxHeaderWidth = '100%';
  75722. /**
  75723. * @input {string} The approximate height of each header template's cell.
  75724. * This dimension is used to help determine how many cells should
  75725. * be created when initialized, and to help calculate the height of
  75726. * the scrollable area. This height value can only use `px` units.
  75727. * Note that the actual rendered size of each cell comes from the
  75728. * app's CSS, whereas this approximation is used to help calculate
  75729. * initial dimensions before the item has been rendered. Default is `40px`.
  75730. */
  75731. this.approxHeaderHeight = '40px';
  75732. /**
  75733. * @input {string} The approximate width of each footer template's cell.
  75734. * This dimension is used to help determine how many cells should
  75735. * be created when initialized, and to help calculate the height of
  75736. * the scrollable area. This value can use either `px` or `%` units.
  75737. * Note that the actual rendered size of each cell comes from the
  75738. * app's CSS, whereas this approximation is used to help calculate
  75739. * initial dimensions before the item has been rendered. Default is `100%`.
  75740. */
  75741. this.approxFooterWidth = '100%';
  75742. /**
  75743. * @input {string} The approximate height of each footer template's cell.
  75744. * This dimension is used to help determine how many cells should
  75745. * be created when initialized, and to help calculate the height of
  75746. * the scrollable area. This height value can only use `px` units.
  75747. * Note that the actual rendered size of each cell comes from the
  75748. * app's CSS, whereas this approximation is used to help calculate
  75749. * initial dimensions before the item has been rendered. Default is `40px`.
  75750. */
  75751. this.approxFooterHeight = '40px';
  75752. // hide the virtual scroll element with opacity so we don't
  75753. // see jank as it loads up, but we're still able to read
  75754. // dimensions because it's still rendered and only opacity hidden
  75755. this.setElementClass('virtual-loading', true);
  75756. // wait for the content to be rendered and has readable dimensions
  75757. var readSub = _ctrl.readReady.subscribe(function () {
  75758. readSub.unsubscribe();
  75759. _this.readUpdate(true);
  75760. });
  75761. // wait for the content to be writable
  75762. var writeSub = _ctrl.writeReady.subscribe(function () {
  75763. writeSub.unsubscribe();
  75764. _this._init = true;
  75765. _this.writeUpdate(true);
  75766. _this._listeners();
  75767. });
  75768. }
  75769. Object.defineProperty(VirtualScroll.prototype, "virtualScroll", {
  75770. get: function () {
  75771. return this._records;
  75772. },
  75773. /**
  75774. * @input {array} The data that builds the templates within the virtual scroll.
  75775. * This is the same data that you'd pass to `*ngFor`. It's important to note
  75776. * that when this data has changed, then the entire virtual scroll is reset,
  75777. * which is an expensive operation and should be avoided if possible.
  75778. */
  75779. set: function (val) {
  75780. this._records = val;
  75781. },
  75782. enumerable: true,
  75783. configurable: true
  75784. });
  75785. Object.defineProperty(VirtualScroll.prototype, "headerFn", {
  75786. /**
  75787. * @input {function} Section headers and the data used within its given
  75788. * template can be dynamically created by passing a function to `headerFn`.
  75789. * For example, a large list of contacts usually has dividers between each
  75790. * letter in the alphabet. App's can provide their own custom `headerFn`
  75791. * which is called with each record within the dataset. The logic within
  75792. * the header function can decide if the header template should be used,
  75793. * and what data to give to the header template. The function must return
  75794. * `null` if a header cell shouldn't be created.
  75795. */
  75796. set: function (val) {
  75797. if (Object(__WEBPACK_IMPORTED_MODULE_5__util_util__["i" /* isFunction */])(val)) {
  75798. this._hdrFn = val.bind((this._ctrl._cmp) || this);
  75799. }
  75800. },
  75801. enumerable: true,
  75802. configurable: true
  75803. });
  75804. Object.defineProperty(VirtualScroll.prototype, "footerFn", {
  75805. /**
  75806. * @input {function} Section footers and the data used within its given
  75807. * template can be dynamically created by passing a function to `footerFn`.
  75808. * The logic within the footer function can decide if the footer template
  75809. * should be used, and what data to give to the footer template. The function
  75810. * must return `null` if a footer cell shouldn't be created.
  75811. */
  75812. set: function (val) {
  75813. if (Object(__WEBPACK_IMPORTED_MODULE_5__util_util__["i" /* isFunction */])(val)) {
  75814. this._ftrFn = val.bind((this._ctrl._cmp) || this);
  75815. }
  75816. },
  75817. enumerable: true,
  75818. configurable: true
  75819. });
  75820. /**
  75821. * @hidden
  75822. */
  75823. VirtualScroll.prototype.firstRecord = function () {
  75824. var cells = this._cells;
  75825. return (cells.length > 0) ? cells[0].record : 0;
  75826. };
  75827. /**
  75828. * @hidden
  75829. */
  75830. VirtualScroll.prototype.lastRecord = function () {
  75831. var cells = this._cells;
  75832. return (cells.length > 0) ? cells[cells.length - 1].record : 0;
  75833. };
  75834. /**
  75835. * @hidden
  75836. */
  75837. VirtualScroll.prototype.ngOnChanges = function (changes) {
  75838. if ('virtualScroll' in changes) {
  75839. // React on virtualScroll changes only once all inputs have been initialized
  75840. var value = changes['virtualScroll'].currentValue;
  75841. if (!Object(__WEBPACK_IMPORTED_MODULE_5__util_util__["l" /* isPresent */])(this._differ) && Object(__WEBPACK_IMPORTED_MODULE_5__util_util__["l" /* isPresent */])(value)) {
  75842. try {
  75843. this._differ = this._iterableDiffers.find(value).create(this.virtualTrackBy);
  75844. }
  75845. catch (e) {
  75846. throw new Error("Cannot find a differ supporting object '" + value + "'. VirtualScroll only supports binding to Iterables such as Arrays.");
  75847. }
  75848. }
  75849. }
  75850. };
  75851. /**
  75852. * @hidden
  75853. */
  75854. VirtualScroll.prototype.ngDoCheck = function () {
  75855. // only continue if we've already initialized
  75856. if (!this._init) {
  75857. return;
  75858. }
  75859. // and if there actually are changes
  75860. var changes = Object(__WEBPACK_IMPORTED_MODULE_5__util_util__["l" /* isPresent */])(this._differ) ? this._differ.diff(this.virtualScroll) : null;
  75861. if (!Object(__WEBPACK_IMPORTED_MODULE_5__util_util__["l" /* isPresent */])(changes)) {
  75862. return;
  75863. }
  75864. var needClean = false;
  75865. var lastRecord = this._recordSize;
  75866. changes.forEachOperation(function (_, pindex, cindex) {
  75867. // add new record after current position
  75868. if (pindex === null && (cindex < lastRecord)) {
  75869. (void 0) /* console.debug */;
  75870. needClean = true;
  75871. return;
  75872. }
  75873. // remove record after current position
  75874. if (pindex < lastRecord && cindex === null) {
  75875. (void 0) /* console.debug */;
  75876. needClean = true;
  75877. return;
  75878. }
  75879. });
  75880. this._recordSize = this._records ? this._records.length : 0;
  75881. this.readUpdate(needClean);
  75882. this.writeUpdate(needClean);
  75883. };
  75884. /**
  75885. * @hidden
  75886. */
  75887. VirtualScroll.prototype.readUpdate = function (needClean) {
  75888. if (needClean) {
  75889. // reset everything
  75890. (void 0) /* console.debug */;
  75891. this._cells.length = 0;
  75892. // this._nodes.length = 0;
  75893. // this._itmTmp.viewContainer.clear();
  75894. // ******** DOM READ ****************
  75895. this.calcDimensions();
  75896. }
  75897. else {
  75898. (void 0) /* console.debug */;
  75899. }
  75900. };
  75901. /**
  75902. * @hidden
  75903. */
  75904. VirtualScroll.prototype.writeUpdate = function (needClean) {
  75905. (void 0) /* console.debug */;
  75906. var data = this._data;
  75907. var stopAtHeight = (data.scrollTop + data.renderHeight);
  75908. data.scrollDiff = SCROLL_DIFFERENCE_MINIMUM + 1;
  75909. Object(__WEBPACK_IMPORTED_MODULE_1__virtual_util__["f" /* processRecords */])(stopAtHeight, this._records, this._cells, this._hdrFn, this._ftrFn, this._data);
  75910. // ******** DOM WRITE ****************
  75911. this.renderVirtual(needClean);
  75912. };
  75913. /**
  75914. * @hidden
  75915. */
  75916. VirtualScroll.prototype.calcDimensions = function () {
  75917. Object(__WEBPACK_IMPORTED_MODULE_1__virtual_util__["b" /* calcDimensions */])(this._data, this._elementRef.nativeElement, this.approxItemWidth, this.approxItemHeight, this.approxHeaderWidth, this.approxHeaderHeight, this.approxFooterWidth, this.approxFooterHeight, this.bufferRatio);
  75918. };
  75919. /**
  75920. * @hidden
  75921. * DOM WRITE
  75922. */
  75923. VirtualScroll.prototype.renderVirtual = function (needClean) {
  75924. var _this = this;
  75925. this._plt.raf(function () {
  75926. var nodes = _this._nodes;
  75927. var cells = _this._cells;
  75928. var data = _this._data;
  75929. var records = _this._records;
  75930. if (needClean) {
  75931. // ******** DOM WRITE ****************
  75932. Object(__WEBPACK_IMPORTED_MODULE_1__virtual_util__["g" /* updateDimensions */])(_this._plt, nodes, cells, data, true);
  75933. data.topCell = 0;
  75934. data.bottomCell = (cells.length - 1);
  75935. }
  75936. Object(__WEBPACK_IMPORTED_MODULE_1__virtual_util__["a" /* adjustRendered */])(cells, data);
  75937. _this._zone.run(function () {
  75938. Object(__WEBPACK_IMPORTED_MODULE_1__virtual_util__["e" /* populateNodeData */])(data.topCell, data.bottomCell, true, cells, records, nodes, _this._itmTmp.viewContainer, _this._itmTmp.templateRef, _this._hdrTmp && _this._hdrTmp.templateRef, _this._ftrTmp && _this._ftrTmp.templateRef);
  75939. });
  75940. if (needClean) {
  75941. _this._cd.detectChanges();
  75942. }
  75943. // at this point, this fn was called from within another
  75944. // requestAnimationFrame, so the next dom reads/writes within the next frame
  75945. // wait a frame before trying to read and calculate the dimensions
  75946. // ******** DOM READ ****************
  75947. _this._dom.read(function () { return Object(__WEBPACK_IMPORTED_MODULE_1__virtual_util__["d" /* initReadNodes */])(_this._plt, nodes, cells, data); });
  75948. _this._dom.write(function () {
  75949. // update the bound context for each node
  75950. Object(__WEBPACK_IMPORTED_MODULE_1__virtual_util__["h" /* updateNodeContext */])(nodes, cells, data);
  75951. // ******** DOM WRITE ****************
  75952. _this._stepChangeDetection();
  75953. // ******** DOM WRITE ****************
  75954. _this._stepDOMWrite();
  75955. // ******** DOM WRITE ****************
  75956. _this._content.imgsUpdate();
  75957. // First time load
  75958. if (!_this._lastEle) {
  75959. // add an element at the end so :last-child css doesn't get messed up
  75960. // ******** DOM WRITE ****************
  75961. var ele = _this._elementRef.nativeElement;
  75962. var lastEle = _this._renderer.createElement(ele, 'div');
  75963. lastEle.className = 'virtual-last';
  75964. _this._lastEle = true;
  75965. // ******** DOM WRITE ****************
  75966. _this.setElementClass('virtual-scroll', true);
  75967. // ******** DOM WRITE ****************
  75968. _this.setElementClass('virtual-loading', false);
  75969. }
  75970. (void 0) /* assert */;
  75971. });
  75972. });
  75973. };
  75974. /**
  75975. * @hidden
  75976. */
  75977. VirtualScroll.prototype.resize = function () {
  75978. // only continue if we've already initialized
  75979. if (!this._init) {
  75980. return;
  75981. }
  75982. // check if component is rendered in the dom currently
  75983. if (this._elementRef.nativeElement.offsetParent === null) {
  75984. return;
  75985. }
  75986. (void 0) /* console.debug */;
  75987. this.calcDimensions();
  75988. this.writeUpdate(false);
  75989. };
  75990. /**
  75991. * @hidden
  75992. */
  75993. VirtualScroll.prototype._stepDOMWrite = function () {
  75994. var cells = this._cells;
  75995. var nodes = this._nodes;
  75996. // ******** DOM WRITE ****************
  75997. Object(__WEBPACK_IMPORTED_MODULE_1__virtual_util__["i" /* writeToNodes */])(this._plt, nodes, cells, this._recordSize);
  75998. // ******** DOM WRITE ****************
  75999. this._setHeight(Object(__WEBPACK_IMPORTED_MODULE_1__virtual_util__["c" /* estimateHeight */])(this._recordSize, cells[cells.length - 1], this._vHeight, 0.25));
  76000. // we're done here, good work
  76001. this._queue = 1 /* NoChanges */;
  76002. };
  76003. /**
  76004. * @hidden
  76005. */
  76006. VirtualScroll.prototype._stepChangeDetection = function () {
  76007. // we need to do some change detection in this frame
  76008. // we've got work painting do, let's throw it in the
  76009. // domWrite callback so everyone plays nice
  76010. // ******** DOM WRITE ****************
  76011. var nodes = this._nodes;
  76012. for (var i = 0; i < nodes.length; i++) {
  76013. if (nodes[i].hasChanges) {
  76014. nodes[i].view.detectChanges();
  76015. }
  76016. }
  76017. // on the next frame we need write to the dom nodes manually
  76018. this._queue = 3 /* DomWrite */;
  76019. };
  76020. /**
  76021. * @hidden
  76022. */
  76023. VirtualScroll.prototype._stepNoChanges = function () {
  76024. var data = this._data;
  76025. // let's see if we've scroll far enough to require another check
  76026. var diff = data.scrollDiff = (data.scrollTop - this._lastCheck);
  76027. if (Math.abs(diff) < SCROLL_DIFFERENCE_MINIMUM) {
  76028. return;
  76029. }
  76030. var cells = this._cells;
  76031. var nodes = this._nodes;
  76032. var records = this._records;
  76033. // don't bother updating if the scrollTop hasn't changed much
  76034. this._lastCheck = data.scrollTop;
  76035. if (diff > 0) {
  76036. // load data we may not have processed yet
  76037. var stopAtHeight = (data.scrollTop + data.renderHeight);
  76038. Object(__WEBPACK_IMPORTED_MODULE_1__virtual_util__["f" /* processRecords */])(stopAtHeight, records, cells, this._hdrFn, this._ftrFn, data);
  76039. }
  76040. // ******** DOM READ ****************
  76041. Object(__WEBPACK_IMPORTED_MODULE_1__virtual_util__["g" /* updateDimensions */])(this._plt, nodes, cells, data, false);
  76042. Object(__WEBPACK_IMPORTED_MODULE_1__virtual_util__["a" /* adjustRendered */])(cells, data);
  76043. var hasChanges = Object(__WEBPACK_IMPORTED_MODULE_1__virtual_util__["e" /* populateNodeData */])(data.topCell, data.bottomCell, diff > 0, cells, records, nodes, this._itmTmp.viewContainer, this._itmTmp.templateRef, this._hdrTmp && this._hdrTmp.templateRef, this._ftrTmp && this._ftrTmp.templateRef);
  76044. if (hasChanges) {
  76045. // queue making updates in the next frame
  76046. this._queue = 2 /* ChangeDetection */;
  76047. // update the bound context for each node
  76048. Object(__WEBPACK_IMPORTED_MODULE_1__virtual_util__["h" /* updateNodeContext */])(nodes, cells, data);
  76049. }
  76050. };
  76051. /**
  76052. * @hidden
  76053. */
  76054. VirtualScroll.prototype.scrollUpdate = function (ev) {
  76055. var _this = this;
  76056. // set the scroll top from the scroll event
  76057. this._data.scrollTop = ev.scrollTop;
  76058. // there is a queue system so that we can
  76059. // spread out the work over multiple frames
  76060. var queue = this._queue;
  76061. if (queue === 1 /* NoChanges */) {
  76062. // no dom writes or change detection to take care of
  76063. this._stepNoChanges();
  76064. }
  76065. else if (queue === 2 /* ChangeDetection */) {
  76066. this._dom.write(function () { return _this._stepChangeDetection(); });
  76067. }
  76068. else {
  76069. (void 0) /* assert */;
  76070. // there are DOM writes we need to take care of in this frame
  76071. this._dom.write(function () { return _this._stepDOMWrite(); });
  76072. }
  76073. };
  76074. /**
  76075. * @hidden
  76076. * DOM WRITE
  76077. */
  76078. VirtualScroll.prototype.scrollEnd = function () {
  76079. var _this = this;
  76080. // ******** DOM READ ****************
  76081. Object(__WEBPACK_IMPORTED_MODULE_1__virtual_util__["g" /* updateDimensions */])(this._plt, this._nodes, this._cells, this._data, false);
  76082. Object(__WEBPACK_IMPORTED_MODULE_1__virtual_util__["a" /* adjustRendered */])(this._cells, this._data);
  76083. Object(__WEBPACK_IMPORTED_MODULE_1__virtual_util__["e" /* populateNodeData */])(this._data.topCell, this._data.bottomCell, true, this._cells, this._records, this._nodes, this._itmTmp.viewContainer, this._itmTmp.templateRef, this._hdrTmp && this._hdrTmp.templateRef, this._ftrTmp && this._ftrTmp.templateRef);
  76084. // ******** DOM WRITE ***************
  76085. this._dom.write(function () {
  76086. // update the bound context for each node
  76087. Object(__WEBPACK_IMPORTED_MODULE_1__virtual_util__["h" /* updateNodeContext */])(_this._nodes, _this._cells, _this._data);
  76088. // ******** DOM WRITE ***************
  76089. _this._stepChangeDetection();
  76090. // ******** DOM WRITE ****************
  76091. _this._stepDOMWrite();
  76092. });
  76093. };
  76094. /**
  76095. * @hidden
  76096. * NO DOM
  76097. */
  76098. VirtualScroll.prototype._listeners = function () {
  76099. (void 0) /* assert */;
  76100. if (!this._scrollSub) {
  76101. if (this._config.getBoolean('virtualScrollEventAssist')) {
  76102. // use JS scrolling for iOS UIWebView
  76103. // goal is to completely remove this when iOS
  76104. // fully supports scroll events
  76105. // listen to JS scroll events
  76106. this._content.enableJsScroll();
  76107. }
  76108. this._resizeSub = this._plt.resize.subscribe(this.resize.bind(this));
  76109. this._scrollSub = this._content.ionScroll.subscribe(this.scrollUpdate.bind(this));
  76110. this._scrollEndSub = this._content.ionScrollEnd.subscribe(this.scrollEnd.bind(this));
  76111. }
  76112. };
  76113. /**
  76114. * @hidden
  76115. * DOM WRITE
  76116. */
  76117. VirtualScroll.prototype._setHeight = function (newVirtualHeight) {
  76118. if (newVirtualHeight !== this._vHeight) {
  76119. // ******** DOM WRITE ****************
  76120. this._renderer.setElementStyle(this._elementRef.nativeElement, 'height', newVirtualHeight > 0 ? newVirtualHeight + 'px' : '');
  76121. this._vHeight = newVirtualHeight;
  76122. (void 0) /* console.debug */;
  76123. }
  76124. };
  76125. /**
  76126. * @hidden
  76127. */
  76128. VirtualScroll.prototype.ngAfterContentInit = function () {
  76129. (void 0) /* assert */;
  76130. if (!this.approxItemHeight) {
  76131. this.approxItemHeight = '40px';
  76132. console.warn('Virtual Scroll: Please provide an "approxItemHeight" input to ensure proper virtual scroll rendering');
  76133. }
  76134. };
  76135. /**
  76136. * @hidden
  76137. */
  76138. VirtualScroll.prototype.setElementClass = function (className, add) {
  76139. this._renderer.setElementClass(this._elementRef.nativeElement, className, add);
  76140. };
  76141. /**
  76142. * @hidden
  76143. */
  76144. VirtualScroll.prototype.ngOnDestroy = function () {
  76145. this._resizeSub && this._resizeSub.unsubscribe();
  76146. this._scrollSub && this._scrollSub.unsubscribe();
  76147. this._scrollEndSub && this._scrollEndSub.unsubscribe();
  76148. this._resizeSub = this._scrollEndSub = this._scrollSub = null;
  76149. this._hdrFn = this._ftrFn = this._records = this._cells = this._nodes = this._data = null;
  76150. };
  76151. VirtualScroll.decorators = [
  76152. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  76153. selector: '[virtualScroll]'
  76154. },] },
  76155. ];
  76156. /** @nocollapse */
  76157. VirtualScroll.ctorParameters = function () { return [
  76158. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["E" /* IterableDiffers */], },
  76159. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  76160. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  76161. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["M" /* NgZone */], },
  76162. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["j" /* ChangeDetectorRef */], },
  76163. { type: __WEBPACK_IMPORTED_MODULE_3__content_content__["a" /* Content */], },
  76164. { type: __WEBPACK_IMPORTED_MODULE_6__platform_platform__["a" /* Platform */], },
  76165. { type: __WEBPACK_IMPORTED_MODULE_7__navigation_view_controller__["a" /* ViewController */], },
  76166. { type: __WEBPACK_IMPORTED_MODULE_2__config_config__["a" /* Config */], },
  76167. { type: __WEBPACK_IMPORTED_MODULE_4__platform_dom_controller__["a" /* DomController */], },
  76168. ]; };
  76169. VirtualScroll.propDecorators = {
  76170. '_itmTmp': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["q" /* ContentChild */], args: [__WEBPACK_IMPORTED_MODULE_8__virtual_item__["a" /* VirtualItem */],] },],
  76171. '_hdrTmp': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["q" /* ContentChild */], args: [__WEBPACK_IMPORTED_MODULE_10__virtual_header__["a" /* VirtualHeader */],] },],
  76172. '_ftrTmp': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["q" /* ContentChild */], args: [__WEBPACK_IMPORTED_MODULE_9__virtual_footer__["a" /* VirtualFooter */],] },],
  76173. 'virtualScroll': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  76174. 'bufferRatio': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  76175. 'approxItemWidth': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  76176. 'approxItemHeight': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  76177. 'approxHeaderWidth': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  76178. 'approxHeaderHeight': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  76179. 'approxFooterWidth': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  76180. 'approxFooterHeight': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  76181. 'headerFn': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  76182. 'footerFn': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  76183. 'virtualTrackBy': [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */] },],
  76184. };
  76185. return VirtualScroll;
  76186. }());
  76187. var SCROLL_DIFFERENCE_MINIMUM = 40;
  76188. //# sourceMappingURL=virtual-scroll.js.map
  76189. /***/ }),
  76190. /* 192 */
  76191. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  76192. "use strict";
  76193. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TapClick; });
  76194. /* unused harmony export isActivatable */
  76195. /* harmony export (immutable) */ __webpack_exports__["b"] = setupTapClick;
  76196. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  76197. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__activator__ = __webpack_require__(193);
  76198. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__components_app_app__ = __webpack_require__(6);
  76199. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__config_config__ = __webpack_require__(1);
  76200. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__platform_dom_controller__ = __webpack_require__(8);
  76201. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__gestures_gesture_controller__ = __webpack_require__(7);
  76202. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__platform_platform__ = __webpack_require__(3);
  76203. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__util_dom__ = __webpack_require__(10);
  76204. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__gestures_pointer_events__ = __webpack_require__(117);
  76205. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__ripple__ = __webpack_require__(265);
  76206. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__gestures_ui_event_manager__ = __webpack_require__(23);
  76207. /**
  76208. * @hidden
  76209. */
  76210. var TapClick = (function () {
  76211. function TapClick(config, plt, dom, app, gestureCtrl) {
  76212. this.plt = plt;
  76213. this.app = app;
  76214. this.gestureCtrl = gestureCtrl;
  76215. this.disableClick = 0;
  76216. this.events = new __WEBPACK_IMPORTED_MODULE_10__gestures_ui_event_manager__["a" /* UIEventManager */](plt);
  76217. var activator = config.get('activator');
  76218. if (activator === 'ripple') {
  76219. this.activator = new __WEBPACK_IMPORTED_MODULE_9__ripple__["a" /* RippleActivator */](app, config, dom);
  76220. }
  76221. else if (activator === 'highlight') {
  76222. this.activator = new __WEBPACK_IMPORTED_MODULE_1__activator__["a" /* Activator */](app, config, dom);
  76223. }
  76224. this.usePolyfill = config.getBoolean('tapPolyfill');
  76225. (void 0) /* console.debug */;
  76226. var doc = plt.doc();
  76227. this.events.listen(doc, 'click', this.click.bind(this), { passive: false, capture: true });
  76228. this.pointerEvents = this.events.pointerEvents({
  76229. element: doc,
  76230. pointerDown: this.pointerStart.bind(this),
  76231. pointerMove: this.pointerMove.bind(this),
  76232. pointerUp: this.pointerEnd.bind(this),
  76233. passive: true
  76234. });
  76235. this.pointerEvents.mouseWait = DISABLE_NATIVE_CLICK_AMOUNT;
  76236. }
  76237. TapClick.prototype.pointerStart = function (ev) {
  76238. if (this.startCoord) {
  76239. return false;
  76240. }
  76241. if (!this.app.isEnabled()) {
  76242. return false;
  76243. }
  76244. this.lastTouchEnd = 0;
  76245. this.dispatchClick = true;
  76246. if (this.plt.doc() === ev.target) {
  76247. this.startCoord = Object(__WEBPACK_IMPORTED_MODULE_7__util_dom__["f" /* pointerCoord */])(ev);
  76248. return true;
  76249. }
  76250. this.activatableEle = getActivatableTarget(ev.target);
  76251. if (!this.activatableEle) {
  76252. this.startCoord = null;
  76253. return false;
  76254. }
  76255. this.startCoord = Object(__WEBPACK_IMPORTED_MODULE_7__util_dom__["f" /* pointerCoord */])(ev);
  76256. this.activator && this.activator.downAction(ev, this.activatableEle, this.startCoord);
  76257. return true;
  76258. };
  76259. TapClick.prototype.pointerMove = function (ev) {
  76260. if (this.startCoord && this.shouldCancelEvent(ev)) {
  76261. this.pointerCancel(ev);
  76262. }
  76263. };
  76264. TapClick.prototype.pointerEnd = function (ev, pointerEventType) {
  76265. if (!this.dispatchClick)
  76266. return;
  76267. (void 0) /* runInDev */;
  76268. if (!this.startCoord) {
  76269. return;
  76270. }
  76271. if (this.activator && ev.target !== this.plt.doc()) {
  76272. var activatableEle = getActivatableTarget(ev.target) || this.activatableEle;
  76273. if (activatableEle) {
  76274. this.activator.upAction(ev, activatableEle, this.startCoord);
  76275. }
  76276. }
  76277. if (this.usePolyfill && pointerEventType === __WEBPACK_IMPORTED_MODULE_8__gestures_pointer_events__["a" /* POINTER_EVENT_TYPE_TOUCH */] && this.app.isEnabled()) {
  76278. this.handleTapPolyfill(ev);
  76279. }
  76280. this.startCoord = null;
  76281. this.activatableEle = null;
  76282. };
  76283. TapClick.prototype.pointerCancel = function (ev) {
  76284. (void 0) /* console.debug */;
  76285. this.startCoord = null;
  76286. this.activatableEle = null;
  76287. this.dispatchClick = false;
  76288. this.activator && this.activator.clearState(false);
  76289. this.pointerEvents.stop();
  76290. };
  76291. TapClick.prototype.shouldCancelEvent = function (ev) {
  76292. return (this.app.isScrolling() ||
  76293. this.gestureCtrl.isCaptured() ||
  76294. Object(__WEBPACK_IMPORTED_MODULE_7__util_dom__["d" /* hasPointerMoved */])(POINTER_TOLERANCE, this.startCoord, Object(__WEBPACK_IMPORTED_MODULE_7__util_dom__["f" /* pointerCoord */])(ev)));
  76295. };
  76296. TapClick.prototype.click = function (ev) {
  76297. if (this.shouldCancelClick(ev)) {
  76298. ev.preventDefault();
  76299. ev.stopPropagation();
  76300. return;
  76301. }
  76302. if (this.activator && this.plt.doc() !== ev.target) {
  76303. // cool, a click is gonna happen, let's tell the activator
  76304. // so the element can get the given "active" style
  76305. var activatableEle = getActivatableTarget(ev.target);
  76306. if (activatableEle) {
  76307. this.activator.clickAction(ev, activatableEle, this.startCoord);
  76308. }
  76309. }
  76310. (void 0) /* runInDev */;
  76311. };
  76312. TapClick.prototype.shouldCancelClick = function (ev) {
  76313. if (this.usePolyfill) {
  76314. if (!ev.isIonicTap && this.isDisabledNativeClick()) {
  76315. (void 0) /* console.debug */;
  76316. return true;
  76317. }
  76318. }
  76319. else if (!this.dispatchClick) {
  76320. (void 0) /* console.debug */;
  76321. return true;
  76322. }
  76323. if (!this.app.isEnabled()) {
  76324. (void 0) /* console.debug */;
  76325. return true;
  76326. }
  76327. if (this.gestureCtrl.isCaptured()) {
  76328. (void 0) /* console.debug */;
  76329. return true;
  76330. }
  76331. return false;
  76332. };
  76333. TapClick.prototype.profileClickDelay = function (ev) {
  76334. if (this.lastTouchEnd) {
  76335. var diff = Date.now() - this.lastTouchEnd;
  76336. if (diff < 100) {
  76337. (void 0) /* console.debug */;
  76338. }
  76339. else {
  76340. console.warn("SLOW click dispatched. Delay(ms):", diff, ev);
  76341. }
  76342. this.lastTouchEnd = null;
  76343. }
  76344. else {
  76345. (void 0) /* console.debug */;
  76346. }
  76347. };
  76348. TapClick.prototype.handleTapPolyfill = function (ev) {
  76349. (void 0) /* assert */;
  76350. // only dispatch mouse click events from a touchend event
  76351. // when tapPolyfill config is true, and the startCoordand endCoord
  76352. // are not too far off from each other
  76353. var endCoord = Object(__WEBPACK_IMPORTED_MODULE_7__util_dom__["f" /* pointerCoord */])(ev);
  76354. if (Object(__WEBPACK_IMPORTED_MODULE_7__util_dom__["d" /* hasPointerMoved */])(POINTER_TOLERANCE, this.startCoord, endCoord)) {
  76355. (void 0) /* console.debug */;
  76356. return;
  76357. }
  76358. // prevent native mouse click events for XX amount of time
  76359. this.disableClick = Date.now() + DISABLE_NATIVE_CLICK_AMOUNT;
  76360. if (this.app.isScrolling()) {
  76361. // do not fire off a click event while the app was scrolling
  76362. (void 0) /* console.debug */;
  76363. }
  76364. else {
  76365. // dispatch a mouse click event
  76366. (void 0) /* console.debug */;
  76367. var clickEvent = this.plt.doc().createEvent('MouseEvents');
  76368. clickEvent.initMouseEvent('click', true, true, this.plt.win(), 1, 0, 0, endCoord.x, endCoord.y, false, false, false, false, 0, null);
  76369. clickEvent.isIonicTap = true;
  76370. ev.target.dispatchEvent(clickEvent);
  76371. }
  76372. };
  76373. TapClick.prototype.isDisabledNativeClick = function () {
  76374. return this.disableClick > Date.now();
  76375. };
  76376. TapClick.decorators = [
  76377. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */] },
  76378. ];
  76379. /** @nocollapse */
  76380. TapClick.ctorParameters = function () { return [
  76381. { type: __WEBPACK_IMPORTED_MODULE_3__config_config__["a" /* Config */], },
  76382. { type: __WEBPACK_IMPORTED_MODULE_6__platform_platform__["a" /* Platform */], },
  76383. { type: __WEBPACK_IMPORTED_MODULE_4__platform_dom_controller__["a" /* DomController */], },
  76384. { type: __WEBPACK_IMPORTED_MODULE_2__components_app_app__["a" /* App */], },
  76385. { type: __WEBPACK_IMPORTED_MODULE_5__gestures_gesture_controller__["l" /* GestureController */], },
  76386. ]; };
  76387. return TapClick;
  76388. }());
  76389. function getActivatableTarget(ele) {
  76390. var targetEle = ele;
  76391. for (var x = 0; x < 10; x++) {
  76392. if (!targetEle)
  76393. break;
  76394. if (isActivatable(targetEle)) {
  76395. return targetEle;
  76396. }
  76397. targetEle = targetEle.parentElement;
  76398. }
  76399. return null;
  76400. }
  76401. /**
  76402. * @hidden
  76403. */
  76404. function isActivatable(ele) {
  76405. if (ACTIVATABLE_ELEMENTS.indexOf(ele.tagName) > -1) {
  76406. return true;
  76407. }
  76408. for (var i = 0, l = ACTIVATABLE_ATTRIBUTES.length; i < l; i++) {
  76409. if (ele.hasAttribute && ele.hasAttribute(ACTIVATABLE_ATTRIBUTES[i])) {
  76410. return true;
  76411. }
  76412. }
  76413. return false;
  76414. }
  76415. var ACTIVATABLE_ELEMENTS = ['A', 'BUTTON'];
  76416. var ACTIVATABLE_ATTRIBUTES = ['tappable', 'ion-button'];
  76417. var POINTER_TOLERANCE = 100;
  76418. var DISABLE_NATIVE_CLICK_AMOUNT = 2500;
  76419. /**
  76420. * @hidden
  76421. */
  76422. function setupTapClick(config, plt, dom, app, gestureCtrl) {
  76423. return function () {
  76424. return new TapClick(config, plt, dom, app, gestureCtrl);
  76425. };
  76426. }
  76427. //# sourceMappingURL=tap-click.js.map
  76428. /***/ }),
  76429. /* 193 */
  76430. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  76431. "use strict";
  76432. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Activator; });
  76433. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__activator_base__ = __webpack_require__(194);
  76434. var Activator = (function () {
  76435. function Activator(app, config, dom) {
  76436. this.app = app;
  76437. this.dom = dom;
  76438. this._queue = [];
  76439. this._active = [];
  76440. this.activatedDelay = ADD_ACTIVATED_DEFERS;
  76441. this.clearDelay = CLEAR_STATE_DEFERS;
  76442. this._css = config.get('activatedClass', 'activated');
  76443. }
  76444. Activator.prototype.clickAction = function (ev, activatableEle, _startCoord) {
  76445. if (Object(__WEBPACK_IMPORTED_MODULE_0__activator_base__["a" /* isActivatedDisabled */])(ev, activatableEle)) {
  76446. return;
  76447. }
  76448. // a click happened, so immediately deactive all activated elements
  76449. this._scheduleClear();
  76450. this._queue.length = 0;
  76451. for (var i = 0; i < this._active.length; i++) {
  76452. this._active[i].classList.remove(this._css);
  76453. }
  76454. this._active.length = 0;
  76455. // then immediately activate this element
  76456. if (activatableEle && activatableEle.parentNode) {
  76457. this._active.push(activatableEle);
  76458. activatableEle.classList.add(this._css);
  76459. }
  76460. };
  76461. Activator.prototype.downAction = function (ev, activatableEle, _startCoord) {
  76462. var _this = this;
  76463. // the user just pressed down
  76464. if (Object(__WEBPACK_IMPORTED_MODULE_0__activator_base__["a" /* isActivatedDisabled */])(ev, activatableEle)) {
  76465. return;
  76466. }
  76467. this.unscheduleClear();
  76468. this.deactivate(true);
  76469. // queue to have this element activated
  76470. this._queue.push(activatableEle);
  76471. this._activeDefer = this.dom.write(function () {
  76472. _this._activeDefer = null;
  76473. var activatableEle;
  76474. for (var i = 0; i < _this._queue.length; i++) {
  76475. activatableEle = _this._queue[i];
  76476. _this._active.push(activatableEle);
  76477. activatableEle.classList.add(_this._css);
  76478. }
  76479. _this._queue.length = 0;
  76480. }, this.activatedDelay);
  76481. };
  76482. // the user was pressing down, then just let up
  76483. Activator.prototype.upAction = function (_ev, _activatableEle, _startCoord) {
  76484. this._scheduleClear();
  76485. };
  76486. Activator.prototype._scheduleClear = function () {
  76487. var _this = this;
  76488. if (this._clearDefer) {
  76489. return;
  76490. }
  76491. this._clearDefer = this.dom.write(function () {
  76492. _this.clearState(true);
  76493. _this._clearDefer = null;
  76494. }, this.clearDelay);
  76495. };
  76496. Activator.prototype.unscheduleClear = function () {
  76497. if (this._clearDefer) {
  76498. this._clearDefer();
  76499. this._clearDefer = null;
  76500. }
  76501. };
  76502. // all states should return to normal
  76503. Activator.prototype.clearState = function (animated) {
  76504. var _this = this;
  76505. if (!this.app.isEnabled()) {
  76506. // the app is actively disabled, so don't bother deactivating anything.
  76507. // this makes it easier on the GPU so it doesn't have to redraw any
  76508. // buttons during a transition. This will retry in XX milliseconds.
  76509. this.dom.write(function () {
  76510. _this.clearState(animated);
  76511. }, 600);
  76512. }
  76513. else {
  76514. // not actively transitioning, good to deactivate any elements
  76515. this.deactivate(animated);
  76516. }
  76517. };
  76518. // remove the active class from all active elements
  76519. Activator.prototype.deactivate = function (animated) {
  76520. this._clearDeferred();
  76521. this._queue.length = 0;
  76522. var ele;
  76523. for (var i = 0; i < this._active.length; i++) {
  76524. ele = this._active[i];
  76525. ele.style[this.dom.plt.Css.transition] = animated ? '' : 'none';
  76526. ele.classList.remove(this._css);
  76527. }
  76528. this._active.length = 0;
  76529. };
  76530. Activator.prototype._clearDeferred = function () {
  76531. // Clear any active deferral
  76532. if (this._activeDefer) {
  76533. this._activeDefer();
  76534. this._activeDefer = null;
  76535. }
  76536. };
  76537. return Activator;
  76538. }());
  76539. var ADD_ACTIVATED_DEFERS = 80;
  76540. var CLEAR_STATE_DEFERS = 80;
  76541. //# sourceMappingURL=activator.js.map
  76542. /***/ }),
  76543. /* 194 */
  76544. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  76545. "use strict";
  76546. /* unused harmony export ActivatorBase */
  76547. /* harmony export (immutable) */ __webpack_exports__["a"] = isActivatedDisabled;
  76548. var ActivatorBase = (function () {
  76549. function ActivatorBase() {
  76550. }
  76551. return ActivatorBase;
  76552. }());
  76553. function isActivatedDisabled(ev, activatableEle) {
  76554. if (!activatableEle || !activatableEle.parentNode) {
  76555. return true;
  76556. }
  76557. if (!ev) {
  76558. return false;
  76559. }
  76560. if (ev.defaultPrevented) {
  76561. return true;
  76562. }
  76563. var targetEle = ev.target;
  76564. for (var i = 0; i < 4; i++) {
  76565. if (!targetEle) {
  76566. break;
  76567. }
  76568. if (targetEle.hasAttribute('disable-activated')) {
  76569. return true;
  76570. }
  76571. targetEle = targetEle.parentElement;
  76572. }
  76573. return false;
  76574. }
  76575. //# sourceMappingURL=activator-base.js.map
  76576. /***/ }),
  76577. /* 195 */
  76578. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  76579. "use strict";
  76580. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Events; });
  76581. /* unused harmony export setupEvents */
  76582. /* harmony export (immutable) */ __webpack_exports__["b"] = setupProvideEvents;
  76583. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__scroll_view__ = __webpack_require__(129);
  76584. /**
  76585. * @name Events
  76586. * @description
  76587. * Events is a publish-subscribe style event system for sending and responding to application-level
  76588. * events across your app.
  76589. *
  76590. * @usage
  76591. * ```ts
  76592. * import { Events } from 'ionic-angular';
  76593. *
  76594. * // first page (publish an event when a user is created)
  76595. * constructor(public events: Events) { }
  76596. *
  76597. * createUser(user) {
  76598. * console.log('User created!')
  76599. * this.events.publish('user:created', user, Date.now());
  76600. * }
  76601. *
  76602. *
  76603. * // second page (listen for the user created event after function is called)
  76604. * constructor(public events: Events) {
  76605. * events.subscribe('user:created', (user, time) => {
  76606. * // user and time are the same arguments passed in `events.publish(user, time)`
  76607. * console.log('Welcome', user, 'at', time);
  76608. * });
  76609. * }
  76610. *
  76611. * ```
  76612. * @demo /docs/demos/src/events/
  76613. */
  76614. var Events = (function () {
  76615. function Events() {
  76616. this._channels = [];
  76617. }
  76618. /**
  76619. * Subscribe to an event topic. Events that get posted to that topic will trigger the provided handler.
  76620. *
  76621. * @param {string} topic the topic to subscribe to
  76622. * @param {function} handler the event handler
  76623. */
  76624. Events.prototype.subscribe = function (topic) {
  76625. var _this = this;
  76626. var handlers = [];
  76627. for (var _i = 1; _i < arguments.length; _i++) {
  76628. handlers[_i - 1] = arguments[_i];
  76629. }
  76630. if (!this._channels[topic]) {
  76631. this._channels[topic] = [];
  76632. }
  76633. handlers.forEach(function (handler) {
  76634. _this._channels[topic].push(handler);
  76635. });
  76636. };
  76637. /**
  76638. * Unsubscribe from the given topic. Your handler will no longer receive events published to this topic.
  76639. *
  76640. * @param {string} topic the topic to unsubscribe from
  76641. * @param {function} handler the event handler
  76642. *
  76643. * @return true if a handler was removed
  76644. */
  76645. Events.prototype.unsubscribe = function (topic, handler) {
  76646. if (handler === void 0) { handler = null; }
  76647. var t = this._channels[topic];
  76648. if (!t) {
  76649. // Wasn't found, wasn't removed
  76650. return false;
  76651. }
  76652. if (!handler) {
  76653. // Remove all handlers for this topic
  76654. delete this._channels[topic];
  76655. return true;
  76656. }
  76657. // We need to find and remove a specific handler
  76658. var i = t.indexOf(handler);
  76659. if (i < 0) {
  76660. // Wasn't found, wasn't removed
  76661. return false;
  76662. }
  76663. t.splice(i, 1);
  76664. // If the channel is empty now, remove it from the channel map
  76665. if (!t.length) {
  76666. delete this._channels[topic];
  76667. }
  76668. return true;
  76669. };
  76670. /**
  76671. * Publish an event to the given topic.
  76672. *
  76673. * @param {string} topic the topic to publish to
  76674. * @param {any} eventData the data to send as the event
  76675. */
  76676. Events.prototype.publish = function (topic) {
  76677. var args = [];
  76678. for (var _i = 1; _i < arguments.length; _i++) {
  76679. args[_i - 1] = arguments[_i];
  76680. }
  76681. var t = this._channels[topic];
  76682. if (!t) {
  76683. return null;
  76684. }
  76685. var responses = [];
  76686. t.forEach(function (handler) {
  76687. responses.push(handler.apply(void 0, args));
  76688. });
  76689. return responses;
  76690. };
  76691. return Events;
  76692. }());
  76693. /**
  76694. * @hidden
  76695. */
  76696. function setupEvents(plt, dom) {
  76697. var events = new Events();
  76698. var win = plt.win();
  76699. var doc = plt.doc();
  76700. // start listening for resizes XXms after the app starts
  76701. plt.timeout(function () {
  76702. win.addEventListener('online', function (ev) {
  76703. events.publish('app:online', ev);
  76704. }, false);
  76705. win.addEventListener('offline', function (ev) {
  76706. events.publish('app:offline', ev);
  76707. }, false);
  76708. win.addEventListener('orientationchange', function (ev) {
  76709. events.publish('app:rotated', ev);
  76710. });
  76711. // When that status taps, we respond
  76712. win.addEventListener('statusTap', function () {
  76713. // TODO: Make this more better
  76714. var el = doc.elementFromPoint(plt.width() / 2, plt.height() / 2);
  76715. if (!el) {
  76716. return;
  76717. }
  76718. var contentEle = el.closest('.scroll-content');
  76719. if (contentEle) {
  76720. var style = contentEle.style;
  76721. var scroll = new __WEBPACK_IMPORTED_MODULE_0__scroll_view__["a" /* ScrollView */](null, plt, dom);
  76722. scroll._el = contentEle;
  76723. // We need to stop scrolling if it's happening and scroll up
  76724. style['WebkitBackfaceVisibility'] = 'hidden';
  76725. style['WebkitTransform'] = 'translate3d(0,0,0)';
  76726. dom.write(function () {
  76727. style.overflow = 'hidden';
  76728. function finish() {
  76729. style.overflow = '';
  76730. style['WebkitBackfaceVisibility'] = '';
  76731. style['WebkitTransform'] = '';
  76732. }
  76733. var didScrollTimeout = plt.timeout(function () {
  76734. finish();
  76735. }, 400);
  76736. scroll.scrollTo(0, 0, 300).then(function () {
  76737. plt.cancelTimeout(didScrollTimeout);
  76738. finish();
  76739. });
  76740. });
  76741. }
  76742. });
  76743. }, 2000);
  76744. return events;
  76745. }
  76746. /**
  76747. * @hidden
  76748. */
  76749. function setupProvideEvents(plt, dom) {
  76750. return function () {
  76751. return setupEvents(plt, dom);
  76752. };
  76753. }
  76754. //# sourceMappingURL=events.js.map
  76755. /***/ }),
  76756. /* 196 */
  76757. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  76758. "use strict";
  76759. /* unused harmony export PLATFORM_CONFIGS */
  76760. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PlatformConfigToken; });
  76761. /* harmony export (immutable) */ __webpack_exports__["b"] = providePlatformConfigs;
  76762. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  76763. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__platform_utils__ = __webpack_require__(177);
  76764. var PLATFORM_CONFIGS = {
  76765. /**
  76766. * core
  76767. */
  76768. 'core': {
  76769. settings: {
  76770. mode: 'md',
  76771. keyboardHeight: 290
  76772. }
  76773. },
  76774. /**
  76775. * mobile
  76776. */
  76777. 'mobile': {},
  76778. /**
  76779. * phablet
  76780. */
  76781. 'phablet': {
  76782. isMatch: function (plt) {
  76783. var smallest = Math.min(plt.width(), plt.height());
  76784. var largest = Math.max(plt.width(), plt.height());
  76785. return (smallest > 390 && smallest < 520) &&
  76786. (largest > 620 && largest < 800);
  76787. }
  76788. },
  76789. /**
  76790. * tablet
  76791. */
  76792. 'tablet': {
  76793. isMatch: function (plt) {
  76794. var smallest = Math.min(plt.width(), plt.height());
  76795. var largest = Math.max(plt.width(), plt.height());
  76796. return (smallest > 460 && smallest < 820) &&
  76797. (largest > 780 && largest < 1400);
  76798. }
  76799. },
  76800. /**
  76801. * android
  76802. */
  76803. 'android': {
  76804. superset: 'mobile',
  76805. subsets: [
  76806. 'phablet',
  76807. 'tablet'
  76808. ],
  76809. settings: {
  76810. activator: function (plt) {
  76811. // md mode defaults to use ripple activator
  76812. // however, under-powered devices shouldn't use ripple
  76813. // if this a linux device, and is using Android Chrome v36 (Android 5.0)
  76814. // or above then use ripple, otherwise do not use a ripple effect
  76815. if (plt.testNavigatorPlatform('linux')) {
  76816. var chromeVersion = plt.matchUserAgentVersion(/Chrome\/(\d+).(\d+)?/);
  76817. if (chromeVersion) {
  76818. // linux android device using modern android chrome browser gets ripple
  76819. if (parseInt(chromeVersion.major, 10) < 36 || plt.version().major < 5) {
  76820. return 'none';
  76821. }
  76822. else {
  76823. return 'ripple';
  76824. }
  76825. }
  76826. // linux android device not using chrome browser checks just android's version
  76827. if (plt.version().major < 5) {
  76828. return 'none';
  76829. }
  76830. }
  76831. // fallback to always use ripple
  76832. return 'ripple';
  76833. },
  76834. autoFocusAssist: 'immediate',
  76835. inputCloning: true,
  76836. scrollAssist: true,
  76837. hoverCSS: false,
  76838. keyboardHeight: 300,
  76839. mode: 'md',
  76840. },
  76841. isMatch: function (plt) {
  76842. return plt.isPlatformMatch('android', ['android', 'silk'], ['windows phone']);
  76843. },
  76844. versionParser: function (plt) {
  76845. return plt.matchUserAgentVersion(/Android (\d+).(\d+)?/);
  76846. }
  76847. },
  76848. /**
  76849. * ios
  76850. */
  76851. 'ios': {
  76852. superset: 'mobile',
  76853. subsets: [
  76854. 'ipad',
  76855. 'iphone'
  76856. ],
  76857. settings: {
  76858. autoFocusAssist: 'delay',
  76859. hideCaretOnScroll: true,
  76860. hoverCSS: false,
  76861. inputBlurring: __WEBPACK_IMPORTED_MODULE_1__platform_utils__["c" /* isIos */],
  76862. inputCloning: __WEBPACK_IMPORTED_MODULE_1__platform_utils__["c" /* isIos */],
  76863. keyboardHeight: 250,
  76864. mode: 'ios',
  76865. statusbarPadding: __WEBPACK_IMPORTED_MODULE_1__platform_utils__["a" /* isCordova */],
  76866. swipeBackEnabled: __WEBPACK_IMPORTED_MODULE_1__platform_utils__["c" /* isIos */],
  76867. tapPolyfill: __WEBPACK_IMPORTED_MODULE_1__platform_utils__["d" /* isIosUIWebView */],
  76868. virtualScrollEventAssist: __WEBPACK_IMPORTED_MODULE_1__platform_utils__["d" /* isIosUIWebView */],
  76869. disableScrollAssist: __WEBPACK_IMPORTED_MODULE_1__platform_utils__["c" /* isIos */],
  76870. scrollAssist: __WEBPACK_IMPORTED_MODULE_1__platform_utils__["c" /* isIos */],
  76871. keyboardResizes: keyboardResizes,
  76872. },
  76873. isMatch: function (plt) {
  76874. return plt.isPlatformMatch('ios', ['iphone', 'ipad', 'ipod'], ['windows phone']);
  76875. },
  76876. versionParser: function (plt) {
  76877. return plt.matchUserAgentVersion(/OS (\d+)_(\d+)?/);
  76878. }
  76879. },
  76880. /**
  76881. * ipad
  76882. */
  76883. 'ipad': {
  76884. superset: 'tablet',
  76885. settings: {
  76886. keyboardHeight: 500,
  76887. },
  76888. isMatch: function (plt) {
  76889. return plt.isPlatformMatch('ipad');
  76890. }
  76891. },
  76892. /**
  76893. * iphone
  76894. */
  76895. 'iphone': {
  76896. subsets: [
  76897. 'phablet'
  76898. ],
  76899. isMatch: function (plt) {
  76900. return plt.isPlatformMatch('iphone');
  76901. }
  76902. },
  76903. /**
  76904. * Windows
  76905. */
  76906. 'windows': {
  76907. superset: 'mobile',
  76908. subsets: [
  76909. 'phablet',
  76910. 'tablet'
  76911. ],
  76912. settings: {
  76913. mode: 'wp',
  76914. autoFocusAssist: 'immediate',
  76915. hoverCSS: false
  76916. },
  76917. isMatch: function (plt) {
  76918. return plt.isPlatformMatch('windows', ['windows phone']);
  76919. },
  76920. versionParser: function (plt) {
  76921. return plt.matchUserAgentVersion(/Windows Phone (\d+).(\d+)?/);
  76922. }
  76923. },
  76924. /**
  76925. * cordova
  76926. */
  76927. 'cordova': {
  76928. isEngine: true,
  76929. initialize: function (plt) {
  76930. // prepare a custom "ready" for cordova "deviceready"
  76931. plt.prepareReady = function () {
  76932. // 1) ionic bootstrapped
  76933. plt.windowLoad(function (win, doc) {
  76934. // 2) window onload triggered or completed
  76935. doc.addEventListener('deviceready', function () {
  76936. // 3) cordova deviceready event triggered
  76937. // add cordova listeners to emit platform events
  76938. doc.addEventListener('backbutton', function (ev) {
  76939. plt.zone.run(function () {
  76940. plt.backButton.emit(ev);
  76941. });
  76942. });
  76943. doc.addEventListener('pause', function (ev) {
  76944. plt.zone.run(function () {
  76945. plt.pause.emit(ev);
  76946. });
  76947. });
  76948. doc.addEventListener('resume', function (ev) {
  76949. plt.zone.run(function () {
  76950. plt.resume.emit(ev);
  76951. });
  76952. });
  76953. // cordova has its own exitApp method
  76954. plt.exitApp = function () {
  76955. win['navigator']['app'].exitApp();
  76956. };
  76957. // cordova has fully loaded and we've added listeners
  76958. plt.triggerReady('cordova');
  76959. });
  76960. });
  76961. };
  76962. },
  76963. isMatch: function (plt) {
  76964. return Object(__WEBPACK_IMPORTED_MODULE_1__platform_utils__["a" /* isCordova */])(plt);
  76965. }
  76966. },
  76967. /**
  76968. * electron
  76969. */
  76970. 'electron': {
  76971. superset: 'core',
  76972. initialize: function (plt) {
  76973. plt.prepareReady = function () {
  76974. // 1) ionic bootstrapped
  76975. plt.windowLoad(function () {
  76976. plt.triggerReady('electron');
  76977. });
  76978. };
  76979. },
  76980. isMatch: function (plt) {
  76981. return Object(__WEBPACK_IMPORTED_MODULE_1__platform_utils__["b" /* isElectron */])(plt);
  76982. }
  76983. }
  76984. };
  76985. function keyboardResizes(plt) {
  76986. var win = plt.win();
  76987. if (win.Ionic && win.Ionic.keyboardResizes === true) {
  76988. return true;
  76989. }
  76990. return false;
  76991. }
  76992. var PlatformConfigToken = new __WEBPACK_IMPORTED_MODULE_0__angular_core__["B" /* InjectionToken */]('PLTCONFIG');
  76993. function providePlatformConfigs() {
  76994. return PLATFORM_CONFIGS;
  76995. }
  76996. //# sourceMappingURL=platform-registry.js.map
  76997. /***/ }),
  76998. /* 197 */
  76999. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  77000. "use strict";
  77001. /* unused harmony export MODE_IOS */
  77002. /* unused harmony export MODE_MD */
  77003. /* unused harmony export MODE_WP */
  77004. /* harmony export (immutable) */ __webpack_exports__["a"] = registerModeConfigs;
  77005. var MODE_IOS = {
  77006. activator: 'highlight',
  77007. actionSheetEnter: 'action-sheet-slide-in',
  77008. actionSheetLeave: 'action-sheet-slide-out',
  77009. alertEnter: 'alert-pop-in',
  77010. alertLeave: 'alert-pop-out',
  77011. backButtonText: 'Back',
  77012. backButtonIcon: 'ios-arrow-back',
  77013. iconMode: 'ios',
  77014. loadingEnter: 'loading-pop-in',
  77015. loadingLeave: 'loading-pop-out',
  77016. menuType: 'reveal',
  77017. modalEnter: 'modal-slide-in',
  77018. modalLeave: 'modal-slide-out',
  77019. pageTransition: 'ios-transition',
  77020. pickerEnter: 'picker-slide-in',
  77021. pickerLeave: 'picker-slide-out',
  77022. pickerRotateFactor: -0.46,
  77023. pickerScaleFactor: 1,
  77024. popoverEnter: 'popover-pop-in',
  77025. popoverLeave: 'popover-pop-out',
  77026. spinner: 'ios',
  77027. tabsHighlight: false,
  77028. tabsPlacement: 'bottom',
  77029. tabsHideOnSubPages: false,
  77030. toastEnter: 'toast-slide-in',
  77031. toastLeave: 'toast-slide-out',
  77032. };
  77033. var MODE_MD = {
  77034. activator: 'ripple',
  77035. actionSheetEnter: 'action-sheet-md-slide-in',
  77036. actionSheetLeave: 'action-sheet-md-slide-out',
  77037. alertEnter: 'alert-md-pop-in',
  77038. alertLeave: 'alert-md-pop-out',
  77039. backButtonText: '',
  77040. backButtonIcon: 'md-arrow-back',
  77041. iconMode: 'md',
  77042. loadingEnter: 'loading-md-pop-in',
  77043. loadingLeave: 'loading-md-pop-out',
  77044. menuType: 'overlay',
  77045. modalEnter: 'modal-md-slide-in',
  77046. modalLeave: 'modal-md-slide-out',
  77047. pageTransition: 'md-transition',
  77048. pickerEnter: 'picker-slide-in',
  77049. pickerLeave: 'picker-slide-out',
  77050. pickerRotateFactor: 0,
  77051. pickerScaleFactor: 0.81,
  77052. popoverEnter: 'popover-md-pop-in',
  77053. popoverLeave: 'popover-md-pop-out',
  77054. spinner: 'crescent',
  77055. tabsHighlight: false,
  77056. tabsPlacement: 'bottom',
  77057. tabsHideOnSubPages: false,
  77058. toastEnter: 'toast-md-slide-in',
  77059. toastLeave: 'toast-md-slide-out',
  77060. };
  77061. var MODE_WP = {
  77062. activator: 'highlight',
  77063. actionSheetEnter: 'action-sheet-wp-slide-in',
  77064. actionSheetLeave: 'action-sheet-wp-slide-out',
  77065. alertEnter: 'alert-wp-pop-in',
  77066. alertLeave: 'alert-wp-pop-out',
  77067. backButtonText: '',
  77068. backButtonIcon: 'ios-arrow-back',
  77069. iconMode: 'ios',
  77070. loadingEnter: 'loading-wp-pop-in',
  77071. loadingLeave: 'loading-wp-pop-out',
  77072. menuType: 'overlay',
  77073. modalEnter: 'modal-md-slide-in',
  77074. modalLeave: 'modal-md-slide-out',
  77075. pageTransition: 'wp-transition',
  77076. pickerEnter: 'picker-slide-in',
  77077. pickerLeave: 'picker-slide-out',
  77078. pickerRotateFactor: 0,
  77079. pickerScaleFactor: 0.81,
  77080. popoverEnter: 'popover-md-pop-in',
  77081. popoverLeave: 'popover-md-pop-out',
  77082. spinner: 'circles',
  77083. tabsHighlight: false,
  77084. tabsPlacement: 'top',
  77085. tabsHideOnSubPages: true,
  77086. toastEnter: 'toast-wp-slide-in',
  77087. toastLeave: 'toast-wp-slide-out',
  77088. };
  77089. function registerModeConfigs(config) {
  77090. return function () {
  77091. // iOS Mode Settings
  77092. config.setModeConfig('ios', MODE_IOS);
  77093. // Material Design Mode Settings
  77094. config.setModeConfig('md', MODE_MD);
  77095. // Windows Mode Settings
  77096. config.setModeConfig('wp', MODE_WP);
  77097. };
  77098. }
  77099. //# sourceMappingURL=mode-registry.js.map
  77100. /***/ }),
  77101. /* 198 */
  77102. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  77103. "use strict";
  77104. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return IonicGestureConfig; });
  77105. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  77106. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_platform_browser__ = __webpack_require__(31);
  77107. var __extends = (this && this.__extends) || (function () {
  77108. var extendStatics = Object.setPrototypeOf ||
  77109. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  77110. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  77111. return function (d, b) {
  77112. extendStatics(d, b);
  77113. function __() { this.constructor = d; }
  77114. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  77115. };
  77116. })();
  77117. /**
  77118. * @hidden
  77119. * This class overrides the default Angular gesture config.
  77120. */
  77121. var IonicGestureConfig = (function (_super) {
  77122. __extends(IonicGestureConfig, _super);
  77123. function IonicGestureConfig() {
  77124. return _super !== null && _super.apply(this, arguments) || this;
  77125. }
  77126. IonicGestureConfig.prototype.buildHammer = function (element) {
  77127. var mc = new window.Hammer(element);
  77128. for (var eventName in this.overrides) {
  77129. mc.get(eventName).set(this.overrides[eventName]);
  77130. }
  77131. return mc;
  77132. };
  77133. IonicGestureConfig.decorators = [
  77134. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */] },
  77135. ];
  77136. /** @nocollapse */
  77137. IonicGestureConfig.ctorParameters = function () { return []; };
  77138. return IonicGestureConfig;
  77139. }(__WEBPACK_IMPORTED_MODULE_1__angular_platform_browser__["d" /* HammerGestureConfig */]));
  77140. //# sourceMappingURL=gesture-config.js.map
  77141. /***/ }),
  77142. /* 199 */
  77143. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  77144. "use strict";
  77145. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SplashScreen; });
  77146. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  77147. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__ionic_native_core__ = __webpack_require__(200);
  77148. var __extends = (this && this.__extends) || (function () {
  77149. var extendStatics = Object.setPrototypeOf ||
  77150. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  77151. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  77152. return function (d, b) {
  77153. extendStatics(d, b);
  77154. function __() { this.constructor = d; }
  77155. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  77156. };
  77157. })();
  77158. var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
  77159. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  77160. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  77161. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  77162. return c > 3 && r && Object.defineProperty(target, key, r), r;
  77163. };
  77164. var __metadata = (this && this.__metadata) || function (k, v) {
  77165. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
  77166. };
  77167. /**
  77168. * @name Splash Screen
  77169. * @description This plugin displays and hides a splash screen during application launch. The methods below allows showing and hiding the splashscreen after the app has loaded.
  77170. * @usage
  77171. * ```typescript
  77172. * import { SplashScreen } from '@ionic-native/splash-screen';
  77173. *
  77174. * constructor(private splashScreen: SplashScreen) { }
  77175. *
  77176. * ...
  77177. *
  77178. * this.splashScreen.show();
  77179. *
  77180. * this.splashScreen.hide();
  77181. * ```
  77182. */
  77183. var SplashScreen = (function (_super) {
  77184. __extends(SplashScreen, _super);
  77185. function SplashScreen() {
  77186. return _super !== null && _super.apply(this, arguments) || this;
  77187. }
  77188. /**
  77189. * Shows the splashscreen
  77190. */
  77191. SplashScreen.prototype.show = function () { };
  77192. /**
  77193. * Hides the splashscreen
  77194. */
  77195. SplashScreen.prototype.hide = function () { };
  77196. SplashScreen.decorators = [
  77197. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */] },
  77198. ];
  77199. /** @nocollapse */
  77200. SplashScreen.ctorParameters = function () { return []; };
  77201. __decorate([
  77202. Object(__WEBPACK_IMPORTED_MODULE_1__ionic_native_core__["a" /* Cordova */])({
  77203. sync: true
  77204. }),
  77205. __metadata("design:type", Function),
  77206. __metadata("design:paramtypes", []),
  77207. __metadata("design:returntype", void 0)
  77208. ], SplashScreen.prototype, "show", null);
  77209. __decorate([
  77210. Object(__WEBPACK_IMPORTED_MODULE_1__ionic_native_core__["a" /* Cordova */])({
  77211. sync: true
  77212. }),
  77213. __metadata("design:type", Function),
  77214. __metadata("design:paramtypes", []),
  77215. __metadata("design:returntype", void 0)
  77216. ], SplashScreen.prototype, "hide", null);
  77217. SplashScreen = __decorate([
  77218. Object(__WEBPACK_IMPORTED_MODULE_1__ionic_native_core__["d" /* Plugin */])({
  77219. pluginName: 'SplashScreen',
  77220. plugin: 'cordova-plugin-splashscreen',
  77221. pluginRef: 'navigator.splashscreen',
  77222. repo: 'https://github.com/apache/cordova-plugin-splashscreen',
  77223. platforms: ['Amazon Fire OS', 'Android', 'iOS', 'Windows']
  77224. })
  77225. ], SplashScreen);
  77226. return SplashScreen;
  77227. }(__WEBPACK_IMPORTED_MODULE_1__ionic_native_core__["c" /* IonicNativePlugin */]));
  77228. //# sourceMappingURL=index.js.map
  77229. /***/ }),
  77230. /* 200 */
  77231. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  77232. "use strict";
  77233. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__plugin__ = __webpack_require__(201);
  77234. /* unused harmony namespace reexport */
  77235. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__decorators__ = __webpack_require__(274);
  77236. /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_1__decorators__["a"]; });
  77237. /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_1__decorators__["b"]; });
  77238. /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_1__decorators__["c"]; });
  77239. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util__ = __webpack_require__(98);
  77240. /* unused harmony namespace reexport */
  77241. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ionic_native_plugin__ = __webpack_require__(277);
  77242. /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_3__ionic_native_plugin__["a"]; });
  77243. //# sourceMappingURL=index.js.map
  77244. /***/ }),
  77245. /* 201 */
  77246. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  77247. "use strict";
  77248. /* unused harmony export ERR_CORDOVA_NOT_AVAILABLE */
  77249. /* unused harmony export ERR_PLUGIN_NOT_INSTALLED */
  77250. /* harmony export (immutable) */ __webpack_exports__["a"] = checkAvailability;
  77251. /* harmony export (immutable) */ __webpack_exports__["b"] = instanceAvailability;
  77252. /* unused harmony export wrapEventObservable */
  77253. /* harmony export (immutable) */ __webpack_exports__["c"] = overrideFunction;
  77254. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return wrap; });
  77255. /* harmony export (immutable) */ __webpack_exports__["e"] = wrapInstance;
  77256. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_rxjs_Observable__ = __webpack_require__(9);
  77257. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_rxjs_Observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_rxjs_Observable__);
  77258. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_observable_fromEvent__ = __webpack_require__(271);
  77259. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_observable_fromEvent___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_rxjs_observable_fromEvent__);
  77260. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__bootstrap__ = __webpack_require__(273);
  77261. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(98);
  77262. Object(__WEBPACK_IMPORTED_MODULE_2__bootstrap__["a" /* checkReady */])();
  77263. // declare const window;
  77264. // declare var Promise;
  77265. var ERR_CORDOVA_NOT_AVAILABLE = { error: 'cordova_not_available' };
  77266. var ERR_PLUGIN_NOT_INSTALLED = { error: 'plugin_not_installed' };
  77267. function checkAvailability(plugin, methodName, pluginName) {
  77268. var pluginRef, pluginInstance, pluginPackage;
  77269. if (typeof plugin === 'string') {
  77270. pluginRef = plugin;
  77271. }
  77272. else {
  77273. pluginRef = plugin.constructor.getPluginRef();
  77274. pluginName = plugin.constructor.getPluginName();
  77275. pluginPackage = plugin.constructor.getPluginInstallName();
  77276. }
  77277. pluginInstance = Object(__WEBPACK_IMPORTED_MODULE_3__util__["b" /* getPlugin */])(pluginRef);
  77278. if (!pluginInstance ||
  77279. (!!methodName && typeof pluginInstance[methodName] === 'undefined')) {
  77280. if (!window.cordova) {
  77281. Object(__WEBPACK_IMPORTED_MODULE_3__util__["a" /* cordovaWarn */])(pluginName, methodName);
  77282. return ERR_CORDOVA_NOT_AVAILABLE;
  77283. }
  77284. Object(__WEBPACK_IMPORTED_MODULE_3__util__["d" /* pluginWarn */])(pluginName, pluginPackage, methodName);
  77285. return ERR_PLUGIN_NOT_INSTALLED;
  77286. }
  77287. return true;
  77288. }
  77289. /**
  77290. * Checks if _objectInstance exists and has the method/property
  77291. * @private
  77292. */
  77293. function instanceAvailability(pluginObj, methodName) {
  77294. return (pluginObj._objectInstance &&
  77295. (!methodName ||
  77296. typeof pluginObj._objectInstance[methodName] !== 'undefined'));
  77297. }
  77298. function setIndex(args, opts, resolve, reject) {
  77299. if (opts === void 0) { opts = {}; }
  77300. // ignore resolve and reject in case sync
  77301. if (opts.sync) {
  77302. return args;
  77303. }
  77304. // If the plugin method expects myMethod(success, err, options)
  77305. if (opts.callbackOrder === 'reverse') {
  77306. // Get those arguments in the order [resolve, reject, ...restOfArgs]
  77307. args.unshift(reject);
  77308. args.unshift(resolve);
  77309. }
  77310. else if (opts.callbackStyle === 'node') {
  77311. args.push(function (err, result) {
  77312. if (err) {
  77313. reject(err);
  77314. }
  77315. else {
  77316. resolve(result);
  77317. }
  77318. });
  77319. }
  77320. else if (opts.callbackStyle === 'object' &&
  77321. opts.successName &&
  77322. opts.errorName) {
  77323. var obj = {};
  77324. obj[opts.successName] = resolve;
  77325. obj[opts.errorName] = reject;
  77326. args.push(obj);
  77327. }
  77328. else if (typeof opts.successIndex !== 'undefined' ||
  77329. typeof opts.errorIndex !== 'undefined') {
  77330. var setSuccessIndex = function () {
  77331. // If we've specified a success/error index
  77332. if (opts.successIndex > args.length) {
  77333. args[opts.successIndex] = resolve;
  77334. }
  77335. else {
  77336. args.splice(opts.successIndex, 0, resolve);
  77337. }
  77338. };
  77339. var setErrorIndex = function () {
  77340. // We don't want that the reject cb gets spliced into the position of an optional argument that has not been defined and thus causing non expected behaviour.
  77341. if (opts.errorIndex > args.length) {
  77342. args[opts.errorIndex] = reject; // insert the reject fn at the correct specific index
  77343. }
  77344. else {
  77345. args.splice(opts.errorIndex, 0, reject); // otherwise just splice it into the array
  77346. }
  77347. };
  77348. if (opts.successIndex > opts.errorIndex) {
  77349. setErrorIndex();
  77350. setSuccessIndex();
  77351. }
  77352. else {
  77353. setSuccessIndex();
  77354. setErrorIndex();
  77355. }
  77356. }
  77357. else {
  77358. // Otherwise, let's tack them on to the end of the argument list
  77359. // which is 90% of cases
  77360. args.push(resolve);
  77361. args.push(reject);
  77362. }
  77363. return args;
  77364. }
  77365. function callCordovaPlugin(pluginObj, methodName, args, opts, resolve, reject) {
  77366. if (opts === void 0) { opts = {}; }
  77367. // Try to figure out where the success/error callbacks need to be bound
  77368. // to our promise resolve/reject handlers.
  77369. args = setIndex(args, opts, resolve, reject);
  77370. var availabilityCheck = checkAvailability(pluginObj, methodName);
  77371. if (availabilityCheck === true) {
  77372. var pluginInstance = Object(__WEBPACK_IMPORTED_MODULE_3__util__["b" /* getPlugin */])(pluginObj.constructor.getPluginRef());
  77373. return pluginInstance[methodName].apply(pluginInstance, args);
  77374. }
  77375. else {
  77376. return availabilityCheck;
  77377. }
  77378. }
  77379. function wrapPromise(pluginObj, methodName, args, opts) {
  77380. if (opts === void 0) { opts = {}; }
  77381. var pluginResult, rej;
  77382. var p = Object(__WEBPACK_IMPORTED_MODULE_3__util__["c" /* getPromise */])(function (resolve, reject) {
  77383. if (opts.destruct) {
  77384. pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, function () {
  77385. var args = [];
  77386. for (var _i = 0; _i < arguments.length; _i++) {
  77387. args[_i] = arguments[_i];
  77388. }
  77389. return resolve(args);
  77390. }, function () {
  77391. var args = [];
  77392. for (var _i = 0; _i < arguments.length; _i++) {
  77393. args[_i] = arguments[_i];
  77394. }
  77395. return reject(args);
  77396. });
  77397. }
  77398. else {
  77399. pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, resolve, reject);
  77400. }
  77401. rej = reject;
  77402. });
  77403. // Angular throws an error on unhandled rejection, but in this case we have already printed
  77404. // a warning that Cordova is undefined or the plugin is uninstalled, so there is no reason
  77405. // to error
  77406. if (pluginResult && pluginResult.error) {
  77407. p.catch(function () { });
  77408. typeof rej === 'function' && rej(pluginResult.error);
  77409. }
  77410. return p;
  77411. }
  77412. function wrapOtherPromise(pluginObj, methodName, args, opts) {
  77413. if (opts === void 0) { opts = {}; }
  77414. return Object(__WEBPACK_IMPORTED_MODULE_3__util__["c" /* getPromise */])(function (resolve, reject) {
  77415. var pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts);
  77416. if (pluginResult) {
  77417. if (pluginResult.error) {
  77418. reject(pluginResult.error);
  77419. }
  77420. else if (pluginResult.then) {
  77421. pluginResult.then(resolve).catch(reject);
  77422. }
  77423. }
  77424. else {
  77425. reject({ error: 'unexpected_error' });
  77426. }
  77427. });
  77428. }
  77429. function wrapObservable(pluginObj, methodName, args, opts) {
  77430. if (opts === void 0) { opts = {}; }
  77431. return new __WEBPACK_IMPORTED_MODULE_0_rxjs_Observable__["Observable"](function (observer) {
  77432. var pluginResult;
  77433. if (opts.destruct) {
  77434. pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, function () {
  77435. var args = [];
  77436. for (var _i = 0; _i < arguments.length; _i++) {
  77437. args[_i] = arguments[_i];
  77438. }
  77439. return observer.next(args);
  77440. }, function () {
  77441. var args = [];
  77442. for (var _i = 0; _i < arguments.length; _i++) {
  77443. args[_i] = arguments[_i];
  77444. }
  77445. return observer.error(args);
  77446. });
  77447. }
  77448. else {
  77449. pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, observer.next.bind(observer), observer.error.bind(observer));
  77450. }
  77451. if (pluginResult && pluginResult.error) {
  77452. observer.error(pluginResult.error);
  77453. observer.complete();
  77454. }
  77455. return function () {
  77456. try {
  77457. if (opts.clearFunction) {
  77458. if (opts.clearWithArgs) {
  77459. return callCordovaPlugin(pluginObj, opts.clearFunction, args, opts, observer.next.bind(observer), observer.error.bind(observer));
  77460. }
  77461. return callCordovaPlugin(pluginObj, opts.clearFunction, []);
  77462. }
  77463. }
  77464. catch (e) {
  77465. console.warn('Unable to clear the previous observable watch for', pluginObj.constructor.getPluginName(), methodName);
  77466. console.warn(e);
  77467. }
  77468. };
  77469. });
  77470. }
  77471. function callInstance(pluginObj, methodName, args, opts, resolve, reject) {
  77472. if (opts === void 0) { opts = {}; }
  77473. args = setIndex(args, opts, resolve, reject);
  77474. if (instanceAvailability(pluginObj, methodName)) {
  77475. return pluginObj._objectInstance[methodName].apply(pluginObj._objectInstance, args);
  77476. }
  77477. }
  77478. /**
  77479. * Wrap the event with an observable
  77480. * @private
  77481. * @param event even name
  77482. * @param element The element to attach the event listener to
  77483. * @returns {Observable}
  77484. */
  77485. function wrapEventObservable(event, element) {
  77486. if (element === void 0) { element = window; }
  77487. return Object(__WEBPACK_IMPORTED_MODULE_1_rxjs_observable_fromEvent__["fromEvent"])(element, event);
  77488. }
  77489. /**
  77490. * Certain plugins expect the user to override methods in the plugin. For example,
  77491. * window.cordova.plugins.backgroundMode.onactivate = function() { ... }.
  77492. *
  77493. * Unfortunately, this is brittle and would be better wrapped as an Observable. overrideFunction
  77494. * does just this.
  77495. * @private
  77496. */
  77497. function overrideFunction(pluginObj, methodName, args, opts) {
  77498. if (opts === void 0) { opts = {}; }
  77499. return new __WEBPACK_IMPORTED_MODULE_0_rxjs_Observable__["Observable"](function (observer) {
  77500. var availabilityCheck = checkAvailability(pluginObj, null, pluginObj.constructor.getPluginName());
  77501. if (availabilityCheck === true) {
  77502. var pluginInstance_1 = Object(__WEBPACK_IMPORTED_MODULE_3__util__["b" /* getPlugin */])(pluginObj.constructor.getPluginRef());
  77503. pluginInstance_1[methodName] = observer.next.bind(observer);
  77504. return function () { return (pluginInstance_1[methodName] = function () { }); };
  77505. }
  77506. else {
  77507. observer.error(availabilityCheck);
  77508. observer.complete();
  77509. }
  77510. });
  77511. }
  77512. /**
  77513. * @private
  77514. */
  77515. var wrap = function (pluginObj, methodName, opts) {
  77516. if (opts === void 0) { opts = {}; }
  77517. return function () {
  77518. var args = [];
  77519. for (var _i = 0; _i < arguments.length; _i++) {
  77520. args[_i] = arguments[_i];
  77521. }
  77522. if (opts.sync) {
  77523. // Sync doesn't wrap the plugin with a promise or observable, it returns the result as-is
  77524. return callCordovaPlugin(pluginObj, methodName, args, opts);
  77525. }
  77526. else if (opts.observable) {
  77527. return wrapObservable(pluginObj, methodName, args, opts);
  77528. }
  77529. else if (opts.eventObservable && opts.event) {
  77530. return wrapEventObservable(opts.event, opts.element);
  77531. }
  77532. else if (opts.otherPromise) {
  77533. return wrapOtherPromise(pluginObj, methodName, args, opts);
  77534. }
  77535. else {
  77536. return wrapPromise(pluginObj, methodName, args, opts);
  77537. }
  77538. };
  77539. };
  77540. /**
  77541. * @private
  77542. */
  77543. function wrapInstance(pluginObj, methodName, opts) {
  77544. if (opts === void 0) { opts = {}; }
  77545. return function () {
  77546. var args = [];
  77547. for (var _i = 0; _i < arguments.length; _i++) {
  77548. args[_i] = arguments[_i];
  77549. }
  77550. if (opts.sync) {
  77551. return callInstance(pluginObj, methodName, args, opts);
  77552. }
  77553. else if (opts.observable) {
  77554. return new __WEBPACK_IMPORTED_MODULE_0_rxjs_Observable__["Observable"](function (observer) {
  77555. var pluginResult;
  77556. if (opts.destruct) {
  77557. pluginResult = callInstance(pluginObj, methodName, args, opts, function () {
  77558. var args = [];
  77559. for (var _i = 0; _i < arguments.length; _i++) {
  77560. args[_i] = arguments[_i];
  77561. }
  77562. return observer.next(args);
  77563. }, function () {
  77564. var args = [];
  77565. for (var _i = 0; _i < arguments.length; _i++) {
  77566. args[_i] = arguments[_i];
  77567. }
  77568. return observer.error(args);
  77569. });
  77570. }
  77571. else {
  77572. pluginResult = callInstance(pluginObj, methodName, args, opts, observer.next.bind(observer), observer.error.bind(observer));
  77573. }
  77574. if (pluginResult && pluginResult.error) {
  77575. observer.error(pluginResult.error);
  77576. observer.complete();
  77577. }
  77578. return function () {
  77579. try {
  77580. if (opts.clearWithArgs) {
  77581. return callInstance(pluginObj, opts.clearFunction, args, opts, observer.next.bind(observer), observer.error.bind(observer));
  77582. }
  77583. return callInstance(pluginObj, opts.clearFunction, []);
  77584. }
  77585. catch (e) {
  77586. console.warn('Unable to clear the previous observable watch for', pluginObj.constructor.getPluginName(), methodName);
  77587. console.warn(e);
  77588. }
  77589. };
  77590. });
  77591. }
  77592. else if (opts.otherPromise) {
  77593. return Object(__WEBPACK_IMPORTED_MODULE_3__util__["c" /* getPromise */])(function (resolve, reject) {
  77594. var result;
  77595. if (opts.destruct) {
  77596. result = callInstance(pluginObj, methodName, args, opts, function () {
  77597. var args = [];
  77598. for (var _i = 0; _i < arguments.length; _i++) {
  77599. args[_i] = arguments[_i];
  77600. }
  77601. return resolve(args);
  77602. }, function () {
  77603. var args = [];
  77604. for (var _i = 0; _i < arguments.length; _i++) {
  77605. args[_i] = arguments[_i];
  77606. }
  77607. return reject(args);
  77608. });
  77609. }
  77610. else {
  77611. result = callInstance(pluginObj, methodName, args, opts, resolve, reject);
  77612. }
  77613. if (result && !!result.then) {
  77614. result.then(resolve, reject);
  77615. }
  77616. else {
  77617. reject();
  77618. }
  77619. });
  77620. }
  77621. else {
  77622. var pluginResult_1, rej_1;
  77623. var p = Object(__WEBPACK_IMPORTED_MODULE_3__util__["c" /* getPromise */])(function (resolve, reject) {
  77624. if (opts.destruct) {
  77625. pluginResult_1 = callInstance(pluginObj, methodName, args, opts, function () {
  77626. var args = [];
  77627. for (var _i = 0; _i < arguments.length; _i++) {
  77628. args[_i] = arguments[_i];
  77629. }
  77630. return resolve(args);
  77631. }, function () {
  77632. var args = [];
  77633. for (var _i = 0; _i < arguments.length; _i++) {
  77634. args[_i] = arguments[_i];
  77635. }
  77636. return reject(args);
  77637. });
  77638. }
  77639. else {
  77640. pluginResult_1 = callInstance(pluginObj, methodName, args, opts, resolve, reject);
  77641. }
  77642. rej_1 = reject;
  77643. });
  77644. // Angular throws an error on unhandled rejection, but in this case we have already printed
  77645. // a warning that Cordova is undefined or the plugin is uninstalled, so there is no reason
  77646. // to error
  77647. if (pluginResult_1 && pluginResult_1.error) {
  77648. p.catch(function () { });
  77649. typeof rej_1 === 'function' && rej_1(pluginResult_1.error);
  77650. }
  77651. return p;
  77652. }
  77653. };
  77654. }
  77655. //# sourceMappingURL=plugin.js.map
  77656. /***/ }),
  77657. /* 202 */
  77658. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  77659. "use strict";
  77660. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return StatusBar; });
  77661. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  77662. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__ionic_native_core__ = __webpack_require__(200);
  77663. var __extends = (this && this.__extends) || (function () {
  77664. var extendStatics = Object.setPrototypeOf ||
  77665. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  77666. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  77667. return function (d, b) {
  77668. extendStatics(d, b);
  77669. function __() { this.constructor = d; }
  77670. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  77671. };
  77672. })();
  77673. var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
  77674. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  77675. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  77676. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  77677. return c > 3 && r && Object.defineProperty(target, key, r), r;
  77678. };
  77679. var __metadata = (this && this.__metadata) || function (k, v) {
  77680. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
  77681. };
  77682. /**
  77683. * @name Status Bar
  77684. * @description
  77685. * Manage the appearance of the native status bar.
  77686. *
  77687. * Requires Cordova plugin: `cordova-plugin-statusbar`. For more info, please see the [StatusBar plugin docs](https://github.com/apache/cordova-plugin-statusbar).
  77688. *
  77689. * @usage
  77690. * ```typescript
  77691. * import { StatusBar } from '@ionic-native/status-bar';
  77692. *
  77693. * constructor(private statusBar: StatusBar) { }
  77694. *
  77695. * ...
  77696. *
  77697. * // let status bar overlay webview
  77698. * this.statusBar.overlaysWebView(true);
  77699. *
  77700. * // set status bar to white
  77701. * this.statusBar.backgroundColorByHexString('#ffffff');
  77702. * ```
  77703. *
  77704. */
  77705. var StatusBar = (function (_super) {
  77706. __extends(StatusBar, _super);
  77707. function StatusBar() {
  77708. return _super !== null && _super.apply(this, arguments) || this;
  77709. }
  77710. /**
  77711. * Set whether the status bar overlays the main app view. The default
  77712. * is true.
  77713. *
  77714. * @param {boolean} doesOverlay Whether the status bar overlays the main app view.
  77715. */
  77716. StatusBar.prototype.overlaysWebView = function (doesOverlay) { };
  77717. ;
  77718. /**
  77719. * Use the default statusbar (dark text, for light backgrounds).
  77720. */
  77721. StatusBar.prototype.styleDefault = function () { };
  77722. ;
  77723. /**
  77724. * Use the lightContent statusbar (light text, for dark backgrounds).
  77725. */
  77726. StatusBar.prototype.styleLightContent = function () { };
  77727. ;
  77728. /**
  77729. * Use the blackTranslucent statusbar (light text, for dark backgrounds).
  77730. */
  77731. StatusBar.prototype.styleBlackTranslucent = function () { };
  77732. ;
  77733. /**
  77734. * Use the blackOpaque statusbar (light text, for dark backgrounds).
  77735. */
  77736. StatusBar.prototype.styleBlackOpaque = function () { };
  77737. ;
  77738. /**
  77739. * Set the status bar to a specific named color. Valid options:
  77740. * black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown.
  77741. *
  77742. * iOS note: you must call StatusBar.overlaysWebView(false) to enable color changing.
  77743. *
  77744. * @param {string} colorName The name of the color (from above)
  77745. */
  77746. StatusBar.prototype.backgroundColorByName = function (colorName) { };
  77747. ;
  77748. /**
  77749. * Set the status bar to a specific hex color (CSS shorthand supported!).
  77750. *
  77751. * iOS note: you must call StatusBar.overlaysWebView(false) to enable color changing.
  77752. *
  77753. * @param {string} hexString The hex value of the color.
  77754. */
  77755. StatusBar.prototype.backgroundColorByHexString = function (hexString) { };
  77756. ;
  77757. /**
  77758. * Hide the StatusBar
  77759. */
  77760. StatusBar.prototype.hide = function () { };
  77761. ;
  77762. /**
  77763. * Show the StatusBar
  77764. */
  77765. StatusBar.prototype.show = function () { };
  77766. ;
  77767. StatusBar.decorators = [
  77768. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */] },
  77769. ];
  77770. /** @nocollapse */
  77771. StatusBar.ctorParameters = function () { return []; };
  77772. __decorate([
  77773. Object(__WEBPACK_IMPORTED_MODULE_1__ionic_native_core__["a" /* Cordova */])({
  77774. sync: true
  77775. }),
  77776. __metadata("design:type", Function),
  77777. __metadata("design:paramtypes", [Boolean]),
  77778. __metadata("design:returntype", void 0)
  77779. ], StatusBar.prototype, "overlaysWebView", null);
  77780. __decorate([
  77781. Object(__WEBPACK_IMPORTED_MODULE_1__ionic_native_core__["a" /* Cordova */])({
  77782. sync: true
  77783. }),
  77784. __metadata("design:type", Function),
  77785. __metadata("design:paramtypes", []),
  77786. __metadata("design:returntype", void 0)
  77787. ], StatusBar.prototype, "styleDefault", null);
  77788. __decorate([
  77789. Object(__WEBPACK_IMPORTED_MODULE_1__ionic_native_core__["a" /* Cordova */])({
  77790. sync: true
  77791. }),
  77792. __metadata("design:type", Function),
  77793. __metadata("design:paramtypes", []),
  77794. __metadata("design:returntype", void 0)
  77795. ], StatusBar.prototype, "styleLightContent", null);
  77796. __decorate([
  77797. Object(__WEBPACK_IMPORTED_MODULE_1__ionic_native_core__["a" /* Cordova */])({
  77798. sync: true
  77799. }),
  77800. __metadata("design:type", Function),
  77801. __metadata("design:paramtypes", []),
  77802. __metadata("design:returntype", void 0)
  77803. ], StatusBar.prototype, "styleBlackTranslucent", null);
  77804. __decorate([
  77805. Object(__WEBPACK_IMPORTED_MODULE_1__ionic_native_core__["a" /* Cordova */])({
  77806. sync: true
  77807. }),
  77808. __metadata("design:type", Function),
  77809. __metadata("design:paramtypes", []),
  77810. __metadata("design:returntype", void 0)
  77811. ], StatusBar.prototype, "styleBlackOpaque", null);
  77812. __decorate([
  77813. Object(__WEBPACK_IMPORTED_MODULE_1__ionic_native_core__["a" /* Cordova */])({
  77814. sync: true
  77815. }),
  77816. __metadata("design:type", Function),
  77817. __metadata("design:paramtypes", [String]),
  77818. __metadata("design:returntype", void 0)
  77819. ], StatusBar.prototype, "backgroundColorByName", null);
  77820. __decorate([
  77821. Object(__WEBPACK_IMPORTED_MODULE_1__ionic_native_core__["a" /* Cordova */])({
  77822. sync: true
  77823. }),
  77824. __metadata("design:type", Function),
  77825. __metadata("design:paramtypes", [String]),
  77826. __metadata("design:returntype", void 0)
  77827. ], StatusBar.prototype, "backgroundColorByHexString", null);
  77828. __decorate([
  77829. Object(__WEBPACK_IMPORTED_MODULE_1__ionic_native_core__["a" /* Cordova */])({
  77830. sync: true
  77831. }),
  77832. __metadata("design:type", Function),
  77833. __metadata("design:paramtypes", []),
  77834. __metadata("design:returntype", void 0)
  77835. ], StatusBar.prototype, "hide", null);
  77836. __decorate([
  77837. Object(__WEBPACK_IMPORTED_MODULE_1__ionic_native_core__["a" /* Cordova */])({
  77838. sync: true
  77839. }),
  77840. __metadata("design:type", Function),
  77841. __metadata("design:paramtypes", []),
  77842. __metadata("design:returntype", void 0)
  77843. ], StatusBar.prototype, "show", null);
  77844. __decorate([
  77845. __WEBPACK_IMPORTED_MODULE_1__ionic_native_core__["b" /* CordovaProperty */],
  77846. __metadata("design:type", Boolean)
  77847. ], StatusBar.prototype, "isVisible", void 0);
  77848. StatusBar = __decorate([
  77849. Object(__WEBPACK_IMPORTED_MODULE_1__ionic_native_core__["d" /* Plugin */])({
  77850. pluginName: 'StatusBar',
  77851. plugin: 'cordova-plugin-statusbar',
  77852. pluginRef: 'StatusBar',
  77853. repo: 'https://github.com/apache/cordova-plugin-statusbar',
  77854. platforms: ['Android', 'iOS', 'Windows']
  77855. })
  77856. ], StatusBar);
  77857. return StatusBar;
  77858. }(__WEBPACK_IMPORTED_MODULE_1__ionic_native_core__["c" /* IonicNativePlugin */]));
  77859. //# sourceMappingURL=index.js.map
  77860. /***/ }),
  77861. /* 203 */,
  77862. /* 204 */
  77863. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  77864. "use strict";
  77865. /* unused harmony export VERSION */
  77866. /* unused harmony export JitCompilerFactory */
  77867. /* unused harmony export RESOURCE_CACHE_PROVIDER */
  77868. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return platformBrowserDynamic; });
  77869. /* unused harmony export ɵCompilerImpl */
  77870. /* unused harmony export ɵplatformCoreDynamic */
  77871. /* unused harmony export ɵINTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS */
  77872. /* unused harmony export ɵResourceLoaderImpl */
  77873. /* unused harmony export ɵa */
  77874. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_compiler__ = __webpack_require__(205);
  77875. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
  77876. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_common__ = __webpack_require__(34);
  77877. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__angular_platform_browser__ = __webpack_require__(31);
  77878. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_tslib__ = __webpack_require__(25);
  77879. /**
  77880. * @license Angular v5.2.11
  77881. * (c) 2010-2018 Google, Inc. https://angular.io/
  77882. * License: MIT
  77883. */
  77884. /**
  77885. * @fileoverview added by tsickle
  77886. * @suppress {checkTypes} checked by tsc
  77887. */
  77888. /**
  77889. * @license
  77890. * Copyright Google Inc. All Rights Reserved.
  77891. *
  77892. * Use of this source code is governed by an MIT-style license that can be
  77893. * found in the LICENSE file at https://angular.io/license
  77894. */
  77895. var MODULE_SUFFIX = '';
  77896. var builtinExternalReferences = createBuiltinExternalReferencesMap();
  77897. var JitReflector = /** @class */ (function () {
  77898. function JitReflector() {
  77899. this.builtinExternalReferences = new Map();
  77900. this.reflectionCapabilities = new __WEBPACK_IMPORTED_MODULE_1__angular_core__["_23" /* ɵReflectionCapabilities */]();
  77901. }
  77902. /**
  77903. * @param {?} type
  77904. * @param {?} cmpMetadata
  77905. * @return {?}
  77906. */
  77907. JitReflector.prototype.componentModuleUrl = /**
  77908. * @param {?} type
  77909. * @param {?} cmpMetadata
  77910. * @return {?}
  77911. */
  77912. function (type, cmpMetadata) {
  77913. var /** @type {?} */ moduleId = cmpMetadata.moduleId;
  77914. if (typeof moduleId === 'string') {
  77915. var /** @type {?} */ scheme = Object(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["z" /* getUrlScheme */])(moduleId);
  77916. return scheme ? moduleId : "package:" + moduleId + MODULE_SUFFIX;
  77917. }
  77918. else if (moduleId !== null && moduleId !== void 0) {
  77919. throw Object(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["A" /* syntaxError */])("moduleId should be a string in \"" + Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_48" /* ɵstringify */])(type) + "\". See https://goo.gl/wIDDiL for more information.\n" +
  77920. "If you're using Webpack you should inline the template and the styles, see https://goo.gl/X2J8zc.");
  77921. }
  77922. return "./" + Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_48" /* ɵstringify */])(type);
  77923. };
  77924. /**
  77925. * @param {?} typeOrFunc
  77926. * @return {?}
  77927. */
  77928. JitReflector.prototype.parameters = /**
  77929. * @param {?} typeOrFunc
  77930. * @return {?}
  77931. */
  77932. function (typeOrFunc) {
  77933. return this.reflectionCapabilities.parameters(typeOrFunc);
  77934. };
  77935. /**
  77936. * @param {?} typeOrFunc
  77937. * @return {?}
  77938. */
  77939. JitReflector.prototype.annotations = /**
  77940. * @param {?} typeOrFunc
  77941. * @return {?}
  77942. */
  77943. function (typeOrFunc) {
  77944. return this.reflectionCapabilities.annotations(typeOrFunc);
  77945. };
  77946. /**
  77947. * @param {?} typeOrFunc
  77948. * @return {?}
  77949. */
  77950. JitReflector.prototype.propMetadata = /**
  77951. * @param {?} typeOrFunc
  77952. * @return {?}
  77953. */
  77954. function (typeOrFunc) {
  77955. return this.reflectionCapabilities.propMetadata(typeOrFunc);
  77956. };
  77957. /**
  77958. * @param {?} type
  77959. * @param {?} lcProperty
  77960. * @return {?}
  77961. */
  77962. JitReflector.prototype.hasLifecycleHook = /**
  77963. * @param {?} type
  77964. * @param {?} lcProperty
  77965. * @return {?}
  77966. */
  77967. function (type, lcProperty) {
  77968. return this.reflectionCapabilities.hasLifecycleHook(type, lcProperty);
  77969. };
  77970. /**
  77971. * @param {?} type
  77972. * @return {?}
  77973. */
  77974. JitReflector.prototype.guards = /**
  77975. * @param {?} type
  77976. * @return {?}
  77977. */
  77978. function (type) { return this.reflectionCapabilities.guards(type); };
  77979. /**
  77980. * @param {?} ref
  77981. * @return {?}
  77982. */
  77983. JitReflector.prototype.resolveExternalReference = /**
  77984. * @param {?} ref
  77985. * @return {?}
  77986. */
  77987. function (ref) {
  77988. return builtinExternalReferences.get(ref) || ref.runtime;
  77989. };
  77990. return JitReflector;
  77991. }());
  77992. /**
  77993. * @return {?}
  77994. */
  77995. function createBuiltinExternalReferencesMap() {
  77996. var /** @type {?} */ map = new Map();
  77997. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].ANALYZE_FOR_ENTRY_COMPONENTS, __WEBPACK_IMPORTED_MODULE_1__angular_core__["a" /* ANALYZE_FOR_ENTRY_COMPONENTS */]);
  77998. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].ElementRef, __WEBPACK_IMPORTED_MODULE_1__angular_core__["t" /* ElementRef */]);
  77999. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].NgModuleRef, __WEBPACK_IMPORTED_MODULE_1__angular_core__["K" /* NgModuleRef */]);
  78000. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].ViewContainerRef, __WEBPACK_IMPORTED_MODULE_1__angular_core__["_10" /* ViewContainerRef */]);
  78001. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].ChangeDetectorRef, __WEBPACK_IMPORTED_MODULE_1__angular_core__["j" /* ChangeDetectorRef */]);
  78002. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].QueryList, __WEBPACK_IMPORTED_MODULE_1__angular_core__["T" /* QueryList */]);
  78003. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].TemplateRef, __WEBPACK_IMPORTED_MODULE_1__angular_core__["_5" /* TemplateRef */]);
  78004. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].CodegenComponentFactoryResolver, __WEBPACK_IMPORTED_MODULE_1__angular_core__["_19" /* ɵCodegenComponentFactoryResolver */]);
  78005. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].ComponentFactoryResolver, __WEBPACK_IMPORTED_MODULE_1__angular_core__["o" /* ComponentFactoryResolver */]);
  78006. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].ComponentFactory, __WEBPACK_IMPORTED_MODULE_1__angular_core__["n" /* ComponentFactory */]);
  78007. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].ComponentRef, __WEBPACK_IMPORTED_MODULE_1__angular_core__["p" /* ComponentRef */]);
  78008. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].NgModuleFactory, __WEBPACK_IMPORTED_MODULE_1__angular_core__["J" /* NgModuleFactory */]);
  78009. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].createModuleFactory, __WEBPACK_IMPORTED_MODULE_1__angular_core__["_26" /* ɵcmf */]);
  78010. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].moduleDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__["_37" /* ɵmod */]);
  78011. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].moduleProviderDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__["_38" /* ɵmpd */]);
  78012. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].RegisterModuleFactoryFn, __WEBPACK_IMPORTED_MODULE_1__angular_core__["_47" /* ɵregisterModuleFactory */]);
  78013. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].Injector, __WEBPACK_IMPORTED_MODULE_1__angular_core__["C" /* Injector */]);
  78014. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].ViewEncapsulation, __WEBPACK_IMPORTED_MODULE_1__angular_core__["_11" /* ViewEncapsulation */]);
  78015. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].ChangeDetectionStrategy, __WEBPACK_IMPORTED_MODULE_1__angular_core__["i" /* ChangeDetectionStrategy */]);
  78016. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].SecurityContext, __WEBPACK_IMPORTED_MODULE_1__angular_core__["_0" /* SecurityContext */]);
  78017. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].LOCALE_ID, __WEBPACK_IMPORTED_MODULE_1__angular_core__["G" /* LOCALE_ID */]);
  78018. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].TRANSLATIONS_FORMAT, __WEBPACK_IMPORTED_MODULE_1__angular_core__["_4" /* TRANSLATIONS_FORMAT */]);
  78019. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].inlineInterpolate, __WEBPACK_IMPORTED_MODULE_1__angular_core__["_31" /* ɵinlineInterpolate */]);
  78020. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].interpolate, __WEBPACK_IMPORTED_MODULE_1__angular_core__["_32" /* ɵinterpolate */]);
  78021. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].EMPTY_ARRAY, __WEBPACK_IMPORTED_MODULE_1__angular_core__["_21" /* ɵEMPTY_ARRAY */]);
  78022. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].EMPTY_MAP, __WEBPACK_IMPORTED_MODULE_1__angular_core__["_22" /* ɵEMPTY_MAP */]);
  78023. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].Renderer, __WEBPACK_IMPORTED_MODULE_1__angular_core__["V" /* Renderer */]);
  78024. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].viewDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__["_51" /* ɵvid */]);
  78025. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].elementDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__["_29" /* ɵeld */]);
  78026. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].anchorDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__["_24" /* ɵand */]);
  78027. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].textDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__["_49" /* ɵted */]);
  78028. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].directiveDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__["_28" /* ɵdid */]);
  78029. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].providerDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__["_45" /* ɵprd */]);
  78030. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].queryDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__["_46" /* ɵqud */]);
  78031. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].pureArrayDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__["_41" /* ɵpad */]);
  78032. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].pureObjectDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__["_43" /* ɵpod */]);
  78033. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].purePipeDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__["_44" /* ɵppd */]);
  78034. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].pipeDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__["_42" /* ɵpid */]);
  78035. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].nodeValue, __WEBPACK_IMPORTED_MODULE_1__angular_core__["_40" /* ɵnov */]);
  78036. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].ngContentDef, __WEBPACK_IMPORTED_MODULE_1__angular_core__["_39" /* ɵncd */]);
  78037. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].unwrapValue, __WEBPACK_IMPORTED_MODULE_1__angular_core__["_50" /* ɵunv */]);
  78038. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].createRendererType2, __WEBPACK_IMPORTED_MODULE_1__angular_core__["_27" /* ɵcrt */]);
  78039. map.set(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["j" /* Identifiers */].createComponentFactory, __WEBPACK_IMPORTED_MODULE_1__angular_core__["_25" /* ɵccf */]);
  78040. return map;
  78041. }
  78042. /**
  78043. * @fileoverview added by tsickle
  78044. * @suppress {checkTypes} checked by tsc
  78045. */
  78046. /**
  78047. * @license
  78048. * Copyright Google Inc. All Rights Reserved.
  78049. *
  78050. * Use of this source code is governed by an MIT-style license that can be
  78051. * found in the LICENSE file at https://angular.io/license
  78052. */
  78053. var ERROR_COLLECTOR_TOKEN = new __WEBPACK_IMPORTED_MODULE_1__angular_core__["B" /* InjectionToken */]('ErrorCollector');
  78054. /**
  78055. * A default provider for {\@link PACKAGE_ROOT_URL} that maps to '/'.
  78056. */
  78057. var DEFAULT_PACKAGE_URL_PROVIDER = {
  78058. provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__["P" /* PACKAGE_ROOT_URL */],
  78059. useValue: '/'
  78060. };
  78061. var _NO_RESOURCE_LOADER = {
  78062. get: /**
  78063. * @param {?} url
  78064. * @return {?}
  78065. */
  78066. function (url) {
  78067. throw new Error("No ResourceLoader implementation has been provided. Can't read the url \"" + url + "\"");
  78068. }
  78069. };
  78070. var baseHtmlParser = new __WEBPACK_IMPORTED_MODULE_1__angular_core__["B" /* InjectionToken */]('HtmlParser');
  78071. var CompilerImpl = /** @class */ (function () {
  78072. function CompilerImpl(injector, _metadataResolver, templateParser, styleCompiler, viewCompiler, ngModuleCompiler, summaryResolver, compileReflector, compilerConfig, console) {
  78073. this._metadataResolver = _metadataResolver;
  78074. this._delegate = new __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["k" /* JitCompiler */](_metadataResolver, templateParser, styleCompiler, viewCompiler, ngModuleCompiler, summaryResolver, compileReflector, compilerConfig, console, this.getExtraNgModuleProviders.bind(this));
  78075. this.injector = injector;
  78076. }
  78077. /**
  78078. * @return {?}
  78079. */
  78080. CompilerImpl.prototype.getExtraNgModuleProviders = /**
  78081. * @return {?}
  78082. */
  78083. function () {
  78084. return [this._metadataResolver.getProviderMetadata(new __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["r" /* ProviderMeta */](__WEBPACK_IMPORTED_MODULE_1__angular_core__["k" /* Compiler */], { useValue: this }))];
  78085. };
  78086. /**
  78087. * @template T
  78088. * @param {?} moduleType
  78089. * @return {?}
  78090. */
  78091. CompilerImpl.prototype.compileModuleSync = /**
  78092. * @template T
  78093. * @param {?} moduleType
  78094. * @return {?}
  78095. */
  78096. function (moduleType) {
  78097. return /** @type {?} */ (this._delegate.compileModuleSync(moduleType));
  78098. };
  78099. /**
  78100. * @template T
  78101. * @param {?} moduleType
  78102. * @return {?}
  78103. */
  78104. CompilerImpl.prototype.compileModuleAsync = /**
  78105. * @template T
  78106. * @param {?} moduleType
  78107. * @return {?}
  78108. */
  78109. function (moduleType) {
  78110. return /** @type {?} */ (this._delegate.compileModuleAsync(moduleType));
  78111. };
  78112. /**
  78113. * @template T
  78114. * @param {?} moduleType
  78115. * @return {?}
  78116. */
  78117. CompilerImpl.prototype.compileModuleAndAllComponentsSync = /**
  78118. * @template T
  78119. * @param {?} moduleType
  78120. * @return {?}
  78121. */
  78122. function (moduleType) {
  78123. var /** @type {?} */ result = this._delegate.compileModuleAndAllComponentsSync(moduleType);
  78124. return {
  78125. ngModuleFactory: /** @type {?} */ (result.ngModuleFactory),
  78126. componentFactories: /** @type {?} */ (result.componentFactories),
  78127. };
  78128. };
  78129. /**
  78130. * @template T
  78131. * @param {?} moduleType
  78132. * @return {?}
  78133. */
  78134. CompilerImpl.prototype.compileModuleAndAllComponentsAsync = /**
  78135. * @template T
  78136. * @param {?} moduleType
  78137. * @return {?}
  78138. */
  78139. function (moduleType) {
  78140. return this._delegate.compileModuleAndAllComponentsAsync(moduleType)
  78141. .then(function (result) {
  78142. return ({
  78143. ngModuleFactory: /** @type {?} */ (result.ngModuleFactory),
  78144. componentFactories: /** @type {?} */ (result.componentFactories),
  78145. });
  78146. });
  78147. };
  78148. /**
  78149. * @param {?} summaries
  78150. * @return {?}
  78151. */
  78152. CompilerImpl.prototype.loadAotSummaries = /**
  78153. * @param {?} summaries
  78154. * @return {?}
  78155. */
  78156. function (summaries) { this._delegate.loadAotSummaries(summaries); };
  78157. /**
  78158. * @param {?} ref
  78159. * @return {?}
  78160. */
  78161. CompilerImpl.prototype.hasAotSummary = /**
  78162. * @param {?} ref
  78163. * @return {?}
  78164. */
  78165. function (ref) { return this._delegate.hasAotSummary(ref); };
  78166. /**
  78167. * @template T
  78168. * @param {?} component
  78169. * @return {?}
  78170. */
  78171. CompilerImpl.prototype.getComponentFactory = /**
  78172. * @template T
  78173. * @param {?} component
  78174. * @return {?}
  78175. */
  78176. function (component) {
  78177. return /** @type {?} */ (this._delegate.getComponentFactory(component));
  78178. };
  78179. /**
  78180. * @return {?}
  78181. */
  78182. CompilerImpl.prototype.clearCache = /**
  78183. * @return {?}
  78184. */
  78185. function () { this._delegate.clearCache(); };
  78186. /**
  78187. * @param {?} type
  78188. * @return {?}
  78189. */
  78190. CompilerImpl.prototype.clearCacheFor = /**
  78191. * @param {?} type
  78192. * @return {?}
  78193. */
  78194. function (type) { this._delegate.clearCacheFor(type); };
  78195. return CompilerImpl;
  78196. }());
  78197. /**
  78198. * A set of providers that provide `JitCompiler` and its dependencies to use for
  78199. * template compilation.
  78200. */
  78201. var COMPILER_PROVIDERS = /** @type {?} */ ([
  78202. { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["b" /* CompileReflector */], useValue: new JitReflector() },
  78203. { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["s" /* ResourceLoader */], useValue: _NO_RESOURCE_LOADER },
  78204. { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["l" /* JitSummaryResolver */], deps: [] },
  78205. { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["v" /* SummaryResolver */], useExisting: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["l" /* JitSummaryResolver */] },
  78206. { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__["_20" /* ɵConsole */], deps: [] },
  78207. { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["m" /* Lexer */], deps: [] },
  78208. { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["p" /* Parser */], deps: [__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["m" /* Lexer */]] },
  78209. {
  78210. provide: baseHtmlParser,
  78211. useClass: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["h" /* HtmlParser */],
  78212. deps: [],
  78213. },
  78214. {
  78215. provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["i" /* I18NHtmlParser */],
  78216. useFactory: function (parser, translations, format, config, console) {
  78217. translations = translations || '';
  78218. var /** @type {?} */ missingTranslation = translations ? /** @type {?} */ ((config.missingTranslation)) : __WEBPACK_IMPORTED_MODULE_1__angular_core__["H" /* MissingTranslationStrategy */].Ignore;
  78219. return new __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["i" /* I18NHtmlParser */](parser, translations, format, missingTranslation, console);
  78220. },
  78221. deps: [
  78222. baseHtmlParser,
  78223. [new __WEBPACK_IMPORTED_MODULE_1__angular_core__["N" /* Optional */](), new __WEBPACK_IMPORTED_MODULE_1__angular_core__["z" /* Inject */](__WEBPACK_IMPORTED_MODULE_1__angular_core__["_3" /* TRANSLATIONS */])],
  78224. [new __WEBPACK_IMPORTED_MODULE_1__angular_core__["N" /* Optional */](), new __WEBPACK_IMPORTED_MODULE_1__angular_core__["z" /* Inject */](__WEBPACK_IMPORTED_MODULE_1__angular_core__["_4" /* TRANSLATIONS_FORMAT */])],
  78225. [__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["c" /* CompilerConfig */]],
  78226. [__WEBPACK_IMPORTED_MODULE_1__angular_core__["_20" /* ɵConsole */]],
  78227. ]
  78228. },
  78229. {
  78230. provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["h" /* HtmlParser */],
  78231. useExisting: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["i" /* I18NHtmlParser */],
  78232. },
  78233. {
  78234. provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["w" /* TemplateParser */], deps: [__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["c" /* CompilerConfig */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["b" /* CompileReflector */],
  78235. __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["p" /* Parser */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["g" /* ElementSchemaRegistry */],
  78236. __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["i" /* I18NHtmlParser */], __WEBPACK_IMPORTED_MODULE_1__angular_core__["_20" /* ɵConsole */]]
  78237. },
  78238. { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["d" /* DirectiveNormalizer */], deps: [__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["s" /* ResourceLoader */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["x" /* UrlResolver */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["h" /* HtmlParser */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["c" /* CompilerConfig */]] },
  78239. { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["a" /* CompileMetadataResolver */], deps: [__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["c" /* CompilerConfig */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["h" /* HtmlParser */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["o" /* NgModuleResolver */],
  78240. __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["e" /* DirectiveResolver */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["q" /* PipeResolver */],
  78241. __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["v" /* SummaryResolver */],
  78242. __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["g" /* ElementSchemaRegistry */],
  78243. __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["d" /* DirectiveNormalizer */], __WEBPACK_IMPORTED_MODULE_1__angular_core__["_20" /* ɵConsole */],
  78244. [__WEBPACK_IMPORTED_MODULE_1__angular_core__["N" /* Optional */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["t" /* StaticSymbolCache */]],
  78245. __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["b" /* CompileReflector */],
  78246. [__WEBPACK_IMPORTED_MODULE_1__angular_core__["N" /* Optional */], ERROR_COLLECTOR_TOKEN]] },
  78247. DEFAULT_PACKAGE_URL_PROVIDER,
  78248. { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["u" /* StyleCompiler */], deps: [__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["x" /* UrlResolver */]] },
  78249. { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["y" /* ViewCompiler */], deps: [__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["b" /* CompileReflector */]] },
  78250. { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["n" /* NgModuleCompiler */], deps: [__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["b" /* CompileReflector */]] },
  78251. { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["c" /* CompilerConfig */], useValue: new __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["c" /* CompilerConfig */]() },
  78252. { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__["k" /* Compiler */], useClass: CompilerImpl, deps: [__WEBPACK_IMPORTED_MODULE_1__angular_core__["C" /* Injector */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["a" /* CompileMetadataResolver */],
  78253. __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["w" /* TemplateParser */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["u" /* StyleCompiler */],
  78254. __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["y" /* ViewCompiler */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["n" /* NgModuleCompiler */],
  78255. __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["v" /* SummaryResolver */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["b" /* CompileReflector */], __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["c" /* CompilerConfig */],
  78256. __WEBPACK_IMPORTED_MODULE_1__angular_core__["_20" /* ɵConsole */]] },
  78257. { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["f" /* DomElementSchemaRegistry */], deps: [] },
  78258. { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["g" /* ElementSchemaRegistry */], useExisting: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["f" /* DomElementSchemaRegistry */] },
  78259. { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["x" /* UrlResolver */], deps: [__WEBPACK_IMPORTED_MODULE_1__angular_core__["P" /* PACKAGE_ROOT_URL */]] },
  78260. { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["e" /* DirectiveResolver */], deps: [__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["b" /* CompileReflector */]] },
  78261. { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["q" /* PipeResolver */], deps: [__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["b" /* CompileReflector */]] },
  78262. { provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["o" /* NgModuleResolver */], deps: [__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["b" /* CompileReflector */]] },
  78263. ]);
  78264. /**
  78265. * \@experimental
  78266. */
  78267. var JitCompilerFactory = /** @class */ (function () {
  78268. /* @internal */
  78269. function JitCompilerFactory(defaultOptions) {
  78270. var /** @type {?} */ compilerOptions = {
  78271. useJit: true,
  78272. defaultEncapsulation: __WEBPACK_IMPORTED_MODULE_1__angular_core__["_11" /* ViewEncapsulation */].Emulated,
  78273. missingTranslation: __WEBPACK_IMPORTED_MODULE_1__angular_core__["H" /* MissingTranslationStrategy */].Warning,
  78274. enableLegacyTemplate: false,
  78275. };
  78276. this._defaultOptions = [compilerOptions].concat(defaultOptions);
  78277. }
  78278. /**
  78279. * @param {?=} options
  78280. * @return {?}
  78281. */
  78282. JitCompilerFactory.prototype.createCompiler = /**
  78283. * @param {?=} options
  78284. * @return {?}
  78285. */
  78286. function (options) {
  78287. if (options === void 0) { options = []; }
  78288. var /** @type {?} */ opts = _mergeOptions(this._defaultOptions.concat(options));
  78289. var /** @type {?} */ injector = __WEBPACK_IMPORTED_MODULE_1__angular_core__["C" /* Injector */].create([
  78290. COMPILER_PROVIDERS, {
  78291. provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["c" /* CompilerConfig */],
  78292. useFactory: function () {
  78293. return new __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["c" /* CompilerConfig */]({
  78294. // let explicit values from the compiler options overwrite options
  78295. // from the app providers
  78296. useJit: opts.useJit,
  78297. jitDevMode: Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_16" /* isDevMode */])(),
  78298. // let explicit values from the compiler options overwrite options
  78299. // from the app providers
  78300. defaultEncapsulation: opts.defaultEncapsulation,
  78301. missingTranslation: opts.missingTranslation,
  78302. enableLegacyTemplate: opts.enableLegacyTemplate,
  78303. preserveWhitespaces: opts.preserveWhitespaces,
  78304. });
  78305. },
  78306. deps: []
  78307. },
  78308. /** @type {?} */ ((opts.providers))
  78309. ]);
  78310. return injector.get(__WEBPACK_IMPORTED_MODULE_1__angular_core__["k" /* Compiler */]);
  78311. };
  78312. return JitCompilerFactory;
  78313. }());
  78314. /**
  78315. * @param {?} optionsArr
  78316. * @return {?}
  78317. */
  78318. function _mergeOptions(optionsArr) {
  78319. return {
  78320. useJit: _lastDefined(optionsArr.map(function (options) { return options.useJit; })),
  78321. defaultEncapsulation: _lastDefined(optionsArr.map(function (options) { return options.defaultEncapsulation; })),
  78322. providers: _mergeArrays(optionsArr.map(function (options) { return ((options.providers)); })),
  78323. missingTranslation: _lastDefined(optionsArr.map(function (options) { return options.missingTranslation; })),
  78324. enableLegacyTemplate: _lastDefined(optionsArr.map(function (options) { return options.enableLegacyTemplate; })),
  78325. preserveWhitespaces: _lastDefined(optionsArr.map(function (options) { return options.preserveWhitespaces; })),
  78326. };
  78327. }
  78328. /**
  78329. * @template T
  78330. * @param {?} args
  78331. * @return {?}
  78332. */
  78333. function _lastDefined(args) {
  78334. for (var /** @type {?} */ i = args.length - 1; i >= 0; i--) {
  78335. if (args[i] !== undefined) {
  78336. return args[i];
  78337. }
  78338. }
  78339. return undefined;
  78340. }
  78341. /**
  78342. * @param {?} parts
  78343. * @return {?}
  78344. */
  78345. function _mergeArrays(parts) {
  78346. var /** @type {?} */ result = [];
  78347. parts.forEach(function (part) { return part && result.push.apply(result, part); });
  78348. return result;
  78349. }
  78350. /**
  78351. * @fileoverview added by tsickle
  78352. * @suppress {checkTypes} checked by tsc
  78353. */
  78354. /**
  78355. * @license
  78356. * Copyright Google Inc. All Rights Reserved.
  78357. *
  78358. * Use of this source code is governed by an MIT-style license that can be
  78359. * found in the LICENSE file at https://angular.io/license
  78360. */
  78361. /**
  78362. * A platform that included corePlatform and the compiler.
  78363. *
  78364. * \@experimental
  78365. */
  78366. var platformCoreDynamic = Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_13" /* createPlatformFactory */])(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_17" /* platformCore */], 'coreDynamic', [
  78367. { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__["h" /* COMPILER_OPTIONS */], useValue: {}, multi: true },
  78368. { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__["l" /* CompilerFactory */], useClass: JitCompilerFactory, deps: [__WEBPACK_IMPORTED_MODULE_1__angular_core__["h" /* COMPILER_OPTIONS */]] },
  78369. ]);
  78370. /**
  78371. * @fileoverview added by tsickle
  78372. * @suppress {checkTypes} checked by tsc
  78373. */
  78374. var ResourceLoaderImpl = /** @class */ (function (_super) {
  78375. Object(__WEBPACK_IMPORTED_MODULE_4_tslib__["b" /* __extends */])(ResourceLoaderImpl, _super);
  78376. function ResourceLoaderImpl() {
  78377. return _super !== null && _super.apply(this, arguments) || this;
  78378. }
  78379. /**
  78380. * @param {?} url
  78381. * @return {?}
  78382. */
  78383. ResourceLoaderImpl.prototype.get = /**
  78384. * @param {?} url
  78385. * @return {?}
  78386. */
  78387. function (url) {
  78388. var /** @type {?} */ resolve;
  78389. var /** @type {?} */ reject;
  78390. var /** @type {?} */ promise = new Promise(function (res, rej) {
  78391. resolve = res;
  78392. reject = rej;
  78393. });
  78394. var /** @type {?} */ xhr = new XMLHttpRequest();
  78395. xhr.open('GET', url, true);
  78396. xhr.responseType = 'text';
  78397. xhr.onload = function () {
  78398. // responseText is the old-school way of retrieving response (supported by IE8 & 9)
  78399. // response/responseType properties were introduced in ResourceLoader Level2 spec (supported
  78400. // by IE10)
  78401. var /** @type {?} */ response = xhr.response || xhr.responseText;
  78402. // normalize IE9 bug (http://bugs.jquery.com/ticket/1450)
  78403. var /** @type {?} */ status = xhr.status === 1223 ? 204 : xhr.status;
  78404. // fix status code when it is 0 (0 status is undocumented).
  78405. // Occurs when accessing file resources or on Android 4.1 stock browser
  78406. // while retrieving files from application cache.
  78407. if (status === 0) {
  78408. status = response ? 200 : 0;
  78409. }
  78410. if (200 <= status && status <= 300) {
  78411. resolve(response);
  78412. }
  78413. else {
  78414. reject("Failed to load " + url);
  78415. }
  78416. };
  78417. xhr.onerror = function () { reject("Failed to load " + url); };
  78418. xhr.send();
  78419. return promise;
  78420. };
  78421. ResourceLoaderImpl.decorators = [
  78422. { type: __WEBPACK_IMPORTED_MODULE_1__angular_core__["A" /* Injectable */] },
  78423. ];
  78424. /** @nocollapse */
  78425. ResourceLoaderImpl.ctorParameters = function () { return []; };
  78426. return ResourceLoaderImpl;
  78427. }(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["s" /* ResourceLoader */]));
  78428. /**
  78429. * @fileoverview added by tsickle
  78430. * @suppress {checkTypes} checked by tsc
  78431. */
  78432. /**
  78433. * @license
  78434. * Copyright Google Inc. All Rights Reserved.
  78435. *
  78436. * Use of this source code is governed by an MIT-style license that can be
  78437. * found in the LICENSE file at https://angular.io/license
  78438. */
  78439. var INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS = [
  78440. __WEBPACK_IMPORTED_MODULE_3__angular_platform_browser__["f" /* ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS */],
  78441. {
  78442. provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__["h" /* COMPILER_OPTIONS */],
  78443. useValue: { providers: [{ provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["s" /* ResourceLoader */], useClass: ResourceLoaderImpl, deps: [] }] },
  78444. multi: true
  78445. },
  78446. { provide: __WEBPACK_IMPORTED_MODULE_1__angular_core__["Q" /* PLATFORM_ID */], useValue: __WEBPACK_IMPORTED_MODULE_2__angular_common__["i" /* ɵPLATFORM_BROWSER_ID */] },
  78447. ];
  78448. /**
  78449. * @fileoverview added by tsickle
  78450. * @suppress {checkTypes} checked by tsc
  78451. */
  78452. /**
  78453. * @license
  78454. * Copyright Google Inc. All Rights Reserved.
  78455. *
  78456. * Use of this source code is governed by an MIT-style license that can be
  78457. * found in the LICENSE file at https://angular.io/license
  78458. */
  78459. /**
  78460. * An implementation of ResourceLoader that uses a template cache to avoid doing an actual
  78461. * ResourceLoader.
  78462. *
  78463. * The template cache needs to be built and loaded into window.$templateCache
  78464. * via a separate mechanism.
  78465. */
  78466. var CachedResourceLoader = /** @class */ (function (_super) {
  78467. Object(__WEBPACK_IMPORTED_MODULE_4_tslib__["b" /* __extends */])(CachedResourceLoader, _super);
  78468. function CachedResourceLoader() {
  78469. var _this = _super.call(this) || this;
  78470. _this._cache = (/** @type {?} */ (__WEBPACK_IMPORTED_MODULE_1__angular_core__["_30" /* ɵglobal */])).$templateCache;
  78471. if (_this._cache == null) {
  78472. throw new Error('CachedResourceLoader: Template cache was not found in $templateCache.');
  78473. }
  78474. return _this;
  78475. }
  78476. /**
  78477. * @param {?} url
  78478. * @return {?}
  78479. */
  78480. CachedResourceLoader.prototype.get = /**
  78481. * @param {?} url
  78482. * @return {?}
  78483. */
  78484. function (url) {
  78485. if (this._cache.hasOwnProperty(url)) {
  78486. return Promise.resolve(this._cache[url]);
  78487. }
  78488. else {
  78489. return /** @type {?} */ (Promise.reject('CachedResourceLoader: Did not find cached template for ' + url));
  78490. }
  78491. };
  78492. return CachedResourceLoader;
  78493. }(__WEBPACK_IMPORTED_MODULE_0__angular_compiler__["s" /* ResourceLoader */]));
  78494. /**
  78495. * @fileoverview added by tsickle
  78496. * @suppress {checkTypes} checked by tsc
  78497. */
  78498. /**
  78499. * @license
  78500. * Copyright Google Inc. All Rights Reserved.
  78501. *
  78502. * Use of this source code is governed by an MIT-style license that can be
  78503. * found in the LICENSE file at https://angular.io/license
  78504. */
  78505. /**
  78506. * @fileoverview added by tsickle
  78507. * @suppress {checkTypes} checked by tsc
  78508. */
  78509. /**
  78510. * @license
  78511. * Copyright Google Inc. All Rights Reserved.
  78512. *
  78513. * Use of this source code is governed by an MIT-style license that can be
  78514. * found in the LICENSE file at https://angular.io/license
  78515. */
  78516. /**
  78517. * \@stable
  78518. */
  78519. var VERSION = new __WEBPACK_IMPORTED_MODULE_1__angular_core__["_7" /* Version */]('5.2.11');
  78520. /**
  78521. * @fileoverview added by tsickle
  78522. * @suppress {checkTypes} checked by tsc
  78523. */
  78524. /**
  78525. * @license
  78526. * Copyright Google Inc. All Rights Reserved.
  78527. *
  78528. * Use of this source code is governed by an MIT-style license that can be
  78529. * found in the LICENSE file at https://angular.io/license
  78530. */
  78531. /**
  78532. * \@experimental
  78533. */
  78534. var RESOURCE_CACHE_PROVIDER = [{ provide: __WEBPACK_IMPORTED_MODULE_0__angular_compiler__["s" /* ResourceLoader */], useClass: CachedResourceLoader, deps: [] }];
  78535. /**
  78536. * \@stable
  78537. */
  78538. var platformBrowserDynamic = Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["_13" /* createPlatformFactory */])(platformCoreDynamic, 'browserDynamic', INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS);
  78539. /**
  78540. * @fileoverview added by tsickle
  78541. * @suppress {checkTypes} checked by tsc
  78542. */
  78543. /**
  78544. * @license
  78545. * Copyright Google Inc. All Rights Reserved.
  78546. *
  78547. * Use of this source code is governed by an MIT-style license that can be
  78548. * found in the LICENSE file at https://angular.io/license
  78549. */
  78550. /**
  78551. * @module
  78552. * @description
  78553. * Entry point for all public APIs of this package.
  78554. */
  78555. // This file only reexports content of the `src` folder. Keep it that way.
  78556. /**
  78557. * @fileoverview added by tsickle
  78558. * @suppress {checkTypes} checked by tsc
  78559. */
  78560. /**
  78561. * Generated bundle index. Do not edit.
  78562. */
  78563. //# sourceMappingURL=platform-browser-dynamic.js.map
  78564. /***/ }),
  78565. /* 205 */
  78566. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  78567. "use strict";
  78568. /* unused harmony export core */
  78569. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return CompilerConfig; });
  78570. /* unused harmony export preserveWhitespacesDefault */
  78571. /* unused harmony export isLoweredSymbol */
  78572. /* unused harmony export createLoweredSymbol */
  78573. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return Identifiers; });
  78574. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return JitCompiler; });
  78575. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return DirectiveResolver; });
  78576. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return PipeResolver; });
  78577. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return NgModuleResolver; });
  78578. /* unused harmony export DEFAULT_INTERPOLATION_CONFIG */
  78579. /* unused harmony export InterpolationConfig */
  78580. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return NgModuleCompiler; });
  78581. /* unused harmony export AssertNotNull */
  78582. /* unused harmony export BinaryOperator */
  78583. /* unused harmony export BinaryOperatorExpr */
  78584. /* unused harmony export BuiltinMethod */
  78585. /* unused harmony export BuiltinVar */
  78586. /* unused harmony export CastExpr */
  78587. /* unused harmony export ClassStmt */
  78588. /* unused harmony export CommaExpr */
  78589. /* unused harmony export CommentStmt */
  78590. /* unused harmony export ConditionalExpr */
  78591. /* unused harmony export DeclareFunctionStmt */
  78592. /* unused harmony export DeclareVarStmt */
  78593. /* unused harmony export ExpressionStatement */
  78594. /* unused harmony export ExternalExpr */
  78595. /* unused harmony export ExternalReference */
  78596. /* unused harmony export FunctionExpr */
  78597. /* unused harmony export IfStmt */
  78598. /* unused harmony export InstantiateExpr */
  78599. /* unused harmony export InvokeFunctionExpr */
  78600. /* unused harmony export InvokeMethodExpr */
  78601. /* unused harmony export LiteralArrayExpr */
  78602. /* unused harmony export LiteralExpr */
  78603. /* unused harmony export LiteralMapExpr */
  78604. /* unused harmony export NotExpr */
  78605. /* unused harmony export ReadKeyExpr */
  78606. /* unused harmony export ReadPropExpr */
  78607. /* unused harmony export ReadVarExpr */
  78608. /* unused harmony export ReturnStatement */
  78609. /* unused harmony export ThrowStmt */
  78610. /* unused harmony export TryCatchStmt */
  78611. /* unused harmony export WriteKeyExpr */
  78612. /* unused harmony export WritePropExpr */
  78613. /* unused harmony export WriteVarExpr */
  78614. /* unused harmony export StmtModifier */
  78615. /* unused harmony export Statement */
  78616. /* unused harmony export collectExternalReferences */
  78617. /* unused harmony export EmitterVisitorContext */
  78618. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "y", function() { return ViewCompiler; });
  78619. /* unused harmony export getParseErrors */
  78620. /* unused harmony export isSyntaxError */
  78621. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "A", function() { return syntaxError; });
  78622. /* unused harmony export Version */
  78623. /* unused harmony export VERSION */
  78624. /* unused harmony export TextAst */
  78625. /* unused harmony export BoundTextAst */
  78626. /* unused harmony export AttrAst */
  78627. /* unused harmony export BoundElementPropertyAst */
  78628. /* unused harmony export BoundEventAst */
  78629. /* unused harmony export ReferenceAst */
  78630. /* unused harmony export VariableAst */
  78631. /* unused harmony export ElementAst */
  78632. /* unused harmony export EmbeddedTemplateAst */
  78633. /* unused harmony export BoundDirectivePropertyAst */
  78634. /* unused harmony export DirectiveAst */
  78635. /* unused harmony export ProviderAst */
  78636. /* unused harmony export ProviderAstType */
  78637. /* unused harmony export NgContentAst */
  78638. /* unused harmony export PropertyBindingType */
  78639. /* unused harmony export NullTemplateVisitor */
  78640. /* unused harmony export RecursiveTemplateAstVisitor */
  78641. /* unused harmony export templateVisitAll */
  78642. /* unused harmony export identifierName */
  78643. /* unused harmony export identifierModuleUrl */
  78644. /* unused harmony export viewClassName */
  78645. /* unused harmony export rendererTypeName */
  78646. /* unused harmony export hostViewClassName */
  78647. /* unused harmony export componentFactoryName */
  78648. /* unused harmony export CompileSummaryKind */
  78649. /* unused harmony export tokenName */
  78650. /* unused harmony export tokenReference */
  78651. /* unused harmony export CompileStylesheetMetadata */
  78652. /* unused harmony export CompileTemplateMetadata */
  78653. /* unused harmony export CompileDirectiveMetadata */
  78654. /* unused harmony export CompilePipeMetadata */
  78655. /* unused harmony export CompileNgModuleMetadata */
  78656. /* unused harmony export TransitiveCompileNgModuleMetadata */
  78657. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return ProviderMeta; });
  78658. /* unused harmony export flatten */
  78659. /* unused harmony export templateSourceUrl */
  78660. /* unused harmony export sharedStylesheetJitUrl */
  78661. /* unused harmony export ngModuleJitUrl */
  78662. /* unused harmony export templateJitUrl */
  78663. /* unused harmony export createAotUrlResolver */
  78664. /* unused harmony export createAotCompiler */
  78665. /* unused harmony export AotCompiler */
  78666. /* unused harmony export analyzeNgModules */
  78667. /* unused harmony export analyzeAndValidateNgModules */
  78668. /* unused harmony export analyzeFile */
  78669. /* unused harmony export mergeAnalyzedFiles */
  78670. /* unused harmony export GeneratedFile */
  78671. /* unused harmony export toTypeScript */
  78672. /* unused harmony export formattedError */
  78673. /* unused harmony export isFormattedError */
  78674. /* unused harmony export StaticReflector */
  78675. /* unused harmony export StaticSymbol */
  78676. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return StaticSymbolCache; });
  78677. /* unused harmony export ResolvedStaticSymbol */
  78678. /* unused harmony export StaticSymbolResolver */
  78679. /* unused harmony export unescapeIdentifier */
  78680. /* unused harmony export unwrapResolvedMetadata */
  78681. /* unused harmony export AotSummaryResolver */
  78682. /* unused harmony export AstPath */
  78683. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "v", function() { return SummaryResolver; });
  78684. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return JitSummaryResolver; });
  78685. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return CompileReflector; });
  78686. /* unused harmony export createUrlResolverWithoutPackagePrefix */
  78687. /* unused harmony export createOfflineCompileUrlResolver */
  78688. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "x", function() { return UrlResolver; });
  78689. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "z", function() { return getUrlScheme; });
  78690. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return ResourceLoader; });
  78691. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return ElementSchemaRegistry; });
  78692. /* unused harmony export Extractor */
  78693. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return I18NHtmlParser; });
  78694. /* unused harmony export MessageBundle */
  78695. /* unused harmony export Serializer */
  78696. /* unused harmony export Xliff */
  78697. /* unused harmony export Xliff2 */
  78698. /* unused harmony export Xmb */
  78699. /* unused harmony export Xtb */
  78700. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return DirectiveNormalizer; });
  78701. /* unused harmony export ParserError */
  78702. /* unused harmony export ParseSpan */
  78703. /* unused harmony export AST */
  78704. /* unused harmony export Quote */
  78705. /* unused harmony export EmptyExpr */
  78706. /* unused harmony export ImplicitReceiver */
  78707. /* unused harmony export Chain */
  78708. /* unused harmony export Conditional */
  78709. /* unused harmony export PropertyRead */
  78710. /* unused harmony export PropertyWrite */
  78711. /* unused harmony export SafePropertyRead */
  78712. /* unused harmony export KeyedRead */
  78713. /* unused harmony export KeyedWrite */
  78714. /* unused harmony export BindingPipe */
  78715. /* unused harmony export LiteralPrimitive */
  78716. /* unused harmony export LiteralArray */
  78717. /* unused harmony export LiteralMap */
  78718. /* unused harmony export Interpolation */
  78719. /* unused harmony export Binary */
  78720. /* unused harmony export PrefixNot */
  78721. /* unused harmony export NonNullAssert */
  78722. /* unused harmony export MethodCall */
  78723. /* unused harmony export SafeMethodCall */
  78724. /* unused harmony export FunctionCall */
  78725. /* unused harmony export ASTWithSource */
  78726. /* unused harmony export TemplateBinding */
  78727. /* unused harmony export NullAstVisitor */
  78728. /* unused harmony export RecursiveAstVisitor */
  78729. /* unused harmony export AstTransformer */
  78730. /* unused harmony export visitAstChildren */
  78731. /* unused harmony export TokenType */
  78732. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return Lexer; });
  78733. /* unused harmony export Token */
  78734. /* unused harmony export EOF */
  78735. /* unused harmony export isIdentifier */
  78736. /* unused harmony export isQuote */
  78737. /* unused harmony export SplitInterpolation */
  78738. /* unused harmony export TemplateBindingParseResult */
  78739. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return Parser; });
  78740. /* unused harmony export _ParseAST */
  78741. /* unused harmony export ERROR_COMPONENT_TYPE */
  78742. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CompileMetadataResolver; });
  78743. /* unused harmony export Text */
  78744. /* unused harmony export Expansion */
  78745. /* unused harmony export ExpansionCase */
  78746. /* unused harmony export Attribute */
  78747. /* unused harmony export Element */
  78748. /* unused harmony export Comment */
  78749. /* unused harmony export visitAll */
  78750. /* unused harmony export RecursiveVisitor */
  78751. /* unused harmony export findNode */
  78752. /* unused harmony export ParseTreeResult */
  78753. /* unused harmony export TreeError */
  78754. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return HtmlParser; });
  78755. /* unused harmony export HtmlTagDefinition */
  78756. /* unused harmony export getHtmlTagDefinition */
  78757. /* unused harmony export TagContentType */
  78758. /* unused harmony export splitNsName */
  78759. /* unused harmony export isNgContainer */
  78760. /* unused harmony export isNgContent */
  78761. /* unused harmony export isNgTemplate */
  78762. /* unused harmony export getNsPrefix */
  78763. /* unused harmony export mergeNsAndName */
  78764. /* unused harmony export NAMED_ENTITIES */
  78765. /* unused harmony export NGSP_UNICODE */
  78766. /* unused harmony export debugOutputAstAsTypeScript */
  78767. /* unused harmony export TypeScriptEmitter */
  78768. /* unused harmony export ParseLocation */
  78769. /* unused harmony export ParseSourceFile */
  78770. /* unused harmony export ParseSourceSpan */
  78771. /* unused harmony export ParseErrorLevel */
  78772. /* unused harmony export ParseError */
  78773. /* unused harmony export typeSourceSpan */
  78774. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return DomElementSchemaRegistry; });
  78775. /* unused harmony export CssSelector */
  78776. /* unused harmony export SelectorMatcher */
  78777. /* unused harmony export SelectorListContext */
  78778. /* unused harmony export SelectorContext */
  78779. /* unused harmony export StylesCompileDependency */
  78780. /* unused harmony export CompiledStylesheet */
  78781. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "u", function() { return StyleCompiler; });
  78782. /* unused harmony export TemplateParseError */
  78783. /* unused harmony export TemplateParseResult */
  78784. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "w", function() { return TemplateParser; });
  78785. /* unused harmony export splitClasses */
  78786. /* unused harmony export createElementCssSelector */
  78787. /* unused harmony export removeSummaryDuplicates */
  78788. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(25);
  78789. /**
  78790. * @license Angular v5.2.11
  78791. * (c) 2010-2018 Google, Inc. https://angular.io/
  78792. * License: MIT
  78793. */
  78794. /**
  78795. * @fileoverview added by tsickle
  78796. * @suppress {checkTypes} checked by tsc
  78797. */
  78798. /**
  78799. * @license
  78800. * Copyright Google Inc. All Rights Reserved.
  78801. *
  78802. * Use of this source code is governed by an MIT-style license that can be
  78803. * found in the LICENSE file at https://angular.io/license
  78804. */
  78805. // Attention:
  78806. // This file duplicates types and values from @angular/core
  78807. // so that we are able to make @angular/compiler independent of @angular/core.
  78808. // This is important to prevent a build cycle, as @angular/core needs to
  78809. // be compiled with the compiler.
  78810. /**
  78811. * @record
  78812. */
  78813. function Inject() { }
  78814. var createInject = makeMetadataFactory('Inject', function (token) { return ({ token: token }); });
  78815. var createInjectionToken = makeMetadataFactory('InjectionToken', function (desc) { return ({ _desc: desc }); });
  78816. /**
  78817. * @record
  78818. */
  78819. function Attribute() { }
  78820. var createAttribute = makeMetadataFactory('Attribute', function (attributeName) { return ({ attributeName: attributeName }); });
  78821. /**
  78822. * @record
  78823. */
  78824. function Query() { }
  78825. var createContentChildren = makeMetadataFactory('ContentChildren', function (selector, data) {
  78826. if (data === void 0) { data = {}; }
  78827. return (Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */])({ selector: selector, first: false, isViewQuery: false, descendants: false }, data));
  78828. });
  78829. var createContentChild = makeMetadataFactory('ContentChild', function (selector, data) {
  78830. if (data === void 0) { data = {}; }
  78831. return (Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */])({ selector: selector, first: true, isViewQuery: false, descendants: true }, data));
  78832. });
  78833. var createViewChildren = makeMetadataFactory('ViewChildren', function (selector, data) {
  78834. if (data === void 0) { data = {}; }
  78835. return (Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */])({ selector: selector, first: false, isViewQuery: true, descendants: true }, data));
  78836. });
  78837. var createViewChild = makeMetadataFactory('ViewChild', function (selector, data) {
  78838. return (Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */])({ selector: selector, first: true, isViewQuery: true, descendants: true }, data));
  78839. });
  78840. /**
  78841. * @record
  78842. */
  78843. function Directive() { }
  78844. var createDirective = makeMetadataFactory('Directive', function (dir) {
  78845. if (dir === void 0) { dir = {}; }
  78846. return dir;
  78847. });
  78848. /**
  78849. * @record
  78850. */
  78851. function Component() { }
  78852. /** @enum {number} */
  78853. var ViewEncapsulation = {
  78854. Emulated: 0,
  78855. Native: 1,
  78856. None: 2,
  78857. };
  78858. ViewEncapsulation[ViewEncapsulation.Emulated] = "Emulated";
  78859. ViewEncapsulation[ViewEncapsulation.Native] = "Native";
  78860. ViewEncapsulation[ViewEncapsulation.None] = "None";
  78861. /** @enum {number} */
  78862. var ChangeDetectionStrategy = {
  78863. OnPush: 0,
  78864. Default: 1,
  78865. };
  78866. ChangeDetectionStrategy[ChangeDetectionStrategy.OnPush] = "OnPush";
  78867. ChangeDetectionStrategy[ChangeDetectionStrategy.Default] = "Default";
  78868. var createComponent = makeMetadataFactory('Component', function (c) {
  78869. if (c === void 0) { c = {}; }
  78870. return (Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */])({ changeDetection: ChangeDetectionStrategy.Default }, c));
  78871. });
  78872. /**
  78873. * @record
  78874. */
  78875. function Pipe() { }
  78876. var createPipe = makeMetadataFactory('Pipe', function (p) { return (Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */])({ pure: true }, p)); });
  78877. /**
  78878. * @record
  78879. */
  78880. function Input() { }
  78881. var createInput = makeMetadataFactory('Input', function (bindingPropertyName) { return ({ bindingPropertyName: bindingPropertyName }); });
  78882. /**
  78883. * @record
  78884. */
  78885. function Output() { }
  78886. var createOutput = makeMetadataFactory('Output', function (bindingPropertyName) { return ({ bindingPropertyName: bindingPropertyName }); });
  78887. /**
  78888. * @record
  78889. */
  78890. function HostBinding() { }
  78891. var createHostBinding = makeMetadataFactory('HostBinding', function (hostPropertyName) { return ({ hostPropertyName: hostPropertyName }); });
  78892. /**
  78893. * @record
  78894. */
  78895. function HostListener() { }
  78896. var createHostListener = makeMetadataFactory('HostListener', function (eventName, args) { return ({ eventName: eventName, args: args }); });
  78897. /**
  78898. * @record
  78899. */
  78900. function NgModule() { }
  78901. var createNgModule = makeMetadataFactory('NgModule', function (ngModule) { return ngModule; });
  78902. /**
  78903. * @record
  78904. */
  78905. function ModuleWithProviders() { }
  78906. /**
  78907. * @record
  78908. */
  78909. function SchemaMetadata() { }
  78910. var CUSTOM_ELEMENTS_SCHEMA = {
  78911. name: 'custom-elements'
  78912. };
  78913. var NO_ERRORS_SCHEMA = {
  78914. name: 'no-errors-schema'
  78915. };
  78916. var createOptional = makeMetadataFactory('Optional');
  78917. var createInjectable = makeMetadataFactory('Injectable');
  78918. var createSelf = makeMetadataFactory('Self');
  78919. var createSkipSelf = makeMetadataFactory('SkipSelf');
  78920. var createHost = makeMetadataFactory('Host');
  78921. var Type = Function;
  78922. /** @enum {number} */
  78923. var SecurityContext = {
  78924. NONE: 0,
  78925. HTML: 1,
  78926. STYLE: 2,
  78927. SCRIPT: 3,
  78928. URL: 4,
  78929. RESOURCE_URL: 5,
  78930. };
  78931. SecurityContext[SecurityContext.NONE] = "NONE";
  78932. SecurityContext[SecurityContext.HTML] = "HTML";
  78933. SecurityContext[SecurityContext.STYLE] = "STYLE";
  78934. SecurityContext[SecurityContext.SCRIPT] = "SCRIPT";
  78935. SecurityContext[SecurityContext.URL] = "URL";
  78936. SecurityContext[SecurityContext.RESOURCE_URL] = "RESOURCE_URL";
  78937. /** @enum {number} */
  78938. var NodeFlags = {
  78939. None: 0,
  78940. TypeElement: 1,
  78941. TypeText: 2,
  78942. ProjectedTemplate: 4,
  78943. CatRenderNode: 3,
  78944. TypeNgContent: 8,
  78945. TypePipe: 16,
  78946. TypePureArray: 32,
  78947. TypePureObject: 64,
  78948. TypePurePipe: 128,
  78949. CatPureExpression: 224,
  78950. TypeValueProvider: 256,
  78951. TypeClassProvider: 512,
  78952. TypeFactoryProvider: 1024,
  78953. TypeUseExistingProvider: 2048,
  78954. LazyProvider: 4096,
  78955. PrivateProvider: 8192,
  78956. TypeDirective: 16384,
  78957. Component: 32768,
  78958. CatProviderNoDirective: 3840,
  78959. CatProvider: 20224,
  78960. OnInit: 65536,
  78961. OnDestroy: 131072,
  78962. DoCheck: 262144,
  78963. OnChanges: 524288,
  78964. AfterContentInit: 1048576,
  78965. AfterContentChecked: 2097152,
  78966. AfterViewInit: 4194304,
  78967. AfterViewChecked: 8388608,
  78968. EmbeddedViews: 16777216,
  78969. ComponentView: 33554432,
  78970. TypeContentQuery: 67108864,
  78971. TypeViewQuery: 134217728,
  78972. StaticQuery: 268435456,
  78973. DynamicQuery: 536870912,
  78974. CatQuery: 201326592,
  78975. // mutually exclusive values...
  78976. Types: 201347067,
  78977. };
  78978. /** @enum {number} */
  78979. var DepFlags = {
  78980. None: 0,
  78981. SkipSelf: 1,
  78982. Optional: 2,
  78983. Value: 8,
  78984. };
  78985. /** @enum {number} */
  78986. var ArgumentType = { Inline: 0, Dynamic: 1, };
  78987. /** @enum {number} */
  78988. var BindingFlags = {
  78989. TypeElementAttribute: 1,
  78990. TypeElementClass: 2,
  78991. TypeElementStyle: 4,
  78992. TypeProperty: 8,
  78993. SyntheticProperty: 16,
  78994. SyntheticHostProperty: 32,
  78995. CatSyntheticProperty: 48,
  78996. // mutually exclusive values...
  78997. Types: 15,
  78998. };
  78999. /** @enum {number} */
  79000. var QueryBindingType = { First: 0, All: 1, };
  79001. /** @enum {number} */
  79002. var QueryValueType = {
  79003. ElementRef: 0,
  79004. RenderElement: 1,
  79005. TemplateRef: 2,
  79006. ViewContainerRef: 3,
  79007. Provider: 4,
  79008. };
  79009. /** @enum {number} */
  79010. var ViewFlags = {
  79011. None: 0,
  79012. OnPush: 2,
  79013. };
  79014. /** @enum {number} */
  79015. var MissingTranslationStrategy = {
  79016. Error: 0,
  79017. Warning: 1,
  79018. Ignore: 2,
  79019. };
  79020. MissingTranslationStrategy[MissingTranslationStrategy.Error] = "Error";
  79021. MissingTranslationStrategy[MissingTranslationStrategy.Warning] = "Warning";
  79022. MissingTranslationStrategy[MissingTranslationStrategy.Ignore] = "Ignore";
  79023. /**
  79024. * @record
  79025. * @template T
  79026. */
  79027. function MetadataFactory() { }
  79028. /**
  79029. * @template T
  79030. * @param {?} name
  79031. * @param {?=} props
  79032. * @return {?}
  79033. */
  79034. function makeMetadataFactory(name, props) {
  79035. var /** @type {?} */ factory = function () {
  79036. var args = [];
  79037. for (var _i = 0; _i < arguments.length; _i++) {
  79038. args[_i] = arguments[_i];
  79039. }
  79040. var /** @type {?} */ values = props ? props.apply(void 0, args) : {};
  79041. return Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */])({ ngMetadataName: name }, values);
  79042. };
  79043. factory.isTypeOf = function (obj) { return obj && obj.ngMetadataName === name; };
  79044. factory.ngMetadataName = name;
  79045. return factory;
  79046. }
  79047. /**
  79048. * @record
  79049. */
  79050. function Route() { }
  79051. var core = Object.freeze({
  79052. Inject: Inject,
  79053. createInject: createInject,
  79054. createInjectionToken: createInjectionToken,
  79055. Attribute: Attribute,
  79056. createAttribute: createAttribute,
  79057. Query: Query,
  79058. createContentChildren: createContentChildren,
  79059. createContentChild: createContentChild,
  79060. createViewChildren: createViewChildren,
  79061. createViewChild: createViewChild,
  79062. Directive: Directive,
  79063. createDirective: createDirective,
  79064. Component: Component,
  79065. ViewEncapsulation: ViewEncapsulation,
  79066. ChangeDetectionStrategy: ChangeDetectionStrategy,
  79067. createComponent: createComponent,
  79068. Pipe: Pipe,
  79069. createPipe: createPipe,
  79070. Input: Input,
  79071. createInput: createInput,
  79072. Output: Output,
  79073. createOutput: createOutput,
  79074. HostBinding: HostBinding,
  79075. createHostBinding: createHostBinding,
  79076. HostListener: HostListener,
  79077. createHostListener: createHostListener,
  79078. NgModule: NgModule,
  79079. createNgModule: createNgModule,
  79080. ModuleWithProviders: ModuleWithProviders,
  79081. SchemaMetadata: SchemaMetadata,
  79082. CUSTOM_ELEMENTS_SCHEMA: CUSTOM_ELEMENTS_SCHEMA,
  79083. NO_ERRORS_SCHEMA: NO_ERRORS_SCHEMA,
  79084. createOptional: createOptional,
  79085. createInjectable: createInjectable,
  79086. createSelf: createSelf,
  79087. createSkipSelf: createSkipSelf,
  79088. createHost: createHost,
  79089. Type: Type,
  79090. SecurityContext: SecurityContext,
  79091. NodeFlags: NodeFlags,
  79092. DepFlags: DepFlags,
  79093. ArgumentType: ArgumentType,
  79094. BindingFlags: BindingFlags,
  79095. QueryBindingType: QueryBindingType,
  79096. QueryValueType: QueryValueType,
  79097. ViewFlags: ViewFlags,
  79098. MissingTranslationStrategy: MissingTranslationStrategy,
  79099. MetadataFactory: MetadataFactory,
  79100. Route: Route
  79101. });
  79102. /**
  79103. * @fileoverview added by tsickle
  79104. * @suppress {checkTypes} checked by tsc
  79105. */
  79106. /**
  79107. * @license
  79108. * Copyright Google Inc. All Rights Reserved.
  79109. *
  79110. * Use of this source code is governed by an MIT-style license that can be
  79111. * found in the LICENSE file at https://angular.io/license
  79112. */
  79113. var DASH_CASE_REGEXP = /-+([a-z0-9])/g;
  79114. /**
  79115. * @param {?} input
  79116. * @return {?}
  79117. */
  79118. function dashCaseToCamelCase(input) {
  79119. return input.replace(DASH_CASE_REGEXP, function () {
  79120. var m = [];
  79121. for (var _i = 0; _i < arguments.length; _i++) {
  79122. m[_i] = arguments[_i];
  79123. }
  79124. return m[1].toUpperCase();
  79125. });
  79126. }
  79127. /**
  79128. * @param {?} input
  79129. * @param {?} defaultValues
  79130. * @return {?}
  79131. */
  79132. function splitAtColon(input, defaultValues) {
  79133. return _splitAt(input, ':', defaultValues);
  79134. }
  79135. /**
  79136. * @param {?} input
  79137. * @param {?} defaultValues
  79138. * @return {?}
  79139. */
  79140. function splitAtPeriod(input, defaultValues) {
  79141. return _splitAt(input, '.', defaultValues);
  79142. }
  79143. /**
  79144. * @param {?} input
  79145. * @param {?} character
  79146. * @param {?} defaultValues
  79147. * @return {?}
  79148. */
  79149. function _splitAt(input, character, defaultValues) {
  79150. var /** @type {?} */ characterIndex = input.indexOf(character);
  79151. if (characterIndex == -1)
  79152. return defaultValues;
  79153. return [input.slice(0, characterIndex).trim(), input.slice(characterIndex + 1).trim()];
  79154. }
  79155. /**
  79156. * @param {?} value
  79157. * @param {?} visitor
  79158. * @param {?} context
  79159. * @return {?}
  79160. */
  79161. function visitValue(value, visitor, context) {
  79162. if (Array.isArray(value)) {
  79163. return visitor.visitArray(/** @type {?} */ (value), context);
  79164. }
  79165. if (isStrictStringMap(value)) {
  79166. return visitor.visitStringMap(/** @type {?} */ (value), context);
  79167. }
  79168. if (value == null || typeof value == 'string' || typeof value == 'number' ||
  79169. typeof value == 'boolean') {
  79170. return visitor.visitPrimitive(value, context);
  79171. }
  79172. return visitor.visitOther(value, context);
  79173. }
  79174. /**
  79175. * @param {?} val
  79176. * @return {?}
  79177. */
  79178. function isDefined(val) {
  79179. return val !== null && val !== undefined;
  79180. }
  79181. /**
  79182. * @template T
  79183. * @param {?} val
  79184. * @return {?}
  79185. */
  79186. function noUndefined(val) {
  79187. return val === undefined ? /** @type {?} */ ((null)) : val;
  79188. }
  79189. /**
  79190. * @record
  79191. */
  79192. var ValueTransformer = /** @class */ (function () {
  79193. function ValueTransformer() {
  79194. }
  79195. /**
  79196. * @param {?} arr
  79197. * @param {?} context
  79198. * @return {?}
  79199. */
  79200. ValueTransformer.prototype.visitArray = /**
  79201. * @param {?} arr
  79202. * @param {?} context
  79203. * @return {?}
  79204. */
  79205. function (arr, context) {
  79206. var _this = this;
  79207. return arr.map(function (value) { return visitValue(value, _this, context); });
  79208. };
  79209. /**
  79210. * @param {?} map
  79211. * @param {?} context
  79212. * @return {?}
  79213. */
  79214. ValueTransformer.prototype.visitStringMap = /**
  79215. * @param {?} map
  79216. * @param {?} context
  79217. * @return {?}
  79218. */
  79219. function (map, context) {
  79220. var _this = this;
  79221. var /** @type {?} */ result = {};
  79222. Object.keys(map).forEach(function (key) { result[key] = visitValue(map[key], _this, context); });
  79223. return result;
  79224. };
  79225. /**
  79226. * @param {?} value
  79227. * @param {?} context
  79228. * @return {?}
  79229. */
  79230. ValueTransformer.prototype.visitPrimitive = /**
  79231. * @param {?} value
  79232. * @param {?} context
  79233. * @return {?}
  79234. */
  79235. function (value, context) { return value; };
  79236. /**
  79237. * @param {?} value
  79238. * @param {?} context
  79239. * @return {?}
  79240. */
  79241. ValueTransformer.prototype.visitOther = /**
  79242. * @param {?} value
  79243. * @param {?} context
  79244. * @return {?}
  79245. */
  79246. function (value, context) { return value; };
  79247. return ValueTransformer;
  79248. }());
  79249. var SyncAsync = {
  79250. assertSync: function (value) {
  79251. if (isPromise(value)) {
  79252. throw new Error("Illegal state: value cannot be a promise");
  79253. }
  79254. return value;
  79255. },
  79256. then: function (value, cb) { return isPromise(value) ? value.then(cb) : cb(value); },
  79257. all: function (syncAsyncValues) {
  79258. return syncAsyncValues.some(isPromise) ? Promise.all(syncAsyncValues) : /** @type {?} */ (syncAsyncValues);
  79259. }
  79260. };
  79261. /**
  79262. * @param {?} msg
  79263. * @param {?=} parseErrors
  79264. * @return {?}
  79265. */
  79266. function syntaxError(msg, parseErrors) {
  79267. var /** @type {?} */ error = Error(msg);
  79268. (/** @type {?} */ (error))[ERROR_SYNTAX_ERROR] = true;
  79269. if (parseErrors)
  79270. (/** @type {?} */ (error))[ERROR_PARSE_ERRORS] = parseErrors;
  79271. return error;
  79272. }
  79273. var ERROR_SYNTAX_ERROR = 'ngSyntaxError';
  79274. var ERROR_PARSE_ERRORS = 'ngParseErrors';
  79275. /**
  79276. * @param {?} error
  79277. * @return {?}
  79278. */
  79279. function isSyntaxError(error) {
  79280. return (/** @type {?} */ (error))[ERROR_SYNTAX_ERROR];
  79281. }
  79282. /**
  79283. * @param {?} error
  79284. * @return {?}
  79285. */
  79286. function getParseErrors(error) {
  79287. return (/** @type {?} */ (error))[ERROR_PARSE_ERRORS] || [];
  79288. }
  79289. /**
  79290. * @param {?} s
  79291. * @return {?}
  79292. */
  79293. function escapeRegExp(s) {
  79294. return s.replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
  79295. }
  79296. var STRING_MAP_PROTO = Object.getPrototypeOf({});
  79297. /**
  79298. * @param {?} obj
  79299. * @return {?}
  79300. */
  79301. function isStrictStringMap(obj) {
  79302. return typeof obj === 'object' && obj !== null && Object.getPrototypeOf(obj) === STRING_MAP_PROTO;
  79303. }
  79304. /**
  79305. * @param {?} str
  79306. * @return {?}
  79307. */
  79308. function utf8Encode(str) {
  79309. var /** @type {?} */ encoded = '';
  79310. for (var /** @type {?} */ index = 0; index < str.length; index++) {
  79311. var /** @type {?} */ codePoint = str.charCodeAt(index);
  79312. // decode surrogate
  79313. // see https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
  79314. if (codePoint >= 0xd800 && codePoint <= 0xdbff && str.length > (index + 1)) {
  79315. var /** @type {?} */ low = str.charCodeAt(index + 1);
  79316. if (low >= 0xdc00 && low <= 0xdfff) {
  79317. index++;
  79318. codePoint = ((codePoint - 0xd800) << 10) + low - 0xdc00 + 0x10000;
  79319. }
  79320. }
  79321. if (codePoint <= 0x7f) {
  79322. encoded += String.fromCharCode(codePoint);
  79323. }
  79324. else if (codePoint <= 0x7ff) {
  79325. encoded += String.fromCharCode(((codePoint >> 6) & 0x1F) | 0xc0, (codePoint & 0x3f) | 0x80);
  79326. }
  79327. else if (codePoint <= 0xffff) {
  79328. encoded += String.fromCharCode((codePoint >> 12) | 0xe0, ((codePoint >> 6) & 0x3f) | 0x80, (codePoint & 0x3f) | 0x80);
  79329. }
  79330. else if (codePoint <= 0x1fffff) {
  79331. encoded += String.fromCharCode(((codePoint >> 18) & 0x07) | 0xf0, ((codePoint >> 12) & 0x3f) | 0x80, ((codePoint >> 6) & 0x3f) | 0x80, (codePoint & 0x3f) | 0x80);
  79332. }
  79333. }
  79334. return encoded;
  79335. }
  79336. /**
  79337. * @record
  79338. */
  79339. /**
  79340. * @param {?} token
  79341. * @return {?}
  79342. */
  79343. function stringify(token) {
  79344. if (typeof token === 'string') {
  79345. return token;
  79346. }
  79347. if (token instanceof Array) {
  79348. return '[' + token.map(stringify).join(', ') + ']';
  79349. }
  79350. if (token == null) {
  79351. return '' + token;
  79352. }
  79353. if (token.overriddenName) {
  79354. return "" + token.overriddenName;
  79355. }
  79356. if (token.name) {
  79357. return "" + token.name;
  79358. }
  79359. var /** @type {?} */ res = token.toString();
  79360. if (res == null) {
  79361. return '' + res;
  79362. }
  79363. var /** @type {?} */ newLineIndex = res.indexOf('\n');
  79364. return newLineIndex === -1 ? res : res.substring(0, newLineIndex);
  79365. }
  79366. /**
  79367. * Lazily retrieves the reference value from a forwardRef.
  79368. * @param {?} type
  79369. * @return {?}
  79370. */
  79371. function resolveForwardRef(type) {
  79372. if (typeof type === 'function' && type.hasOwnProperty('__forward_ref__')) {
  79373. return type();
  79374. }
  79375. else {
  79376. return type;
  79377. }
  79378. }
  79379. /**
  79380. * Determine if the argument is shaped like a Promise
  79381. * @param {?} obj
  79382. * @return {?}
  79383. */
  79384. function isPromise(obj) {
  79385. // allow any Promise/A+ compliant thenable.
  79386. // It's up to the caller to ensure that obj.then conforms to the spec
  79387. return !!obj && typeof obj.then === 'function';
  79388. }
  79389. var Version = /** @class */ (function () {
  79390. function Version(full) {
  79391. this.full = full;
  79392. var /** @type {?} */ splits = full.split('.');
  79393. this.major = splits[0];
  79394. this.minor = splits[1];
  79395. this.patch = splits.slice(2).join('.');
  79396. }
  79397. return Version;
  79398. }());
  79399. /**
  79400. * @record
  79401. */
  79402. /**
  79403. * @fileoverview added by tsickle
  79404. * @suppress {checkTypes} checked by tsc
  79405. */
  79406. /**
  79407. * @license
  79408. * Copyright Google Inc. All Rights Reserved.
  79409. *
  79410. * Use of this source code is governed by an MIT-style license that can be
  79411. * found in the LICENSE file at https://angular.io/license
  79412. */
  79413. /**
  79414. * \@stable
  79415. */
  79416. var VERSION = new Version('5.2.11');
  79417. /**
  79418. * @fileoverview added by tsickle
  79419. * @suppress {checkTypes} checked by tsc
  79420. */
  79421. /**
  79422. * @license
  79423. * Copyright Google Inc. All Rights Reserved.
  79424. *
  79425. * Use of this source code is governed by an MIT-style license that can be
  79426. * found in the LICENSE file at https://angular.io/license
  79427. */
  79428. /**
  79429. * An Abstract Syntax Tree node representing part of a parsed Angular template.
  79430. * @record
  79431. */
  79432. /**
  79433. * A segment of text within the template.
  79434. */
  79435. var TextAst = /** @class */ (function () {
  79436. function TextAst(value, ngContentIndex, sourceSpan) {
  79437. this.value = value;
  79438. this.ngContentIndex = ngContentIndex;
  79439. this.sourceSpan = sourceSpan;
  79440. }
  79441. /**
  79442. * @param {?} visitor
  79443. * @param {?} context
  79444. * @return {?}
  79445. */
  79446. TextAst.prototype.visit = /**
  79447. * @param {?} visitor
  79448. * @param {?} context
  79449. * @return {?}
  79450. */
  79451. function (visitor, context) { return visitor.visitText(this, context); };
  79452. return TextAst;
  79453. }());
  79454. /**
  79455. * A bound expression within the text of a template.
  79456. */
  79457. var BoundTextAst = /** @class */ (function () {
  79458. function BoundTextAst(value, ngContentIndex, sourceSpan) {
  79459. this.value = value;
  79460. this.ngContentIndex = ngContentIndex;
  79461. this.sourceSpan = sourceSpan;
  79462. }
  79463. /**
  79464. * @param {?} visitor
  79465. * @param {?} context
  79466. * @return {?}
  79467. */
  79468. BoundTextAst.prototype.visit = /**
  79469. * @param {?} visitor
  79470. * @param {?} context
  79471. * @return {?}
  79472. */
  79473. function (visitor, context) {
  79474. return visitor.visitBoundText(this, context);
  79475. };
  79476. return BoundTextAst;
  79477. }());
  79478. /**
  79479. * A plain attribute on an element.
  79480. */
  79481. var AttrAst = /** @class */ (function () {
  79482. function AttrAst(name, value, sourceSpan) {
  79483. this.name = name;
  79484. this.value = value;
  79485. this.sourceSpan = sourceSpan;
  79486. }
  79487. /**
  79488. * @param {?} visitor
  79489. * @param {?} context
  79490. * @return {?}
  79491. */
  79492. AttrAst.prototype.visit = /**
  79493. * @param {?} visitor
  79494. * @param {?} context
  79495. * @return {?}
  79496. */
  79497. function (visitor, context) { return visitor.visitAttr(this, context); };
  79498. return AttrAst;
  79499. }());
  79500. /**
  79501. * A binding for an element property (e.g. `[property]="expression"`) or an animation trigger (e.g.
  79502. * `[\@trigger]="stateExp"`)
  79503. */
  79504. var BoundElementPropertyAst = /** @class */ (function () {
  79505. function BoundElementPropertyAst(name, type, securityContext, value, unit, sourceSpan) {
  79506. this.name = name;
  79507. this.type = type;
  79508. this.securityContext = securityContext;
  79509. this.value = value;
  79510. this.unit = unit;
  79511. this.sourceSpan = sourceSpan;
  79512. this.isAnimation = this.type === PropertyBindingType.Animation;
  79513. }
  79514. /**
  79515. * @param {?} visitor
  79516. * @param {?} context
  79517. * @return {?}
  79518. */
  79519. BoundElementPropertyAst.prototype.visit = /**
  79520. * @param {?} visitor
  79521. * @param {?} context
  79522. * @return {?}
  79523. */
  79524. function (visitor, context) {
  79525. return visitor.visitElementProperty(this, context);
  79526. };
  79527. return BoundElementPropertyAst;
  79528. }());
  79529. /**
  79530. * A binding for an element event (e.g. `(event)="handler()"`) or an animation trigger event (e.g.
  79531. * `(\@trigger.phase)="callback($event)"`).
  79532. */
  79533. var BoundEventAst = /** @class */ (function () {
  79534. function BoundEventAst(name, target, phase, handler, sourceSpan) {
  79535. this.name = name;
  79536. this.target = target;
  79537. this.phase = phase;
  79538. this.handler = handler;
  79539. this.sourceSpan = sourceSpan;
  79540. this.fullName = BoundEventAst.calcFullName(this.name, this.target, this.phase);
  79541. this.isAnimation = !!this.phase;
  79542. }
  79543. /**
  79544. * @param {?} name
  79545. * @param {?} target
  79546. * @param {?} phase
  79547. * @return {?}
  79548. */
  79549. BoundEventAst.calcFullName = /**
  79550. * @param {?} name
  79551. * @param {?} target
  79552. * @param {?} phase
  79553. * @return {?}
  79554. */
  79555. function (name, target, phase) {
  79556. if (target) {
  79557. return target + ":" + name;
  79558. }
  79559. else if (phase) {
  79560. return "@" + name + "." + phase;
  79561. }
  79562. else {
  79563. return name;
  79564. }
  79565. };
  79566. /**
  79567. * @param {?} visitor
  79568. * @param {?} context
  79569. * @return {?}
  79570. */
  79571. BoundEventAst.prototype.visit = /**
  79572. * @param {?} visitor
  79573. * @param {?} context
  79574. * @return {?}
  79575. */
  79576. function (visitor, context) {
  79577. return visitor.visitEvent(this, context);
  79578. };
  79579. return BoundEventAst;
  79580. }());
  79581. /**
  79582. * A reference declaration on an element (e.g. `let someName="expression"`).
  79583. */
  79584. var ReferenceAst = /** @class */ (function () {
  79585. function ReferenceAst(name, value, sourceSpan) {
  79586. this.name = name;
  79587. this.value = value;
  79588. this.sourceSpan = sourceSpan;
  79589. }
  79590. /**
  79591. * @param {?} visitor
  79592. * @param {?} context
  79593. * @return {?}
  79594. */
  79595. ReferenceAst.prototype.visit = /**
  79596. * @param {?} visitor
  79597. * @param {?} context
  79598. * @return {?}
  79599. */
  79600. function (visitor, context) {
  79601. return visitor.visitReference(this, context);
  79602. };
  79603. return ReferenceAst;
  79604. }());
  79605. /**
  79606. * A variable declaration on a <ng-template> (e.g. `var-someName="someLocalName"`).
  79607. */
  79608. var VariableAst = /** @class */ (function () {
  79609. function VariableAst(name, value, sourceSpan) {
  79610. this.name = name;
  79611. this.value = value;
  79612. this.sourceSpan = sourceSpan;
  79613. }
  79614. /**
  79615. * @param {?} visitor
  79616. * @param {?} context
  79617. * @return {?}
  79618. */
  79619. VariableAst.prototype.visit = /**
  79620. * @param {?} visitor
  79621. * @param {?} context
  79622. * @return {?}
  79623. */
  79624. function (visitor, context) {
  79625. return visitor.visitVariable(this, context);
  79626. };
  79627. return VariableAst;
  79628. }());
  79629. /**
  79630. * An element declaration in a template.
  79631. */
  79632. var ElementAst = /** @class */ (function () {
  79633. function ElementAst(name, attrs, inputs, outputs, references, directives, providers, hasViewContainer, queryMatches, children, ngContentIndex, sourceSpan, endSourceSpan) {
  79634. this.name = name;
  79635. this.attrs = attrs;
  79636. this.inputs = inputs;
  79637. this.outputs = outputs;
  79638. this.references = references;
  79639. this.directives = directives;
  79640. this.providers = providers;
  79641. this.hasViewContainer = hasViewContainer;
  79642. this.queryMatches = queryMatches;
  79643. this.children = children;
  79644. this.ngContentIndex = ngContentIndex;
  79645. this.sourceSpan = sourceSpan;
  79646. this.endSourceSpan = endSourceSpan;
  79647. }
  79648. /**
  79649. * @param {?} visitor
  79650. * @param {?} context
  79651. * @return {?}
  79652. */
  79653. ElementAst.prototype.visit = /**
  79654. * @param {?} visitor
  79655. * @param {?} context
  79656. * @return {?}
  79657. */
  79658. function (visitor, context) {
  79659. return visitor.visitElement(this, context);
  79660. };
  79661. return ElementAst;
  79662. }());
  79663. /**
  79664. * A `<ng-template>` element included in an Angular template.
  79665. */
  79666. var EmbeddedTemplateAst = /** @class */ (function () {
  79667. function EmbeddedTemplateAst(attrs, outputs, references, variables, directives, providers, hasViewContainer, queryMatches, children, ngContentIndex, sourceSpan) {
  79668. this.attrs = attrs;
  79669. this.outputs = outputs;
  79670. this.references = references;
  79671. this.variables = variables;
  79672. this.directives = directives;
  79673. this.providers = providers;
  79674. this.hasViewContainer = hasViewContainer;
  79675. this.queryMatches = queryMatches;
  79676. this.children = children;
  79677. this.ngContentIndex = ngContentIndex;
  79678. this.sourceSpan = sourceSpan;
  79679. }
  79680. /**
  79681. * @param {?} visitor
  79682. * @param {?} context
  79683. * @return {?}
  79684. */
  79685. EmbeddedTemplateAst.prototype.visit = /**
  79686. * @param {?} visitor
  79687. * @param {?} context
  79688. * @return {?}
  79689. */
  79690. function (visitor, context) {
  79691. return visitor.visitEmbeddedTemplate(this, context);
  79692. };
  79693. return EmbeddedTemplateAst;
  79694. }());
  79695. /**
  79696. * A directive property with a bound value (e.g. `*ngIf="condition").
  79697. */
  79698. var BoundDirectivePropertyAst = /** @class */ (function () {
  79699. function BoundDirectivePropertyAst(directiveName, templateName, value, sourceSpan) {
  79700. this.directiveName = directiveName;
  79701. this.templateName = templateName;
  79702. this.value = value;
  79703. this.sourceSpan = sourceSpan;
  79704. }
  79705. /**
  79706. * @param {?} visitor
  79707. * @param {?} context
  79708. * @return {?}
  79709. */
  79710. BoundDirectivePropertyAst.prototype.visit = /**
  79711. * @param {?} visitor
  79712. * @param {?} context
  79713. * @return {?}
  79714. */
  79715. function (visitor, context) {
  79716. return visitor.visitDirectiveProperty(this, context);
  79717. };
  79718. return BoundDirectivePropertyAst;
  79719. }());
  79720. /**
  79721. * A directive declared on an element.
  79722. */
  79723. var DirectiveAst = /** @class */ (function () {
  79724. function DirectiveAst(directive, inputs, hostProperties, hostEvents, contentQueryStartId, sourceSpan) {
  79725. this.directive = directive;
  79726. this.inputs = inputs;
  79727. this.hostProperties = hostProperties;
  79728. this.hostEvents = hostEvents;
  79729. this.contentQueryStartId = contentQueryStartId;
  79730. this.sourceSpan = sourceSpan;
  79731. }
  79732. /**
  79733. * @param {?} visitor
  79734. * @param {?} context
  79735. * @return {?}
  79736. */
  79737. DirectiveAst.prototype.visit = /**
  79738. * @param {?} visitor
  79739. * @param {?} context
  79740. * @return {?}
  79741. */
  79742. function (visitor, context) {
  79743. return visitor.visitDirective(this, context);
  79744. };
  79745. return DirectiveAst;
  79746. }());
  79747. /**
  79748. * A provider declared on an element
  79749. */
  79750. var ProviderAst = /** @class */ (function () {
  79751. function ProviderAst(token, multiProvider, eager, providers, providerType, lifecycleHooks, sourceSpan) {
  79752. this.token = token;
  79753. this.multiProvider = multiProvider;
  79754. this.eager = eager;
  79755. this.providers = providers;
  79756. this.providerType = providerType;
  79757. this.lifecycleHooks = lifecycleHooks;
  79758. this.sourceSpan = sourceSpan;
  79759. }
  79760. /**
  79761. * @param {?} visitor
  79762. * @param {?} context
  79763. * @return {?}
  79764. */
  79765. ProviderAst.prototype.visit = /**
  79766. * @param {?} visitor
  79767. * @param {?} context
  79768. * @return {?}
  79769. */
  79770. function (visitor, context) {
  79771. // No visit method in the visitor for now...
  79772. return null;
  79773. };
  79774. return ProviderAst;
  79775. }());
  79776. /** @enum {number} */
  79777. var ProviderAstType = {
  79778. PublicService: 0,
  79779. PrivateService: 1,
  79780. Component: 2,
  79781. Directive: 3,
  79782. Builtin: 4,
  79783. };
  79784. ProviderAstType[ProviderAstType.PublicService] = "PublicService";
  79785. ProviderAstType[ProviderAstType.PrivateService] = "PrivateService";
  79786. ProviderAstType[ProviderAstType.Component] = "Component";
  79787. ProviderAstType[ProviderAstType.Directive] = "Directive";
  79788. ProviderAstType[ProviderAstType.Builtin] = "Builtin";
  79789. /**
  79790. * Position where content is to be projected (instance of `<ng-content>` in a template).
  79791. */
  79792. var NgContentAst = /** @class */ (function () {
  79793. function NgContentAst(index, ngContentIndex, sourceSpan) {
  79794. this.index = index;
  79795. this.ngContentIndex = ngContentIndex;
  79796. this.sourceSpan = sourceSpan;
  79797. }
  79798. /**
  79799. * @param {?} visitor
  79800. * @param {?} context
  79801. * @return {?}
  79802. */
  79803. NgContentAst.prototype.visit = /**
  79804. * @param {?} visitor
  79805. * @param {?} context
  79806. * @return {?}
  79807. */
  79808. function (visitor, context) {
  79809. return visitor.visitNgContent(this, context);
  79810. };
  79811. return NgContentAst;
  79812. }());
  79813. /** @enum {number} */
  79814. var PropertyBindingType = {
  79815. /**
  79816. * A normal binding to a property (e.g. `[property]="expression"`).
  79817. */
  79818. Property: 0,
  79819. /**
  79820. * A binding to an element attribute (e.g. `[attr.name]="expression"`).
  79821. */
  79822. Attribute: 1,
  79823. /**
  79824. * A binding to a CSS class (e.g. `[class.name]="condition"`).
  79825. */
  79826. Class: 2,
  79827. /**
  79828. * A binding to a style rule (e.g. `[style.rule]="expression"`).
  79829. */
  79830. Style: 3,
  79831. /**
  79832. * A binding to an animation reference (e.g. `[animate.key]="expression"`).
  79833. */
  79834. Animation: 4,
  79835. };
  79836. PropertyBindingType[PropertyBindingType.Property] = "Property";
  79837. PropertyBindingType[PropertyBindingType.Attribute] = "Attribute";
  79838. PropertyBindingType[PropertyBindingType.Class] = "Class";
  79839. PropertyBindingType[PropertyBindingType.Style] = "Style";
  79840. PropertyBindingType[PropertyBindingType.Animation] = "Animation";
  79841. /**
  79842. * @record
  79843. */
  79844. /**
  79845. * A visitor for {\@link TemplateAst} trees that will process each node.
  79846. * @record
  79847. */
  79848. /**
  79849. * A visitor that accepts each node but doesn't do anything. It is intended to be used
  79850. * as the base class for a visitor that is only interested in a subset of the node types.
  79851. */
  79852. var NullTemplateVisitor = /** @class */ (function () {
  79853. function NullTemplateVisitor() {
  79854. }
  79855. /**
  79856. * @param {?} ast
  79857. * @param {?} context
  79858. * @return {?}
  79859. */
  79860. NullTemplateVisitor.prototype.visitNgContent = /**
  79861. * @param {?} ast
  79862. * @param {?} context
  79863. * @return {?}
  79864. */
  79865. function (ast, context) { };
  79866. /**
  79867. * @param {?} ast
  79868. * @param {?} context
  79869. * @return {?}
  79870. */
  79871. NullTemplateVisitor.prototype.visitEmbeddedTemplate = /**
  79872. * @param {?} ast
  79873. * @param {?} context
  79874. * @return {?}
  79875. */
  79876. function (ast, context) { };
  79877. /**
  79878. * @param {?} ast
  79879. * @param {?} context
  79880. * @return {?}
  79881. */
  79882. NullTemplateVisitor.prototype.visitElement = /**
  79883. * @param {?} ast
  79884. * @param {?} context
  79885. * @return {?}
  79886. */
  79887. function (ast, context) { };
  79888. /**
  79889. * @param {?} ast
  79890. * @param {?} context
  79891. * @return {?}
  79892. */
  79893. NullTemplateVisitor.prototype.visitReference = /**
  79894. * @param {?} ast
  79895. * @param {?} context
  79896. * @return {?}
  79897. */
  79898. function (ast, context) { };
  79899. /**
  79900. * @param {?} ast
  79901. * @param {?} context
  79902. * @return {?}
  79903. */
  79904. NullTemplateVisitor.prototype.visitVariable = /**
  79905. * @param {?} ast
  79906. * @param {?} context
  79907. * @return {?}
  79908. */
  79909. function (ast, context) { };
  79910. /**
  79911. * @param {?} ast
  79912. * @param {?} context
  79913. * @return {?}
  79914. */
  79915. NullTemplateVisitor.prototype.visitEvent = /**
  79916. * @param {?} ast
  79917. * @param {?} context
  79918. * @return {?}
  79919. */
  79920. function (ast, context) { };
  79921. /**
  79922. * @param {?} ast
  79923. * @param {?} context
  79924. * @return {?}
  79925. */
  79926. NullTemplateVisitor.prototype.visitElementProperty = /**
  79927. * @param {?} ast
  79928. * @param {?} context
  79929. * @return {?}
  79930. */
  79931. function (ast, context) { };
  79932. /**
  79933. * @param {?} ast
  79934. * @param {?} context
  79935. * @return {?}
  79936. */
  79937. NullTemplateVisitor.prototype.visitAttr = /**
  79938. * @param {?} ast
  79939. * @param {?} context
  79940. * @return {?}
  79941. */
  79942. function (ast, context) { };
  79943. /**
  79944. * @param {?} ast
  79945. * @param {?} context
  79946. * @return {?}
  79947. */
  79948. NullTemplateVisitor.prototype.visitBoundText = /**
  79949. * @param {?} ast
  79950. * @param {?} context
  79951. * @return {?}
  79952. */
  79953. function (ast, context) { };
  79954. /**
  79955. * @param {?} ast
  79956. * @param {?} context
  79957. * @return {?}
  79958. */
  79959. NullTemplateVisitor.prototype.visitText = /**
  79960. * @param {?} ast
  79961. * @param {?} context
  79962. * @return {?}
  79963. */
  79964. function (ast, context) { };
  79965. /**
  79966. * @param {?} ast
  79967. * @param {?} context
  79968. * @return {?}
  79969. */
  79970. NullTemplateVisitor.prototype.visitDirective = /**
  79971. * @param {?} ast
  79972. * @param {?} context
  79973. * @return {?}
  79974. */
  79975. function (ast, context) { };
  79976. /**
  79977. * @param {?} ast
  79978. * @param {?} context
  79979. * @return {?}
  79980. */
  79981. NullTemplateVisitor.prototype.visitDirectiveProperty = /**
  79982. * @param {?} ast
  79983. * @param {?} context
  79984. * @return {?}
  79985. */
  79986. function (ast, context) { };
  79987. return NullTemplateVisitor;
  79988. }());
  79989. /**
  79990. * Base class that can be used to build a visitor that visits each node
  79991. * in an template ast recursively.
  79992. */
  79993. var RecursiveTemplateAstVisitor = /** @class */ (function (_super) {
  79994. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(RecursiveTemplateAstVisitor, _super);
  79995. function RecursiveTemplateAstVisitor() {
  79996. return _super.call(this) || this;
  79997. }
  79998. // Nodes with children
  79999. /**
  80000. * @param {?} ast
  80001. * @param {?} context
  80002. * @return {?}
  80003. */
  80004. RecursiveTemplateAstVisitor.prototype.visitEmbeddedTemplate = /**
  80005. * @param {?} ast
  80006. * @param {?} context
  80007. * @return {?}
  80008. */
  80009. function (ast, context) {
  80010. return this.visitChildren(context, function (visit) {
  80011. visit(ast.attrs);
  80012. visit(ast.references);
  80013. visit(ast.variables);
  80014. visit(ast.directives);
  80015. visit(ast.providers);
  80016. visit(ast.children);
  80017. });
  80018. };
  80019. /**
  80020. * @param {?} ast
  80021. * @param {?} context
  80022. * @return {?}
  80023. */
  80024. RecursiveTemplateAstVisitor.prototype.visitElement = /**
  80025. * @param {?} ast
  80026. * @param {?} context
  80027. * @return {?}
  80028. */
  80029. function (ast, context) {
  80030. return this.visitChildren(context, function (visit) {
  80031. visit(ast.attrs);
  80032. visit(ast.inputs);
  80033. visit(ast.outputs);
  80034. visit(ast.references);
  80035. visit(ast.directives);
  80036. visit(ast.providers);
  80037. visit(ast.children);
  80038. });
  80039. };
  80040. /**
  80041. * @param {?} ast
  80042. * @param {?} context
  80043. * @return {?}
  80044. */
  80045. RecursiveTemplateAstVisitor.prototype.visitDirective = /**
  80046. * @param {?} ast
  80047. * @param {?} context
  80048. * @return {?}
  80049. */
  80050. function (ast, context) {
  80051. return this.visitChildren(context, function (visit) {
  80052. visit(ast.inputs);
  80053. visit(ast.hostProperties);
  80054. visit(ast.hostEvents);
  80055. });
  80056. };
  80057. /**
  80058. * @template T
  80059. * @param {?} context
  80060. * @param {?} cb
  80061. * @return {?}
  80062. */
  80063. RecursiveTemplateAstVisitor.prototype.visitChildren = /**
  80064. * @template T
  80065. * @param {?} context
  80066. * @param {?} cb
  80067. * @return {?}
  80068. */
  80069. function (context, cb) {
  80070. var /** @type {?} */ results = [];
  80071. var /** @type {?} */ t = this;
  80072. /**
  80073. * @template T
  80074. * @param {?} children
  80075. * @return {?}
  80076. */
  80077. function visit(children) {
  80078. if (children && children.length)
  80079. results.push(templateVisitAll(t, children, context));
  80080. }
  80081. cb(visit);
  80082. return [].concat.apply([], results);
  80083. };
  80084. return RecursiveTemplateAstVisitor;
  80085. }(NullTemplateVisitor));
  80086. /**
  80087. * Visit every node in a list of {\@link TemplateAst}s with the given {\@link TemplateAstVisitor}.
  80088. * @param {?} visitor
  80089. * @param {?} asts
  80090. * @param {?=} context
  80091. * @return {?}
  80092. */
  80093. function templateVisitAll(visitor, asts, context) {
  80094. if (context === void 0) { context = null; }
  80095. var /** @type {?} */ result = [];
  80096. var /** @type {?} */ visit = visitor.visit ?
  80097. function (ast) { return ((visitor.visit))(ast, context) || ast.visit(visitor, context); } :
  80098. function (ast) { return ast.visit(visitor, context); };
  80099. asts.forEach(function (ast) {
  80100. var /** @type {?} */ astResult = visit(ast);
  80101. if (astResult) {
  80102. result.push(astResult);
  80103. }
  80104. });
  80105. return result;
  80106. }
  80107. /**
  80108. * @fileoverview added by tsickle
  80109. * @suppress {checkTypes} checked by tsc
  80110. */
  80111. /**
  80112. * @license
  80113. * Copyright Google Inc. All Rights Reserved.
  80114. *
  80115. * Use of this source code is governed by an MIT-style license that can be
  80116. * found in the LICENSE file at https://angular.io/license
  80117. */
  80118. var CompilerConfig = /** @class */ (function () {
  80119. function CompilerConfig(_a) {
  80120. var _b = _a === void 0 ? {} : _a, _c = _b.defaultEncapsulation, defaultEncapsulation = _c === void 0 ? ViewEncapsulation.Emulated : _c, _d = _b.useJit, useJit = _d === void 0 ? true : _d, _e = _b.jitDevMode, jitDevMode = _e === void 0 ? false : _e, _f = _b.missingTranslation, missingTranslation = _f === void 0 ? null : _f, enableLegacyTemplate = _b.enableLegacyTemplate, preserveWhitespaces = _b.preserveWhitespaces, strictInjectionParameters = _b.strictInjectionParameters;
  80121. this.defaultEncapsulation = defaultEncapsulation;
  80122. this.useJit = !!useJit;
  80123. this.jitDevMode = !!jitDevMode;
  80124. this.missingTranslation = missingTranslation;
  80125. this.enableLegacyTemplate = enableLegacyTemplate === true;
  80126. this.preserveWhitespaces = preserveWhitespacesDefault(noUndefined(preserveWhitespaces));
  80127. this.strictInjectionParameters = strictInjectionParameters === true;
  80128. }
  80129. return CompilerConfig;
  80130. }());
  80131. /**
  80132. * @param {?} preserveWhitespacesOption
  80133. * @param {?=} defaultSetting
  80134. * @return {?}
  80135. */
  80136. function preserveWhitespacesDefault(preserveWhitespacesOption, defaultSetting) {
  80137. if (defaultSetting === void 0) { defaultSetting = true; }
  80138. return preserveWhitespacesOption === null ? defaultSetting : preserveWhitespacesOption;
  80139. }
  80140. /**
  80141. * @fileoverview added by tsickle
  80142. * @suppress {checkTypes} checked by tsc
  80143. */
  80144. /**
  80145. * @license
  80146. * Copyright Google Inc. All Rights Reserved.
  80147. *
  80148. * Use of this source code is governed by an MIT-style license that can be
  80149. * found in the LICENSE file at https://angular.io/license
  80150. */
  80151. /**
  80152. * A token representing the a reference to a static type.
  80153. *
  80154. * This token is unique for a filePath and name and can be used as a hash table key.
  80155. */
  80156. var StaticSymbol = /** @class */ (function () {
  80157. function StaticSymbol(filePath, name, members) {
  80158. this.filePath = filePath;
  80159. this.name = name;
  80160. this.members = members;
  80161. }
  80162. /**
  80163. * @return {?}
  80164. */
  80165. StaticSymbol.prototype.assertNoMembers = /**
  80166. * @return {?}
  80167. */
  80168. function () {
  80169. if (this.members.length) {
  80170. throw new Error("Illegal state: symbol without members expected, but got " + JSON.stringify(this) + ".");
  80171. }
  80172. };
  80173. return StaticSymbol;
  80174. }());
  80175. /**
  80176. * A cache of static symbol used by the StaticReflector to return the same symbol for the
  80177. * same symbol values.
  80178. */
  80179. var StaticSymbolCache = /** @class */ (function () {
  80180. function StaticSymbolCache() {
  80181. this.cache = new Map();
  80182. }
  80183. /**
  80184. * @param {?} declarationFile
  80185. * @param {?} name
  80186. * @param {?=} members
  80187. * @return {?}
  80188. */
  80189. StaticSymbolCache.prototype.get = /**
  80190. * @param {?} declarationFile
  80191. * @param {?} name
  80192. * @param {?=} members
  80193. * @return {?}
  80194. */
  80195. function (declarationFile, name, members) {
  80196. members = members || [];
  80197. var /** @type {?} */ memberSuffix = members.length ? "." + members.join('.') : '';
  80198. var /** @type {?} */ key = "\"" + declarationFile + "\"." + name + memberSuffix;
  80199. var /** @type {?} */ result = this.cache.get(key);
  80200. if (!result) {
  80201. result = new StaticSymbol(declarationFile, name, members);
  80202. this.cache.set(key, result);
  80203. }
  80204. return result;
  80205. };
  80206. return StaticSymbolCache;
  80207. }());
  80208. /**
  80209. * @fileoverview added by tsickle
  80210. * @suppress {checkTypes} checked by tsc
  80211. */
  80212. /**
  80213. * @license
  80214. * Copyright Google Inc. All Rights Reserved.
  80215. *
  80216. * Use of this source code is governed by an MIT-style license that can be
  80217. * found in the LICENSE file at https://angular.io/license
  80218. */
  80219. // group 0: "[prop] or (event) or @trigger"
  80220. // group 1: "prop" from "[prop]"
  80221. // group 2: "event" from "(event)"
  80222. // group 3: "@trigger" from "@trigger"
  80223. var HOST_REG_EXP = /^(?:(?:\[([^\]]+)\])|(?:\(([^\)]+)\)))|(\@[-\w]+)$/;
  80224. /**
  80225. * @param {?} name
  80226. * @return {?}
  80227. */
  80228. function _sanitizeIdentifier(name) {
  80229. return name.replace(/\W/g, '_');
  80230. }
  80231. var _anonymousTypeIndex = 0;
  80232. /**
  80233. * @param {?} compileIdentifier
  80234. * @return {?}
  80235. */
  80236. function identifierName(compileIdentifier) {
  80237. if (!compileIdentifier || !compileIdentifier.reference) {
  80238. return null;
  80239. }
  80240. var /** @type {?} */ ref = compileIdentifier.reference;
  80241. if (ref instanceof StaticSymbol) {
  80242. return ref.name;
  80243. }
  80244. if (ref['__anonymousType']) {
  80245. return ref['__anonymousType'];
  80246. }
  80247. var /** @type {?} */ identifier = stringify(ref);
  80248. if (identifier.indexOf('(') >= 0) {
  80249. // case: anonymous functions!
  80250. identifier = "anonymous_" + _anonymousTypeIndex++;
  80251. ref['__anonymousType'] = identifier;
  80252. }
  80253. else {
  80254. identifier = _sanitizeIdentifier(identifier);
  80255. }
  80256. return identifier;
  80257. }
  80258. /**
  80259. * @param {?} compileIdentifier
  80260. * @return {?}
  80261. */
  80262. function identifierModuleUrl(compileIdentifier) {
  80263. var /** @type {?} */ ref = compileIdentifier.reference;
  80264. if (ref instanceof StaticSymbol) {
  80265. return ref.filePath;
  80266. }
  80267. // Runtime type
  80268. return "./" + stringify(ref);
  80269. }
  80270. /**
  80271. * @param {?} compType
  80272. * @param {?} embeddedTemplateIndex
  80273. * @return {?}
  80274. */
  80275. function viewClassName(compType, embeddedTemplateIndex) {
  80276. return "View_" + identifierName({ reference: compType }) + "_" + embeddedTemplateIndex;
  80277. }
  80278. /**
  80279. * @param {?} compType
  80280. * @return {?}
  80281. */
  80282. function rendererTypeName(compType) {
  80283. return "RenderType_" + identifierName({ reference: compType });
  80284. }
  80285. /**
  80286. * @param {?} compType
  80287. * @return {?}
  80288. */
  80289. function hostViewClassName(compType) {
  80290. return "HostView_" + identifierName({ reference: compType });
  80291. }
  80292. /**
  80293. * @param {?} compType
  80294. * @return {?}
  80295. */
  80296. function componentFactoryName(compType) {
  80297. return identifierName({ reference: compType }) + "NgFactory";
  80298. }
  80299. /**
  80300. * @record
  80301. */
  80302. /**
  80303. * @record
  80304. */
  80305. /** @enum {number} */
  80306. var CompileSummaryKind = {
  80307. Pipe: 0,
  80308. Directive: 1,
  80309. NgModule: 2,
  80310. Injectable: 3,
  80311. };
  80312. CompileSummaryKind[CompileSummaryKind.Pipe] = "Pipe";
  80313. CompileSummaryKind[CompileSummaryKind.Directive] = "Directive";
  80314. CompileSummaryKind[CompileSummaryKind.NgModule] = "NgModule";
  80315. CompileSummaryKind[CompileSummaryKind.Injectable] = "Injectable";
  80316. /**
  80317. * A CompileSummary is the data needed to use a directive / pipe / module
  80318. * in other modules / components. However, this data is not enough to compile
  80319. * the directive / module itself.
  80320. * @record
  80321. */
  80322. /**
  80323. * @record
  80324. */
  80325. /**
  80326. * @record
  80327. */
  80328. /**
  80329. * @record
  80330. */
  80331. /**
  80332. * @param {?} token
  80333. * @return {?}
  80334. */
  80335. function tokenName(token) {
  80336. return token.value != null ? _sanitizeIdentifier(token.value) : identifierName(token.identifier);
  80337. }
  80338. /**
  80339. * @param {?} token
  80340. * @return {?}
  80341. */
  80342. function tokenReference(token) {
  80343. if (token.identifier != null) {
  80344. return token.identifier.reference;
  80345. }
  80346. else {
  80347. return token.value;
  80348. }
  80349. }
  80350. /**
  80351. * @record
  80352. */
  80353. /**
  80354. * Metadata regarding compilation of a type.
  80355. * @record
  80356. */
  80357. /**
  80358. * @record
  80359. */
  80360. /**
  80361. * Metadata about a stylesheet
  80362. */
  80363. var CompileStylesheetMetadata = /** @class */ (function () {
  80364. function CompileStylesheetMetadata(_a) {
  80365. var _b = _a === void 0 ? {} : _a, moduleUrl = _b.moduleUrl, styles = _b.styles, styleUrls = _b.styleUrls;
  80366. this.moduleUrl = moduleUrl || null;
  80367. this.styles = _normalizeArray(styles);
  80368. this.styleUrls = _normalizeArray(styleUrls);
  80369. }
  80370. return CompileStylesheetMetadata;
  80371. }());
  80372. /**
  80373. * Summary Metadata regarding compilation of a template.
  80374. * @record
  80375. */
  80376. /**
  80377. * Metadata regarding compilation of a template.
  80378. */
  80379. var CompileTemplateMetadata = /** @class */ (function () {
  80380. function CompileTemplateMetadata(_a) {
  80381. var encapsulation = _a.encapsulation, template = _a.template, templateUrl = _a.templateUrl, htmlAst = _a.htmlAst, styles = _a.styles, styleUrls = _a.styleUrls, externalStylesheets = _a.externalStylesheets, animations = _a.animations, ngContentSelectors = _a.ngContentSelectors, interpolation = _a.interpolation, isInline = _a.isInline, preserveWhitespaces = _a.preserveWhitespaces;
  80382. this.encapsulation = encapsulation;
  80383. this.template = template;
  80384. this.templateUrl = templateUrl;
  80385. this.htmlAst = htmlAst;
  80386. this.styles = _normalizeArray(styles);
  80387. this.styleUrls = _normalizeArray(styleUrls);
  80388. this.externalStylesheets = _normalizeArray(externalStylesheets);
  80389. this.animations = animations ? flatten(animations) : [];
  80390. this.ngContentSelectors = ngContentSelectors || [];
  80391. if (interpolation && interpolation.length != 2) {
  80392. throw new Error("'interpolation' should have a start and an end symbol.");
  80393. }
  80394. this.interpolation = interpolation;
  80395. this.isInline = isInline;
  80396. this.preserveWhitespaces = preserveWhitespaces;
  80397. }
  80398. /**
  80399. * @return {?}
  80400. */
  80401. CompileTemplateMetadata.prototype.toSummary = /**
  80402. * @return {?}
  80403. */
  80404. function () {
  80405. return {
  80406. ngContentSelectors: this.ngContentSelectors,
  80407. encapsulation: this.encapsulation,
  80408. };
  80409. };
  80410. return CompileTemplateMetadata;
  80411. }());
  80412. /**
  80413. * @record
  80414. */
  80415. /**
  80416. * @record
  80417. */
  80418. /**
  80419. * Metadata regarding compilation of a directive.
  80420. */
  80421. var CompileDirectiveMetadata = /** @class */ (function () {
  80422. function CompileDirectiveMetadata(_a) {
  80423. var isHost = _a.isHost, type = _a.type, isComponent = _a.isComponent, selector = _a.selector, exportAs = _a.exportAs, changeDetection = _a.changeDetection, inputs = _a.inputs, outputs = _a.outputs, hostListeners = _a.hostListeners, hostProperties = _a.hostProperties, hostAttributes = _a.hostAttributes, providers = _a.providers, viewProviders = _a.viewProviders, queries = _a.queries, guards = _a.guards, viewQueries = _a.viewQueries, entryComponents = _a.entryComponents, template = _a.template, componentViewType = _a.componentViewType, rendererType = _a.rendererType, componentFactory = _a.componentFactory;
  80424. this.isHost = !!isHost;
  80425. this.type = type;
  80426. this.isComponent = isComponent;
  80427. this.selector = selector;
  80428. this.exportAs = exportAs;
  80429. this.changeDetection = changeDetection;
  80430. this.inputs = inputs;
  80431. this.outputs = outputs;
  80432. this.hostListeners = hostListeners;
  80433. this.hostProperties = hostProperties;
  80434. this.hostAttributes = hostAttributes;
  80435. this.providers = _normalizeArray(providers);
  80436. this.viewProviders = _normalizeArray(viewProviders);
  80437. this.queries = _normalizeArray(queries);
  80438. this.guards = guards;
  80439. this.viewQueries = _normalizeArray(viewQueries);
  80440. this.entryComponents = _normalizeArray(entryComponents);
  80441. this.template = template;
  80442. this.componentViewType = componentViewType;
  80443. this.rendererType = rendererType;
  80444. this.componentFactory = componentFactory;
  80445. }
  80446. /**
  80447. * @param {?} __0
  80448. * @return {?}
  80449. */
  80450. CompileDirectiveMetadata.create = /**
  80451. * @param {?} __0
  80452. * @return {?}
  80453. */
  80454. function (_a) {
  80455. var isHost = _a.isHost, type = _a.type, isComponent = _a.isComponent, selector = _a.selector, exportAs = _a.exportAs, changeDetection = _a.changeDetection, inputs = _a.inputs, outputs = _a.outputs, host = _a.host, providers = _a.providers, viewProviders = _a.viewProviders, queries = _a.queries, guards = _a.guards, viewQueries = _a.viewQueries, entryComponents = _a.entryComponents, template = _a.template, componentViewType = _a.componentViewType, rendererType = _a.rendererType, componentFactory = _a.componentFactory;
  80456. var /** @type {?} */ hostListeners = {};
  80457. var /** @type {?} */ hostProperties = {};
  80458. var /** @type {?} */ hostAttributes = {};
  80459. if (host != null) {
  80460. Object.keys(host).forEach(function (key) {
  80461. var /** @type {?} */ value = host[key];
  80462. var /** @type {?} */ matches = key.match(HOST_REG_EXP);
  80463. if (matches === null) {
  80464. hostAttributes[key] = value;
  80465. }
  80466. else if (matches[1] != null) {
  80467. hostProperties[matches[1]] = value;
  80468. }
  80469. else if (matches[2] != null) {
  80470. hostListeners[matches[2]] = value;
  80471. }
  80472. });
  80473. }
  80474. var /** @type {?} */ inputsMap = {};
  80475. if (inputs != null) {
  80476. inputs.forEach(function (bindConfig) {
  80477. // canonical syntax: `dirProp: elProp`
  80478. // if there is no `:`, use dirProp = elProp
  80479. var /** @type {?} */ parts = splitAtColon(bindConfig, [bindConfig, bindConfig]);
  80480. inputsMap[parts[0]] = parts[1];
  80481. });
  80482. }
  80483. var /** @type {?} */ outputsMap = {};
  80484. if (outputs != null) {
  80485. outputs.forEach(function (bindConfig) {
  80486. // canonical syntax: `dirProp: elProp`
  80487. // if there is no `:`, use dirProp = elProp
  80488. var /** @type {?} */ parts = splitAtColon(bindConfig, [bindConfig, bindConfig]);
  80489. outputsMap[parts[0]] = parts[1];
  80490. });
  80491. }
  80492. return new CompileDirectiveMetadata({
  80493. isHost: isHost,
  80494. type: type,
  80495. isComponent: !!isComponent, selector: selector, exportAs: exportAs, changeDetection: changeDetection,
  80496. inputs: inputsMap,
  80497. outputs: outputsMap,
  80498. hostListeners: hostListeners,
  80499. hostProperties: hostProperties,
  80500. hostAttributes: hostAttributes,
  80501. providers: providers,
  80502. viewProviders: viewProviders,
  80503. queries: queries,
  80504. guards: guards,
  80505. viewQueries: viewQueries,
  80506. entryComponents: entryComponents,
  80507. template: template,
  80508. componentViewType: componentViewType,
  80509. rendererType: rendererType,
  80510. componentFactory: componentFactory,
  80511. });
  80512. };
  80513. /**
  80514. * @return {?}
  80515. */
  80516. CompileDirectiveMetadata.prototype.toSummary = /**
  80517. * @return {?}
  80518. */
  80519. function () {
  80520. return {
  80521. summaryKind: CompileSummaryKind.Directive,
  80522. type: this.type,
  80523. isComponent: this.isComponent,
  80524. selector: this.selector,
  80525. exportAs: this.exportAs,
  80526. inputs: this.inputs,
  80527. outputs: this.outputs,
  80528. hostListeners: this.hostListeners,
  80529. hostProperties: this.hostProperties,
  80530. hostAttributes: this.hostAttributes,
  80531. providers: this.providers,
  80532. viewProviders: this.viewProviders,
  80533. queries: this.queries,
  80534. guards: this.guards,
  80535. viewQueries: this.viewQueries,
  80536. entryComponents: this.entryComponents,
  80537. changeDetection: this.changeDetection,
  80538. template: this.template && this.template.toSummary(),
  80539. componentViewType: this.componentViewType,
  80540. rendererType: this.rendererType,
  80541. componentFactory: this.componentFactory
  80542. };
  80543. };
  80544. return CompileDirectiveMetadata;
  80545. }());
  80546. /**
  80547. * @record
  80548. */
  80549. var CompilePipeMetadata = /** @class */ (function () {
  80550. function CompilePipeMetadata(_a) {
  80551. var type = _a.type, name = _a.name, pure = _a.pure;
  80552. this.type = type;
  80553. this.name = name;
  80554. this.pure = !!pure;
  80555. }
  80556. /**
  80557. * @return {?}
  80558. */
  80559. CompilePipeMetadata.prototype.toSummary = /**
  80560. * @return {?}
  80561. */
  80562. function () {
  80563. return {
  80564. summaryKind: CompileSummaryKind.Pipe,
  80565. type: this.type,
  80566. name: this.name,
  80567. pure: this.pure
  80568. };
  80569. };
  80570. return CompilePipeMetadata;
  80571. }());
  80572. /**
  80573. * @record
  80574. */
  80575. /**
  80576. * Metadata regarding compilation of a module.
  80577. */
  80578. var CompileNgModuleMetadata = /** @class */ (function () {
  80579. function CompileNgModuleMetadata(_a) {
  80580. var type = _a.type, providers = _a.providers, declaredDirectives = _a.declaredDirectives, exportedDirectives = _a.exportedDirectives, declaredPipes = _a.declaredPipes, exportedPipes = _a.exportedPipes, entryComponents = _a.entryComponents, bootstrapComponents = _a.bootstrapComponents, importedModules = _a.importedModules, exportedModules = _a.exportedModules, schemas = _a.schemas, transitiveModule = _a.transitiveModule, id = _a.id;
  80581. this.type = type || null;
  80582. this.declaredDirectives = _normalizeArray(declaredDirectives);
  80583. this.exportedDirectives = _normalizeArray(exportedDirectives);
  80584. this.declaredPipes = _normalizeArray(declaredPipes);
  80585. this.exportedPipes = _normalizeArray(exportedPipes);
  80586. this.providers = _normalizeArray(providers);
  80587. this.entryComponents = _normalizeArray(entryComponents);
  80588. this.bootstrapComponents = _normalizeArray(bootstrapComponents);
  80589. this.importedModules = _normalizeArray(importedModules);
  80590. this.exportedModules = _normalizeArray(exportedModules);
  80591. this.schemas = _normalizeArray(schemas);
  80592. this.id = id || null;
  80593. this.transitiveModule = transitiveModule || null;
  80594. }
  80595. /**
  80596. * @return {?}
  80597. */
  80598. CompileNgModuleMetadata.prototype.toSummary = /**
  80599. * @return {?}
  80600. */
  80601. function () {
  80602. var /** @type {?} */ module = /** @type {?} */ ((this.transitiveModule));
  80603. return {
  80604. summaryKind: CompileSummaryKind.NgModule,
  80605. type: this.type,
  80606. entryComponents: module.entryComponents,
  80607. providers: module.providers,
  80608. modules: module.modules,
  80609. exportedDirectives: module.exportedDirectives,
  80610. exportedPipes: module.exportedPipes
  80611. };
  80612. };
  80613. return CompileNgModuleMetadata;
  80614. }());
  80615. var TransitiveCompileNgModuleMetadata = /** @class */ (function () {
  80616. function TransitiveCompileNgModuleMetadata() {
  80617. this.directivesSet = new Set();
  80618. this.directives = [];
  80619. this.exportedDirectivesSet = new Set();
  80620. this.exportedDirectives = [];
  80621. this.pipesSet = new Set();
  80622. this.pipes = [];
  80623. this.exportedPipesSet = new Set();
  80624. this.exportedPipes = [];
  80625. this.modulesSet = new Set();
  80626. this.modules = [];
  80627. this.entryComponentsSet = new Set();
  80628. this.entryComponents = [];
  80629. this.providers = [];
  80630. }
  80631. /**
  80632. * @param {?} provider
  80633. * @param {?} module
  80634. * @return {?}
  80635. */
  80636. TransitiveCompileNgModuleMetadata.prototype.addProvider = /**
  80637. * @param {?} provider
  80638. * @param {?} module
  80639. * @return {?}
  80640. */
  80641. function (provider, module) {
  80642. this.providers.push({ provider: provider, module: module });
  80643. };
  80644. /**
  80645. * @param {?} id
  80646. * @return {?}
  80647. */
  80648. TransitiveCompileNgModuleMetadata.prototype.addDirective = /**
  80649. * @param {?} id
  80650. * @return {?}
  80651. */
  80652. function (id) {
  80653. if (!this.directivesSet.has(id.reference)) {
  80654. this.directivesSet.add(id.reference);
  80655. this.directives.push(id);
  80656. }
  80657. };
  80658. /**
  80659. * @param {?} id
  80660. * @return {?}
  80661. */
  80662. TransitiveCompileNgModuleMetadata.prototype.addExportedDirective = /**
  80663. * @param {?} id
  80664. * @return {?}
  80665. */
  80666. function (id) {
  80667. if (!this.exportedDirectivesSet.has(id.reference)) {
  80668. this.exportedDirectivesSet.add(id.reference);
  80669. this.exportedDirectives.push(id);
  80670. }
  80671. };
  80672. /**
  80673. * @param {?} id
  80674. * @return {?}
  80675. */
  80676. TransitiveCompileNgModuleMetadata.prototype.addPipe = /**
  80677. * @param {?} id
  80678. * @return {?}
  80679. */
  80680. function (id) {
  80681. if (!this.pipesSet.has(id.reference)) {
  80682. this.pipesSet.add(id.reference);
  80683. this.pipes.push(id);
  80684. }
  80685. };
  80686. /**
  80687. * @param {?} id
  80688. * @return {?}
  80689. */
  80690. TransitiveCompileNgModuleMetadata.prototype.addExportedPipe = /**
  80691. * @param {?} id
  80692. * @return {?}
  80693. */
  80694. function (id) {
  80695. if (!this.exportedPipesSet.has(id.reference)) {
  80696. this.exportedPipesSet.add(id.reference);
  80697. this.exportedPipes.push(id);
  80698. }
  80699. };
  80700. /**
  80701. * @param {?} id
  80702. * @return {?}
  80703. */
  80704. TransitiveCompileNgModuleMetadata.prototype.addModule = /**
  80705. * @param {?} id
  80706. * @return {?}
  80707. */
  80708. function (id) {
  80709. if (!this.modulesSet.has(id.reference)) {
  80710. this.modulesSet.add(id.reference);
  80711. this.modules.push(id);
  80712. }
  80713. };
  80714. /**
  80715. * @param {?} ec
  80716. * @return {?}
  80717. */
  80718. TransitiveCompileNgModuleMetadata.prototype.addEntryComponent = /**
  80719. * @param {?} ec
  80720. * @return {?}
  80721. */
  80722. function (ec) {
  80723. if (!this.entryComponentsSet.has(ec.componentType)) {
  80724. this.entryComponentsSet.add(ec.componentType);
  80725. this.entryComponents.push(ec);
  80726. }
  80727. };
  80728. return TransitiveCompileNgModuleMetadata;
  80729. }());
  80730. /**
  80731. * @param {?} obj
  80732. * @return {?}
  80733. */
  80734. function _normalizeArray(obj) {
  80735. return obj || [];
  80736. }
  80737. var ProviderMeta = /** @class */ (function () {
  80738. function ProviderMeta(token, _a) {
  80739. var useClass = _a.useClass, useValue = _a.useValue, useExisting = _a.useExisting, useFactory = _a.useFactory, deps = _a.deps, multi = _a.multi;
  80740. this.token = token;
  80741. this.useClass = useClass || null;
  80742. this.useValue = useValue;
  80743. this.useExisting = useExisting;
  80744. this.useFactory = useFactory || null;
  80745. this.dependencies = deps || null;
  80746. this.multi = !!multi;
  80747. }
  80748. return ProviderMeta;
  80749. }());
  80750. /**
  80751. * @template T
  80752. * @param {?} list
  80753. * @return {?}
  80754. */
  80755. function flatten(list) {
  80756. return list.reduce(function (flat, item) {
  80757. var /** @type {?} */ flatItem = Array.isArray(item) ? flatten(item) : item;
  80758. return (/** @type {?} */ (flat)).concat(flatItem);
  80759. }, []);
  80760. }
  80761. /**
  80762. * @param {?} url
  80763. * @return {?}
  80764. */
  80765. function jitSourceUrl(url) {
  80766. // Note: We need 3 "/" so that ng shows up as a separate domain
  80767. // in the chrome dev tools.
  80768. return url.replace(/(\w+:\/\/[\w:-]+)?(\/+)?/, 'ng:///');
  80769. }
  80770. /**
  80771. * @param {?} ngModuleType
  80772. * @param {?} compMeta
  80773. * @param {?} templateMeta
  80774. * @return {?}
  80775. */
  80776. function templateSourceUrl(ngModuleType, compMeta, templateMeta) {
  80777. var /** @type {?} */ url;
  80778. if (templateMeta.isInline) {
  80779. if (compMeta.type.reference instanceof StaticSymbol) {
  80780. // Note: a .ts file might contain multiple components with inline templates,
  80781. // so we need to give them unique urls, as these will be used for sourcemaps.
  80782. url = compMeta.type.reference.filePath + "." + compMeta.type.reference.name + ".html";
  80783. }
  80784. else {
  80785. url = identifierName(ngModuleType) + "/" + identifierName(compMeta.type) + ".html";
  80786. }
  80787. }
  80788. else {
  80789. url = /** @type {?} */ ((templateMeta.templateUrl));
  80790. }
  80791. return compMeta.type.reference instanceof StaticSymbol ? url : jitSourceUrl(url);
  80792. }
  80793. /**
  80794. * @param {?} meta
  80795. * @param {?} id
  80796. * @return {?}
  80797. */
  80798. function sharedStylesheetJitUrl(meta, id) {
  80799. var /** @type {?} */ pathParts = /** @type {?} */ ((meta.moduleUrl)).split(/\/\\/g);
  80800. var /** @type {?} */ baseName = pathParts[pathParts.length - 1];
  80801. return jitSourceUrl("css/" + id + baseName + ".ngstyle.js");
  80802. }
  80803. /**
  80804. * @param {?} moduleMeta
  80805. * @return {?}
  80806. */
  80807. function ngModuleJitUrl(moduleMeta) {
  80808. return jitSourceUrl(identifierName(moduleMeta.type) + "/module.ngfactory.js");
  80809. }
  80810. /**
  80811. * @param {?} ngModuleType
  80812. * @param {?} compMeta
  80813. * @return {?}
  80814. */
  80815. function templateJitUrl(ngModuleType, compMeta) {
  80816. return jitSourceUrl(identifierName(ngModuleType) + "/" + identifierName(compMeta.type) + ".ngfactory.js");
  80817. }
  80818. /**
  80819. * @fileoverview added by tsickle
  80820. * @suppress {checkTypes} checked by tsc
  80821. */
  80822. /**
  80823. * @license
  80824. * Copyright Google Inc. All Rights Reserved.
  80825. *
  80826. * Use of this source code is governed by an MIT-style license that can be
  80827. * found in the LICENSE file at https://angular.io/license
  80828. */
  80829. /**
  80830. * A path is an ordered set of elements. Typically a path is to a
  80831. * particular offset in a source file. The head of the list is the top
  80832. * most node. The tail is the node that contains the offset directly.
  80833. *
  80834. * For example, the expresion `a + b + c` might have an ast that looks
  80835. * like:
  80836. * +
  80837. * / \
  80838. * a +
  80839. * / \
  80840. * b c
  80841. *
  80842. * The path to the node at offset 9 would be `['+' at 1-10, '+' at 7-10,
  80843. * 'c' at 9-10]` and the path the node at offset 1 would be
  80844. * `['+' at 1-10, 'a' at 1-2]`.
  80845. * @template T
  80846. */
  80847. var AstPath = /** @class */ (function () {
  80848. function AstPath(path, position) {
  80849. if (position === void 0) { position = -1; }
  80850. this.path = path;
  80851. this.position = position;
  80852. }
  80853. Object.defineProperty(AstPath.prototype, "empty", {
  80854. get: /**
  80855. * @return {?}
  80856. */
  80857. function () { return !this.path || !this.path.length; },
  80858. enumerable: true,
  80859. configurable: true
  80860. });
  80861. Object.defineProperty(AstPath.prototype, "head", {
  80862. get: /**
  80863. * @return {?}
  80864. */
  80865. function () { return this.path[0]; },
  80866. enumerable: true,
  80867. configurable: true
  80868. });
  80869. Object.defineProperty(AstPath.prototype, "tail", {
  80870. get: /**
  80871. * @return {?}
  80872. */
  80873. function () { return this.path[this.path.length - 1]; },
  80874. enumerable: true,
  80875. configurable: true
  80876. });
  80877. /**
  80878. * @param {?} node
  80879. * @return {?}
  80880. */
  80881. AstPath.prototype.parentOf = /**
  80882. * @param {?} node
  80883. * @return {?}
  80884. */
  80885. function (node) {
  80886. return node && this.path[this.path.indexOf(node) - 1];
  80887. };
  80888. /**
  80889. * @param {?} node
  80890. * @return {?}
  80891. */
  80892. AstPath.prototype.childOf = /**
  80893. * @param {?} node
  80894. * @return {?}
  80895. */
  80896. function (node) { return this.path[this.path.indexOf(node) + 1]; };
  80897. /**
  80898. * @template N
  80899. * @param {?} ctor
  80900. * @return {?}
  80901. */
  80902. AstPath.prototype.first = /**
  80903. * @template N
  80904. * @param {?} ctor
  80905. * @return {?}
  80906. */
  80907. function (ctor) {
  80908. for (var /** @type {?} */ i = this.path.length - 1; i >= 0; i--) {
  80909. var /** @type {?} */ item = this.path[i];
  80910. if (item instanceof ctor)
  80911. return /** @type {?} */ (item);
  80912. }
  80913. };
  80914. /**
  80915. * @param {?} node
  80916. * @return {?}
  80917. */
  80918. AstPath.prototype.push = /**
  80919. * @param {?} node
  80920. * @return {?}
  80921. */
  80922. function (node) { this.path.push(node); };
  80923. /**
  80924. * @return {?}
  80925. */
  80926. AstPath.prototype.pop = /**
  80927. * @return {?}
  80928. */
  80929. function () { return /** @type {?} */ ((this.path.pop())); };
  80930. return AstPath;
  80931. }());
  80932. /**
  80933. * @fileoverview added by tsickle
  80934. * @suppress {checkTypes} checked by tsc
  80935. */
  80936. /**
  80937. * @license
  80938. * Copyright Google Inc. All Rights Reserved.
  80939. *
  80940. * Use of this source code is governed by an MIT-style license that can be
  80941. * found in the LICENSE file at https://angular.io/license
  80942. */
  80943. /**
  80944. * @record
  80945. */
  80946. var Text = /** @class */ (function () {
  80947. function Text(value, sourceSpan) {
  80948. this.value = value;
  80949. this.sourceSpan = sourceSpan;
  80950. }
  80951. /**
  80952. * @param {?} visitor
  80953. * @param {?} context
  80954. * @return {?}
  80955. */
  80956. Text.prototype.visit = /**
  80957. * @param {?} visitor
  80958. * @param {?} context
  80959. * @return {?}
  80960. */
  80961. function (visitor, context) { return visitor.visitText(this, context); };
  80962. return Text;
  80963. }());
  80964. var Expansion = /** @class */ (function () {
  80965. function Expansion(switchValue, type, cases, sourceSpan, switchValueSourceSpan) {
  80966. this.switchValue = switchValue;
  80967. this.type = type;
  80968. this.cases = cases;
  80969. this.sourceSpan = sourceSpan;
  80970. this.switchValueSourceSpan = switchValueSourceSpan;
  80971. }
  80972. /**
  80973. * @param {?} visitor
  80974. * @param {?} context
  80975. * @return {?}
  80976. */
  80977. Expansion.prototype.visit = /**
  80978. * @param {?} visitor
  80979. * @param {?} context
  80980. * @return {?}
  80981. */
  80982. function (visitor, context) { return visitor.visitExpansion(this, context); };
  80983. return Expansion;
  80984. }());
  80985. var ExpansionCase = /** @class */ (function () {
  80986. function ExpansionCase(value, expression, sourceSpan, valueSourceSpan, expSourceSpan) {
  80987. this.value = value;
  80988. this.expression = expression;
  80989. this.sourceSpan = sourceSpan;
  80990. this.valueSourceSpan = valueSourceSpan;
  80991. this.expSourceSpan = expSourceSpan;
  80992. }
  80993. /**
  80994. * @param {?} visitor
  80995. * @param {?} context
  80996. * @return {?}
  80997. */
  80998. ExpansionCase.prototype.visit = /**
  80999. * @param {?} visitor
  81000. * @param {?} context
  81001. * @return {?}
  81002. */
  81003. function (visitor, context) { return visitor.visitExpansionCase(this, context); };
  81004. return ExpansionCase;
  81005. }());
  81006. var Attribute$1 = /** @class */ (function () {
  81007. function Attribute(name, value, sourceSpan, valueSpan) {
  81008. this.name = name;
  81009. this.value = value;
  81010. this.sourceSpan = sourceSpan;
  81011. this.valueSpan = valueSpan;
  81012. }
  81013. /**
  81014. * @param {?} visitor
  81015. * @param {?} context
  81016. * @return {?}
  81017. */
  81018. Attribute.prototype.visit = /**
  81019. * @param {?} visitor
  81020. * @param {?} context
  81021. * @return {?}
  81022. */
  81023. function (visitor, context) { return visitor.visitAttribute(this, context); };
  81024. return Attribute;
  81025. }());
  81026. var Element = /** @class */ (function () {
  81027. function Element(name, attrs, children, sourceSpan, startSourceSpan, endSourceSpan) {
  81028. if (startSourceSpan === void 0) { startSourceSpan = null; }
  81029. if (endSourceSpan === void 0) { endSourceSpan = null; }
  81030. this.name = name;
  81031. this.attrs = attrs;
  81032. this.children = children;
  81033. this.sourceSpan = sourceSpan;
  81034. this.startSourceSpan = startSourceSpan;
  81035. this.endSourceSpan = endSourceSpan;
  81036. }
  81037. /**
  81038. * @param {?} visitor
  81039. * @param {?} context
  81040. * @return {?}
  81041. */
  81042. Element.prototype.visit = /**
  81043. * @param {?} visitor
  81044. * @param {?} context
  81045. * @return {?}
  81046. */
  81047. function (visitor, context) { return visitor.visitElement(this, context); };
  81048. return Element;
  81049. }());
  81050. var Comment = /** @class */ (function () {
  81051. function Comment(value, sourceSpan) {
  81052. this.value = value;
  81053. this.sourceSpan = sourceSpan;
  81054. }
  81055. /**
  81056. * @param {?} visitor
  81057. * @param {?} context
  81058. * @return {?}
  81059. */
  81060. Comment.prototype.visit = /**
  81061. * @param {?} visitor
  81062. * @param {?} context
  81063. * @return {?}
  81064. */
  81065. function (visitor, context) { return visitor.visitComment(this, context); };
  81066. return Comment;
  81067. }());
  81068. /**
  81069. * @record
  81070. */
  81071. /**
  81072. * @param {?} visitor
  81073. * @param {?} nodes
  81074. * @param {?=} context
  81075. * @return {?}
  81076. */
  81077. function visitAll(visitor, nodes, context) {
  81078. if (context === void 0) { context = null; }
  81079. var /** @type {?} */ result = [];
  81080. var /** @type {?} */ visit = visitor.visit ?
  81081. function (ast) { return ((visitor.visit))(ast, context) || ast.visit(visitor, context); } :
  81082. function (ast) { return ast.visit(visitor, context); };
  81083. nodes.forEach(function (ast) {
  81084. var /** @type {?} */ astResult = visit(ast);
  81085. if (astResult) {
  81086. result.push(astResult);
  81087. }
  81088. });
  81089. return result;
  81090. }
  81091. var RecursiveVisitor = /** @class */ (function () {
  81092. function RecursiveVisitor() {
  81093. }
  81094. /**
  81095. * @param {?} ast
  81096. * @param {?} context
  81097. * @return {?}
  81098. */
  81099. RecursiveVisitor.prototype.visitElement = /**
  81100. * @param {?} ast
  81101. * @param {?} context
  81102. * @return {?}
  81103. */
  81104. function (ast, context) {
  81105. this.visitChildren(context, function (visit) {
  81106. visit(ast.attrs);
  81107. visit(ast.children);
  81108. });
  81109. };
  81110. /**
  81111. * @param {?} ast
  81112. * @param {?} context
  81113. * @return {?}
  81114. */
  81115. RecursiveVisitor.prototype.visitAttribute = /**
  81116. * @param {?} ast
  81117. * @param {?} context
  81118. * @return {?}
  81119. */
  81120. function (ast, context) { };
  81121. /**
  81122. * @param {?} ast
  81123. * @param {?} context
  81124. * @return {?}
  81125. */
  81126. RecursiveVisitor.prototype.visitText = /**
  81127. * @param {?} ast
  81128. * @param {?} context
  81129. * @return {?}
  81130. */
  81131. function (ast, context) { };
  81132. /**
  81133. * @param {?} ast
  81134. * @param {?} context
  81135. * @return {?}
  81136. */
  81137. RecursiveVisitor.prototype.visitComment = /**
  81138. * @param {?} ast
  81139. * @param {?} context
  81140. * @return {?}
  81141. */
  81142. function (ast, context) { };
  81143. /**
  81144. * @param {?} ast
  81145. * @param {?} context
  81146. * @return {?}
  81147. */
  81148. RecursiveVisitor.prototype.visitExpansion = /**
  81149. * @param {?} ast
  81150. * @param {?} context
  81151. * @return {?}
  81152. */
  81153. function (ast, context) {
  81154. return this.visitChildren(context, function (visit) { visit(ast.cases); });
  81155. };
  81156. /**
  81157. * @param {?} ast
  81158. * @param {?} context
  81159. * @return {?}
  81160. */
  81161. RecursiveVisitor.prototype.visitExpansionCase = /**
  81162. * @param {?} ast
  81163. * @param {?} context
  81164. * @return {?}
  81165. */
  81166. function (ast, context) { };
  81167. /**
  81168. * @template T
  81169. * @param {?} context
  81170. * @param {?} cb
  81171. * @return {?}
  81172. */
  81173. RecursiveVisitor.prototype.visitChildren = /**
  81174. * @template T
  81175. * @param {?} context
  81176. * @param {?} cb
  81177. * @return {?}
  81178. */
  81179. function (context, cb) {
  81180. var /** @type {?} */ results = [];
  81181. var /** @type {?} */ t = this;
  81182. /**
  81183. * @template T
  81184. * @param {?} children
  81185. * @return {?}
  81186. */
  81187. function visit(children) {
  81188. if (children)
  81189. results.push(visitAll(t, children, context));
  81190. }
  81191. cb(visit);
  81192. return [].concat.apply([], results);
  81193. };
  81194. return RecursiveVisitor;
  81195. }());
  81196. /**
  81197. * @param {?} ast
  81198. * @return {?}
  81199. */
  81200. function spanOf(ast) {
  81201. var /** @type {?} */ start = ast.sourceSpan.start.offset;
  81202. var /** @type {?} */ end = ast.sourceSpan.end.offset;
  81203. if (ast instanceof Element) {
  81204. if (ast.endSourceSpan) {
  81205. end = ast.endSourceSpan.end.offset;
  81206. }
  81207. else if (ast.children && ast.children.length) {
  81208. end = spanOf(ast.children[ast.children.length - 1]).end;
  81209. }
  81210. }
  81211. return { start: start, end: end };
  81212. }
  81213. /**
  81214. * @param {?} nodes
  81215. * @param {?} position
  81216. * @return {?}
  81217. */
  81218. function findNode(nodes, position) {
  81219. var /** @type {?} */ path = [];
  81220. var /** @type {?} */ visitor = new /** @class */ (function (_super) {
  81221. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(class_1, _super);
  81222. function class_1() {
  81223. return _super !== null && _super.apply(this, arguments) || this;
  81224. }
  81225. /**
  81226. * @param {?} ast
  81227. * @param {?} context
  81228. * @return {?}
  81229. */
  81230. class_1.prototype.visit = /**
  81231. * @param {?} ast
  81232. * @param {?} context
  81233. * @return {?}
  81234. */
  81235. function (ast, context) {
  81236. var /** @type {?} */ span = spanOf(ast);
  81237. if (span.start <= position && position < span.end) {
  81238. path.push(ast);
  81239. }
  81240. else {
  81241. // Returning a value here will result in the children being skipped.
  81242. return true;
  81243. }
  81244. };
  81245. return class_1;
  81246. }(RecursiveVisitor));
  81247. visitAll(visitor, nodes);
  81248. return new AstPath(path, position);
  81249. }
  81250. /**
  81251. * @fileoverview added by tsickle
  81252. * @suppress {checkTypes} checked by tsc
  81253. */
  81254. /**
  81255. * @license
  81256. * Copyright Google Inc. All Rights Reserved.
  81257. *
  81258. * Use of this source code is governed by an MIT-style license that can be
  81259. * found in the LICENSE file at https://angular.io/license
  81260. */
  81261. /**
  81262. * @param {?} identifier
  81263. * @param {?} value
  81264. * @return {?}
  81265. */
  81266. function assertArrayOfStrings(identifier, value) {
  81267. if (value == null) {
  81268. return;
  81269. }
  81270. if (!Array.isArray(value)) {
  81271. throw new Error("Expected '" + identifier + "' to be an array of strings.");
  81272. }
  81273. for (var /** @type {?} */ i = 0; i < value.length; i += 1) {
  81274. if (typeof value[i] !== 'string') {
  81275. throw new Error("Expected '" + identifier + "' to be an array of strings.");
  81276. }
  81277. }
  81278. }
  81279. var INTERPOLATION_BLACKLIST_REGEXPS = [
  81280. /^\s*$/,
  81281. /[<>]/,
  81282. /^[{}]$/,
  81283. /&(#|[a-z])/i,
  81284. /^\/\//,
  81285. ];
  81286. /**
  81287. * @param {?} identifier
  81288. * @param {?} value
  81289. * @return {?}
  81290. */
  81291. function assertInterpolationSymbols(identifier, value) {
  81292. if (value != null && !(Array.isArray(value) && value.length == 2)) {
  81293. throw new Error("Expected '" + identifier + "' to be an array, [start, end].");
  81294. }
  81295. else if (value != null) {
  81296. var /** @type {?} */ start_1 = /** @type {?} */ (value[0]);
  81297. var /** @type {?} */ end_1 = /** @type {?} */ (value[1]);
  81298. // black list checking
  81299. INTERPOLATION_BLACKLIST_REGEXPS.forEach(function (regexp) {
  81300. if (regexp.test(start_1) || regexp.test(end_1)) {
  81301. throw new Error("['" + start_1 + "', '" + end_1 + "'] contains unusable interpolation symbol.");
  81302. }
  81303. });
  81304. }
  81305. }
  81306. /**
  81307. * @fileoverview added by tsickle
  81308. * @suppress {checkTypes} checked by tsc
  81309. */
  81310. /**
  81311. * @license
  81312. * Copyright Google Inc. All Rights Reserved.
  81313. *
  81314. * Use of this source code is governed by an MIT-style license that can be
  81315. * found in the LICENSE file at https://angular.io/license
  81316. */
  81317. var InterpolationConfig = /** @class */ (function () {
  81318. function InterpolationConfig(start, end) {
  81319. this.start = start;
  81320. this.end = end;
  81321. }
  81322. /**
  81323. * @param {?} markers
  81324. * @return {?}
  81325. */
  81326. InterpolationConfig.fromArray = /**
  81327. * @param {?} markers
  81328. * @return {?}
  81329. */
  81330. function (markers) {
  81331. if (!markers) {
  81332. return DEFAULT_INTERPOLATION_CONFIG;
  81333. }
  81334. assertInterpolationSymbols('interpolation', markers);
  81335. return new InterpolationConfig(markers[0], markers[1]);
  81336. };
  81337. return InterpolationConfig;
  81338. }());
  81339. var DEFAULT_INTERPOLATION_CONFIG = new InterpolationConfig('{{', '}}');
  81340. /**
  81341. * @fileoverview added by tsickle
  81342. * @suppress {checkTypes} checked by tsc
  81343. */
  81344. /**
  81345. * @license
  81346. * Copyright Google Inc. All Rights Reserved.
  81347. *
  81348. * Use of this source code is governed by an MIT-style license that can be
  81349. * found in the LICENSE file at https://angular.io/license
  81350. */
  81351. var StyleWithImports = /** @class */ (function () {
  81352. function StyleWithImports(style, styleUrls) {
  81353. this.style = style;
  81354. this.styleUrls = styleUrls;
  81355. }
  81356. return StyleWithImports;
  81357. }());
  81358. /**
  81359. * @param {?} url
  81360. * @return {?}
  81361. */
  81362. function isStyleUrlResolvable(url) {
  81363. if (url == null || url.length === 0 || url[0] == '/')
  81364. return false;
  81365. var /** @type {?} */ schemeMatch = url.match(URL_WITH_SCHEMA_REGEXP);
  81366. return schemeMatch === null || schemeMatch[1] == 'package' || schemeMatch[1] == 'asset';
  81367. }
  81368. /**
  81369. * Rewrites stylesheets by resolving and removing the \@import urls that
  81370. * are either relative or don't have a `package:` scheme
  81371. * @param {?} resolver
  81372. * @param {?} baseUrl
  81373. * @param {?} cssText
  81374. * @return {?}
  81375. */
  81376. function extractStyleUrls(resolver, baseUrl, cssText) {
  81377. var /** @type {?} */ foundUrls = [];
  81378. var /** @type {?} */ modifiedCssText = cssText.replace(CSS_STRIPPABLE_COMMENT_REGEXP, '')
  81379. .replace(CSS_IMPORT_REGEXP, function () {
  81380. var m = [];
  81381. for (var _i = 0; _i < arguments.length; _i++) {
  81382. m[_i] = arguments[_i];
  81383. }
  81384. var /** @type {?} */ url = m[1] || m[2];
  81385. if (!isStyleUrlResolvable(url)) {
  81386. // Do not attempt to resolve non-package absolute URLs with URI
  81387. // scheme
  81388. return m[0];
  81389. }
  81390. foundUrls.push(resolver.resolve(baseUrl, url));
  81391. return '';
  81392. });
  81393. return new StyleWithImports(modifiedCssText, foundUrls);
  81394. }
  81395. var CSS_IMPORT_REGEXP = /@import\s+(?:url\()?\s*(?:(?:['"]([^'"]*))|([^;\)\s]*))[^;]*;?/g;
  81396. var CSS_STRIPPABLE_COMMENT_REGEXP = /\/\*(?!#\s*(?:sourceURL|sourceMappingURL)=)[\s\S]+?\*\//g;
  81397. var URL_WITH_SCHEMA_REGEXP = /^([^:/?#]+):/;
  81398. /**
  81399. * @fileoverview added by tsickle
  81400. * @suppress {checkTypes} checked by tsc
  81401. */
  81402. /**
  81403. * @license
  81404. * Copyright Google Inc. All Rights Reserved.
  81405. *
  81406. * Use of this source code is governed by an MIT-style license that can be
  81407. * found in the LICENSE file at https://angular.io/license
  81408. */
  81409. /** @enum {number} */
  81410. var TagContentType = {
  81411. RAW_TEXT: 0,
  81412. ESCAPABLE_RAW_TEXT: 1,
  81413. PARSABLE_DATA: 2,
  81414. };
  81415. TagContentType[TagContentType.RAW_TEXT] = "RAW_TEXT";
  81416. TagContentType[TagContentType.ESCAPABLE_RAW_TEXT] = "ESCAPABLE_RAW_TEXT";
  81417. TagContentType[TagContentType.PARSABLE_DATA] = "PARSABLE_DATA";
  81418. /**
  81419. * @record
  81420. */
  81421. /**
  81422. * @param {?} elementName
  81423. * @return {?}
  81424. */
  81425. function splitNsName(elementName) {
  81426. if (elementName[0] != ':') {
  81427. return [null, elementName];
  81428. }
  81429. var /** @type {?} */ colonIndex = elementName.indexOf(':', 1);
  81430. if (colonIndex == -1) {
  81431. throw new Error("Unsupported format \"" + elementName + "\" expecting \":namespace:name\"");
  81432. }
  81433. return [elementName.slice(1, colonIndex), elementName.slice(colonIndex + 1)];
  81434. }
  81435. /**
  81436. * @param {?} tagName
  81437. * @return {?}
  81438. */
  81439. function isNgContainer(tagName) {
  81440. return splitNsName(tagName)[1] === 'ng-container';
  81441. }
  81442. /**
  81443. * @param {?} tagName
  81444. * @return {?}
  81445. */
  81446. function isNgContent(tagName) {
  81447. return splitNsName(tagName)[1] === 'ng-content';
  81448. }
  81449. /**
  81450. * @param {?} tagName
  81451. * @return {?}
  81452. */
  81453. function isNgTemplate(tagName) {
  81454. return splitNsName(tagName)[1] === 'ng-template';
  81455. }
  81456. /**
  81457. * @param {?} fullName
  81458. * @return {?}
  81459. */
  81460. function getNsPrefix(fullName) {
  81461. return fullName === null ? null : splitNsName(fullName)[0];
  81462. }
  81463. /**
  81464. * @param {?} prefix
  81465. * @param {?} localName
  81466. * @return {?}
  81467. */
  81468. function mergeNsAndName(prefix, localName) {
  81469. return prefix ? ":" + prefix + ":" + localName : localName;
  81470. }
  81471. // see http://www.w3.org/TR/html51/syntax.html#named-character-references
  81472. // see https://html.spec.whatwg.org/multipage/entities.json
  81473. // This list is not exhaustive to keep the compiler footprint low.
  81474. // The `&#123;` / `&#x1ab;` syntax should be used when the named character reference does not
  81475. // exist.
  81476. var NAMED_ENTITIES = {
  81477. 'Aacute': '\u00C1',
  81478. 'aacute': '\u00E1',
  81479. 'Acirc': '\u00C2',
  81480. 'acirc': '\u00E2',
  81481. 'acute': '\u00B4',
  81482. 'AElig': '\u00C6',
  81483. 'aelig': '\u00E6',
  81484. 'Agrave': '\u00C0',
  81485. 'agrave': '\u00E0',
  81486. 'alefsym': '\u2135',
  81487. 'Alpha': '\u0391',
  81488. 'alpha': '\u03B1',
  81489. 'amp': '&',
  81490. 'and': '\u2227',
  81491. 'ang': '\u2220',
  81492. 'apos': '\u0027',
  81493. 'Aring': '\u00C5',
  81494. 'aring': '\u00E5',
  81495. 'asymp': '\u2248',
  81496. 'Atilde': '\u00C3',
  81497. 'atilde': '\u00E3',
  81498. 'Auml': '\u00C4',
  81499. 'auml': '\u00E4',
  81500. 'bdquo': '\u201E',
  81501. 'Beta': '\u0392',
  81502. 'beta': '\u03B2',
  81503. 'brvbar': '\u00A6',
  81504. 'bull': '\u2022',
  81505. 'cap': '\u2229',
  81506. 'Ccedil': '\u00C7',
  81507. 'ccedil': '\u00E7',
  81508. 'cedil': '\u00B8',
  81509. 'cent': '\u00A2',
  81510. 'Chi': '\u03A7',
  81511. 'chi': '\u03C7',
  81512. 'circ': '\u02C6',
  81513. 'clubs': '\u2663',
  81514. 'cong': '\u2245',
  81515. 'copy': '\u00A9',
  81516. 'crarr': '\u21B5',
  81517. 'cup': '\u222A',
  81518. 'curren': '\u00A4',
  81519. 'dagger': '\u2020',
  81520. 'Dagger': '\u2021',
  81521. 'darr': '\u2193',
  81522. 'dArr': '\u21D3',
  81523. 'deg': '\u00B0',
  81524. 'Delta': '\u0394',
  81525. 'delta': '\u03B4',
  81526. 'diams': '\u2666',
  81527. 'divide': '\u00F7',
  81528. 'Eacute': '\u00C9',
  81529. 'eacute': '\u00E9',
  81530. 'Ecirc': '\u00CA',
  81531. 'ecirc': '\u00EA',
  81532. 'Egrave': '\u00C8',
  81533. 'egrave': '\u00E8',
  81534. 'empty': '\u2205',
  81535. 'emsp': '\u2003',
  81536. 'ensp': '\u2002',
  81537. 'Epsilon': '\u0395',
  81538. 'epsilon': '\u03B5',
  81539. 'equiv': '\u2261',
  81540. 'Eta': '\u0397',
  81541. 'eta': '\u03B7',
  81542. 'ETH': '\u00D0',
  81543. 'eth': '\u00F0',
  81544. 'Euml': '\u00CB',
  81545. 'euml': '\u00EB',
  81546. 'euro': '\u20AC',
  81547. 'exist': '\u2203',
  81548. 'fnof': '\u0192',
  81549. 'forall': '\u2200',
  81550. 'frac12': '\u00BD',
  81551. 'frac14': '\u00BC',
  81552. 'frac34': '\u00BE',
  81553. 'frasl': '\u2044',
  81554. 'Gamma': '\u0393',
  81555. 'gamma': '\u03B3',
  81556. 'ge': '\u2265',
  81557. 'gt': '>',
  81558. 'harr': '\u2194',
  81559. 'hArr': '\u21D4',
  81560. 'hearts': '\u2665',
  81561. 'hellip': '\u2026',
  81562. 'Iacute': '\u00CD',
  81563. 'iacute': '\u00ED',
  81564. 'Icirc': '\u00CE',
  81565. 'icirc': '\u00EE',
  81566. 'iexcl': '\u00A1',
  81567. 'Igrave': '\u00CC',
  81568. 'igrave': '\u00EC',
  81569. 'image': '\u2111',
  81570. 'infin': '\u221E',
  81571. 'int': '\u222B',
  81572. 'Iota': '\u0399',
  81573. 'iota': '\u03B9',
  81574. 'iquest': '\u00BF',
  81575. 'isin': '\u2208',
  81576. 'Iuml': '\u00CF',
  81577. 'iuml': '\u00EF',
  81578. 'Kappa': '\u039A',
  81579. 'kappa': '\u03BA',
  81580. 'Lambda': '\u039B',
  81581. 'lambda': '\u03BB',
  81582. 'lang': '\u27E8',
  81583. 'laquo': '\u00AB',
  81584. 'larr': '\u2190',
  81585. 'lArr': '\u21D0',
  81586. 'lceil': '\u2308',
  81587. 'ldquo': '\u201C',
  81588. 'le': '\u2264',
  81589. 'lfloor': '\u230A',
  81590. 'lowast': '\u2217',
  81591. 'loz': '\u25CA',
  81592. 'lrm': '\u200E',
  81593. 'lsaquo': '\u2039',
  81594. 'lsquo': '\u2018',
  81595. 'lt': '<',
  81596. 'macr': '\u00AF',
  81597. 'mdash': '\u2014',
  81598. 'micro': '\u00B5',
  81599. 'middot': '\u00B7',
  81600. 'minus': '\u2212',
  81601. 'Mu': '\u039C',
  81602. 'mu': '\u03BC',
  81603. 'nabla': '\u2207',
  81604. 'nbsp': '\u00A0',
  81605. 'ndash': '\u2013',
  81606. 'ne': '\u2260',
  81607. 'ni': '\u220B',
  81608. 'not': '\u00AC',
  81609. 'notin': '\u2209',
  81610. 'nsub': '\u2284',
  81611. 'Ntilde': '\u00D1',
  81612. 'ntilde': '\u00F1',
  81613. 'Nu': '\u039D',
  81614. 'nu': '\u03BD',
  81615. 'Oacute': '\u00D3',
  81616. 'oacute': '\u00F3',
  81617. 'Ocirc': '\u00D4',
  81618. 'ocirc': '\u00F4',
  81619. 'OElig': '\u0152',
  81620. 'oelig': '\u0153',
  81621. 'Ograve': '\u00D2',
  81622. 'ograve': '\u00F2',
  81623. 'oline': '\u203E',
  81624. 'Omega': '\u03A9',
  81625. 'omega': '\u03C9',
  81626. 'Omicron': '\u039F',
  81627. 'omicron': '\u03BF',
  81628. 'oplus': '\u2295',
  81629. 'or': '\u2228',
  81630. 'ordf': '\u00AA',
  81631. 'ordm': '\u00BA',
  81632. 'Oslash': '\u00D8',
  81633. 'oslash': '\u00F8',
  81634. 'Otilde': '\u00D5',
  81635. 'otilde': '\u00F5',
  81636. 'otimes': '\u2297',
  81637. 'Ouml': '\u00D6',
  81638. 'ouml': '\u00F6',
  81639. 'para': '\u00B6',
  81640. 'permil': '\u2030',
  81641. 'perp': '\u22A5',
  81642. 'Phi': '\u03A6',
  81643. 'phi': '\u03C6',
  81644. 'Pi': '\u03A0',
  81645. 'pi': '\u03C0',
  81646. 'piv': '\u03D6',
  81647. 'plusmn': '\u00B1',
  81648. 'pound': '\u00A3',
  81649. 'prime': '\u2032',
  81650. 'Prime': '\u2033',
  81651. 'prod': '\u220F',
  81652. 'prop': '\u221D',
  81653. 'Psi': '\u03A8',
  81654. 'psi': '\u03C8',
  81655. 'quot': '\u0022',
  81656. 'radic': '\u221A',
  81657. 'rang': '\u27E9',
  81658. 'raquo': '\u00BB',
  81659. 'rarr': '\u2192',
  81660. 'rArr': '\u21D2',
  81661. 'rceil': '\u2309',
  81662. 'rdquo': '\u201D',
  81663. 'real': '\u211C',
  81664. 'reg': '\u00AE',
  81665. 'rfloor': '\u230B',
  81666. 'Rho': '\u03A1',
  81667. 'rho': '\u03C1',
  81668. 'rlm': '\u200F',
  81669. 'rsaquo': '\u203A',
  81670. 'rsquo': '\u2019',
  81671. 'sbquo': '\u201A',
  81672. 'Scaron': '\u0160',
  81673. 'scaron': '\u0161',
  81674. 'sdot': '\u22C5',
  81675. 'sect': '\u00A7',
  81676. 'shy': '\u00AD',
  81677. 'Sigma': '\u03A3',
  81678. 'sigma': '\u03C3',
  81679. 'sigmaf': '\u03C2',
  81680. 'sim': '\u223C',
  81681. 'spades': '\u2660',
  81682. 'sub': '\u2282',
  81683. 'sube': '\u2286',
  81684. 'sum': '\u2211',
  81685. 'sup': '\u2283',
  81686. 'sup1': '\u00B9',
  81687. 'sup2': '\u00B2',
  81688. 'sup3': '\u00B3',
  81689. 'supe': '\u2287',
  81690. 'szlig': '\u00DF',
  81691. 'Tau': '\u03A4',
  81692. 'tau': '\u03C4',
  81693. 'there4': '\u2234',
  81694. 'Theta': '\u0398',
  81695. 'theta': '\u03B8',
  81696. 'thetasym': '\u03D1',
  81697. 'thinsp': '\u2009',
  81698. 'THORN': '\u00DE',
  81699. 'thorn': '\u00FE',
  81700. 'tilde': '\u02DC',
  81701. 'times': '\u00D7',
  81702. 'trade': '\u2122',
  81703. 'Uacute': '\u00DA',
  81704. 'uacute': '\u00FA',
  81705. 'uarr': '\u2191',
  81706. 'uArr': '\u21D1',
  81707. 'Ucirc': '\u00DB',
  81708. 'ucirc': '\u00FB',
  81709. 'Ugrave': '\u00D9',
  81710. 'ugrave': '\u00F9',
  81711. 'uml': '\u00A8',
  81712. 'upsih': '\u03D2',
  81713. 'Upsilon': '\u03A5',
  81714. 'upsilon': '\u03C5',
  81715. 'Uuml': '\u00DC',
  81716. 'uuml': '\u00FC',
  81717. 'weierp': '\u2118',
  81718. 'Xi': '\u039E',
  81719. 'xi': '\u03BE',
  81720. 'Yacute': '\u00DD',
  81721. 'yacute': '\u00FD',
  81722. 'yen': '\u00A5',
  81723. 'yuml': '\u00FF',
  81724. 'Yuml': '\u0178',
  81725. 'Zeta': '\u0396',
  81726. 'zeta': '\u03B6',
  81727. 'zwj': '\u200D',
  81728. 'zwnj': '\u200C',
  81729. };
  81730. // The &ngsp; pseudo-entity is denoting a space. see:
  81731. // https://github.com/dart-lang/angular/blob/0bb611387d29d65b5af7f9d2515ab571fd3fbee4/_tests/test/compiler/preserve_whitespace_test.dart
  81732. var NGSP_UNICODE = '\uE500';
  81733. NAMED_ENTITIES['ngsp'] = NGSP_UNICODE;
  81734. /**
  81735. * @fileoverview added by tsickle
  81736. * @suppress {checkTypes} checked by tsc
  81737. */
  81738. /**
  81739. * @license
  81740. * Copyright Google Inc. All Rights Reserved.
  81741. *
  81742. * Use of this source code is governed by an MIT-style license that can be
  81743. * found in the LICENSE file at https://angular.io/license
  81744. */
  81745. var NG_CONTENT_SELECT_ATTR = 'select';
  81746. var LINK_ELEMENT = 'link';
  81747. var LINK_STYLE_REL_ATTR = 'rel';
  81748. var LINK_STYLE_HREF_ATTR = 'href';
  81749. var LINK_STYLE_REL_VALUE = 'stylesheet';
  81750. var STYLE_ELEMENT = 'style';
  81751. var SCRIPT_ELEMENT = 'script';
  81752. var NG_NON_BINDABLE_ATTR = 'ngNonBindable';
  81753. var NG_PROJECT_AS = 'ngProjectAs';
  81754. /**
  81755. * @param {?} ast
  81756. * @return {?}
  81757. */
  81758. function preparseElement(ast) {
  81759. var /** @type {?} */ selectAttr = /** @type {?} */ ((null));
  81760. var /** @type {?} */ hrefAttr = /** @type {?} */ ((null));
  81761. var /** @type {?} */ relAttr = /** @type {?} */ ((null));
  81762. var /** @type {?} */ nonBindable = false;
  81763. var /** @type {?} */ projectAs = /** @type {?} */ ((null));
  81764. ast.attrs.forEach(function (attr) {
  81765. var /** @type {?} */ lcAttrName = attr.name.toLowerCase();
  81766. if (lcAttrName == NG_CONTENT_SELECT_ATTR) {
  81767. selectAttr = attr.value;
  81768. }
  81769. else if (lcAttrName == LINK_STYLE_HREF_ATTR) {
  81770. hrefAttr = attr.value;
  81771. }
  81772. else if (lcAttrName == LINK_STYLE_REL_ATTR) {
  81773. relAttr = attr.value;
  81774. }
  81775. else if (attr.name == NG_NON_BINDABLE_ATTR) {
  81776. nonBindable = true;
  81777. }
  81778. else if (attr.name == NG_PROJECT_AS) {
  81779. if (attr.value.length > 0) {
  81780. projectAs = attr.value;
  81781. }
  81782. }
  81783. });
  81784. selectAttr = normalizeNgContentSelect(selectAttr);
  81785. var /** @type {?} */ nodeName = ast.name.toLowerCase();
  81786. var /** @type {?} */ type = PreparsedElementType.OTHER;
  81787. if (isNgContent(nodeName)) {
  81788. type = PreparsedElementType.NG_CONTENT;
  81789. }
  81790. else if (nodeName == STYLE_ELEMENT) {
  81791. type = PreparsedElementType.STYLE;
  81792. }
  81793. else if (nodeName == SCRIPT_ELEMENT) {
  81794. type = PreparsedElementType.SCRIPT;
  81795. }
  81796. else if (nodeName == LINK_ELEMENT && relAttr == LINK_STYLE_REL_VALUE) {
  81797. type = PreparsedElementType.STYLESHEET;
  81798. }
  81799. return new PreparsedElement(type, selectAttr, hrefAttr, nonBindable, projectAs);
  81800. }
  81801. /** @enum {number} */
  81802. var PreparsedElementType = {
  81803. NG_CONTENT: 0,
  81804. STYLE: 1,
  81805. STYLESHEET: 2,
  81806. SCRIPT: 3,
  81807. OTHER: 4,
  81808. };
  81809. PreparsedElementType[PreparsedElementType.NG_CONTENT] = "NG_CONTENT";
  81810. PreparsedElementType[PreparsedElementType.STYLE] = "STYLE";
  81811. PreparsedElementType[PreparsedElementType.STYLESHEET] = "STYLESHEET";
  81812. PreparsedElementType[PreparsedElementType.SCRIPT] = "SCRIPT";
  81813. PreparsedElementType[PreparsedElementType.OTHER] = "OTHER";
  81814. var PreparsedElement = /** @class */ (function () {
  81815. function PreparsedElement(type, selectAttr, hrefAttr, nonBindable, projectAs) {
  81816. this.type = type;
  81817. this.selectAttr = selectAttr;
  81818. this.hrefAttr = hrefAttr;
  81819. this.nonBindable = nonBindable;
  81820. this.projectAs = projectAs;
  81821. }
  81822. return PreparsedElement;
  81823. }());
  81824. /**
  81825. * @param {?} selectAttr
  81826. * @return {?}
  81827. */
  81828. function normalizeNgContentSelect(selectAttr) {
  81829. if (selectAttr === null || selectAttr.length === 0) {
  81830. return '*';
  81831. }
  81832. return selectAttr;
  81833. }
  81834. /**
  81835. * @fileoverview added by tsickle
  81836. * @suppress {checkTypes} checked by tsc
  81837. */
  81838. /**
  81839. * @license
  81840. * Copyright Google Inc. All Rights Reserved.
  81841. *
  81842. * Use of this source code is governed by an MIT-style license that can be
  81843. * found in the LICENSE file at https://angular.io/license
  81844. */
  81845. /**
  81846. * @record
  81847. */
  81848. var DirectiveNormalizer = /** @class */ (function () {
  81849. function DirectiveNormalizer(_resourceLoader, _urlResolver, _htmlParser, _config) {
  81850. this._resourceLoader = _resourceLoader;
  81851. this._urlResolver = _urlResolver;
  81852. this._htmlParser = _htmlParser;
  81853. this._config = _config;
  81854. this._resourceLoaderCache = new Map();
  81855. }
  81856. /**
  81857. * @return {?}
  81858. */
  81859. DirectiveNormalizer.prototype.clearCache = /**
  81860. * @return {?}
  81861. */
  81862. function () { this._resourceLoaderCache.clear(); };
  81863. /**
  81864. * @param {?} normalizedDirective
  81865. * @return {?}
  81866. */
  81867. DirectiveNormalizer.prototype.clearCacheFor = /**
  81868. * @param {?} normalizedDirective
  81869. * @return {?}
  81870. */
  81871. function (normalizedDirective) {
  81872. var _this = this;
  81873. if (!normalizedDirective.isComponent) {
  81874. return;
  81875. }
  81876. var /** @type {?} */ template = /** @type {?} */ ((normalizedDirective.template));
  81877. this._resourceLoaderCache.delete(/** @type {?} */ ((template.templateUrl)));
  81878. template.externalStylesheets.forEach(function (stylesheet) { _this._resourceLoaderCache.delete(/** @type {?} */ ((stylesheet.moduleUrl))); });
  81879. };
  81880. /**
  81881. * @param {?} url
  81882. * @return {?}
  81883. */
  81884. DirectiveNormalizer.prototype._fetch = /**
  81885. * @param {?} url
  81886. * @return {?}
  81887. */
  81888. function (url) {
  81889. var /** @type {?} */ result = this._resourceLoaderCache.get(url);
  81890. if (!result) {
  81891. result = this._resourceLoader.get(url);
  81892. this._resourceLoaderCache.set(url, result);
  81893. }
  81894. return result;
  81895. };
  81896. /**
  81897. * @param {?} prenormData
  81898. * @return {?}
  81899. */
  81900. DirectiveNormalizer.prototype.normalizeTemplate = /**
  81901. * @param {?} prenormData
  81902. * @return {?}
  81903. */
  81904. function (prenormData) {
  81905. var _this = this;
  81906. if (isDefined(prenormData.template)) {
  81907. if (isDefined(prenormData.templateUrl)) {
  81908. throw syntaxError("'" + stringify(prenormData.componentType) + "' component cannot define both template and templateUrl");
  81909. }
  81910. if (typeof prenormData.template !== 'string') {
  81911. throw syntaxError("The template specified for component " + stringify(prenormData.componentType) + " is not a string");
  81912. }
  81913. }
  81914. else if (isDefined(prenormData.templateUrl)) {
  81915. if (typeof prenormData.templateUrl !== 'string') {
  81916. throw syntaxError("The templateUrl specified for component " + stringify(prenormData.componentType) + " is not a string");
  81917. }
  81918. }
  81919. else {
  81920. throw syntaxError("No template specified for component " + stringify(prenormData.componentType));
  81921. }
  81922. if (isDefined(prenormData.preserveWhitespaces) &&
  81923. typeof prenormData.preserveWhitespaces !== 'boolean') {
  81924. throw syntaxError("The preserveWhitespaces option for component " + stringify(prenormData.componentType) + " must be a boolean");
  81925. }
  81926. return SyncAsync.then(this._preParseTemplate(prenormData), function (preparsedTemplate) { return _this._normalizeTemplateMetadata(prenormData, preparsedTemplate); });
  81927. };
  81928. /**
  81929. * @param {?} prenomData
  81930. * @return {?}
  81931. */
  81932. DirectiveNormalizer.prototype._preParseTemplate = /**
  81933. * @param {?} prenomData
  81934. * @return {?}
  81935. */
  81936. function (prenomData) {
  81937. var _this = this;
  81938. var /** @type {?} */ template;
  81939. var /** @type {?} */ templateUrl;
  81940. if (prenomData.template != null) {
  81941. template = prenomData.template;
  81942. templateUrl = prenomData.moduleUrl;
  81943. }
  81944. else {
  81945. templateUrl = this._urlResolver.resolve(prenomData.moduleUrl, /** @type {?} */ ((prenomData.templateUrl)));
  81946. template = this._fetch(templateUrl);
  81947. }
  81948. return SyncAsync.then(template, function (template) { return _this._preparseLoadedTemplate(prenomData, template, templateUrl); });
  81949. };
  81950. /**
  81951. * @param {?} prenormData
  81952. * @param {?} template
  81953. * @param {?} templateAbsUrl
  81954. * @return {?}
  81955. */
  81956. DirectiveNormalizer.prototype._preparseLoadedTemplate = /**
  81957. * @param {?} prenormData
  81958. * @param {?} template
  81959. * @param {?} templateAbsUrl
  81960. * @return {?}
  81961. */
  81962. function (prenormData, template, templateAbsUrl) {
  81963. var /** @type {?} */ isInline = !!prenormData.template;
  81964. var /** @type {?} */ interpolationConfig = InterpolationConfig.fromArray(/** @type {?} */ ((prenormData.interpolation)));
  81965. var /** @type {?} */ rootNodesAndErrors = this._htmlParser.parse(template, templateSourceUrl({ reference: prenormData.ngModuleType }, { type: { reference: prenormData.componentType } }, { isInline: isInline, templateUrl: templateAbsUrl }), true, interpolationConfig);
  81966. if (rootNodesAndErrors.errors.length > 0) {
  81967. var /** @type {?} */ errorString = rootNodesAndErrors.errors.join('\n');
  81968. throw syntaxError("Template parse errors:\n" + errorString);
  81969. }
  81970. var /** @type {?} */ templateMetadataStyles = this._normalizeStylesheet(new CompileStylesheetMetadata({ styles: prenormData.styles, moduleUrl: prenormData.moduleUrl }));
  81971. var /** @type {?} */ visitor = new TemplatePreparseVisitor();
  81972. visitAll(visitor, rootNodesAndErrors.rootNodes);
  81973. var /** @type {?} */ templateStyles = this._normalizeStylesheet(new CompileStylesheetMetadata({ styles: visitor.styles, styleUrls: visitor.styleUrls, moduleUrl: templateAbsUrl }));
  81974. var /** @type {?} */ styles = templateMetadataStyles.styles.concat(templateStyles.styles);
  81975. var /** @type {?} */ inlineStyleUrls = templateMetadataStyles.styleUrls.concat(templateStyles.styleUrls);
  81976. var /** @type {?} */ styleUrls = this
  81977. ._normalizeStylesheet(new CompileStylesheetMetadata({ styleUrls: prenormData.styleUrls, moduleUrl: prenormData.moduleUrl }))
  81978. .styleUrls;
  81979. return {
  81980. template: template,
  81981. templateUrl: templateAbsUrl, isInline: isInline,
  81982. htmlAst: rootNodesAndErrors, styles: styles, inlineStyleUrls: inlineStyleUrls, styleUrls: styleUrls,
  81983. ngContentSelectors: visitor.ngContentSelectors,
  81984. };
  81985. };
  81986. /**
  81987. * @param {?} prenormData
  81988. * @param {?} preparsedTemplate
  81989. * @return {?}
  81990. */
  81991. DirectiveNormalizer.prototype._normalizeTemplateMetadata = /**
  81992. * @param {?} prenormData
  81993. * @param {?} preparsedTemplate
  81994. * @return {?}
  81995. */
  81996. function (prenormData, preparsedTemplate) {
  81997. var _this = this;
  81998. return SyncAsync.then(this._loadMissingExternalStylesheets(preparsedTemplate.styleUrls.concat(preparsedTemplate.inlineStyleUrls)), function (externalStylesheets) {
  81999. return _this._normalizeLoadedTemplateMetadata(prenormData, preparsedTemplate, externalStylesheets);
  82000. });
  82001. };
  82002. /**
  82003. * @param {?} prenormData
  82004. * @param {?} preparsedTemplate
  82005. * @param {?} stylesheets
  82006. * @return {?}
  82007. */
  82008. DirectiveNormalizer.prototype._normalizeLoadedTemplateMetadata = /**
  82009. * @param {?} prenormData
  82010. * @param {?} preparsedTemplate
  82011. * @param {?} stylesheets
  82012. * @return {?}
  82013. */
  82014. function (prenormData, preparsedTemplate, stylesheets) {
  82015. var _this = this;
  82016. // Algorithm:
  82017. // - produce exactly 1 entry per original styleUrl in
  82018. // CompileTemplateMetadata.externalStylesheets whith all styles inlined
  82019. // - inline all styles that are referenced by the template into CompileTemplateMetadata.styles.
  82020. // Reason: be able to determine how many stylesheets there are even without loading
  82021. // the template nor the stylesheets, so we can create a stub for TypeScript always synchronously
  82022. // (as resouce loading may be async)
  82023. var /** @type {?} */ styles = preparsedTemplate.styles.slice();
  82024. this._inlineStyles(preparsedTemplate.inlineStyleUrls, stylesheets, styles);
  82025. var /** @type {?} */ styleUrls = preparsedTemplate.styleUrls;
  82026. var /** @type {?} */ externalStylesheets = styleUrls.map(function (styleUrl) {
  82027. var /** @type {?} */ stylesheet = /** @type {?} */ ((stylesheets.get(styleUrl)));
  82028. var /** @type {?} */ styles = stylesheet.styles.slice();
  82029. _this._inlineStyles(stylesheet.styleUrls, stylesheets, styles);
  82030. return new CompileStylesheetMetadata({ moduleUrl: styleUrl, styles: styles });
  82031. });
  82032. var /** @type {?} */ encapsulation = prenormData.encapsulation;
  82033. if (encapsulation == null) {
  82034. encapsulation = this._config.defaultEncapsulation;
  82035. }
  82036. if (encapsulation === ViewEncapsulation.Emulated && styles.length === 0 &&
  82037. styleUrls.length === 0) {
  82038. encapsulation = ViewEncapsulation.None;
  82039. }
  82040. return new CompileTemplateMetadata({
  82041. encapsulation: encapsulation,
  82042. template: preparsedTemplate.template,
  82043. templateUrl: preparsedTemplate.templateUrl,
  82044. htmlAst: preparsedTemplate.htmlAst, styles: styles, styleUrls: styleUrls,
  82045. ngContentSelectors: preparsedTemplate.ngContentSelectors,
  82046. animations: prenormData.animations,
  82047. interpolation: prenormData.interpolation,
  82048. isInline: preparsedTemplate.isInline, externalStylesheets: externalStylesheets,
  82049. preserveWhitespaces: preserveWhitespacesDefault(prenormData.preserveWhitespaces, this._config.preserveWhitespaces),
  82050. });
  82051. };
  82052. /**
  82053. * @param {?} styleUrls
  82054. * @param {?} stylesheets
  82055. * @param {?} targetStyles
  82056. * @return {?}
  82057. */
  82058. DirectiveNormalizer.prototype._inlineStyles = /**
  82059. * @param {?} styleUrls
  82060. * @param {?} stylesheets
  82061. * @param {?} targetStyles
  82062. * @return {?}
  82063. */
  82064. function (styleUrls, stylesheets, targetStyles) {
  82065. var _this = this;
  82066. styleUrls.forEach(function (styleUrl) {
  82067. var /** @type {?} */ stylesheet = /** @type {?} */ ((stylesheets.get(styleUrl)));
  82068. stylesheet.styles.forEach(function (style) { return targetStyles.push(style); });
  82069. _this._inlineStyles(stylesheet.styleUrls, stylesheets, targetStyles);
  82070. });
  82071. };
  82072. /**
  82073. * @param {?} styleUrls
  82074. * @param {?=} loadedStylesheets
  82075. * @return {?}
  82076. */
  82077. DirectiveNormalizer.prototype._loadMissingExternalStylesheets = /**
  82078. * @param {?} styleUrls
  82079. * @param {?=} loadedStylesheets
  82080. * @return {?}
  82081. */
  82082. function (styleUrls, loadedStylesheets) {
  82083. var _this = this;
  82084. if (loadedStylesheets === void 0) { loadedStylesheets = new Map(); }
  82085. return SyncAsync.then(SyncAsync.all(styleUrls.filter(function (styleUrl) { return !loadedStylesheets.has(styleUrl); })
  82086. .map(function (styleUrl) {
  82087. return SyncAsync.then(_this._fetch(styleUrl), function (loadedStyle) {
  82088. var /** @type {?} */ stylesheet = _this._normalizeStylesheet(new CompileStylesheetMetadata({ styles: [loadedStyle], moduleUrl: styleUrl }));
  82089. loadedStylesheets.set(styleUrl, stylesheet);
  82090. return _this._loadMissingExternalStylesheets(stylesheet.styleUrls, loadedStylesheets);
  82091. });
  82092. })), function (_) { return loadedStylesheets; });
  82093. };
  82094. /**
  82095. * @param {?} stylesheet
  82096. * @return {?}
  82097. */
  82098. DirectiveNormalizer.prototype._normalizeStylesheet = /**
  82099. * @param {?} stylesheet
  82100. * @return {?}
  82101. */
  82102. function (stylesheet) {
  82103. var _this = this;
  82104. var /** @type {?} */ moduleUrl = /** @type {?} */ ((stylesheet.moduleUrl));
  82105. var /** @type {?} */ allStyleUrls = stylesheet.styleUrls.filter(isStyleUrlResolvable)
  82106. .map(function (url) { return _this._urlResolver.resolve(moduleUrl, url); });
  82107. var /** @type {?} */ allStyles = stylesheet.styles.map(function (style) {
  82108. var /** @type {?} */ styleWithImports = extractStyleUrls(_this._urlResolver, moduleUrl, style);
  82109. allStyleUrls.push.apply(allStyleUrls, styleWithImports.styleUrls);
  82110. return styleWithImports.style;
  82111. });
  82112. return new CompileStylesheetMetadata({ styles: allStyles, styleUrls: allStyleUrls, moduleUrl: moduleUrl });
  82113. };
  82114. return DirectiveNormalizer;
  82115. }());
  82116. var TemplatePreparseVisitor = /** @class */ (function () {
  82117. function TemplatePreparseVisitor() {
  82118. this.ngContentSelectors = [];
  82119. this.styles = [];
  82120. this.styleUrls = [];
  82121. this.ngNonBindableStackCount = 0;
  82122. }
  82123. /**
  82124. * @param {?} ast
  82125. * @param {?} context
  82126. * @return {?}
  82127. */
  82128. TemplatePreparseVisitor.prototype.visitElement = /**
  82129. * @param {?} ast
  82130. * @param {?} context
  82131. * @return {?}
  82132. */
  82133. function (ast, context) {
  82134. var /** @type {?} */ preparsedElement = preparseElement(ast);
  82135. switch (preparsedElement.type) {
  82136. case PreparsedElementType.NG_CONTENT:
  82137. if (this.ngNonBindableStackCount === 0) {
  82138. this.ngContentSelectors.push(preparsedElement.selectAttr);
  82139. }
  82140. break;
  82141. case PreparsedElementType.STYLE:
  82142. var /** @type {?} */ textContent_1 = '';
  82143. ast.children.forEach(function (child) {
  82144. if (child instanceof Text) {
  82145. textContent_1 += child.value;
  82146. }
  82147. });
  82148. this.styles.push(textContent_1);
  82149. break;
  82150. case PreparsedElementType.STYLESHEET:
  82151. this.styleUrls.push(preparsedElement.hrefAttr);
  82152. break;
  82153. default:
  82154. break;
  82155. }
  82156. if (preparsedElement.nonBindable) {
  82157. this.ngNonBindableStackCount++;
  82158. }
  82159. visitAll(this, ast.children);
  82160. if (preparsedElement.nonBindable) {
  82161. this.ngNonBindableStackCount--;
  82162. }
  82163. return null;
  82164. };
  82165. /**
  82166. * @param {?} ast
  82167. * @param {?} context
  82168. * @return {?}
  82169. */
  82170. TemplatePreparseVisitor.prototype.visitExpansion = /**
  82171. * @param {?} ast
  82172. * @param {?} context
  82173. * @return {?}
  82174. */
  82175. function (ast, context) { visitAll(this, ast.cases); };
  82176. /**
  82177. * @param {?} ast
  82178. * @param {?} context
  82179. * @return {?}
  82180. */
  82181. TemplatePreparseVisitor.prototype.visitExpansionCase = /**
  82182. * @param {?} ast
  82183. * @param {?} context
  82184. * @return {?}
  82185. */
  82186. function (ast, context) {
  82187. visitAll(this, ast.expression);
  82188. };
  82189. /**
  82190. * @param {?} ast
  82191. * @param {?} context
  82192. * @return {?}
  82193. */
  82194. TemplatePreparseVisitor.prototype.visitComment = /**
  82195. * @param {?} ast
  82196. * @param {?} context
  82197. * @return {?}
  82198. */
  82199. function (ast, context) { return null; };
  82200. /**
  82201. * @param {?} ast
  82202. * @param {?} context
  82203. * @return {?}
  82204. */
  82205. TemplatePreparseVisitor.prototype.visitAttribute = /**
  82206. * @param {?} ast
  82207. * @param {?} context
  82208. * @return {?}
  82209. */
  82210. function (ast, context) { return null; };
  82211. /**
  82212. * @param {?} ast
  82213. * @param {?} context
  82214. * @return {?}
  82215. */
  82216. TemplatePreparseVisitor.prototype.visitText = /**
  82217. * @param {?} ast
  82218. * @param {?} context
  82219. * @return {?}
  82220. */
  82221. function (ast, context) { return null; };
  82222. return TemplatePreparseVisitor;
  82223. }());
  82224. /**
  82225. * @fileoverview added by tsickle
  82226. * @suppress {checkTypes} checked by tsc
  82227. */
  82228. /**
  82229. * @license
  82230. * Copyright Google Inc. All Rights Reserved.
  82231. *
  82232. * Use of this source code is governed by an MIT-style license that can be
  82233. * found in the LICENSE file at https://angular.io/license
  82234. */
  82235. var QUERY_METADATA_IDENTIFIERS = [
  82236. createViewChild,
  82237. createViewChildren,
  82238. createContentChild,
  82239. createContentChildren,
  82240. ];
  82241. var DirectiveResolver = /** @class */ (function () {
  82242. function DirectiveResolver(_reflector) {
  82243. this._reflector = _reflector;
  82244. }
  82245. /**
  82246. * @param {?} type
  82247. * @return {?}
  82248. */
  82249. DirectiveResolver.prototype.isDirective = /**
  82250. * @param {?} type
  82251. * @return {?}
  82252. */
  82253. function (type) {
  82254. var /** @type {?} */ typeMetadata = this._reflector.annotations(resolveForwardRef(type));
  82255. return typeMetadata && typeMetadata.some(isDirectiveMetadata);
  82256. };
  82257. /**
  82258. * @param {?} type
  82259. * @param {?=} throwIfNotFound
  82260. * @return {?}
  82261. */
  82262. DirectiveResolver.prototype.resolve = /**
  82263. * @param {?} type
  82264. * @param {?=} throwIfNotFound
  82265. * @return {?}
  82266. */
  82267. function (type, throwIfNotFound) {
  82268. if (throwIfNotFound === void 0) { throwIfNotFound = true; }
  82269. var /** @type {?} */ typeMetadata = this._reflector.annotations(resolveForwardRef(type));
  82270. if (typeMetadata) {
  82271. var /** @type {?} */ metadata = findLast(typeMetadata, isDirectiveMetadata);
  82272. if (metadata) {
  82273. var /** @type {?} */ propertyMetadata = this._reflector.propMetadata(type);
  82274. var /** @type {?} */ guards = this._reflector.guards(type);
  82275. return this._mergeWithPropertyMetadata(metadata, propertyMetadata, guards, type);
  82276. }
  82277. }
  82278. if (throwIfNotFound) {
  82279. throw new Error("No Directive annotation found on " + stringify(type));
  82280. }
  82281. return null;
  82282. };
  82283. /**
  82284. * @param {?} dm
  82285. * @param {?} propertyMetadata
  82286. * @param {?} guards
  82287. * @param {?} directiveType
  82288. * @return {?}
  82289. */
  82290. DirectiveResolver.prototype._mergeWithPropertyMetadata = /**
  82291. * @param {?} dm
  82292. * @param {?} propertyMetadata
  82293. * @param {?} guards
  82294. * @param {?} directiveType
  82295. * @return {?}
  82296. */
  82297. function (dm, propertyMetadata, guards, directiveType) {
  82298. var /** @type {?} */ inputs = [];
  82299. var /** @type {?} */ outputs = [];
  82300. var /** @type {?} */ host = {};
  82301. var /** @type {?} */ queries = {};
  82302. Object.keys(propertyMetadata).forEach(function (propName) {
  82303. var /** @type {?} */ input = findLast(propertyMetadata[propName], function (a) { return createInput.isTypeOf(a); });
  82304. if (input) {
  82305. if (input.bindingPropertyName) {
  82306. inputs.push(propName + ": " + input.bindingPropertyName);
  82307. }
  82308. else {
  82309. inputs.push(propName);
  82310. }
  82311. }
  82312. var /** @type {?} */ output = findLast(propertyMetadata[propName], function (a) { return createOutput.isTypeOf(a); });
  82313. if (output) {
  82314. if (output.bindingPropertyName) {
  82315. outputs.push(propName + ": " + output.bindingPropertyName);
  82316. }
  82317. else {
  82318. outputs.push(propName);
  82319. }
  82320. }
  82321. var /** @type {?} */ hostBindings = propertyMetadata[propName].filter(function (a) { return createHostBinding.isTypeOf(a); });
  82322. hostBindings.forEach(function (hostBinding) {
  82323. if (hostBinding.hostPropertyName) {
  82324. var /** @type {?} */ startWith = hostBinding.hostPropertyName[0];
  82325. if (startWith === '(') {
  82326. throw new Error("@HostBinding can not bind to events. Use @HostListener instead.");
  82327. }
  82328. else if (startWith === '[') {
  82329. throw new Error("@HostBinding parameter should be a property name, 'class.<name>', or 'attr.<name>'.");
  82330. }
  82331. host["[" + hostBinding.hostPropertyName + "]"] = propName;
  82332. }
  82333. else {
  82334. host["[" + propName + "]"] = propName;
  82335. }
  82336. });
  82337. var /** @type {?} */ hostListeners = propertyMetadata[propName].filter(function (a) { return createHostListener.isTypeOf(a); });
  82338. hostListeners.forEach(function (hostListener) {
  82339. var /** @type {?} */ args = hostListener.args || [];
  82340. host["(" + hostListener.eventName + ")"] = propName + "(" + args.join(',') + ")";
  82341. });
  82342. var /** @type {?} */ query = findLast(propertyMetadata[propName], function (a) { return QUERY_METADATA_IDENTIFIERS.some(function (i) { return i.isTypeOf(a); }); });
  82343. if (query) {
  82344. queries[propName] = query;
  82345. }
  82346. });
  82347. return this._merge(dm, inputs, outputs, host, queries, guards, directiveType);
  82348. };
  82349. /**
  82350. * @param {?} def
  82351. * @return {?}
  82352. */
  82353. DirectiveResolver.prototype._extractPublicName = /**
  82354. * @param {?} def
  82355. * @return {?}
  82356. */
  82357. function (def) { return splitAtColon(def, [/** @type {?} */ ((null)), def])[1].trim(); };
  82358. /**
  82359. * @param {?} bindings
  82360. * @return {?}
  82361. */
  82362. DirectiveResolver.prototype._dedupeBindings = /**
  82363. * @param {?} bindings
  82364. * @return {?}
  82365. */
  82366. function (bindings) {
  82367. var /** @type {?} */ names = new Set();
  82368. var /** @type {?} */ publicNames = new Set();
  82369. var /** @type {?} */ reversedResult = [];
  82370. // go last to first to allow later entries to overwrite previous entries
  82371. for (var /** @type {?} */ i = bindings.length - 1; i >= 0; i--) {
  82372. var /** @type {?} */ binding = bindings[i];
  82373. var /** @type {?} */ name_1 = this._extractPublicName(binding);
  82374. publicNames.add(name_1);
  82375. if (!names.has(name_1)) {
  82376. names.add(name_1);
  82377. reversedResult.push(binding);
  82378. }
  82379. }
  82380. return reversedResult.reverse();
  82381. };
  82382. /**
  82383. * @param {?} directive
  82384. * @param {?} inputs
  82385. * @param {?} outputs
  82386. * @param {?} host
  82387. * @param {?} queries
  82388. * @param {?} guards
  82389. * @param {?} directiveType
  82390. * @return {?}
  82391. */
  82392. DirectiveResolver.prototype._merge = /**
  82393. * @param {?} directive
  82394. * @param {?} inputs
  82395. * @param {?} outputs
  82396. * @param {?} host
  82397. * @param {?} queries
  82398. * @param {?} guards
  82399. * @param {?} directiveType
  82400. * @return {?}
  82401. */
  82402. function (directive, inputs, outputs, host, queries, guards, directiveType) {
  82403. var /** @type {?} */ mergedInputs = this._dedupeBindings(directive.inputs ? directive.inputs.concat(inputs) : inputs);
  82404. var /** @type {?} */ mergedOutputs = this._dedupeBindings(directive.outputs ? directive.outputs.concat(outputs) : outputs);
  82405. var /** @type {?} */ mergedHost = directive.host ? Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */])({}, directive.host, host) : host;
  82406. var /** @type {?} */ mergedQueries = directive.queries ? Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */])({}, directive.queries, queries) : queries;
  82407. if (createComponent.isTypeOf(directive)) {
  82408. var /** @type {?} */ comp = /** @type {?} */ (directive);
  82409. return createComponent({
  82410. selector: comp.selector,
  82411. inputs: mergedInputs,
  82412. outputs: mergedOutputs,
  82413. host: mergedHost,
  82414. exportAs: comp.exportAs,
  82415. moduleId: comp.moduleId,
  82416. queries: mergedQueries,
  82417. changeDetection: comp.changeDetection,
  82418. providers: comp.providers,
  82419. viewProviders: comp.viewProviders,
  82420. entryComponents: comp.entryComponents,
  82421. template: comp.template,
  82422. templateUrl: comp.templateUrl,
  82423. styles: comp.styles,
  82424. styleUrls: comp.styleUrls,
  82425. encapsulation: comp.encapsulation,
  82426. animations: comp.animations,
  82427. interpolation: comp.interpolation,
  82428. preserveWhitespaces: directive.preserveWhitespaces,
  82429. });
  82430. }
  82431. else {
  82432. return createDirective({
  82433. selector: directive.selector,
  82434. inputs: mergedInputs,
  82435. outputs: mergedOutputs,
  82436. host: mergedHost,
  82437. exportAs: directive.exportAs,
  82438. queries: mergedQueries,
  82439. providers: directive.providers, guards: guards
  82440. });
  82441. }
  82442. };
  82443. return DirectiveResolver;
  82444. }());
  82445. /**
  82446. * @param {?} type
  82447. * @return {?}
  82448. */
  82449. function isDirectiveMetadata(type) {
  82450. return createDirective.isTypeOf(type) || createComponent.isTypeOf(type);
  82451. }
  82452. /**
  82453. * @template T
  82454. * @param {?} arr
  82455. * @param {?} condition
  82456. * @return {?}
  82457. */
  82458. function findLast(arr, condition) {
  82459. for (var /** @type {?} */ i = arr.length - 1; i >= 0; i--) {
  82460. if (condition(arr[i])) {
  82461. return arr[i];
  82462. }
  82463. }
  82464. return null;
  82465. }
  82466. /**
  82467. * @fileoverview added by tsickle
  82468. * @suppress {checkTypes} checked by tsc
  82469. */
  82470. /**
  82471. * @license
  82472. * Copyright Google Inc. All Rights Reserved.
  82473. *
  82474. * Use of this source code is governed by an MIT-style license that can be
  82475. * found in the LICENSE file at https://angular.io/license
  82476. */
  82477. var $EOF = 0;
  82478. var $TAB = 9;
  82479. var $LF = 10;
  82480. var $VTAB = 11;
  82481. var $FF = 12;
  82482. var $CR = 13;
  82483. var $SPACE = 32;
  82484. var $BANG = 33;
  82485. var $DQ = 34;
  82486. var $HASH = 35;
  82487. var $$ = 36;
  82488. var $PERCENT = 37;
  82489. var $AMPERSAND = 38;
  82490. var $SQ = 39;
  82491. var $LPAREN = 40;
  82492. var $RPAREN = 41;
  82493. var $STAR = 42;
  82494. var $PLUS = 43;
  82495. var $COMMA = 44;
  82496. var $MINUS = 45;
  82497. var $PERIOD = 46;
  82498. var $SLASH = 47;
  82499. var $COLON = 58;
  82500. var $SEMICOLON = 59;
  82501. var $LT = 60;
  82502. var $EQ = 61;
  82503. var $GT = 62;
  82504. var $QUESTION = 63;
  82505. var $0 = 48;
  82506. var $9 = 57;
  82507. var $A = 65;
  82508. var $E = 69;
  82509. var $F = 70;
  82510. var $X = 88;
  82511. var $Z = 90;
  82512. var $LBRACKET = 91;
  82513. var $BACKSLASH = 92;
  82514. var $RBRACKET = 93;
  82515. var $CARET = 94;
  82516. var $_ = 95;
  82517. var $a = 97;
  82518. var $e = 101;
  82519. var $f = 102;
  82520. var $n = 110;
  82521. var $r = 114;
  82522. var $t = 116;
  82523. var $u = 117;
  82524. var $v = 118;
  82525. var $x = 120;
  82526. var $z = 122;
  82527. var $LBRACE = 123;
  82528. var $BAR = 124;
  82529. var $RBRACE = 125;
  82530. var $NBSP = 160;
  82531. var $BT = 96;
  82532. /**
  82533. * @param {?} code
  82534. * @return {?}
  82535. */
  82536. function isWhitespace(code) {
  82537. return (code >= $TAB && code <= $SPACE) || (code == $NBSP);
  82538. }
  82539. /**
  82540. * @param {?} code
  82541. * @return {?}
  82542. */
  82543. function isDigit(code) {
  82544. return $0 <= code && code <= $9;
  82545. }
  82546. /**
  82547. * @param {?} code
  82548. * @return {?}
  82549. */
  82550. function isAsciiLetter(code) {
  82551. return code >= $a && code <= $z || code >= $A && code <= $Z;
  82552. }
  82553. /**
  82554. * @param {?} code
  82555. * @return {?}
  82556. */
  82557. function isAsciiHexDigit(code) {
  82558. return code >= $a && code <= $f || code >= $A && code <= $F || isDigit(code);
  82559. }
  82560. /**
  82561. * @fileoverview added by tsickle
  82562. * @suppress {checkTypes} checked by tsc
  82563. */
  82564. /**
  82565. * @license
  82566. * Copyright Google Inc. All Rights Reserved.
  82567. *
  82568. * Use of this source code is governed by an MIT-style license that can be
  82569. * found in the LICENSE file at https://angular.io/license
  82570. */
  82571. /** @enum {number} */
  82572. var TokenType = {
  82573. Character: 0,
  82574. Identifier: 1,
  82575. Keyword: 2,
  82576. String: 3,
  82577. Operator: 4,
  82578. Number: 5,
  82579. Error: 6,
  82580. };
  82581. TokenType[TokenType.Character] = "Character";
  82582. TokenType[TokenType.Identifier] = "Identifier";
  82583. TokenType[TokenType.Keyword] = "Keyword";
  82584. TokenType[TokenType.String] = "String";
  82585. TokenType[TokenType.Operator] = "Operator";
  82586. TokenType[TokenType.Number] = "Number";
  82587. TokenType[TokenType.Error] = "Error";
  82588. var KEYWORDS = ['var', 'let', 'as', 'null', 'undefined', 'true', 'false', 'if', 'else', 'this'];
  82589. var Lexer = /** @class */ (function () {
  82590. function Lexer() {
  82591. }
  82592. /**
  82593. * @param {?} text
  82594. * @return {?}
  82595. */
  82596. Lexer.prototype.tokenize = /**
  82597. * @param {?} text
  82598. * @return {?}
  82599. */
  82600. function (text) {
  82601. var /** @type {?} */ scanner = new _Scanner(text);
  82602. var /** @type {?} */ tokens = [];
  82603. var /** @type {?} */ token = scanner.scanToken();
  82604. while (token != null) {
  82605. tokens.push(token);
  82606. token = scanner.scanToken();
  82607. }
  82608. return tokens;
  82609. };
  82610. return Lexer;
  82611. }());
  82612. var Token = /** @class */ (function () {
  82613. function Token(index, type, numValue, strValue) {
  82614. this.index = index;
  82615. this.type = type;
  82616. this.numValue = numValue;
  82617. this.strValue = strValue;
  82618. }
  82619. /**
  82620. * @param {?} code
  82621. * @return {?}
  82622. */
  82623. Token.prototype.isCharacter = /**
  82624. * @param {?} code
  82625. * @return {?}
  82626. */
  82627. function (code) {
  82628. return this.type == TokenType.Character && this.numValue == code;
  82629. };
  82630. /**
  82631. * @return {?}
  82632. */
  82633. Token.prototype.isNumber = /**
  82634. * @return {?}
  82635. */
  82636. function () { return this.type == TokenType.Number; };
  82637. /**
  82638. * @return {?}
  82639. */
  82640. Token.prototype.isString = /**
  82641. * @return {?}
  82642. */
  82643. function () { return this.type == TokenType.String; };
  82644. /**
  82645. * @param {?} operater
  82646. * @return {?}
  82647. */
  82648. Token.prototype.isOperator = /**
  82649. * @param {?} operater
  82650. * @return {?}
  82651. */
  82652. function (operater) {
  82653. return this.type == TokenType.Operator && this.strValue == operater;
  82654. };
  82655. /**
  82656. * @return {?}
  82657. */
  82658. Token.prototype.isIdentifier = /**
  82659. * @return {?}
  82660. */
  82661. function () { return this.type == TokenType.Identifier; };
  82662. /**
  82663. * @return {?}
  82664. */
  82665. Token.prototype.isKeyword = /**
  82666. * @return {?}
  82667. */
  82668. function () { return this.type == TokenType.Keyword; };
  82669. /**
  82670. * @return {?}
  82671. */
  82672. Token.prototype.isKeywordLet = /**
  82673. * @return {?}
  82674. */
  82675. function () { return this.type == TokenType.Keyword && this.strValue == 'let'; };
  82676. /**
  82677. * @return {?}
  82678. */
  82679. Token.prototype.isKeywordAs = /**
  82680. * @return {?}
  82681. */
  82682. function () { return this.type == TokenType.Keyword && this.strValue == 'as'; };
  82683. /**
  82684. * @return {?}
  82685. */
  82686. Token.prototype.isKeywordNull = /**
  82687. * @return {?}
  82688. */
  82689. function () { return this.type == TokenType.Keyword && this.strValue == 'null'; };
  82690. /**
  82691. * @return {?}
  82692. */
  82693. Token.prototype.isKeywordUndefined = /**
  82694. * @return {?}
  82695. */
  82696. function () {
  82697. return this.type == TokenType.Keyword && this.strValue == 'undefined';
  82698. };
  82699. /**
  82700. * @return {?}
  82701. */
  82702. Token.prototype.isKeywordTrue = /**
  82703. * @return {?}
  82704. */
  82705. function () { return this.type == TokenType.Keyword && this.strValue == 'true'; };
  82706. /**
  82707. * @return {?}
  82708. */
  82709. Token.prototype.isKeywordFalse = /**
  82710. * @return {?}
  82711. */
  82712. function () { return this.type == TokenType.Keyword && this.strValue == 'false'; };
  82713. /**
  82714. * @return {?}
  82715. */
  82716. Token.prototype.isKeywordThis = /**
  82717. * @return {?}
  82718. */
  82719. function () { return this.type == TokenType.Keyword && this.strValue == 'this'; };
  82720. /**
  82721. * @return {?}
  82722. */
  82723. Token.prototype.isError = /**
  82724. * @return {?}
  82725. */
  82726. function () { return this.type == TokenType.Error; };
  82727. /**
  82728. * @return {?}
  82729. */
  82730. Token.prototype.toNumber = /**
  82731. * @return {?}
  82732. */
  82733. function () { return this.type == TokenType.Number ? this.numValue : -1; };
  82734. /**
  82735. * @return {?}
  82736. */
  82737. Token.prototype.toString = /**
  82738. * @return {?}
  82739. */
  82740. function () {
  82741. switch (this.type) {
  82742. case TokenType.Character:
  82743. case TokenType.Identifier:
  82744. case TokenType.Keyword:
  82745. case TokenType.Operator:
  82746. case TokenType.String:
  82747. case TokenType.Error:
  82748. return this.strValue;
  82749. case TokenType.Number:
  82750. return this.numValue.toString();
  82751. default:
  82752. return null;
  82753. }
  82754. };
  82755. return Token;
  82756. }());
  82757. /**
  82758. * @param {?} index
  82759. * @param {?} code
  82760. * @return {?}
  82761. */
  82762. function newCharacterToken(index, code) {
  82763. return new Token(index, TokenType.Character, code, String.fromCharCode(code));
  82764. }
  82765. /**
  82766. * @param {?} index
  82767. * @param {?} text
  82768. * @return {?}
  82769. */
  82770. function newIdentifierToken(index, text) {
  82771. return new Token(index, TokenType.Identifier, 0, text);
  82772. }
  82773. /**
  82774. * @param {?} index
  82775. * @param {?} text
  82776. * @return {?}
  82777. */
  82778. function newKeywordToken(index, text) {
  82779. return new Token(index, TokenType.Keyword, 0, text);
  82780. }
  82781. /**
  82782. * @param {?} index
  82783. * @param {?} text
  82784. * @return {?}
  82785. */
  82786. function newOperatorToken(index, text) {
  82787. return new Token(index, TokenType.Operator, 0, text);
  82788. }
  82789. /**
  82790. * @param {?} index
  82791. * @param {?} text
  82792. * @return {?}
  82793. */
  82794. function newStringToken(index, text) {
  82795. return new Token(index, TokenType.String, 0, text);
  82796. }
  82797. /**
  82798. * @param {?} index
  82799. * @param {?} n
  82800. * @return {?}
  82801. */
  82802. function newNumberToken(index, n) {
  82803. return new Token(index, TokenType.Number, n, '');
  82804. }
  82805. /**
  82806. * @param {?} index
  82807. * @param {?} message
  82808. * @return {?}
  82809. */
  82810. function newErrorToken(index, message) {
  82811. return new Token(index, TokenType.Error, 0, message);
  82812. }
  82813. var EOF = new Token(-1, TokenType.Character, 0, '');
  82814. var _Scanner = /** @class */ (function () {
  82815. function _Scanner(input) {
  82816. this.input = input;
  82817. this.peek = 0;
  82818. this.index = -1;
  82819. this.length = input.length;
  82820. this.advance();
  82821. }
  82822. /**
  82823. * @return {?}
  82824. */
  82825. _Scanner.prototype.advance = /**
  82826. * @return {?}
  82827. */
  82828. function () {
  82829. this.peek = ++this.index >= this.length ? $EOF : this.input.charCodeAt(this.index);
  82830. };
  82831. /**
  82832. * @return {?}
  82833. */
  82834. _Scanner.prototype.scanToken = /**
  82835. * @return {?}
  82836. */
  82837. function () {
  82838. var /** @type {?} */ input = this.input, /** @type {?} */ length = this.length;
  82839. var /** @type {?} */ peek = this.peek, /** @type {?} */ index = this.index;
  82840. // Skip whitespace.
  82841. while (peek <= $SPACE) {
  82842. if (++index >= length) {
  82843. peek = $EOF;
  82844. break;
  82845. }
  82846. else {
  82847. peek = input.charCodeAt(index);
  82848. }
  82849. }
  82850. this.peek = peek;
  82851. this.index = index;
  82852. if (index >= length) {
  82853. return null;
  82854. }
  82855. // Handle identifiers and numbers.
  82856. if (isIdentifierStart(peek))
  82857. return this.scanIdentifier();
  82858. if (isDigit(peek))
  82859. return this.scanNumber(index);
  82860. var /** @type {?} */ start = index;
  82861. switch (peek) {
  82862. case $PERIOD:
  82863. this.advance();
  82864. return isDigit(this.peek) ? this.scanNumber(start) :
  82865. newCharacterToken(start, $PERIOD);
  82866. case $LPAREN:
  82867. case $RPAREN:
  82868. case $LBRACE:
  82869. case $RBRACE:
  82870. case $LBRACKET:
  82871. case $RBRACKET:
  82872. case $COMMA:
  82873. case $COLON:
  82874. case $SEMICOLON:
  82875. return this.scanCharacter(start, peek);
  82876. case $SQ:
  82877. case $DQ:
  82878. return this.scanString();
  82879. case $HASH:
  82880. case $PLUS:
  82881. case $MINUS:
  82882. case $STAR:
  82883. case $SLASH:
  82884. case $PERCENT:
  82885. case $CARET:
  82886. return this.scanOperator(start, String.fromCharCode(peek));
  82887. case $QUESTION:
  82888. return this.scanComplexOperator(start, '?', $PERIOD, '.');
  82889. case $LT:
  82890. case $GT:
  82891. return this.scanComplexOperator(start, String.fromCharCode(peek), $EQ, '=');
  82892. case $BANG:
  82893. case $EQ:
  82894. return this.scanComplexOperator(start, String.fromCharCode(peek), $EQ, '=', $EQ, '=');
  82895. case $AMPERSAND:
  82896. return this.scanComplexOperator(start, '&', $AMPERSAND, '&');
  82897. case $BAR:
  82898. return this.scanComplexOperator(start, '|', $BAR, '|');
  82899. case $NBSP:
  82900. while (isWhitespace(this.peek))
  82901. this.advance();
  82902. return this.scanToken();
  82903. }
  82904. this.advance();
  82905. return this.error("Unexpected character [" + String.fromCharCode(peek) + "]", 0);
  82906. };
  82907. /**
  82908. * @param {?} start
  82909. * @param {?} code
  82910. * @return {?}
  82911. */
  82912. _Scanner.prototype.scanCharacter = /**
  82913. * @param {?} start
  82914. * @param {?} code
  82915. * @return {?}
  82916. */
  82917. function (start, code) {
  82918. this.advance();
  82919. return newCharacterToken(start, code);
  82920. };
  82921. /**
  82922. * @param {?} start
  82923. * @param {?} str
  82924. * @return {?}
  82925. */
  82926. _Scanner.prototype.scanOperator = /**
  82927. * @param {?} start
  82928. * @param {?} str
  82929. * @return {?}
  82930. */
  82931. function (start, str) {
  82932. this.advance();
  82933. return newOperatorToken(start, str);
  82934. };
  82935. /**
  82936. * Tokenize a 2/3 char long operator
  82937. *
  82938. * @param start start index in the expression
  82939. * @param one first symbol (always part of the operator)
  82940. * @param twoCode code point for the second symbol
  82941. * @param two second symbol (part of the operator when the second code point matches)
  82942. * @param threeCode code point for the third symbol
  82943. * @param three third symbol (part of the operator when provided and matches source expression)
  82944. */
  82945. /**
  82946. * Tokenize a 2/3 char long operator
  82947. *
  82948. * @param {?} start start index in the expression
  82949. * @param {?} one first symbol (always part of the operator)
  82950. * @param {?} twoCode code point for the second symbol
  82951. * @param {?} two second symbol (part of the operator when the second code point matches)
  82952. * @param {?=} threeCode code point for the third symbol
  82953. * @param {?=} three third symbol (part of the operator when provided and matches source expression)
  82954. * @return {?}
  82955. */
  82956. _Scanner.prototype.scanComplexOperator = /**
  82957. * Tokenize a 2/3 char long operator
  82958. *
  82959. * @param {?} start start index in the expression
  82960. * @param {?} one first symbol (always part of the operator)
  82961. * @param {?} twoCode code point for the second symbol
  82962. * @param {?} two second symbol (part of the operator when the second code point matches)
  82963. * @param {?=} threeCode code point for the third symbol
  82964. * @param {?=} three third symbol (part of the operator when provided and matches source expression)
  82965. * @return {?}
  82966. */
  82967. function (start, one, twoCode, two, threeCode, three) {
  82968. this.advance();
  82969. var /** @type {?} */ str = one;
  82970. if (this.peek == twoCode) {
  82971. this.advance();
  82972. str += two;
  82973. }
  82974. if (threeCode != null && this.peek == threeCode) {
  82975. this.advance();
  82976. str += three;
  82977. }
  82978. return newOperatorToken(start, str);
  82979. };
  82980. /**
  82981. * @return {?}
  82982. */
  82983. _Scanner.prototype.scanIdentifier = /**
  82984. * @return {?}
  82985. */
  82986. function () {
  82987. var /** @type {?} */ start = this.index;
  82988. this.advance();
  82989. while (isIdentifierPart(this.peek))
  82990. this.advance();
  82991. var /** @type {?} */ str = this.input.substring(start, this.index);
  82992. return KEYWORDS.indexOf(str) > -1 ? newKeywordToken(start, str) :
  82993. newIdentifierToken(start, str);
  82994. };
  82995. /**
  82996. * @param {?} start
  82997. * @return {?}
  82998. */
  82999. _Scanner.prototype.scanNumber = /**
  83000. * @param {?} start
  83001. * @return {?}
  83002. */
  83003. function (start) {
  83004. var /** @type {?} */ simple = (this.index === start);
  83005. this.advance(); // Skip initial digit.
  83006. while (true) {
  83007. if (isDigit(this.peek)) {
  83008. // Do nothing.
  83009. }
  83010. else if (this.peek == $PERIOD) {
  83011. simple = false;
  83012. }
  83013. else if (isExponentStart(this.peek)) {
  83014. this.advance();
  83015. if (isExponentSign(this.peek))
  83016. this.advance();
  83017. if (!isDigit(this.peek))
  83018. return this.error('Invalid exponent', -1);
  83019. simple = false;
  83020. }
  83021. else {
  83022. break;
  83023. }
  83024. this.advance();
  83025. }
  83026. var /** @type {?} */ str = this.input.substring(start, this.index);
  83027. var /** @type {?} */ value = simple ? parseIntAutoRadix(str) : parseFloat(str);
  83028. return newNumberToken(start, value);
  83029. };
  83030. /**
  83031. * @return {?}
  83032. */
  83033. _Scanner.prototype.scanString = /**
  83034. * @return {?}
  83035. */
  83036. function () {
  83037. var /** @type {?} */ start = this.index;
  83038. var /** @type {?} */ quote = this.peek;
  83039. this.advance(); // Skip initial quote.
  83040. var /** @type {?} */ buffer = '';
  83041. var /** @type {?} */ marker = this.index;
  83042. var /** @type {?} */ input = this.input;
  83043. while (this.peek != quote) {
  83044. if (this.peek == $BACKSLASH) {
  83045. buffer += input.substring(marker, this.index);
  83046. this.advance();
  83047. var /** @type {?} */ unescapedCode = void 0;
  83048. // Workaround for TS2.1-introduced type strictness
  83049. this.peek = this.peek;
  83050. if (this.peek == $u) {
  83051. // 4 character hex code for unicode character.
  83052. var /** @type {?} */ hex = input.substring(this.index + 1, this.index + 5);
  83053. if (/^[0-9a-f]+$/i.test(hex)) {
  83054. unescapedCode = parseInt(hex, 16);
  83055. }
  83056. else {
  83057. return this.error("Invalid unicode escape [\\u" + hex + "]", 0);
  83058. }
  83059. for (var /** @type {?} */ i = 0; i < 5; i++) {
  83060. this.advance();
  83061. }
  83062. }
  83063. else {
  83064. unescapedCode = unescape(this.peek);
  83065. this.advance();
  83066. }
  83067. buffer += String.fromCharCode(unescapedCode);
  83068. marker = this.index;
  83069. }
  83070. else if (this.peek == $EOF) {
  83071. return this.error('Unterminated quote', 0);
  83072. }
  83073. else {
  83074. this.advance();
  83075. }
  83076. }
  83077. var /** @type {?} */ last = input.substring(marker, this.index);
  83078. this.advance(); // Skip terminating quote.
  83079. return newStringToken(start, buffer + last);
  83080. };
  83081. /**
  83082. * @param {?} message
  83083. * @param {?} offset
  83084. * @return {?}
  83085. */
  83086. _Scanner.prototype.error = /**
  83087. * @param {?} message
  83088. * @param {?} offset
  83089. * @return {?}
  83090. */
  83091. function (message, offset) {
  83092. var /** @type {?} */ position = this.index + offset;
  83093. return newErrorToken(position, "Lexer Error: " + message + " at column " + position + " in expression [" + this.input + "]");
  83094. };
  83095. return _Scanner;
  83096. }());
  83097. /**
  83098. * @param {?} code
  83099. * @return {?}
  83100. */
  83101. function isIdentifierStart(code) {
  83102. return ($a <= code && code <= $z) || ($A <= code && code <= $Z) ||
  83103. (code == $_) || (code == $$);
  83104. }
  83105. /**
  83106. * @param {?} input
  83107. * @return {?}
  83108. */
  83109. function isIdentifier(input) {
  83110. if (input.length == 0)
  83111. return false;
  83112. var /** @type {?} */ scanner = new _Scanner(input);
  83113. if (!isIdentifierStart(scanner.peek))
  83114. return false;
  83115. scanner.advance();
  83116. while (scanner.peek !== $EOF) {
  83117. if (!isIdentifierPart(scanner.peek))
  83118. return false;
  83119. scanner.advance();
  83120. }
  83121. return true;
  83122. }
  83123. /**
  83124. * @param {?} code
  83125. * @return {?}
  83126. */
  83127. function isIdentifierPart(code) {
  83128. return isAsciiLetter(code) || isDigit(code) || (code == $_) ||
  83129. (code == $$);
  83130. }
  83131. /**
  83132. * @param {?} code
  83133. * @return {?}
  83134. */
  83135. function isExponentStart(code) {
  83136. return code == $e || code == $E;
  83137. }
  83138. /**
  83139. * @param {?} code
  83140. * @return {?}
  83141. */
  83142. function isExponentSign(code) {
  83143. return code == $MINUS || code == $PLUS;
  83144. }
  83145. /**
  83146. * @param {?} code
  83147. * @return {?}
  83148. */
  83149. function isQuote(code) {
  83150. return code === $SQ || code === $DQ || code === $BT;
  83151. }
  83152. /**
  83153. * @param {?} code
  83154. * @return {?}
  83155. */
  83156. function unescape(code) {
  83157. switch (code) {
  83158. case $n:
  83159. return $LF;
  83160. case $f:
  83161. return $FF;
  83162. case $r:
  83163. return $CR;
  83164. case $t:
  83165. return $TAB;
  83166. case $v:
  83167. return $VTAB;
  83168. default:
  83169. return code;
  83170. }
  83171. }
  83172. /**
  83173. * @param {?} text
  83174. * @return {?}
  83175. */
  83176. function parseIntAutoRadix(text) {
  83177. var /** @type {?} */ result = parseInt(text);
  83178. if (isNaN(result)) {
  83179. throw new Error('Invalid integer literal when parsing ' + text);
  83180. }
  83181. return result;
  83182. }
  83183. /**
  83184. * @fileoverview added by tsickle
  83185. * @suppress {checkTypes} checked by tsc
  83186. */
  83187. /**
  83188. * @license
  83189. * Copyright Google Inc. All Rights Reserved.
  83190. *
  83191. * Use of this source code is governed by an MIT-style license that can be
  83192. * found in the LICENSE file at https://angular.io/license
  83193. */
  83194. var ParserError = /** @class */ (function () {
  83195. function ParserError(message, input, errLocation, ctxLocation) {
  83196. this.input = input;
  83197. this.errLocation = errLocation;
  83198. this.ctxLocation = ctxLocation;
  83199. this.message = "Parser Error: " + message + " " + errLocation + " [" + input + "] in " + ctxLocation;
  83200. }
  83201. return ParserError;
  83202. }());
  83203. var ParseSpan = /** @class */ (function () {
  83204. function ParseSpan(start, end) {
  83205. this.start = start;
  83206. this.end = end;
  83207. }
  83208. return ParseSpan;
  83209. }());
  83210. var AST = /** @class */ (function () {
  83211. function AST(span) {
  83212. this.span = span;
  83213. }
  83214. /**
  83215. * @param {?} visitor
  83216. * @param {?=} context
  83217. * @return {?}
  83218. */
  83219. AST.prototype.visit = /**
  83220. * @param {?} visitor
  83221. * @param {?=} context
  83222. * @return {?}
  83223. */
  83224. function (visitor, context) {
  83225. if (context === void 0) { context = null; }
  83226. return null;
  83227. };
  83228. /**
  83229. * @return {?}
  83230. */
  83231. AST.prototype.toString = /**
  83232. * @return {?}
  83233. */
  83234. function () { return 'AST'; };
  83235. return AST;
  83236. }());
  83237. /**
  83238. * Represents a quoted expression of the form:
  83239. *
  83240. * quote = prefix `:` uninterpretedExpression
  83241. * prefix = identifier
  83242. * uninterpretedExpression = arbitrary string
  83243. *
  83244. * A quoted expression is meant to be pre-processed by an AST transformer that
  83245. * converts it into another AST that no longer contains quoted expressions.
  83246. * It is meant to allow third-party developers to extend Angular template
  83247. * expression language. The `uninterpretedExpression` part of the quote is
  83248. * therefore not interpreted by the Angular's own expression parser.
  83249. */
  83250. var Quote = /** @class */ (function (_super) {
  83251. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(Quote, _super);
  83252. function Quote(span, prefix, uninterpretedExpression, location) {
  83253. var _this = _super.call(this, span) || this;
  83254. _this.prefix = prefix;
  83255. _this.uninterpretedExpression = uninterpretedExpression;
  83256. _this.location = location;
  83257. return _this;
  83258. }
  83259. /**
  83260. * @param {?} visitor
  83261. * @param {?=} context
  83262. * @return {?}
  83263. */
  83264. Quote.prototype.visit = /**
  83265. * @param {?} visitor
  83266. * @param {?=} context
  83267. * @return {?}
  83268. */
  83269. function (visitor, context) {
  83270. if (context === void 0) { context = null; }
  83271. return visitor.visitQuote(this, context);
  83272. };
  83273. /**
  83274. * @return {?}
  83275. */
  83276. Quote.prototype.toString = /**
  83277. * @return {?}
  83278. */
  83279. function () { return 'Quote'; };
  83280. return Quote;
  83281. }(AST));
  83282. var EmptyExpr = /** @class */ (function (_super) {
  83283. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(EmptyExpr, _super);
  83284. function EmptyExpr() {
  83285. return _super !== null && _super.apply(this, arguments) || this;
  83286. }
  83287. /**
  83288. * @param {?} visitor
  83289. * @param {?=} context
  83290. * @return {?}
  83291. */
  83292. EmptyExpr.prototype.visit = /**
  83293. * @param {?} visitor
  83294. * @param {?=} context
  83295. * @return {?}
  83296. */
  83297. function (visitor, context) {
  83298. if (context === void 0) { context = null; }
  83299. // do nothing
  83300. };
  83301. return EmptyExpr;
  83302. }(AST));
  83303. var ImplicitReceiver = /** @class */ (function (_super) {
  83304. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(ImplicitReceiver, _super);
  83305. function ImplicitReceiver() {
  83306. return _super !== null && _super.apply(this, arguments) || this;
  83307. }
  83308. /**
  83309. * @param {?} visitor
  83310. * @param {?=} context
  83311. * @return {?}
  83312. */
  83313. ImplicitReceiver.prototype.visit = /**
  83314. * @param {?} visitor
  83315. * @param {?=} context
  83316. * @return {?}
  83317. */
  83318. function (visitor, context) {
  83319. if (context === void 0) { context = null; }
  83320. return visitor.visitImplicitReceiver(this, context);
  83321. };
  83322. return ImplicitReceiver;
  83323. }(AST));
  83324. /**
  83325. * Multiple expressions separated by a semicolon.
  83326. */
  83327. var Chain = /** @class */ (function (_super) {
  83328. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(Chain, _super);
  83329. function Chain(span, expressions) {
  83330. var _this = _super.call(this, span) || this;
  83331. _this.expressions = expressions;
  83332. return _this;
  83333. }
  83334. /**
  83335. * @param {?} visitor
  83336. * @param {?=} context
  83337. * @return {?}
  83338. */
  83339. Chain.prototype.visit = /**
  83340. * @param {?} visitor
  83341. * @param {?=} context
  83342. * @return {?}
  83343. */
  83344. function (visitor, context) {
  83345. if (context === void 0) { context = null; }
  83346. return visitor.visitChain(this, context);
  83347. };
  83348. return Chain;
  83349. }(AST));
  83350. var Conditional = /** @class */ (function (_super) {
  83351. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(Conditional, _super);
  83352. function Conditional(span, condition, trueExp, falseExp) {
  83353. var _this = _super.call(this, span) || this;
  83354. _this.condition = condition;
  83355. _this.trueExp = trueExp;
  83356. _this.falseExp = falseExp;
  83357. return _this;
  83358. }
  83359. /**
  83360. * @param {?} visitor
  83361. * @param {?=} context
  83362. * @return {?}
  83363. */
  83364. Conditional.prototype.visit = /**
  83365. * @param {?} visitor
  83366. * @param {?=} context
  83367. * @return {?}
  83368. */
  83369. function (visitor, context) {
  83370. if (context === void 0) { context = null; }
  83371. return visitor.visitConditional(this, context);
  83372. };
  83373. return Conditional;
  83374. }(AST));
  83375. var PropertyRead = /** @class */ (function (_super) {
  83376. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(PropertyRead, _super);
  83377. function PropertyRead(span, receiver, name) {
  83378. var _this = _super.call(this, span) || this;
  83379. _this.receiver = receiver;
  83380. _this.name = name;
  83381. return _this;
  83382. }
  83383. /**
  83384. * @param {?} visitor
  83385. * @param {?=} context
  83386. * @return {?}
  83387. */
  83388. PropertyRead.prototype.visit = /**
  83389. * @param {?} visitor
  83390. * @param {?=} context
  83391. * @return {?}
  83392. */
  83393. function (visitor, context) {
  83394. if (context === void 0) { context = null; }
  83395. return visitor.visitPropertyRead(this, context);
  83396. };
  83397. return PropertyRead;
  83398. }(AST));
  83399. var PropertyWrite = /** @class */ (function (_super) {
  83400. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(PropertyWrite, _super);
  83401. function PropertyWrite(span, receiver, name, value) {
  83402. var _this = _super.call(this, span) || this;
  83403. _this.receiver = receiver;
  83404. _this.name = name;
  83405. _this.value = value;
  83406. return _this;
  83407. }
  83408. /**
  83409. * @param {?} visitor
  83410. * @param {?=} context
  83411. * @return {?}
  83412. */
  83413. PropertyWrite.prototype.visit = /**
  83414. * @param {?} visitor
  83415. * @param {?=} context
  83416. * @return {?}
  83417. */
  83418. function (visitor, context) {
  83419. if (context === void 0) { context = null; }
  83420. return visitor.visitPropertyWrite(this, context);
  83421. };
  83422. return PropertyWrite;
  83423. }(AST));
  83424. var SafePropertyRead = /** @class */ (function (_super) {
  83425. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(SafePropertyRead, _super);
  83426. function SafePropertyRead(span, receiver, name) {
  83427. var _this = _super.call(this, span) || this;
  83428. _this.receiver = receiver;
  83429. _this.name = name;
  83430. return _this;
  83431. }
  83432. /**
  83433. * @param {?} visitor
  83434. * @param {?=} context
  83435. * @return {?}
  83436. */
  83437. SafePropertyRead.prototype.visit = /**
  83438. * @param {?} visitor
  83439. * @param {?=} context
  83440. * @return {?}
  83441. */
  83442. function (visitor, context) {
  83443. if (context === void 0) { context = null; }
  83444. return visitor.visitSafePropertyRead(this, context);
  83445. };
  83446. return SafePropertyRead;
  83447. }(AST));
  83448. var KeyedRead = /** @class */ (function (_super) {
  83449. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(KeyedRead, _super);
  83450. function KeyedRead(span, obj, key) {
  83451. var _this = _super.call(this, span) || this;
  83452. _this.obj = obj;
  83453. _this.key = key;
  83454. return _this;
  83455. }
  83456. /**
  83457. * @param {?} visitor
  83458. * @param {?=} context
  83459. * @return {?}
  83460. */
  83461. KeyedRead.prototype.visit = /**
  83462. * @param {?} visitor
  83463. * @param {?=} context
  83464. * @return {?}
  83465. */
  83466. function (visitor, context) {
  83467. if (context === void 0) { context = null; }
  83468. return visitor.visitKeyedRead(this, context);
  83469. };
  83470. return KeyedRead;
  83471. }(AST));
  83472. var KeyedWrite = /** @class */ (function (_super) {
  83473. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(KeyedWrite, _super);
  83474. function KeyedWrite(span, obj, key, value) {
  83475. var _this = _super.call(this, span) || this;
  83476. _this.obj = obj;
  83477. _this.key = key;
  83478. _this.value = value;
  83479. return _this;
  83480. }
  83481. /**
  83482. * @param {?} visitor
  83483. * @param {?=} context
  83484. * @return {?}
  83485. */
  83486. KeyedWrite.prototype.visit = /**
  83487. * @param {?} visitor
  83488. * @param {?=} context
  83489. * @return {?}
  83490. */
  83491. function (visitor, context) {
  83492. if (context === void 0) { context = null; }
  83493. return visitor.visitKeyedWrite(this, context);
  83494. };
  83495. return KeyedWrite;
  83496. }(AST));
  83497. var BindingPipe = /** @class */ (function (_super) {
  83498. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(BindingPipe, _super);
  83499. function BindingPipe(span, exp, name, args) {
  83500. var _this = _super.call(this, span) || this;
  83501. _this.exp = exp;
  83502. _this.name = name;
  83503. _this.args = args;
  83504. return _this;
  83505. }
  83506. /**
  83507. * @param {?} visitor
  83508. * @param {?=} context
  83509. * @return {?}
  83510. */
  83511. BindingPipe.prototype.visit = /**
  83512. * @param {?} visitor
  83513. * @param {?=} context
  83514. * @return {?}
  83515. */
  83516. function (visitor, context) {
  83517. if (context === void 0) { context = null; }
  83518. return visitor.visitPipe(this, context);
  83519. };
  83520. return BindingPipe;
  83521. }(AST));
  83522. var LiteralPrimitive = /** @class */ (function (_super) {
  83523. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(LiteralPrimitive, _super);
  83524. function LiteralPrimitive(span, value) {
  83525. var _this = _super.call(this, span) || this;
  83526. _this.value = value;
  83527. return _this;
  83528. }
  83529. /**
  83530. * @param {?} visitor
  83531. * @param {?=} context
  83532. * @return {?}
  83533. */
  83534. LiteralPrimitive.prototype.visit = /**
  83535. * @param {?} visitor
  83536. * @param {?=} context
  83537. * @return {?}
  83538. */
  83539. function (visitor, context) {
  83540. if (context === void 0) { context = null; }
  83541. return visitor.visitLiteralPrimitive(this, context);
  83542. };
  83543. return LiteralPrimitive;
  83544. }(AST));
  83545. var LiteralArray = /** @class */ (function (_super) {
  83546. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(LiteralArray, _super);
  83547. function LiteralArray(span, expressions) {
  83548. var _this = _super.call(this, span) || this;
  83549. _this.expressions = expressions;
  83550. return _this;
  83551. }
  83552. /**
  83553. * @param {?} visitor
  83554. * @param {?=} context
  83555. * @return {?}
  83556. */
  83557. LiteralArray.prototype.visit = /**
  83558. * @param {?} visitor
  83559. * @param {?=} context
  83560. * @return {?}
  83561. */
  83562. function (visitor, context) {
  83563. if (context === void 0) { context = null; }
  83564. return visitor.visitLiteralArray(this, context);
  83565. };
  83566. return LiteralArray;
  83567. }(AST));
  83568. var LiteralMap = /** @class */ (function (_super) {
  83569. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(LiteralMap, _super);
  83570. function LiteralMap(span, keys, values) {
  83571. var _this = _super.call(this, span) || this;
  83572. _this.keys = keys;
  83573. _this.values = values;
  83574. return _this;
  83575. }
  83576. /**
  83577. * @param {?} visitor
  83578. * @param {?=} context
  83579. * @return {?}
  83580. */
  83581. LiteralMap.prototype.visit = /**
  83582. * @param {?} visitor
  83583. * @param {?=} context
  83584. * @return {?}
  83585. */
  83586. function (visitor, context) {
  83587. if (context === void 0) { context = null; }
  83588. return visitor.visitLiteralMap(this, context);
  83589. };
  83590. return LiteralMap;
  83591. }(AST));
  83592. var Interpolation = /** @class */ (function (_super) {
  83593. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(Interpolation, _super);
  83594. function Interpolation(span, strings, expressions) {
  83595. var _this = _super.call(this, span) || this;
  83596. _this.strings = strings;
  83597. _this.expressions = expressions;
  83598. return _this;
  83599. }
  83600. /**
  83601. * @param {?} visitor
  83602. * @param {?=} context
  83603. * @return {?}
  83604. */
  83605. Interpolation.prototype.visit = /**
  83606. * @param {?} visitor
  83607. * @param {?=} context
  83608. * @return {?}
  83609. */
  83610. function (visitor, context) {
  83611. if (context === void 0) { context = null; }
  83612. return visitor.visitInterpolation(this, context);
  83613. };
  83614. return Interpolation;
  83615. }(AST));
  83616. var Binary = /** @class */ (function (_super) {
  83617. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(Binary, _super);
  83618. function Binary(span, operation, left, right) {
  83619. var _this = _super.call(this, span) || this;
  83620. _this.operation = operation;
  83621. _this.left = left;
  83622. _this.right = right;
  83623. return _this;
  83624. }
  83625. /**
  83626. * @param {?} visitor
  83627. * @param {?=} context
  83628. * @return {?}
  83629. */
  83630. Binary.prototype.visit = /**
  83631. * @param {?} visitor
  83632. * @param {?=} context
  83633. * @return {?}
  83634. */
  83635. function (visitor, context) {
  83636. if (context === void 0) { context = null; }
  83637. return visitor.visitBinary(this, context);
  83638. };
  83639. return Binary;
  83640. }(AST));
  83641. var PrefixNot = /** @class */ (function (_super) {
  83642. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(PrefixNot, _super);
  83643. function PrefixNot(span, expression) {
  83644. var _this = _super.call(this, span) || this;
  83645. _this.expression = expression;
  83646. return _this;
  83647. }
  83648. /**
  83649. * @param {?} visitor
  83650. * @param {?=} context
  83651. * @return {?}
  83652. */
  83653. PrefixNot.prototype.visit = /**
  83654. * @param {?} visitor
  83655. * @param {?=} context
  83656. * @return {?}
  83657. */
  83658. function (visitor, context) {
  83659. if (context === void 0) { context = null; }
  83660. return visitor.visitPrefixNot(this, context);
  83661. };
  83662. return PrefixNot;
  83663. }(AST));
  83664. var NonNullAssert = /** @class */ (function (_super) {
  83665. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(NonNullAssert, _super);
  83666. function NonNullAssert(span, expression) {
  83667. var _this = _super.call(this, span) || this;
  83668. _this.expression = expression;
  83669. return _this;
  83670. }
  83671. /**
  83672. * @param {?} visitor
  83673. * @param {?=} context
  83674. * @return {?}
  83675. */
  83676. NonNullAssert.prototype.visit = /**
  83677. * @param {?} visitor
  83678. * @param {?=} context
  83679. * @return {?}
  83680. */
  83681. function (visitor, context) {
  83682. if (context === void 0) { context = null; }
  83683. return visitor.visitNonNullAssert(this, context);
  83684. };
  83685. return NonNullAssert;
  83686. }(AST));
  83687. var MethodCall = /** @class */ (function (_super) {
  83688. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(MethodCall, _super);
  83689. function MethodCall(span, receiver, name, args) {
  83690. var _this = _super.call(this, span) || this;
  83691. _this.receiver = receiver;
  83692. _this.name = name;
  83693. _this.args = args;
  83694. return _this;
  83695. }
  83696. /**
  83697. * @param {?} visitor
  83698. * @param {?=} context
  83699. * @return {?}
  83700. */
  83701. MethodCall.prototype.visit = /**
  83702. * @param {?} visitor
  83703. * @param {?=} context
  83704. * @return {?}
  83705. */
  83706. function (visitor, context) {
  83707. if (context === void 0) { context = null; }
  83708. return visitor.visitMethodCall(this, context);
  83709. };
  83710. return MethodCall;
  83711. }(AST));
  83712. var SafeMethodCall = /** @class */ (function (_super) {
  83713. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(SafeMethodCall, _super);
  83714. function SafeMethodCall(span, receiver, name, args) {
  83715. var _this = _super.call(this, span) || this;
  83716. _this.receiver = receiver;
  83717. _this.name = name;
  83718. _this.args = args;
  83719. return _this;
  83720. }
  83721. /**
  83722. * @param {?} visitor
  83723. * @param {?=} context
  83724. * @return {?}
  83725. */
  83726. SafeMethodCall.prototype.visit = /**
  83727. * @param {?} visitor
  83728. * @param {?=} context
  83729. * @return {?}
  83730. */
  83731. function (visitor, context) {
  83732. if (context === void 0) { context = null; }
  83733. return visitor.visitSafeMethodCall(this, context);
  83734. };
  83735. return SafeMethodCall;
  83736. }(AST));
  83737. var FunctionCall = /** @class */ (function (_super) {
  83738. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(FunctionCall, _super);
  83739. function FunctionCall(span, target, args) {
  83740. var _this = _super.call(this, span) || this;
  83741. _this.target = target;
  83742. _this.args = args;
  83743. return _this;
  83744. }
  83745. /**
  83746. * @param {?} visitor
  83747. * @param {?=} context
  83748. * @return {?}
  83749. */
  83750. FunctionCall.prototype.visit = /**
  83751. * @param {?} visitor
  83752. * @param {?=} context
  83753. * @return {?}
  83754. */
  83755. function (visitor, context) {
  83756. if (context === void 0) { context = null; }
  83757. return visitor.visitFunctionCall(this, context);
  83758. };
  83759. return FunctionCall;
  83760. }(AST));
  83761. var ASTWithSource = /** @class */ (function (_super) {
  83762. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(ASTWithSource, _super);
  83763. function ASTWithSource(ast, source, location, errors) {
  83764. var _this = _super.call(this, new ParseSpan(0, source == null ? 0 : source.length)) || this;
  83765. _this.ast = ast;
  83766. _this.source = source;
  83767. _this.location = location;
  83768. _this.errors = errors;
  83769. return _this;
  83770. }
  83771. /**
  83772. * @param {?} visitor
  83773. * @param {?=} context
  83774. * @return {?}
  83775. */
  83776. ASTWithSource.prototype.visit = /**
  83777. * @param {?} visitor
  83778. * @param {?=} context
  83779. * @return {?}
  83780. */
  83781. function (visitor, context) {
  83782. if (context === void 0) { context = null; }
  83783. return this.ast.visit(visitor, context);
  83784. };
  83785. /**
  83786. * @return {?}
  83787. */
  83788. ASTWithSource.prototype.toString = /**
  83789. * @return {?}
  83790. */
  83791. function () { return this.source + " in " + this.location; };
  83792. return ASTWithSource;
  83793. }(AST));
  83794. var TemplateBinding = /** @class */ (function () {
  83795. function TemplateBinding(span, key, keyIsVar, name, expression) {
  83796. this.span = span;
  83797. this.key = key;
  83798. this.keyIsVar = keyIsVar;
  83799. this.name = name;
  83800. this.expression = expression;
  83801. }
  83802. return TemplateBinding;
  83803. }());
  83804. /**
  83805. * @record
  83806. */
  83807. var NullAstVisitor = /** @class */ (function () {
  83808. function NullAstVisitor() {
  83809. }
  83810. /**
  83811. * @param {?} ast
  83812. * @param {?} context
  83813. * @return {?}
  83814. */
  83815. NullAstVisitor.prototype.visitBinary = /**
  83816. * @param {?} ast
  83817. * @param {?} context
  83818. * @return {?}
  83819. */
  83820. function (ast, context) { };
  83821. /**
  83822. * @param {?} ast
  83823. * @param {?} context
  83824. * @return {?}
  83825. */
  83826. NullAstVisitor.prototype.visitChain = /**
  83827. * @param {?} ast
  83828. * @param {?} context
  83829. * @return {?}
  83830. */
  83831. function (ast, context) { };
  83832. /**
  83833. * @param {?} ast
  83834. * @param {?} context
  83835. * @return {?}
  83836. */
  83837. NullAstVisitor.prototype.visitConditional = /**
  83838. * @param {?} ast
  83839. * @param {?} context
  83840. * @return {?}
  83841. */
  83842. function (ast, context) { };
  83843. /**
  83844. * @param {?} ast
  83845. * @param {?} context
  83846. * @return {?}
  83847. */
  83848. NullAstVisitor.prototype.visitFunctionCall = /**
  83849. * @param {?} ast
  83850. * @param {?} context
  83851. * @return {?}
  83852. */
  83853. function (ast, context) { };
  83854. /**
  83855. * @param {?} ast
  83856. * @param {?} context
  83857. * @return {?}
  83858. */
  83859. NullAstVisitor.prototype.visitImplicitReceiver = /**
  83860. * @param {?} ast
  83861. * @param {?} context
  83862. * @return {?}
  83863. */
  83864. function (ast, context) { };
  83865. /**
  83866. * @param {?} ast
  83867. * @param {?} context
  83868. * @return {?}
  83869. */
  83870. NullAstVisitor.prototype.visitInterpolation = /**
  83871. * @param {?} ast
  83872. * @param {?} context
  83873. * @return {?}
  83874. */
  83875. function (ast, context) { };
  83876. /**
  83877. * @param {?} ast
  83878. * @param {?} context
  83879. * @return {?}
  83880. */
  83881. NullAstVisitor.prototype.visitKeyedRead = /**
  83882. * @param {?} ast
  83883. * @param {?} context
  83884. * @return {?}
  83885. */
  83886. function (ast, context) { };
  83887. /**
  83888. * @param {?} ast
  83889. * @param {?} context
  83890. * @return {?}
  83891. */
  83892. NullAstVisitor.prototype.visitKeyedWrite = /**
  83893. * @param {?} ast
  83894. * @param {?} context
  83895. * @return {?}
  83896. */
  83897. function (ast, context) { };
  83898. /**
  83899. * @param {?} ast
  83900. * @param {?} context
  83901. * @return {?}
  83902. */
  83903. NullAstVisitor.prototype.visitLiteralArray = /**
  83904. * @param {?} ast
  83905. * @param {?} context
  83906. * @return {?}
  83907. */
  83908. function (ast, context) { };
  83909. /**
  83910. * @param {?} ast
  83911. * @param {?} context
  83912. * @return {?}
  83913. */
  83914. NullAstVisitor.prototype.visitLiteralMap = /**
  83915. * @param {?} ast
  83916. * @param {?} context
  83917. * @return {?}
  83918. */
  83919. function (ast, context) { };
  83920. /**
  83921. * @param {?} ast
  83922. * @param {?} context
  83923. * @return {?}
  83924. */
  83925. NullAstVisitor.prototype.visitLiteralPrimitive = /**
  83926. * @param {?} ast
  83927. * @param {?} context
  83928. * @return {?}
  83929. */
  83930. function (ast, context) { };
  83931. /**
  83932. * @param {?} ast
  83933. * @param {?} context
  83934. * @return {?}
  83935. */
  83936. NullAstVisitor.prototype.visitMethodCall = /**
  83937. * @param {?} ast
  83938. * @param {?} context
  83939. * @return {?}
  83940. */
  83941. function (ast, context) { };
  83942. /**
  83943. * @param {?} ast
  83944. * @param {?} context
  83945. * @return {?}
  83946. */
  83947. NullAstVisitor.prototype.visitPipe = /**
  83948. * @param {?} ast
  83949. * @param {?} context
  83950. * @return {?}
  83951. */
  83952. function (ast, context) { };
  83953. /**
  83954. * @param {?} ast
  83955. * @param {?} context
  83956. * @return {?}
  83957. */
  83958. NullAstVisitor.prototype.visitPrefixNot = /**
  83959. * @param {?} ast
  83960. * @param {?} context
  83961. * @return {?}
  83962. */
  83963. function (ast, context) { };
  83964. /**
  83965. * @param {?} ast
  83966. * @param {?} context
  83967. * @return {?}
  83968. */
  83969. NullAstVisitor.prototype.visitNonNullAssert = /**
  83970. * @param {?} ast
  83971. * @param {?} context
  83972. * @return {?}
  83973. */
  83974. function (ast, context) { };
  83975. /**
  83976. * @param {?} ast
  83977. * @param {?} context
  83978. * @return {?}
  83979. */
  83980. NullAstVisitor.prototype.visitPropertyRead = /**
  83981. * @param {?} ast
  83982. * @param {?} context
  83983. * @return {?}
  83984. */
  83985. function (ast, context) { };
  83986. /**
  83987. * @param {?} ast
  83988. * @param {?} context
  83989. * @return {?}
  83990. */
  83991. NullAstVisitor.prototype.visitPropertyWrite = /**
  83992. * @param {?} ast
  83993. * @param {?} context
  83994. * @return {?}
  83995. */
  83996. function (ast, context) { };
  83997. /**
  83998. * @param {?} ast
  83999. * @param {?} context
  84000. * @return {?}
  84001. */
  84002. NullAstVisitor.prototype.visitQuote = /**
  84003. * @param {?} ast
  84004. * @param {?} context
  84005. * @return {?}
  84006. */
  84007. function (ast, context) { };
  84008. /**
  84009. * @param {?} ast
  84010. * @param {?} context
  84011. * @return {?}
  84012. */
  84013. NullAstVisitor.prototype.visitSafeMethodCall = /**
  84014. * @param {?} ast
  84015. * @param {?} context
  84016. * @return {?}
  84017. */
  84018. function (ast, context) { };
  84019. /**
  84020. * @param {?} ast
  84021. * @param {?} context
  84022. * @return {?}
  84023. */
  84024. NullAstVisitor.prototype.visitSafePropertyRead = /**
  84025. * @param {?} ast
  84026. * @param {?} context
  84027. * @return {?}
  84028. */
  84029. function (ast, context) { };
  84030. return NullAstVisitor;
  84031. }());
  84032. var RecursiveAstVisitor = /** @class */ (function () {
  84033. function RecursiveAstVisitor() {
  84034. }
  84035. /**
  84036. * @param {?} ast
  84037. * @param {?} context
  84038. * @return {?}
  84039. */
  84040. RecursiveAstVisitor.prototype.visitBinary = /**
  84041. * @param {?} ast
  84042. * @param {?} context
  84043. * @return {?}
  84044. */
  84045. function (ast, context) {
  84046. ast.left.visit(this);
  84047. ast.right.visit(this);
  84048. return null;
  84049. };
  84050. /**
  84051. * @param {?} ast
  84052. * @param {?} context
  84053. * @return {?}
  84054. */
  84055. RecursiveAstVisitor.prototype.visitChain = /**
  84056. * @param {?} ast
  84057. * @param {?} context
  84058. * @return {?}
  84059. */
  84060. function (ast, context) { return this.visitAll(ast.expressions, context); };
  84061. /**
  84062. * @param {?} ast
  84063. * @param {?} context
  84064. * @return {?}
  84065. */
  84066. RecursiveAstVisitor.prototype.visitConditional = /**
  84067. * @param {?} ast
  84068. * @param {?} context
  84069. * @return {?}
  84070. */
  84071. function (ast, context) {
  84072. ast.condition.visit(this);
  84073. ast.trueExp.visit(this);
  84074. ast.falseExp.visit(this);
  84075. return null;
  84076. };
  84077. /**
  84078. * @param {?} ast
  84079. * @param {?} context
  84080. * @return {?}
  84081. */
  84082. RecursiveAstVisitor.prototype.visitPipe = /**
  84083. * @param {?} ast
  84084. * @param {?} context
  84085. * @return {?}
  84086. */
  84087. function (ast, context) {
  84088. ast.exp.visit(this);
  84089. this.visitAll(ast.args, context);
  84090. return null;
  84091. };
  84092. /**
  84093. * @param {?} ast
  84094. * @param {?} context
  84095. * @return {?}
  84096. */
  84097. RecursiveAstVisitor.prototype.visitFunctionCall = /**
  84098. * @param {?} ast
  84099. * @param {?} context
  84100. * @return {?}
  84101. */
  84102. function (ast, context) {
  84103. /** @type {?} */ ((ast.target)).visit(this);
  84104. this.visitAll(ast.args, context);
  84105. return null;
  84106. };
  84107. /**
  84108. * @param {?} ast
  84109. * @param {?} context
  84110. * @return {?}
  84111. */
  84112. RecursiveAstVisitor.prototype.visitImplicitReceiver = /**
  84113. * @param {?} ast
  84114. * @param {?} context
  84115. * @return {?}
  84116. */
  84117. function (ast, context) { return null; };
  84118. /**
  84119. * @param {?} ast
  84120. * @param {?} context
  84121. * @return {?}
  84122. */
  84123. RecursiveAstVisitor.prototype.visitInterpolation = /**
  84124. * @param {?} ast
  84125. * @param {?} context
  84126. * @return {?}
  84127. */
  84128. function (ast, context) {
  84129. return this.visitAll(ast.expressions, context);
  84130. };
  84131. /**
  84132. * @param {?} ast
  84133. * @param {?} context
  84134. * @return {?}
  84135. */
  84136. RecursiveAstVisitor.prototype.visitKeyedRead = /**
  84137. * @param {?} ast
  84138. * @param {?} context
  84139. * @return {?}
  84140. */
  84141. function (ast, context) {
  84142. ast.obj.visit(this);
  84143. ast.key.visit(this);
  84144. return null;
  84145. };
  84146. /**
  84147. * @param {?} ast
  84148. * @param {?} context
  84149. * @return {?}
  84150. */
  84151. RecursiveAstVisitor.prototype.visitKeyedWrite = /**
  84152. * @param {?} ast
  84153. * @param {?} context
  84154. * @return {?}
  84155. */
  84156. function (ast, context) {
  84157. ast.obj.visit(this);
  84158. ast.key.visit(this);
  84159. ast.value.visit(this);
  84160. return null;
  84161. };
  84162. /**
  84163. * @param {?} ast
  84164. * @param {?} context
  84165. * @return {?}
  84166. */
  84167. RecursiveAstVisitor.prototype.visitLiteralArray = /**
  84168. * @param {?} ast
  84169. * @param {?} context
  84170. * @return {?}
  84171. */
  84172. function (ast, context) {
  84173. return this.visitAll(ast.expressions, context);
  84174. };
  84175. /**
  84176. * @param {?} ast
  84177. * @param {?} context
  84178. * @return {?}
  84179. */
  84180. RecursiveAstVisitor.prototype.visitLiteralMap = /**
  84181. * @param {?} ast
  84182. * @param {?} context
  84183. * @return {?}
  84184. */
  84185. function (ast, context) { return this.visitAll(ast.values, context); };
  84186. /**
  84187. * @param {?} ast
  84188. * @param {?} context
  84189. * @return {?}
  84190. */
  84191. RecursiveAstVisitor.prototype.visitLiteralPrimitive = /**
  84192. * @param {?} ast
  84193. * @param {?} context
  84194. * @return {?}
  84195. */
  84196. function (ast, context) { return null; };
  84197. /**
  84198. * @param {?} ast
  84199. * @param {?} context
  84200. * @return {?}
  84201. */
  84202. RecursiveAstVisitor.prototype.visitMethodCall = /**
  84203. * @param {?} ast
  84204. * @param {?} context
  84205. * @return {?}
  84206. */
  84207. function (ast, context) {
  84208. ast.receiver.visit(this);
  84209. return this.visitAll(ast.args, context);
  84210. };
  84211. /**
  84212. * @param {?} ast
  84213. * @param {?} context
  84214. * @return {?}
  84215. */
  84216. RecursiveAstVisitor.prototype.visitPrefixNot = /**
  84217. * @param {?} ast
  84218. * @param {?} context
  84219. * @return {?}
  84220. */
  84221. function (ast, context) {
  84222. ast.expression.visit(this);
  84223. return null;
  84224. };
  84225. /**
  84226. * @param {?} ast
  84227. * @param {?} context
  84228. * @return {?}
  84229. */
  84230. RecursiveAstVisitor.prototype.visitNonNullAssert = /**
  84231. * @param {?} ast
  84232. * @param {?} context
  84233. * @return {?}
  84234. */
  84235. function (ast, context) {
  84236. ast.expression.visit(this);
  84237. return null;
  84238. };
  84239. /**
  84240. * @param {?} ast
  84241. * @param {?} context
  84242. * @return {?}
  84243. */
  84244. RecursiveAstVisitor.prototype.visitPropertyRead = /**
  84245. * @param {?} ast
  84246. * @param {?} context
  84247. * @return {?}
  84248. */
  84249. function (ast, context) {
  84250. ast.receiver.visit(this);
  84251. return null;
  84252. };
  84253. /**
  84254. * @param {?} ast
  84255. * @param {?} context
  84256. * @return {?}
  84257. */
  84258. RecursiveAstVisitor.prototype.visitPropertyWrite = /**
  84259. * @param {?} ast
  84260. * @param {?} context
  84261. * @return {?}
  84262. */
  84263. function (ast, context) {
  84264. ast.receiver.visit(this);
  84265. ast.value.visit(this);
  84266. return null;
  84267. };
  84268. /**
  84269. * @param {?} ast
  84270. * @param {?} context
  84271. * @return {?}
  84272. */
  84273. RecursiveAstVisitor.prototype.visitSafePropertyRead = /**
  84274. * @param {?} ast
  84275. * @param {?} context
  84276. * @return {?}
  84277. */
  84278. function (ast, context) {
  84279. ast.receiver.visit(this);
  84280. return null;
  84281. };
  84282. /**
  84283. * @param {?} ast
  84284. * @param {?} context
  84285. * @return {?}
  84286. */
  84287. RecursiveAstVisitor.prototype.visitSafeMethodCall = /**
  84288. * @param {?} ast
  84289. * @param {?} context
  84290. * @return {?}
  84291. */
  84292. function (ast, context) {
  84293. ast.receiver.visit(this);
  84294. return this.visitAll(ast.args, context);
  84295. };
  84296. /**
  84297. * @param {?} asts
  84298. * @param {?} context
  84299. * @return {?}
  84300. */
  84301. RecursiveAstVisitor.prototype.visitAll = /**
  84302. * @param {?} asts
  84303. * @param {?} context
  84304. * @return {?}
  84305. */
  84306. function (asts, context) {
  84307. var _this = this;
  84308. asts.forEach(function (ast) { return ast.visit(_this, context); });
  84309. return null;
  84310. };
  84311. /**
  84312. * @param {?} ast
  84313. * @param {?} context
  84314. * @return {?}
  84315. */
  84316. RecursiveAstVisitor.prototype.visitQuote = /**
  84317. * @param {?} ast
  84318. * @param {?} context
  84319. * @return {?}
  84320. */
  84321. function (ast, context) { return null; };
  84322. return RecursiveAstVisitor;
  84323. }());
  84324. var AstTransformer = /** @class */ (function () {
  84325. function AstTransformer() {
  84326. }
  84327. /**
  84328. * @param {?} ast
  84329. * @param {?} context
  84330. * @return {?}
  84331. */
  84332. AstTransformer.prototype.visitImplicitReceiver = /**
  84333. * @param {?} ast
  84334. * @param {?} context
  84335. * @return {?}
  84336. */
  84337. function (ast, context) { return ast; };
  84338. /**
  84339. * @param {?} ast
  84340. * @param {?} context
  84341. * @return {?}
  84342. */
  84343. AstTransformer.prototype.visitInterpolation = /**
  84344. * @param {?} ast
  84345. * @param {?} context
  84346. * @return {?}
  84347. */
  84348. function (ast, context) {
  84349. return new Interpolation(ast.span, ast.strings, this.visitAll(ast.expressions));
  84350. };
  84351. /**
  84352. * @param {?} ast
  84353. * @param {?} context
  84354. * @return {?}
  84355. */
  84356. AstTransformer.prototype.visitLiteralPrimitive = /**
  84357. * @param {?} ast
  84358. * @param {?} context
  84359. * @return {?}
  84360. */
  84361. function (ast, context) {
  84362. return new LiteralPrimitive(ast.span, ast.value);
  84363. };
  84364. /**
  84365. * @param {?} ast
  84366. * @param {?} context
  84367. * @return {?}
  84368. */
  84369. AstTransformer.prototype.visitPropertyRead = /**
  84370. * @param {?} ast
  84371. * @param {?} context
  84372. * @return {?}
  84373. */
  84374. function (ast, context) {
  84375. return new PropertyRead(ast.span, ast.receiver.visit(this), ast.name);
  84376. };
  84377. /**
  84378. * @param {?} ast
  84379. * @param {?} context
  84380. * @return {?}
  84381. */
  84382. AstTransformer.prototype.visitPropertyWrite = /**
  84383. * @param {?} ast
  84384. * @param {?} context
  84385. * @return {?}
  84386. */
  84387. function (ast, context) {
  84388. return new PropertyWrite(ast.span, ast.receiver.visit(this), ast.name, ast.value.visit(this));
  84389. };
  84390. /**
  84391. * @param {?} ast
  84392. * @param {?} context
  84393. * @return {?}
  84394. */
  84395. AstTransformer.prototype.visitSafePropertyRead = /**
  84396. * @param {?} ast
  84397. * @param {?} context
  84398. * @return {?}
  84399. */
  84400. function (ast, context) {
  84401. return new SafePropertyRead(ast.span, ast.receiver.visit(this), ast.name);
  84402. };
  84403. /**
  84404. * @param {?} ast
  84405. * @param {?} context
  84406. * @return {?}
  84407. */
  84408. AstTransformer.prototype.visitMethodCall = /**
  84409. * @param {?} ast
  84410. * @param {?} context
  84411. * @return {?}
  84412. */
  84413. function (ast, context) {
  84414. return new MethodCall(ast.span, ast.receiver.visit(this), ast.name, this.visitAll(ast.args));
  84415. };
  84416. /**
  84417. * @param {?} ast
  84418. * @param {?} context
  84419. * @return {?}
  84420. */
  84421. AstTransformer.prototype.visitSafeMethodCall = /**
  84422. * @param {?} ast
  84423. * @param {?} context
  84424. * @return {?}
  84425. */
  84426. function (ast, context) {
  84427. return new SafeMethodCall(ast.span, ast.receiver.visit(this), ast.name, this.visitAll(ast.args));
  84428. };
  84429. /**
  84430. * @param {?} ast
  84431. * @param {?} context
  84432. * @return {?}
  84433. */
  84434. AstTransformer.prototype.visitFunctionCall = /**
  84435. * @param {?} ast
  84436. * @param {?} context
  84437. * @return {?}
  84438. */
  84439. function (ast, context) {
  84440. return new FunctionCall(ast.span, /** @type {?} */ ((ast.target)).visit(this), this.visitAll(ast.args));
  84441. };
  84442. /**
  84443. * @param {?} ast
  84444. * @param {?} context
  84445. * @return {?}
  84446. */
  84447. AstTransformer.prototype.visitLiteralArray = /**
  84448. * @param {?} ast
  84449. * @param {?} context
  84450. * @return {?}
  84451. */
  84452. function (ast, context) {
  84453. return new LiteralArray(ast.span, this.visitAll(ast.expressions));
  84454. };
  84455. /**
  84456. * @param {?} ast
  84457. * @param {?} context
  84458. * @return {?}
  84459. */
  84460. AstTransformer.prototype.visitLiteralMap = /**
  84461. * @param {?} ast
  84462. * @param {?} context
  84463. * @return {?}
  84464. */
  84465. function (ast, context) {
  84466. return new LiteralMap(ast.span, ast.keys, this.visitAll(ast.values));
  84467. };
  84468. /**
  84469. * @param {?} ast
  84470. * @param {?} context
  84471. * @return {?}
  84472. */
  84473. AstTransformer.prototype.visitBinary = /**
  84474. * @param {?} ast
  84475. * @param {?} context
  84476. * @return {?}
  84477. */
  84478. function (ast, context) {
  84479. return new Binary(ast.span, ast.operation, ast.left.visit(this), ast.right.visit(this));
  84480. };
  84481. /**
  84482. * @param {?} ast
  84483. * @param {?} context
  84484. * @return {?}
  84485. */
  84486. AstTransformer.prototype.visitPrefixNot = /**
  84487. * @param {?} ast
  84488. * @param {?} context
  84489. * @return {?}
  84490. */
  84491. function (ast, context) {
  84492. return new PrefixNot(ast.span, ast.expression.visit(this));
  84493. };
  84494. /**
  84495. * @param {?} ast
  84496. * @param {?} context
  84497. * @return {?}
  84498. */
  84499. AstTransformer.prototype.visitNonNullAssert = /**
  84500. * @param {?} ast
  84501. * @param {?} context
  84502. * @return {?}
  84503. */
  84504. function (ast, context) {
  84505. return new NonNullAssert(ast.span, ast.expression.visit(this));
  84506. };
  84507. /**
  84508. * @param {?} ast
  84509. * @param {?} context
  84510. * @return {?}
  84511. */
  84512. AstTransformer.prototype.visitConditional = /**
  84513. * @param {?} ast
  84514. * @param {?} context
  84515. * @return {?}
  84516. */
  84517. function (ast, context) {
  84518. return new Conditional(ast.span, ast.condition.visit(this), ast.trueExp.visit(this), ast.falseExp.visit(this));
  84519. };
  84520. /**
  84521. * @param {?} ast
  84522. * @param {?} context
  84523. * @return {?}
  84524. */
  84525. AstTransformer.prototype.visitPipe = /**
  84526. * @param {?} ast
  84527. * @param {?} context
  84528. * @return {?}
  84529. */
  84530. function (ast, context) {
  84531. return new BindingPipe(ast.span, ast.exp.visit(this), ast.name, this.visitAll(ast.args));
  84532. };
  84533. /**
  84534. * @param {?} ast
  84535. * @param {?} context
  84536. * @return {?}
  84537. */
  84538. AstTransformer.prototype.visitKeyedRead = /**
  84539. * @param {?} ast
  84540. * @param {?} context
  84541. * @return {?}
  84542. */
  84543. function (ast, context) {
  84544. return new KeyedRead(ast.span, ast.obj.visit(this), ast.key.visit(this));
  84545. };
  84546. /**
  84547. * @param {?} ast
  84548. * @param {?} context
  84549. * @return {?}
  84550. */
  84551. AstTransformer.prototype.visitKeyedWrite = /**
  84552. * @param {?} ast
  84553. * @param {?} context
  84554. * @return {?}
  84555. */
  84556. function (ast, context) {
  84557. return new KeyedWrite(ast.span, ast.obj.visit(this), ast.key.visit(this), ast.value.visit(this));
  84558. };
  84559. /**
  84560. * @param {?} asts
  84561. * @return {?}
  84562. */
  84563. AstTransformer.prototype.visitAll = /**
  84564. * @param {?} asts
  84565. * @return {?}
  84566. */
  84567. function (asts) {
  84568. var /** @type {?} */ res = new Array(asts.length);
  84569. for (var /** @type {?} */ i = 0; i < asts.length; ++i) {
  84570. res[i] = asts[i].visit(this);
  84571. }
  84572. return res;
  84573. };
  84574. /**
  84575. * @param {?} ast
  84576. * @param {?} context
  84577. * @return {?}
  84578. */
  84579. AstTransformer.prototype.visitChain = /**
  84580. * @param {?} ast
  84581. * @param {?} context
  84582. * @return {?}
  84583. */
  84584. function (ast, context) {
  84585. return new Chain(ast.span, this.visitAll(ast.expressions));
  84586. };
  84587. /**
  84588. * @param {?} ast
  84589. * @param {?} context
  84590. * @return {?}
  84591. */
  84592. AstTransformer.prototype.visitQuote = /**
  84593. * @param {?} ast
  84594. * @param {?} context
  84595. * @return {?}
  84596. */
  84597. function (ast, context) {
  84598. return new Quote(ast.span, ast.prefix, ast.uninterpretedExpression, ast.location);
  84599. };
  84600. return AstTransformer;
  84601. }());
  84602. /**
  84603. * @param {?} ast
  84604. * @param {?} visitor
  84605. * @param {?=} context
  84606. * @return {?}
  84607. */
  84608. function visitAstChildren(ast, visitor, context) {
  84609. /**
  84610. * @param {?} ast
  84611. * @return {?}
  84612. */
  84613. function visit(ast) {
  84614. visitor.visit && visitor.visit(ast, context) || ast.visit(visitor, context);
  84615. }
  84616. /**
  84617. * @template T
  84618. * @param {?} asts
  84619. * @return {?}
  84620. */
  84621. function visitAll(asts) { asts.forEach(visit); }
  84622. ast.visit({
  84623. visitBinary: /**
  84624. * @param {?} ast
  84625. * @return {?}
  84626. */
  84627. function (ast) {
  84628. visit(ast.left);
  84629. visit(ast.right);
  84630. },
  84631. visitChain: /**
  84632. * @param {?} ast
  84633. * @return {?}
  84634. */
  84635. function (ast) { visitAll(ast.expressions); },
  84636. visitConditional: /**
  84637. * @param {?} ast
  84638. * @return {?}
  84639. */
  84640. function (ast) {
  84641. visit(ast.condition);
  84642. visit(ast.trueExp);
  84643. visit(ast.falseExp);
  84644. },
  84645. visitFunctionCall: /**
  84646. * @param {?} ast
  84647. * @return {?}
  84648. */
  84649. function (ast) {
  84650. if (ast.target) {
  84651. visit(ast.target);
  84652. }
  84653. visitAll(ast.args);
  84654. },
  84655. visitImplicitReceiver: /**
  84656. * @param {?} ast
  84657. * @return {?}
  84658. */
  84659. function (ast) { },
  84660. visitInterpolation: /**
  84661. * @param {?} ast
  84662. * @return {?}
  84663. */
  84664. function (ast) { visitAll(ast.expressions); },
  84665. visitKeyedRead: /**
  84666. * @param {?} ast
  84667. * @return {?}
  84668. */
  84669. function (ast) {
  84670. visit(ast.obj);
  84671. visit(ast.key);
  84672. },
  84673. visitKeyedWrite: /**
  84674. * @param {?} ast
  84675. * @return {?}
  84676. */
  84677. function (ast) {
  84678. visit(ast.obj);
  84679. visit(ast.key);
  84680. visit(ast.obj);
  84681. },
  84682. visitLiteralArray: /**
  84683. * @param {?} ast
  84684. * @return {?}
  84685. */
  84686. function (ast) { visitAll(ast.expressions); },
  84687. visitLiteralMap: /**
  84688. * @param {?} ast
  84689. * @return {?}
  84690. */
  84691. function (ast) { },
  84692. visitLiteralPrimitive: /**
  84693. * @param {?} ast
  84694. * @return {?}
  84695. */
  84696. function (ast) { },
  84697. visitMethodCall: /**
  84698. * @param {?} ast
  84699. * @return {?}
  84700. */
  84701. function (ast) {
  84702. visit(ast.receiver);
  84703. visitAll(ast.args);
  84704. },
  84705. visitPipe: /**
  84706. * @param {?} ast
  84707. * @return {?}
  84708. */
  84709. function (ast) {
  84710. visit(ast.exp);
  84711. visitAll(ast.args);
  84712. },
  84713. visitPrefixNot: /**
  84714. * @param {?} ast
  84715. * @return {?}
  84716. */
  84717. function (ast) { visit(ast.expression); },
  84718. visitNonNullAssert: /**
  84719. * @param {?} ast
  84720. * @return {?}
  84721. */
  84722. function (ast) { visit(ast.expression); },
  84723. visitPropertyRead: /**
  84724. * @param {?} ast
  84725. * @return {?}
  84726. */
  84727. function (ast) { visit(ast.receiver); },
  84728. visitPropertyWrite: /**
  84729. * @param {?} ast
  84730. * @return {?}
  84731. */
  84732. function (ast) {
  84733. visit(ast.receiver);
  84734. visit(ast.value);
  84735. },
  84736. visitQuote: /**
  84737. * @param {?} ast
  84738. * @return {?}
  84739. */
  84740. function (ast) { },
  84741. visitSafeMethodCall: /**
  84742. * @param {?} ast
  84743. * @return {?}
  84744. */
  84745. function (ast) {
  84746. visit(ast.receiver);
  84747. visitAll(ast.args);
  84748. },
  84749. visitSafePropertyRead: /**
  84750. * @param {?} ast
  84751. * @return {?}
  84752. */
  84753. function (ast) { visit(ast.receiver); },
  84754. });
  84755. }
  84756. /**
  84757. * @fileoverview added by tsickle
  84758. * @suppress {checkTypes} checked by tsc
  84759. */
  84760. /**
  84761. * @license
  84762. * Copyright Google Inc. All Rights Reserved.
  84763. *
  84764. * Use of this source code is governed by an MIT-style license that can be
  84765. * found in the LICENSE file at https://angular.io/license
  84766. */
  84767. var SplitInterpolation = /** @class */ (function () {
  84768. function SplitInterpolation(strings, expressions, offsets) {
  84769. this.strings = strings;
  84770. this.expressions = expressions;
  84771. this.offsets = offsets;
  84772. }
  84773. return SplitInterpolation;
  84774. }());
  84775. var TemplateBindingParseResult = /** @class */ (function () {
  84776. function TemplateBindingParseResult(templateBindings, warnings, errors) {
  84777. this.templateBindings = templateBindings;
  84778. this.warnings = warnings;
  84779. this.errors = errors;
  84780. }
  84781. return TemplateBindingParseResult;
  84782. }());
  84783. /**
  84784. * @param {?} config
  84785. * @return {?}
  84786. */
  84787. function _createInterpolateRegExp(config) {
  84788. var /** @type {?} */ pattern = escapeRegExp(config.start) + '([\\s\\S]*?)' + escapeRegExp(config.end);
  84789. return new RegExp(pattern, 'g');
  84790. }
  84791. var Parser = /** @class */ (function () {
  84792. function Parser(_lexer) {
  84793. this._lexer = _lexer;
  84794. this.errors = [];
  84795. }
  84796. /**
  84797. * @param {?} input
  84798. * @param {?} location
  84799. * @param {?=} interpolationConfig
  84800. * @return {?}
  84801. */
  84802. Parser.prototype.parseAction = /**
  84803. * @param {?} input
  84804. * @param {?} location
  84805. * @param {?=} interpolationConfig
  84806. * @return {?}
  84807. */
  84808. function (input, location, interpolationConfig) {
  84809. if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }
  84810. this._checkNoInterpolation(input, location, interpolationConfig);
  84811. var /** @type {?} */ sourceToLex = this._stripComments(input);
  84812. var /** @type {?} */ tokens = this._lexer.tokenize(this._stripComments(input));
  84813. var /** @type {?} */ ast = new _ParseAST(input, location, tokens, sourceToLex.length, true, this.errors, input.length - sourceToLex.length)
  84814. .parseChain();
  84815. return new ASTWithSource(ast, input, location, this.errors);
  84816. };
  84817. /**
  84818. * @param {?} input
  84819. * @param {?} location
  84820. * @param {?=} interpolationConfig
  84821. * @return {?}
  84822. */
  84823. Parser.prototype.parseBinding = /**
  84824. * @param {?} input
  84825. * @param {?} location
  84826. * @param {?=} interpolationConfig
  84827. * @return {?}
  84828. */
  84829. function (input, location, interpolationConfig) {
  84830. if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }
  84831. var /** @type {?} */ ast = this._parseBindingAst(input, location, interpolationConfig);
  84832. return new ASTWithSource(ast, input, location, this.errors);
  84833. };
  84834. /**
  84835. * @param {?} input
  84836. * @param {?} location
  84837. * @param {?=} interpolationConfig
  84838. * @return {?}
  84839. */
  84840. Parser.prototype.parseSimpleBinding = /**
  84841. * @param {?} input
  84842. * @param {?} location
  84843. * @param {?=} interpolationConfig
  84844. * @return {?}
  84845. */
  84846. function (input, location, interpolationConfig) {
  84847. if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }
  84848. var /** @type {?} */ ast = this._parseBindingAst(input, location, interpolationConfig);
  84849. var /** @type {?} */ errors = SimpleExpressionChecker.check(ast);
  84850. if (errors.length > 0) {
  84851. this._reportError("Host binding expression cannot contain " + errors.join(' '), input, location);
  84852. }
  84853. return new ASTWithSource(ast, input, location, this.errors);
  84854. };
  84855. /**
  84856. * @param {?} message
  84857. * @param {?} input
  84858. * @param {?} errLocation
  84859. * @param {?=} ctxLocation
  84860. * @return {?}
  84861. */
  84862. Parser.prototype._reportError = /**
  84863. * @param {?} message
  84864. * @param {?} input
  84865. * @param {?} errLocation
  84866. * @param {?=} ctxLocation
  84867. * @return {?}
  84868. */
  84869. function (message, input, errLocation, ctxLocation) {
  84870. this.errors.push(new ParserError(message, input, errLocation, ctxLocation));
  84871. };
  84872. /**
  84873. * @param {?} input
  84874. * @param {?} location
  84875. * @param {?} interpolationConfig
  84876. * @return {?}
  84877. */
  84878. Parser.prototype._parseBindingAst = /**
  84879. * @param {?} input
  84880. * @param {?} location
  84881. * @param {?} interpolationConfig
  84882. * @return {?}
  84883. */
  84884. function (input, location, interpolationConfig) {
  84885. // Quotes expressions use 3rd-party expression language. We don't want to use
  84886. // our lexer or parser for that, so we check for that ahead of time.
  84887. var /** @type {?} */ quote = this._parseQuote(input, location);
  84888. if (quote != null) {
  84889. return quote;
  84890. }
  84891. this._checkNoInterpolation(input, location, interpolationConfig);
  84892. var /** @type {?} */ sourceToLex = this._stripComments(input);
  84893. var /** @type {?} */ tokens = this._lexer.tokenize(sourceToLex);
  84894. return new _ParseAST(input, location, tokens, sourceToLex.length, false, this.errors, input.length - sourceToLex.length)
  84895. .parseChain();
  84896. };
  84897. /**
  84898. * @param {?} input
  84899. * @param {?} location
  84900. * @return {?}
  84901. */
  84902. Parser.prototype._parseQuote = /**
  84903. * @param {?} input
  84904. * @param {?} location
  84905. * @return {?}
  84906. */
  84907. function (input, location) {
  84908. if (input == null)
  84909. return null;
  84910. var /** @type {?} */ prefixSeparatorIndex = input.indexOf(':');
  84911. if (prefixSeparatorIndex == -1)
  84912. return null;
  84913. var /** @type {?} */ prefix = input.substring(0, prefixSeparatorIndex).trim();
  84914. if (!isIdentifier(prefix))
  84915. return null;
  84916. var /** @type {?} */ uninterpretedExpression = input.substring(prefixSeparatorIndex + 1);
  84917. return new Quote(new ParseSpan(0, input.length), prefix, uninterpretedExpression, location);
  84918. };
  84919. /**
  84920. * @param {?} prefixToken
  84921. * @param {?} input
  84922. * @param {?} location
  84923. * @return {?}
  84924. */
  84925. Parser.prototype.parseTemplateBindings = /**
  84926. * @param {?} prefixToken
  84927. * @param {?} input
  84928. * @param {?} location
  84929. * @return {?}
  84930. */
  84931. function (prefixToken, input, location) {
  84932. var /** @type {?} */ tokens = this._lexer.tokenize(input);
  84933. if (prefixToken) {
  84934. // Prefix the tokens with the tokens from prefixToken but have them take no space (0 index).
  84935. var /** @type {?} */ prefixTokens = this._lexer.tokenize(prefixToken).map(function (t) {
  84936. t.index = 0;
  84937. return t;
  84938. });
  84939. tokens.unshift.apply(tokens, prefixTokens);
  84940. }
  84941. return new _ParseAST(input, location, tokens, input.length, false, this.errors, 0)
  84942. .parseTemplateBindings();
  84943. };
  84944. /**
  84945. * @param {?} input
  84946. * @param {?} location
  84947. * @param {?=} interpolationConfig
  84948. * @return {?}
  84949. */
  84950. Parser.prototype.parseInterpolation = /**
  84951. * @param {?} input
  84952. * @param {?} location
  84953. * @param {?=} interpolationConfig
  84954. * @return {?}
  84955. */
  84956. function (input, location, interpolationConfig) {
  84957. if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }
  84958. var /** @type {?} */ split = this.splitInterpolation(input, location, interpolationConfig);
  84959. if (split == null)
  84960. return null;
  84961. var /** @type {?} */ expressions = [];
  84962. for (var /** @type {?} */ i = 0; i < split.expressions.length; ++i) {
  84963. var /** @type {?} */ expressionText = split.expressions[i];
  84964. var /** @type {?} */ sourceToLex = this._stripComments(expressionText);
  84965. var /** @type {?} */ tokens = this._lexer.tokenize(sourceToLex);
  84966. var /** @type {?} */ ast = new _ParseAST(input, location, tokens, sourceToLex.length, false, this.errors, split.offsets[i] + (expressionText.length - sourceToLex.length))
  84967. .parseChain();
  84968. expressions.push(ast);
  84969. }
  84970. return new ASTWithSource(new Interpolation(new ParseSpan(0, input == null ? 0 : input.length), split.strings, expressions), input, location, this.errors);
  84971. };
  84972. /**
  84973. * @param {?} input
  84974. * @param {?} location
  84975. * @param {?=} interpolationConfig
  84976. * @return {?}
  84977. */
  84978. Parser.prototype.splitInterpolation = /**
  84979. * @param {?} input
  84980. * @param {?} location
  84981. * @param {?=} interpolationConfig
  84982. * @return {?}
  84983. */
  84984. function (input, location, interpolationConfig) {
  84985. if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }
  84986. var /** @type {?} */ regexp = _createInterpolateRegExp(interpolationConfig);
  84987. var /** @type {?} */ parts = input.split(regexp);
  84988. if (parts.length <= 1) {
  84989. return null;
  84990. }
  84991. var /** @type {?} */ strings = [];
  84992. var /** @type {?} */ expressions = [];
  84993. var /** @type {?} */ offsets = [];
  84994. var /** @type {?} */ offset = 0;
  84995. for (var /** @type {?} */ i = 0; i < parts.length; i++) {
  84996. var /** @type {?} */ part = parts[i];
  84997. if (i % 2 === 0) {
  84998. // fixed string
  84999. strings.push(part);
  85000. offset += part.length;
  85001. }
  85002. else if (part.trim().length > 0) {
  85003. offset += interpolationConfig.start.length;
  85004. expressions.push(part);
  85005. offsets.push(offset);
  85006. offset += part.length + interpolationConfig.end.length;
  85007. }
  85008. else {
  85009. this._reportError('Blank expressions are not allowed in interpolated strings', input, "at column " + this._findInterpolationErrorColumn(parts, i, interpolationConfig) + " in", location);
  85010. expressions.push('$implict');
  85011. offsets.push(offset);
  85012. }
  85013. }
  85014. return new SplitInterpolation(strings, expressions, offsets);
  85015. };
  85016. /**
  85017. * @param {?} input
  85018. * @param {?} location
  85019. * @return {?}
  85020. */
  85021. Parser.prototype.wrapLiteralPrimitive = /**
  85022. * @param {?} input
  85023. * @param {?} location
  85024. * @return {?}
  85025. */
  85026. function (input, location) {
  85027. return new ASTWithSource(new LiteralPrimitive(new ParseSpan(0, input == null ? 0 : input.length), input), input, location, this.errors);
  85028. };
  85029. /**
  85030. * @param {?} input
  85031. * @return {?}
  85032. */
  85033. Parser.prototype._stripComments = /**
  85034. * @param {?} input
  85035. * @return {?}
  85036. */
  85037. function (input) {
  85038. var /** @type {?} */ i = this._commentStart(input);
  85039. return i != null ? input.substring(0, i).trim() : input;
  85040. };
  85041. /**
  85042. * @param {?} input
  85043. * @return {?}
  85044. */
  85045. Parser.prototype._commentStart = /**
  85046. * @param {?} input
  85047. * @return {?}
  85048. */
  85049. function (input) {
  85050. var /** @type {?} */ outerQuote = null;
  85051. for (var /** @type {?} */ i = 0; i < input.length - 1; i++) {
  85052. var /** @type {?} */ char = input.charCodeAt(i);
  85053. var /** @type {?} */ nextChar = input.charCodeAt(i + 1);
  85054. if (char === $SLASH && nextChar == $SLASH && outerQuote == null)
  85055. return i;
  85056. if (outerQuote === char) {
  85057. outerQuote = null;
  85058. }
  85059. else if (outerQuote == null && isQuote(char)) {
  85060. outerQuote = char;
  85061. }
  85062. }
  85063. return null;
  85064. };
  85065. /**
  85066. * @param {?} input
  85067. * @param {?} location
  85068. * @param {?} interpolationConfig
  85069. * @return {?}
  85070. */
  85071. Parser.prototype._checkNoInterpolation = /**
  85072. * @param {?} input
  85073. * @param {?} location
  85074. * @param {?} interpolationConfig
  85075. * @return {?}
  85076. */
  85077. function (input, location, interpolationConfig) {
  85078. var /** @type {?} */ regexp = _createInterpolateRegExp(interpolationConfig);
  85079. var /** @type {?} */ parts = input.split(regexp);
  85080. if (parts.length > 1) {
  85081. this._reportError("Got interpolation (" + interpolationConfig.start + interpolationConfig.end + ") where expression was expected", input, "at column " + this._findInterpolationErrorColumn(parts, 1, interpolationConfig) + " in", location);
  85082. }
  85083. };
  85084. /**
  85085. * @param {?} parts
  85086. * @param {?} partInErrIdx
  85087. * @param {?} interpolationConfig
  85088. * @return {?}
  85089. */
  85090. Parser.prototype._findInterpolationErrorColumn = /**
  85091. * @param {?} parts
  85092. * @param {?} partInErrIdx
  85093. * @param {?} interpolationConfig
  85094. * @return {?}
  85095. */
  85096. function (parts, partInErrIdx, interpolationConfig) {
  85097. var /** @type {?} */ errLocation = '';
  85098. for (var /** @type {?} */ j = 0; j < partInErrIdx; j++) {
  85099. errLocation += j % 2 === 0 ?
  85100. parts[j] :
  85101. "" + interpolationConfig.start + parts[j] + interpolationConfig.end;
  85102. }
  85103. return errLocation.length;
  85104. };
  85105. return Parser;
  85106. }());
  85107. var _ParseAST = /** @class */ (function () {
  85108. function _ParseAST(input, location, tokens, inputLength, parseAction, errors, offset) {
  85109. this.input = input;
  85110. this.location = location;
  85111. this.tokens = tokens;
  85112. this.inputLength = inputLength;
  85113. this.parseAction = parseAction;
  85114. this.errors = errors;
  85115. this.offset = offset;
  85116. this.rparensExpected = 0;
  85117. this.rbracketsExpected = 0;
  85118. this.rbracesExpected = 0;
  85119. this.index = 0;
  85120. }
  85121. /**
  85122. * @param {?} offset
  85123. * @return {?}
  85124. */
  85125. _ParseAST.prototype.peek = /**
  85126. * @param {?} offset
  85127. * @return {?}
  85128. */
  85129. function (offset) {
  85130. var /** @type {?} */ i = this.index + offset;
  85131. return i < this.tokens.length ? this.tokens[i] : EOF;
  85132. };
  85133. Object.defineProperty(_ParseAST.prototype, "next", {
  85134. get: /**
  85135. * @return {?}
  85136. */
  85137. function () { return this.peek(0); },
  85138. enumerable: true,
  85139. configurable: true
  85140. });
  85141. Object.defineProperty(_ParseAST.prototype, "inputIndex", {
  85142. get: /**
  85143. * @return {?}
  85144. */
  85145. function () {
  85146. return (this.index < this.tokens.length) ? this.next.index + this.offset :
  85147. this.inputLength + this.offset;
  85148. },
  85149. enumerable: true,
  85150. configurable: true
  85151. });
  85152. /**
  85153. * @param {?} start
  85154. * @return {?}
  85155. */
  85156. _ParseAST.prototype.span = /**
  85157. * @param {?} start
  85158. * @return {?}
  85159. */
  85160. function (start) { return new ParseSpan(start, this.inputIndex); };
  85161. /**
  85162. * @return {?}
  85163. */
  85164. _ParseAST.prototype.advance = /**
  85165. * @return {?}
  85166. */
  85167. function () { this.index++; };
  85168. /**
  85169. * @param {?} code
  85170. * @return {?}
  85171. */
  85172. _ParseAST.prototype.optionalCharacter = /**
  85173. * @param {?} code
  85174. * @return {?}
  85175. */
  85176. function (code) {
  85177. if (this.next.isCharacter(code)) {
  85178. this.advance();
  85179. return true;
  85180. }
  85181. else {
  85182. return false;
  85183. }
  85184. };
  85185. /**
  85186. * @return {?}
  85187. */
  85188. _ParseAST.prototype.peekKeywordLet = /**
  85189. * @return {?}
  85190. */
  85191. function () { return this.next.isKeywordLet(); };
  85192. /**
  85193. * @return {?}
  85194. */
  85195. _ParseAST.prototype.peekKeywordAs = /**
  85196. * @return {?}
  85197. */
  85198. function () { return this.next.isKeywordAs(); };
  85199. /**
  85200. * @param {?} code
  85201. * @return {?}
  85202. */
  85203. _ParseAST.prototype.expectCharacter = /**
  85204. * @param {?} code
  85205. * @return {?}
  85206. */
  85207. function (code) {
  85208. if (this.optionalCharacter(code))
  85209. return;
  85210. this.error("Missing expected " + String.fromCharCode(code));
  85211. };
  85212. /**
  85213. * @param {?} op
  85214. * @return {?}
  85215. */
  85216. _ParseAST.prototype.optionalOperator = /**
  85217. * @param {?} op
  85218. * @return {?}
  85219. */
  85220. function (op) {
  85221. if (this.next.isOperator(op)) {
  85222. this.advance();
  85223. return true;
  85224. }
  85225. else {
  85226. return false;
  85227. }
  85228. };
  85229. /**
  85230. * @param {?} operator
  85231. * @return {?}
  85232. */
  85233. _ParseAST.prototype.expectOperator = /**
  85234. * @param {?} operator
  85235. * @return {?}
  85236. */
  85237. function (operator) {
  85238. if (this.optionalOperator(operator))
  85239. return;
  85240. this.error("Missing expected operator " + operator);
  85241. };
  85242. /**
  85243. * @return {?}
  85244. */
  85245. _ParseAST.prototype.expectIdentifierOrKeyword = /**
  85246. * @return {?}
  85247. */
  85248. function () {
  85249. var /** @type {?} */ n = this.next;
  85250. if (!n.isIdentifier() && !n.isKeyword()) {
  85251. this.error("Unexpected token " + n + ", expected identifier or keyword");
  85252. return '';
  85253. }
  85254. this.advance();
  85255. return /** @type {?} */ (n.toString());
  85256. };
  85257. /**
  85258. * @return {?}
  85259. */
  85260. _ParseAST.prototype.expectIdentifierOrKeywordOrString = /**
  85261. * @return {?}
  85262. */
  85263. function () {
  85264. var /** @type {?} */ n = this.next;
  85265. if (!n.isIdentifier() && !n.isKeyword() && !n.isString()) {
  85266. this.error("Unexpected token " + n + ", expected identifier, keyword, or string");
  85267. return '';
  85268. }
  85269. this.advance();
  85270. return /** @type {?} */ (n.toString());
  85271. };
  85272. /**
  85273. * @return {?}
  85274. */
  85275. _ParseAST.prototype.parseChain = /**
  85276. * @return {?}
  85277. */
  85278. function () {
  85279. var /** @type {?} */ exprs = [];
  85280. var /** @type {?} */ start = this.inputIndex;
  85281. while (this.index < this.tokens.length) {
  85282. var /** @type {?} */ expr = this.parsePipe();
  85283. exprs.push(expr);
  85284. if (this.optionalCharacter($SEMICOLON)) {
  85285. if (!this.parseAction) {
  85286. this.error('Binding expression cannot contain chained expression');
  85287. }
  85288. while (this.optionalCharacter($SEMICOLON)) {
  85289. } // read all semicolons
  85290. }
  85291. else if (this.index < this.tokens.length) {
  85292. this.error("Unexpected token '" + this.next + "'");
  85293. }
  85294. }
  85295. if (exprs.length == 0)
  85296. return new EmptyExpr(this.span(start));
  85297. if (exprs.length == 1)
  85298. return exprs[0];
  85299. return new Chain(this.span(start), exprs);
  85300. };
  85301. /**
  85302. * @return {?}
  85303. */
  85304. _ParseAST.prototype.parsePipe = /**
  85305. * @return {?}
  85306. */
  85307. function () {
  85308. var /** @type {?} */ result = this.parseExpression();
  85309. if (this.optionalOperator('|')) {
  85310. if (this.parseAction) {
  85311. this.error('Cannot have a pipe in an action expression');
  85312. }
  85313. do {
  85314. var /** @type {?} */ name_1 = this.expectIdentifierOrKeyword();
  85315. var /** @type {?} */ args = [];
  85316. while (this.optionalCharacter($COLON)) {
  85317. args.push(this.parseExpression());
  85318. }
  85319. result = new BindingPipe(this.span(result.span.start), result, name_1, args);
  85320. } while (this.optionalOperator('|'));
  85321. }
  85322. return result;
  85323. };
  85324. /**
  85325. * @return {?}
  85326. */
  85327. _ParseAST.prototype.parseExpression = /**
  85328. * @return {?}
  85329. */
  85330. function () { return this.parseConditional(); };
  85331. /**
  85332. * @return {?}
  85333. */
  85334. _ParseAST.prototype.parseConditional = /**
  85335. * @return {?}
  85336. */
  85337. function () {
  85338. var /** @type {?} */ start = this.inputIndex;
  85339. var /** @type {?} */ result = this.parseLogicalOr();
  85340. if (this.optionalOperator('?')) {
  85341. var /** @type {?} */ yes = this.parsePipe();
  85342. var /** @type {?} */ no = void 0;
  85343. if (!this.optionalCharacter($COLON)) {
  85344. var /** @type {?} */ end = this.inputIndex;
  85345. var /** @type {?} */ expression = this.input.substring(start, end);
  85346. this.error("Conditional expression " + expression + " requires all 3 expressions");
  85347. no = new EmptyExpr(this.span(start));
  85348. }
  85349. else {
  85350. no = this.parsePipe();
  85351. }
  85352. return new Conditional(this.span(start), result, yes, no);
  85353. }
  85354. else {
  85355. return result;
  85356. }
  85357. };
  85358. /**
  85359. * @return {?}
  85360. */
  85361. _ParseAST.prototype.parseLogicalOr = /**
  85362. * @return {?}
  85363. */
  85364. function () {
  85365. // '||'
  85366. var /** @type {?} */ result = this.parseLogicalAnd();
  85367. while (this.optionalOperator('||')) {
  85368. var /** @type {?} */ right = this.parseLogicalAnd();
  85369. result = new Binary(this.span(result.span.start), '||', result, right);
  85370. }
  85371. return result;
  85372. };
  85373. /**
  85374. * @return {?}
  85375. */
  85376. _ParseAST.prototype.parseLogicalAnd = /**
  85377. * @return {?}
  85378. */
  85379. function () {
  85380. // '&&'
  85381. var /** @type {?} */ result = this.parseEquality();
  85382. while (this.optionalOperator('&&')) {
  85383. var /** @type {?} */ right = this.parseEquality();
  85384. result = new Binary(this.span(result.span.start), '&&', result, right);
  85385. }
  85386. return result;
  85387. };
  85388. /**
  85389. * @return {?}
  85390. */
  85391. _ParseAST.prototype.parseEquality = /**
  85392. * @return {?}
  85393. */
  85394. function () {
  85395. // '==','!=','===','!=='
  85396. var /** @type {?} */ result = this.parseRelational();
  85397. while (this.next.type == TokenType.Operator) {
  85398. var /** @type {?} */ operator = this.next.strValue;
  85399. switch (operator) {
  85400. case '==':
  85401. case '===':
  85402. case '!=':
  85403. case '!==':
  85404. this.advance();
  85405. var /** @type {?} */ right = this.parseRelational();
  85406. result = new Binary(this.span(result.span.start), operator, result, right);
  85407. continue;
  85408. }
  85409. break;
  85410. }
  85411. return result;
  85412. };
  85413. /**
  85414. * @return {?}
  85415. */
  85416. _ParseAST.prototype.parseRelational = /**
  85417. * @return {?}
  85418. */
  85419. function () {
  85420. // '<', '>', '<=', '>='
  85421. var /** @type {?} */ result = this.parseAdditive();
  85422. while (this.next.type == TokenType.Operator) {
  85423. var /** @type {?} */ operator = this.next.strValue;
  85424. switch (operator) {
  85425. case '<':
  85426. case '>':
  85427. case '<=':
  85428. case '>=':
  85429. this.advance();
  85430. var /** @type {?} */ right = this.parseAdditive();
  85431. result = new Binary(this.span(result.span.start), operator, result, right);
  85432. continue;
  85433. }
  85434. break;
  85435. }
  85436. return result;
  85437. };
  85438. /**
  85439. * @return {?}
  85440. */
  85441. _ParseAST.prototype.parseAdditive = /**
  85442. * @return {?}
  85443. */
  85444. function () {
  85445. // '+', '-'
  85446. var /** @type {?} */ result = this.parseMultiplicative();
  85447. while (this.next.type == TokenType.Operator) {
  85448. var /** @type {?} */ operator = this.next.strValue;
  85449. switch (operator) {
  85450. case '+':
  85451. case '-':
  85452. this.advance();
  85453. var /** @type {?} */ right = this.parseMultiplicative();
  85454. result = new Binary(this.span(result.span.start), operator, result, right);
  85455. continue;
  85456. }
  85457. break;
  85458. }
  85459. return result;
  85460. };
  85461. /**
  85462. * @return {?}
  85463. */
  85464. _ParseAST.prototype.parseMultiplicative = /**
  85465. * @return {?}
  85466. */
  85467. function () {
  85468. // '*', '%', '/'
  85469. var /** @type {?} */ result = this.parsePrefix();
  85470. while (this.next.type == TokenType.Operator) {
  85471. var /** @type {?} */ operator = this.next.strValue;
  85472. switch (operator) {
  85473. case '*':
  85474. case '%':
  85475. case '/':
  85476. this.advance();
  85477. var /** @type {?} */ right = this.parsePrefix();
  85478. result = new Binary(this.span(result.span.start), operator, result, right);
  85479. continue;
  85480. }
  85481. break;
  85482. }
  85483. return result;
  85484. };
  85485. /**
  85486. * @return {?}
  85487. */
  85488. _ParseAST.prototype.parsePrefix = /**
  85489. * @return {?}
  85490. */
  85491. function () {
  85492. if (this.next.type == TokenType.Operator) {
  85493. var /** @type {?} */ start = this.inputIndex;
  85494. var /** @type {?} */ operator = this.next.strValue;
  85495. var /** @type {?} */ result = void 0;
  85496. switch (operator) {
  85497. case '+':
  85498. this.advance();
  85499. result = this.parsePrefix();
  85500. return new Binary(this.span(start), '-', result, new LiteralPrimitive(new ParseSpan(start, start), 0));
  85501. case '-':
  85502. this.advance();
  85503. result = this.parsePrefix();
  85504. return new Binary(this.span(start), operator, new LiteralPrimitive(new ParseSpan(start, start), 0), result);
  85505. case '!':
  85506. this.advance();
  85507. result = this.parsePrefix();
  85508. return new PrefixNot(this.span(start), result);
  85509. }
  85510. }
  85511. return this.parseCallChain();
  85512. };
  85513. /**
  85514. * @return {?}
  85515. */
  85516. _ParseAST.prototype.parseCallChain = /**
  85517. * @return {?}
  85518. */
  85519. function () {
  85520. var /** @type {?} */ result = this.parsePrimary();
  85521. while (true) {
  85522. if (this.optionalCharacter($PERIOD)) {
  85523. result = this.parseAccessMemberOrMethodCall(result, false);
  85524. }
  85525. else if (this.optionalOperator('?.')) {
  85526. result = this.parseAccessMemberOrMethodCall(result, true);
  85527. }
  85528. else if (this.optionalCharacter($LBRACKET)) {
  85529. this.rbracketsExpected++;
  85530. var /** @type {?} */ key = this.parsePipe();
  85531. this.rbracketsExpected--;
  85532. this.expectCharacter($RBRACKET);
  85533. if (this.optionalOperator('=')) {
  85534. var /** @type {?} */ value = this.parseConditional();
  85535. result = new KeyedWrite(this.span(result.span.start), result, key, value);
  85536. }
  85537. else {
  85538. result = new KeyedRead(this.span(result.span.start), result, key);
  85539. }
  85540. }
  85541. else if (this.optionalCharacter($LPAREN)) {
  85542. this.rparensExpected++;
  85543. var /** @type {?} */ args = this.parseCallArguments();
  85544. this.rparensExpected--;
  85545. this.expectCharacter($RPAREN);
  85546. result = new FunctionCall(this.span(result.span.start), result, args);
  85547. }
  85548. else if (this.optionalOperator('!')) {
  85549. result = new NonNullAssert(this.span(result.span.start), result);
  85550. }
  85551. else {
  85552. return result;
  85553. }
  85554. }
  85555. };
  85556. /**
  85557. * @return {?}
  85558. */
  85559. _ParseAST.prototype.parsePrimary = /**
  85560. * @return {?}
  85561. */
  85562. function () {
  85563. var /** @type {?} */ start = this.inputIndex;
  85564. if (this.optionalCharacter($LPAREN)) {
  85565. this.rparensExpected++;
  85566. var /** @type {?} */ result = this.parsePipe();
  85567. this.rparensExpected--;
  85568. this.expectCharacter($RPAREN);
  85569. return result;
  85570. }
  85571. else if (this.next.isKeywordNull()) {
  85572. this.advance();
  85573. return new LiteralPrimitive(this.span(start), null);
  85574. }
  85575. else if (this.next.isKeywordUndefined()) {
  85576. this.advance();
  85577. return new LiteralPrimitive(this.span(start), void 0);
  85578. }
  85579. else if (this.next.isKeywordTrue()) {
  85580. this.advance();
  85581. return new LiteralPrimitive(this.span(start), true);
  85582. }
  85583. else if (this.next.isKeywordFalse()) {
  85584. this.advance();
  85585. return new LiteralPrimitive(this.span(start), false);
  85586. }
  85587. else if (this.next.isKeywordThis()) {
  85588. this.advance();
  85589. return new ImplicitReceiver(this.span(start));
  85590. }
  85591. else if (this.optionalCharacter($LBRACKET)) {
  85592. this.rbracketsExpected++;
  85593. var /** @type {?} */ elements = this.parseExpressionList($RBRACKET);
  85594. this.rbracketsExpected--;
  85595. this.expectCharacter($RBRACKET);
  85596. return new LiteralArray(this.span(start), elements);
  85597. }
  85598. else if (this.next.isCharacter($LBRACE)) {
  85599. return this.parseLiteralMap();
  85600. }
  85601. else if (this.next.isIdentifier()) {
  85602. return this.parseAccessMemberOrMethodCall(new ImplicitReceiver(this.span(start)), false);
  85603. }
  85604. else if (this.next.isNumber()) {
  85605. var /** @type {?} */ value = this.next.toNumber();
  85606. this.advance();
  85607. return new LiteralPrimitive(this.span(start), value);
  85608. }
  85609. else if (this.next.isString()) {
  85610. var /** @type {?} */ literalValue = this.next.toString();
  85611. this.advance();
  85612. return new LiteralPrimitive(this.span(start), literalValue);
  85613. }
  85614. else if (this.index >= this.tokens.length) {
  85615. this.error("Unexpected end of expression: " + this.input);
  85616. return new EmptyExpr(this.span(start));
  85617. }
  85618. else {
  85619. this.error("Unexpected token " + this.next);
  85620. return new EmptyExpr(this.span(start));
  85621. }
  85622. };
  85623. /**
  85624. * @param {?} terminator
  85625. * @return {?}
  85626. */
  85627. _ParseAST.prototype.parseExpressionList = /**
  85628. * @param {?} terminator
  85629. * @return {?}
  85630. */
  85631. function (terminator) {
  85632. var /** @type {?} */ result = [];
  85633. if (!this.next.isCharacter(terminator)) {
  85634. do {
  85635. result.push(this.parsePipe());
  85636. } while (this.optionalCharacter($COMMA));
  85637. }
  85638. return result;
  85639. };
  85640. /**
  85641. * @return {?}
  85642. */
  85643. _ParseAST.prototype.parseLiteralMap = /**
  85644. * @return {?}
  85645. */
  85646. function () {
  85647. var /** @type {?} */ keys = [];
  85648. var /** @type {?} */ values = [];
  85649. var /** @type {?} */ start = this.inputIndex;
  85650. this.expectCharacter($LBRACE);
  85651. if (!this.optionalCharacter($RBRACE)) {
  85652. this.rbracesExpected++;
  85653. do {
  85654. var /** @type {?} */ quoted = this.next.isString();
  85655. var /** @type {?} */ key = this.expectIdentifierOrKeywordOrString();
  85656. keys.push({ key: key, quoted: quoted });
  85657. this.expectCharacter($COLON);
  85658. values.push(this.parsePipe());
  85659. } while (this.optionalCharacter($COMMA));
  85660. this.rbracesExpected--;
  85661. this.expectCharacter($RBRACE);
  85662. }
  85663. return new LiteralMap(this.span(start), keys, values);
  85664. };
  85665. /**
  85666. * @param {?} receiver
  85667. * @param {?=} isSafe
  85668. * @return {?}
  85669. */
  85670. _ParseAST.prototype.parseAccessMemberOrMethodCall = /**
  85671. * @param {?} receiver
  85672. * @param {?=} isSafe
  85673. * @return {?}
  85674. */
  85675. function (receiver, isSafe) {
  85676. if (isSafe === void 0) { isSafe = false; }
  85677. var /** @type {?} */ start = receiver.span.start;
  85678. var /** @type {?} */ id = this.expectIdentifierOrKeyword();
  85679. if (this.optionalCharacter($LPAREN)) {
  85680. this.rparensExpected++;
  85681. var /** @type {?} */ args = this.parseCallArguments();
  85682. this.expectCharacter($RPAREN);
  85683. this.rparensExpected--;
  85684. var /** @type {?} */ span = this.span(start);
  85685. return isSafe ? new SafeMethodCall(span, receiver, id, args) :
  85686. new MethodCall(span, receiver, id, args);
  85687. }
  85688. else {
  85689. if (isSafe) {
  85690. if (this.optionalOperator('=')) {
  85691. this.error('The \'?.\' operator cannot be used in the assignment');
  85692. return new EmptyExpr(this.span(start));
  85693. }
  85694. else {
  85695. return new SafePropertyRead(this.span(start), receiver, id);
  85696. }
  85697. }
  85698. else {
  85699. if (this.optionalOperator('=')) {
  85700. if (!this.parseAction) {
  85701. this.error('Bindings cannot contain assignments');
  85702. return new EmptyExpr(this.span(start));
  85703. }
  85704. var /** @type {?} */ value = this.parseConditional();
  85705. return new PropertyWrite(this.span(start), receiver, id, value);
  85706. }
  85707. else {
  85708. return new PropertyRead(this.span(start), receiver, id);
  85709. }
  85710. }
  85711. }
  85712. };
  85713. /**
  85714. * @return {?}
  85715. */
  85716. _ParseAST.prototype.parseCallArguments = /**
  85717. * @return {?}
  85718. */
  85719. function () {
  85720. if (this.next.isCharacter($RPAREN))
  85721. return [];
  85722. var /** @type {?} */ positionals = [];
  85723. do {
  85724. positionals.push(this.parsePipe());
  85725. } while (this.optionalCharacter($COMMA));
  85726. return /** @type {?} */ (positionals);
  85727. };
  85728. /**
  85729. * An identifier, a keyword, a string with an optional `-` inbetween.
  85730. */
  85731. /**
  85732. * An identifier, a keyword, a string with an optional `-` inbetween.
  85733. * @return {?}
  85734. */
  85735. _ParseAST.prototype.expectTemplateBindingKey = /**
  85736. * An identifier, a keyword, a string with an optional `-` inbetween.
  85737. * @return {?}
  85738. */
  85739. function () {
  85740. var /** @type {?} */ result = '';
  85741. var /** @type {?} */ operatorFound = false;
  85742. do {
  85743. result += this.expectIdentifierOrKeywordOrString();
  85744. operatorFound = this.optionalOperator('-');
  85745. if (operatorFound) {
  85746. result += '-';
  85747. }
  85748. } while (operatorFound);
  85749. return result.toString();
  85750. };
  85751. /**
  85752. * @return {?}
  85753. */
  85754. _ParseAST.prototype.parseTemplateBindings = /**
  85755. * @return {?}
  85756. */
  85757. function () {
  85758. var /** @type {?} */ bindings = [];
  85759. var /** @type {?} */ prefix = /** @type {?} */ ((null));
  85760. var /** @type {?} */ warnings = [];
  85761. while (this.index < this.tokens.length) {
  85762. var /** @type {?} */ start = this.inputIndex;
  85763. var /** @type {?} */ keyIsVar = this.peekKeywordLet();
  85764. if (keyIsVar) {
  85765. this.advance();
  85766. }
  85767. var /** @type {?} */ rawKey = this.expectTemplateBindingKey();
  85768. var /** @type {?} */ key = rawKey;
  85769. if (!keyIsVar) {
  85770. if (prefix == null) {
  85771. prefix = key;
  85772. }
  85773. else {
  85774. key = prefix + key[0].toUpperCase() + key.substring(1);
  85775. }
  85776. }
  85777. this.optionalCharacter($COLON);
  85778. var /** @type {?} */ name_2 = /** @type {?} */ ((null));
  85779. var /** @type {?} */ expression = /** @type {?} */ ((null));
  85780. if (keyIsVar) {
  85781. if (this.optionalOperator('=')) {
  85782. name_2 = this.expectTemplateBindingKey();
  85783. }
  85784. else {
  85785. name_2 = '\$implicit';
  85786. }
  85787. }
  85788. else if (this.peekKeywordAs()) {
  85789. var /** @type {?} */ letStart = this.inputIndex;
  85790. this.advance(); // consume `as`
  85791. name_2 = rawKey;
  85792. key = this.expectTemplateBindingKey(); // read local var name
  85793. keyIsVar = true;
  85794. }
  85795. else if (this.next !== EOF && !this.peekKeywordLet()) {
  85796. var /** @type {?} */ start_1 = this.inputIndex;
  85797. var /** @type {?} */ ast = this.parsePipe();
  85798. var /** @type {?} */ source = this.input.substring(start_1 - this.offset, this.inputIndex - this.offset);
  85799. expression = new ASTWithSource(ast, source, this.location, this.errors);
  85800. }
  85801. bindings.push(new TemplateBinding(this.span(start), key, keyIsVar, name_2, expression));
  85802. if (this.peekKeywordAs() && !keyIsVar) {
  85803. var /** @type {?} */ letStart = this.inputIndex;
  85804. this.advance(); // consume `as`
  85805. var /** @type {?} */ letName = this.expectTemplateBindingKey(); // read local var name
  85806. bindings.push(new TemplateBinding(this.span(letStart), letName, true, key, /** @type {?} */ ((null))));
  85807. }
  85808. if (!this.optionalCharacter($SEMICOLON)) {
  85809. this.optionalCharacter($COMMA);
  85810. }
  85811. }
  85812. return new TemplateBindingParseResult(bindings, warnings, this.errors);
  85813. };
  85814. /**
  85815. * @param {?} message
  85816. * @param {?=} index
  85817. * @return {?}
  85818. */
  85819. _ParseAST.prototype.error = /**
  85820. * @param {?} message
  85821. * @param {?=} index
  85822. * @return {?}
  85823. */
  85824. function (message, index) {
  85825. if (index === void 0) { index = null; }
  85826. this.errors.push(new ParserError(message, this.input, this.locationText(index), this.location));
  85827. this.skip();
  85828. };
  85829. /**
  85830. * @param {?=} index
  85831. * @return {?}
  85832. */
  85833. _ParseAST.prototype.locationText = /**
  85834. * @param {?=} index
  85835. * @return {?}
  85836. */
  85837. function (index) {
  85838. if (index === void 0) { index = null; }
  85839. if (index == null)
  85840. index = this.index;
  85841. return (index < this.tokens.length) ? "at column " + (this.tokens[index].index + 1) + " in" :
  85842. "at the end of the expression";
  85843. };
  85844. /**
  85845. * @return {?}
  85846. */
  85847. _ParseAST.prototype.skip = /**
  85848. * @return {?}
  85849. */
  85850. function () {
  85851. var /** @type {?} */ n = this.next;
  85852. while (this.index < this.tokens.length && !n.isCharacter($SEMICOLON) &&
  85853. (this.rparensExpected <= 0 || !n.isCharacter($RPAREN)) &&
  85854. (this.rbracesExpected <= 0 || !n.isCharacter($RBRACE)) &&
  85855. (this.rbracketsExpected <= 0 || !n.isCharacter($RBRACKET))) {
  85856. if (this.next.isError()) {
  85857. this.errors.push(new ParserError(/** @type {?} */ ((this.next.toString())), this.input, this.locationText(), this.location));
  85858. }
  85859. this.advance();
  85860. n = this.next;
  85861. }
  85862. };
  85863. return _ParseAST;
  85864. }());
  85865. var SimpleExpressionChecker = /** @class */ (function () {
  85866. function SimpleExpressionChecker() {
  85867. this.errors = [];
  85868. }
  85869. /**
  85870. * @param {?} ast
  85871. * @return {?}
  85872. */
  85873. SimpleExpressionChecker.check = /**
  85874. * @param {?} ast
  85875. * @return {?}
  85876. */
  85877. function (ast) {
  85878. var /** @type {?} */ s = new SimpleExpressionChecker();
  85879. ast.visit(s);
  85880. return s.errors;
  85881. };
  85882. /**
  85883. * @param {?} ast
  85884. * @param {?} context
  85885. * @return {?}
  85886. */
  85887. SimpleExpressionChecker.prototype.visitImplicitReceiver = /**
  85888. * @param {?} ast
  85889. * @param {?} context
  85890. * @return {?}
  85891. */
  85892. function (ast, context) { };
  85893. /**
  85894. * @param {?} ast
  85895. * @param {?} context
  85896. * @return {?}
  85897. */
  85898. SimpleExpressionChecker.prototype.visitInterpolation = /**
  85899. * @param {?} ast
  85900. * @param {?} context
  85901. * @return {?}
  85902. */
  85903. function (ast, context) { };
  85904. /**
  85905. * @param {?} ast
  85906. * @param {?} context
  85907. * @return {?}
  85908. */
  85909. SimpleExpressionChecker.prototype.visitLiteralPrimitive = /**
  85910. * @param {?} ast
  85911. * @param {?} context
  85912. * @return {?}
  85913. */
  85914. function (ast, context) { };
  85915. /**
  85916. * @param {?} ast
  85917. * @param {?} context
  85918. * @return {?}
  85919. */
  85920. SimpleExpressionChecker.prototype.visitPropertyRead = /**
  85921. * @param {?} ast
  85922. * @param {?} context
  85923. * @return {?}
  85924. */
  85925. function (ast, context) { };
  85926. /**
  85927. * @param {?} ast
  85928. * @param {?} context
  85929. * @return {?}
  85930. */
  85931. SimpleExpressionChecker.prototype.visitPropertyWrite = /**
  85932. * @param {?} ast
  85933. * @param {?} context
  85934. * @return {?}
  85935. */
  85936. function (ast, context) { };
  85937. /**
  85938. * @param {?} ast
  85939. * @param {?} context
  85940. * @return {?}
  85941. */
  85942. SimpleExpressionChecker.prototype.visitSafePropertyRead = /**
  85943. * @param {?} ast
  85944. * @param {?} context
  85945. * @return {?}
  85946. */
  85947. function (ast, context) { };
  85948. /**
  85949. * @param {?} ast
  85950. * @param {?} context
  85951. * @return {?}
  85952. */
  85953. SimpleExpressionChecker.prototype.visitMethodCall = /**
  85954. * @param {?} ast
  85955. * @param {?} context
  85956. * @return {?}
  85957. */
  85958. function (ast, context) { };
  85959. /**
  85960. * @param {?} ast
  85961. * @param {?} context
  85962. * @return {?}
  85963. */
  85964. SimpleExpressionChecker.prototype.visitSafeMethodCall = /**
  85965. * @param {?} ast
  85966. * @param {?} context
  85967. * @return {?}
  85968. */
  85969. function (ast, context) { };
  85970. /**
  85971. * @param {?} ast
  85972. * @param {?} context
  85973. * @return {?}
  85974. */
  85975. SimpleExpressionChecker.prototype.visitFunctionCall = /**
  85976. * @param {?} ast
  85977. * @param {?} context
  85978. * @return {?}
  85979. */
  85980. function (ast, context) { };
  85981. /**
  85982. * @param {?} ast
  85983. * @param {?} context
  85984. * @return {?}
  85985. */
  85986. SimpleExpressionChecker.prototype.visitLiteralArray = /**
  85987. * @param {?} ast
  85988. * @param {?} context
  85989. * @return {?}
  85990. */
  85991. function (ast, context) { this.visitAll(ast.expressions); };
  85992. /**
  85993. * @param {?} ast
  85994. * @param {?} context
  85995. * @return {?}
  85996. */
  85997. SimpleExpressionChecker.prototype.visitLiteralMap = /**
  85998. * @param {?} ast
  85999. * @param {?} context
  86000. * @return {?}
  86001. */
  86002. function (ast, context) { this.visitAll(ast.values); };
  86003. /**
  86004. * @param {?} ast
  86005. * @param {?} context
  86006. * @return {?}
  86007. */
  86008. SimpleExpressionChecker.prototype.visitBinary = /**
  86009. * @param {?} ast
  86010. * @param {?} context
  86011. * @return {?}
  86012. */
  86013. function (ast, context) { };
  86014. /**
  86015. * @param {?} ast
  86016. * @param {?} context
  86017. * @return {?}
  86018. */
  86019. SimpleExpressionChecker.prototype.visitPrefixNot = /**
  86020. * @param {?} ast
  86021. * @param {?} context
  86022. * @return {?}
  86023. */
  86024. function (ast, context) { };
  86025. /**
  86026. * @param {?} ast
  86027. * @param {?} context
  86028. * @return {?}
  86029. */
  86030. SimpleExpressionChecker.prototype.visitNonNullAssert = /**
  86031. * @param {?} ast
  86032. * @param {?} context
  86033. * @return {?}
  86034. */
  86035. function (ast, context) { };
  86036. /**
  86037. * @param {?} ast
  86038. * @param {?} context
  86039. * @return {?}
  86040. */
  86041. SimpleExpressionChecker.prototype.visitConditional = /**
  86042. * @param {?} ast
  86043. * @param {?} context
  86044. * @return {?}
  86045. */
  86046. function (ast, context) { };
  86047. /**
  86048. * @param {?} ast
  86049. * @param {?} context
  86050. * @return {?}
  86051. */
  86052. SimpleExpressionChecker.prototype.visitPipe = /**
  86053. * @param {?} ast
  86054. * @param {?} context
  86055. * @return {?}
  86056. */
  86057. function (ast, context) { this.errors.push('pipes'); };
  86058. /**
  86059. * @param {?} ast
  86060. * @param {?} context
  86061. * @return {?}
  86062. */
  86063. SimpleExpressionChecker.prototype.visitKeyedRead = /**
  86064. * @param {?} ast
  86065. * @param {?} context
  86066. * @return {?}
  86067. */
  86068. function (ast, context) { };
  86069. /**
  86070. * @param {?} ast
  86071. * @param {?} context
  86072. * @return {?}
  86073. */
  86074. SimpleExpressionChecker.prototype.visitKeyedWrite = /**
  86075. * @param {?} ast
  86076. * @param {?} context
  86077. * @return {?}
  86078. */
  86079. function (ast, context) { };
  86080. /**
  86081. * @param {?} asts
  86082. * @return {?}
  86083. */
  86084. SimpleExpressionChecker.prototype.visitAll = /**
  86085. * @param {?} asts
  86086. * @return {?}
  86087. */
  86088. function (asts) {
  86089. var _this = this;
  86090. return asts.map(function (node) { return node.visit(_this); });
  86091. };
  86092. /**
  86093. * @param {?} ast
  86094. * @param {?} context
  86095. * @return {?}
  86096. */
  86097. SimpleExpressionChecker.prototype.visitChain = /**
  86098. * @param {?} ast
  86099. * @param {?} context
  86100. * @return {?}
  86101. */
  86102. function (ast, context) { };
  86103. /**
  86104. * @param {?} ast
  86105. * @param {?} context
  86106. * @return {?}
  86107. */
  86108. SimpleExpressionChecker.prototype.visitQuote = /**
  86109. * @param {?} ast
  86110. * @param {?} context
  86111. * @return {?}
  86112. */
  86113. function (ast, context) { };
  86114. return SimpleExpressionChecker;
  86115. }());
  86116. /**
  86117. * @fileoverview added by tsickle
  86118. * @suppress {checkTypes} checked by tsc
  86119. */
  86120. var ParseLocation = /** @class */ (function () {
  86121. function ParseLocation(file, offset, line, col) {
  86122. this.file = file;
  86123. this.offset = offset;
  86124. this.line = line;
  86125. this.col = col;
  86126. }
  86127. /**
  86128. * @return {?}
  86129. */
  86130. ParseLocation.prototype.toString = /**
  86131. * @return {?}
  86132. */
  86133. function () {
  86134. return this.offset != null ? this.file.url + "@" + this.line + ":" + this.col : this.file.url;
  86135. };
  86136. /**
  86137. * @param {?} delta
  86138. * @return {?}
  86139. */
  86140. ParseLocation.prototype.moveBy = /**
  86141. * @param {?} delta
  86142. * @return {?}
  86143. */
  86144. function (delta) {
  86145. var /** @type {?} */ source = this.file.content;
  86146. var /** @type {?} */ len = source.length;
  86147. var /** @type {?} */ offset = this.offset;
  86148. var /** @type {?} */ line = this.line;
  86149. var /** @type {?} */ col = this.col;
  86150. while (offset > 0 && delta < 0) {
  86151. offset--;
  86152. delta++;
  86153. var /** @type {?} */ ch = source.charCodeAt(offset);
  86154. if (ch == $LF) {
  86155. line--;
  86156. var /** @type {?} */ priorLine = source.substr(0, offset - 1).lastIndexOf(String.fromCharCode($LF));
  86157. col = priorLine > 0 ? offset - priorLine : offset;
  86158. }
  86159. else {
  86160. col--;
  86161. }
  86162. }
  86163. while (offset < len && delta > 0) {
  86164. var /** @type {?} */ ch = source.charCodeAt(offset);
  86165. offset++;
  86166. delta--;
  86167. if (ch == $LF) {
  86168. line++;
  86169. col = 0;
  86170. }
  86171. else {
  86172. col++;
  86173. }
  86174. }
  86175. return new ParseLocation(this.file, offset, line, col);
  86176. };
  86177. // Return the source around the location
  86178. // Up to `maxChars` or `maxLines` on each side of the location
  86179. /**
  86180. * @param {?} maxChars
  86181. * @param {?} maxLines
  86182. * @return {?}
  86183. */
  86184. ParseLocation.prototype.getContext = /**
  86185. * @param {?} maxChars
  86186. * @param {?} maxLines
  86187. * @return {?}
  86188. */
  86189. function (maxChars, maxLines) {
  86190. var /** @type {?} */ content = this.file.content;
  86191. var /** @type {?} */ startOffset = this.offset;
  86192. if (startOffset != null) {
  86193. if (startOffset > content.length - 1) {
  86194. startOffset = content.length - 1;
  86195. }
  86196. var /** @type {?} */ endOffset = startOffset;
  86197. var /** @type {?} */ ctxChars = 0;
  86198. var /** @type {?} */ ctxLines = 0;
  86199. while (ctxChars < maxChars && startOffset > 0) {
  86200. startOffset--;
  86201. ctxChars++;
  86202. if (content[startOffset] == '\n') {
  86203. if (++ctxLines == maxLines) {
  86204. break;
  86205. }
  86206. }
  86207. }
  86208. ctxChars = 0;
  86209. ctxLines = 0;
  86210. while (ctxChars < maxChars && endOffset < content.length - 1) {
  86211. endOffset++;
  86212. ctxChars++;
  86213. if (content[endOffset] == '\n') {
  86214. if (++ctxLines == maxLines) {
  86215. break;
  86216. }
  86217. }
  86218. }
  86219. return {
  86220. before: content.substring(startOffset, this.offset),
  86221. after: content.substring(this.offset, endOffset + 1),
  86222. };
  86223. }
  86224. return null;
  86225. };
  86226. return ParseLocation;
  86227. }());
  86228. var ParseSourceFile = /** @class */ (function () {
  86229. function ParseSourceFile(content, url) {
  86230. this.content = content;
  86231. this.url = url;
  86232. }
  86233. return ParseSourceFile;
  86234. }());
  86235. var ParseSourceSpan = /** @class */ (function () {
  86236. function ParseSourceSpan(start, end, details) {
  86237. if (details === void 0) { details = null; }
  86238. this.start = start;
  86239. this.end = end;
  86240. this.details = details;
  86241. }
  86242. /**
  86243. * @return {?}
  86244. */
  86245. ParseSourceSpan.prototype.toString = /**
  86246. * @return {?}
  86247. */
  86248. function () {
  86249. return this.start.file.content.substring(this.start.offset, this.end.offset);
  86250. };
  86251. return ParseSourceSpan;
  86252. }());
  86253. /** @enum {number} */
  86254. var ParseErrorLevel = {
  86255. WARNING: 0,
  86256. ERROR: 1,
  86257. };
  86258. ParseErrorLevel[ParseErrorLevel.WARNING] = "WARNING";
  86259. ParseErrorLevel[ParseErrorLevel.ERROR] = "ERROR";
  86260. var ParseError = /** @class */ (function () {
  86261. function ParseError(span, msg, level) {
  86262. if (level === void 0) { level = ParseErrorLevel.ERROR; }
  86263. this.span = span;
  86264. this.msg = msg;
  86265. this.level = level;
  86266. }
  86267. /**
  86268. * @return {?}
  86269. */
  86270. ParseError.prototype.contextualMessage = /**
  86271. * @return {?}
  86272. */
  86273. function () {
  86274. var /** @type {?} */ ctx = this.span.start.getContext(100, 3);
  86275. return ctx ? this.msg + " (\"" + ctx.before + "[" + ParseErrorLevel[this.level] + " ->]" + ctx.after + "\")" :
  86276. this.msg;
  86277. };
  86278. /**
  86279. * @return {?}
  86280. */
  86281. ParseError.prototype.toString = /**
  86282. * @return {?}
  86283. */
  86284. function () {
  86285. var /** @type {?} */ details = this.span.details ? ", " + this.span.details : '';
  86286. return this.contextualMessage() + ": " + this.span.start + details;
  86287. };
  86288. return ParseError;
  86289. }());
  86290. /**
  86291. * @param {?} kind
  86292. * @param {?} type
  86293. * @return {?}
  86294. */
  86295. function typeSourceSpan(kind, type) {
  86296. var /** @type {?} */ moduleUrl = identifierModuleUrl(type);
  86297. var /** @type {?} */ sourceFileName = moduleUrl != null ? "in " + kind + " " + identifierName(type) + " in " + moduleUrl :
  86298. "in " + kind + " " + identifierName(type);
  86299. var /** @type {?} */ sourceFile = new ParseSourceFile('', sourceFileName);
  86300. return new ParseSourceSpan(new ParseLocation(sourceFile, -1, -1, -1), new ParseLocation(sourceFile, -1, -1, -1));
  86301. }
  86302. /**
  86303. * @fileoverview added by tsickle
  86304. * @suppress {checkTypes} checked by tsc
  86305. */
  86306. /**
  86307. * @license
  86308. * Copyright Google Inc. All Rights Reserved.
  86309. *
  86310. * Use of this source code is governed by an MIT-style license that can be
  86311. * found in the LICENSE file at https://angular.io/license
  86312. */
  86313. /** @enum {number} */
  86314. var TokenType$1 = {
  86315. TAG_OPEN_START: 0,
  86316. TAG_OPEN_END: 1,
  86317. TAG_OPEN_END_VOID: 2,
  86318. TAG_CLOSE: 3,
  86319. TEXT: 4,
  86320. ESCAPABLE_RAW_TEXT: 5,
  86321. RAW_TEXT: 6,
  86322. COMMENT_START: 7,
  86323. COMMENT_END: 8,
  86324. CDATA_START: 9,
  86325. CDATA_END: 10,
  86326. ATTR_NAME: 11,
  86327. ATTR_VALUE: 12,
  86328. DOC_TYPE: 13,
  86329. EXPANSION_FORM_START: 14,
  86330. EXPANSION_CASE_VALUE: 15,
  86331. EXPANSION_CASE_EXP_START: 16,
  86332. EXPANSION_CASE_EXP_END: 17,
  86333. EXPANSION_FORM_END: 18,
  86334. EOF: 19,
  86335. };
  86336. TokenType$1[TokenType$1.TAG_OPEN_START] = "TAG_OPEN_START";
  86337. TokenType$1[TokenType$1.TAG_OPEN_END] = "TAG_OPEN_END";
  86338. TokenType$1[TokenType$1.TAG_OPEN_END_VOID] = "TAG_OPEN_END_VOID";
  86339. TokenType$1[TokenType$1.TAG_CLOSE] = "TAG_CLOSE";
  86340. TokenType$1[TokenType$1.TEXT] = "TEXT";
  86341. TokenType$1[TokenType$1.ESCAPABLE_RAW_TEXT] = "ESCAPABLE_RAW_TEXT";
  86342. TokenType$1[TokenType$1.RAW_TEXT] = "RAW_TEXT";
  86343. TokenType$1[TokenType$1.COMMENT_START] = "COMMENT_START";
  86344. TokenType$1[TokenType$1.COMMENT_END] = "COMMENT_END";
  86345. TokenType$1[TokenType$1.CDATA_START] = "CDATA_START";
  86346. TokenType$1[TokenType$1.CDATA_END] = "CDATA_END";
  86347. TokenType$1[TokenType$1.ATTR_NAME] = "ATTR_NAME";
  86348. TokenType$1[TokenType$1.ATTR_VALUE] = "ATTR_VALUE";
  86349. TokenType$1[TokenType$1.DOC_TYPE] = "DOC_TYPE";
  86350. TokenType$1[TokenType$1.EXPANSION_FORM_START] = "EXPANSION_FORM_START";
  86351. TokenType$1[TokenType$1.EXPANSION_CASE_VALUE] = "EXPANSION_CASE_VALUE";
  86352. TokenType$1[TokenType$1.EXPANSION_CASE_EXP_START] = "EXPANSION_CASE_EXP_START";
  86353. TokenType$1[TokenType$1.EXPANSION_CASE_EXP_END] = "EXPANSION_CASE_EXP_END";
  86354. TokenType$1[TokenType$1.EXPANSION_FORM_END] = "EXPANSION_FORM_END";
  86355. TokenType$1[TokenType$1.EOF] = "EOF";
  86356. var Token$1 = /** @class */ (function () {
  86357. function Token(type, parts, sourceSpan) {
  86358. this.type = type;
  86359. this.parts = parts;
  86360. this.sourceSpan = sourceSpan;
  86361. }
  86362. return Token;
  86363. }());
  86364. var TokenError = /** @class */ (function (_super) {
  86365. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(TokenError, _super);
  86366. function TokenError(errorMsg, tokenType, span) {
  86367. var _this = _super.call(this, span, errorMsg) || this;
  86368. _this.tokenType = tokenType;
  86369. return _this;
  86370. }
  86371. return TokenError;
  86372. }(ParseError));
  86373. var TokenizeResult = /** @class */ (function () {
  86374. function TokenizeResult(tokens, errors) {
  86375. this.tokens = tokens;
  86376. this.errors = errors;
  86377. }
  86378. return TokenizeResult;
  86379. }());
  86380. /**
  86381. * @param {?} source
  86382. * @param {?} url
  86383. * @param {?} getTagDefinition
  86384. * @param {?=} tokenizeExpansionForms
  86385. * @param {?=} interpolationConfig
  86386. * @return {?}
  86387. */
  86388. function tokenize(source, url, getTagDefinition, tokenizeExpansionForms, interpolationConfig) {
  86389. if (tokenizeExpansionForms === void 0) { tokenizeExpansionForms = false; }
  86390. if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }
  86391. return new _Tokenizer(new ParseSourceFile(source, url), getTagDefinition, tokenizeExpansionForms, interpolationConfig)
  86392. .tokenize();
  86393. }
  86394. var _CR_OR_CRLF_REGEXP = /\r\n?/g;
  86395. /**
  86396. * @param {?} charCode
  86397. * @return {?}
  86398. */
  86399. function _unexpectedCharacterErrorMsg(charCode) {
  86400. var /** @type {?} */ char = charCode === $EOF ? 'EOF' : String.fromCharCode(charCode);
  86401. return "Unexpected character \"" + char + "\"";
  86402. }
  86403. /**
  86404. * @param {?} entitySrc
  86405. * @return {?}
  86406. */
  86407. function _unknownEntityErrorMsg(entitySrc) {
  86408. return "Unknown entity \"" + entitySrc + "\" - use the \"&#<decimal>;\" or \"&#x<hex>;\" syntax";
  86409. }
  86410. var _ControlFlowError = /** @class */ (function () {
  86411. function _ControlFlowError(error) {
  86412. this.error = error;
  86413. }
  86414. return _ControlFlowError;
  86415. }());
  86416. var _Tokenizer = /** @class */ (function () {
  86417. /**
  86418. * @param _file The html source
  86419. * @param _getTagDefinition
  86420. * @param _tokenizeIcu Whether to tokenize ICU messages (considered as text nodes when false)
  86421. * @param _interpolationConfig
  86422. */
  86423. function _Tokenizer(_file, _getTagDefinition, _tokenizeIcu, _interpolationConfig) {
  86424. if (_interpolationConfig === void 0) { _interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }
  86425. this._file = _file;
  86426. this._getTagDefinition = _getTagDefinition;
  86427. this._tokenizeIcu = _tokenizeIcu;
  86428. this._interpolationConfig = _interpolationConfig;
  86429. this._peek = -1;
  86430. this._nextPeek = -1;
  86431. this._index = -1;
  86432. this._line = 0;
  86433. this._column = -1;
  86434. this._expansionCaseStack = [];
  86435. this._inInterpolation = false;
  86436. this.tokens = [];
  86437. this.errors = [];
  86438. this._input = _file.content;
  86439. this._length = _file.content.length;
  86440. this._advance();
  86441. }
  86442. /**
  86443. * @param {?} content
  86444. * @return {?}
  86445. */
  86446. _Tokenizer.prototype._processCarriageReturns = /**
  86447. * @param {?} content
  86448. * @return {?}
  86449. */
  86450. function (content) {
  86451. // http://www.w3.org/TR/html5/syntax.html#preprocessing-the-input-stream
  86452. // In order to keep the original position in the source, we can not
  86453. // pre-process it.
  86454. // Instead CRs are processed right before instantiating the tokens.
  86455. return content.replace(_CR_OR_CRLF_REGEXP, '\n');
  86456. };
  86457. /**
  86458. * @return {?}
  86459. */
  86460. _Tokenizer.prototype.tokenize = /**
  86461. * @return {?}
  86462. */
  86463. function () {
  86464. while (this._peek !== $EOF) {
  86465. var /** @type {?} */ start = this._getLocation();
  86466. try {
  86467. if (this._attemptCharCode($LT)) {
  86468. if (this._attemptCharCode($BANG)) {
  86469. if (this._attemptCharCode($LBRACKET)) {
  86470. this._consumeCdata(start);
  86471. }
  86472. else if (this._attemptCharCode($MINUS)) {
  86473. this._consumeComment(start);
  86474. }
  86475. else {
  86476. this._consumeDocType(start);
  86477. }
  86478. }
  86479. else if (this._attemptCharCode($SLASH)) {
  86480. this._consumeTagClose(start);
  86481. }
  86482. else {
  86483. this._consumeTagOpen(start);
  86484. }
  86485. }
  86486. else if (!(this._tokenizeIcu && this._tokenizeExpansionForm())) {
  86487. this._consumeText();
  86488. }
  86489. }
  86490. catch (/** @type {?} */ e) {
  86491. if (e instanceof _ControlFlowError) {
  86492. this.errors.push(e.error);
  86493. }
  86494. else {
  86495. throw e;
  86496. }
  86497. }
  86498. }
  86499. this._beginToken(TokenType$1.EOF);
  86500. this._endToken([]);
  86501. return new TokenizeResult(mergeTextTokens(this.tokens), this.errors);
  86502. };
  86503. /**
  86504. * \@internal
  86505. * @return {?} whether an ICU token has been created
  86506. */
  86507. _Tokenizer.prototype._tokenizeExpansionForm = /**
  86508. * \@internal
  86509. * @return {?} whether an ICU token has been created
  86510. */
  86511. function () {
  86512. if (isExpansionFormStart(this._input, this._index, this._interpolationConfig)) {
  86513. this._consumeExpansionFormStart();
  86514. return true;
  86515. }
  86516. if (isExpansionCaseStart(this._peek) && this._isInExpansionForm()) {
  86517. this._consumeExpansionCaseStart();
  86518. return true;
  86519. }
  86520. if (this._peek === $RBRACE) {
  86521. if (this._isInExpansionCase()) {
  86522. this._consumeExpansionCaseEnd();
  86523. return true;
  86524. }
  86525. if (this._isInExpansionForm()) {
  86526. this._consumeExpansionFormEnd();
  86527. return true;
  86528. }
  86529. }
  86530. return false;
  86531. };
  86532. /**
  86533. * @return {?}
  86534. */
  86535. _Tokenizer.prototype._getLocation = /**
  86536. * @return {?}
  86537. */
  86538. function () {
  86539. return new ParseLocation(this._file, this._index, this._line, this._column);
  86540. };
  86541. /**
  86542. * @param {?=} start
  86543. * @param {?=} end
  86544. * @return {?}
  86545. */
  86546. _Tokenizer.prototype._getSpan = /**
  86547. * @param {?=} start
  86548. * @param {?=} end
  86549. * @return {?}
  86550. */
  86551. function (start, end) {
  86552. if (start === void 0) { start = this._getLocation(); }
  86553. if (end === void 0) { end = this._getLocation(); }
  86554. return new ParseSourceSpan(start, end);
  86555. };
  86556. /**
  86557. * @param {?} type
  86558. * @param {?=} start
  86559. * @return {?}
  86560. */
  86561. _Tokenizer.prototype._beginToken = /**
  86562. * @param {?} type
  86563. * @param {?=} start
  86564. * @return {?}
  86565. */
  86566. function (type, start) {
  86567. if (start === void 0) { start = this._getLocation(); }
  86568. this._currentTokenStart = start;
  86569. this._currentTokenType = type;
  86570. };
  86571. /**
  86572. * @param {?} parts
  86573. * @param {?=} end
  86574. * @return {?}
  86575. */
  86576. _Tokenizer.prototype._endToken = /**
  86577. * @param {?} parts
  86578. * @param {?=} end
  86579. * @return {?}
  86580. */
  86581. function (parts, end) {
  86582. if (end === void 0) { end = this._getLocation(); }
  86583. var /** @type {?} */ token = new Token$1(this._currentTokenType, parts, new ParseSourceSpan(this._currentTokenStart, end));
  86584. this.tokens.push(token);
  86585. this._currentTokenStart = /** @type {?} */ ((null));
  86586. this._currentTokenType = /** @type {?} */ ((null));
  86587. return token;
  86588. };
  86589. /**
  86590. * @param {?} msg
  86591. * @param {?} span
  86592. * @return {?}
  86593. */
  86594. _Tokenizer.prototype._createError = /**
  86595. * @param {?} msg
  86596. * @param {?} span
  86597. * @return {?}
  86598. */
  86599. function (msg, span) {
  86600. if (this._isInExpansionForm()) {
  86601. msg += " (Do you have an unescaped \"{\" in your template? Use \"{{ '{' }}\") to escape it.)";
  86602. }
  86603. var /** @type {?} */ error = new TokenError(msg, this._currentTokenType, span);
  86604. this._currentTokenStart = /** @type {?} */ ((null));
  86605. this._currentTokenType = /** @type {?} */ ((null));
  86606. return new _ControlFlowError(error);
  86607. };
  86608. /**
  86609. * @return {?}
  86610. */
  86611. _Tokenizer.prototype._advance = /**
  86612. * @return {?}
  86613. */
  86614. function () {
  86615. if (this._index >= this._length) {
  86616. throw this._createError(_unexpectedCharacterErrorMsg($EOF), this._getSpan());
  86617. }
  86618. if (this._peek === $LF) {
  86619. this._line++;
  86620. this._column = 0;
  86621. }
  86622. else if (this._peek !== $LF && this._peek !== $CR) {
  86623. this._column++;
  86624. }
  86625. this._index++;
  86626. this._peek = this._index >= this._length ? $EOF : this._input.charCodeAt(this._index);
  86627. this._nextPeek =
  86628. this._index + 1 >= this._length ? $EOF : this._input.charCodeAt(this._index + 1);
  86629. };
  86630. /**
  86631. * @param {?} charCode
  86632. * @return {?}
  86633. */
  86634. _Tokenizer.prototype._attemptCharCode = /**
  86635. * @param {?} charCode
  86636. * @return {?}
  86637. */
  86638. function (charCode) {
  86639. if (this._peek === charCode) {
  86640. this._advance();
  86641. return true;
  86642. }
  86643. return false;
  86644. };
  86645. /**
  86646. * @param {?} charCode
  86647. * @return {?}
  86648. */
  86649. _Tokenizer.prototype._attemptCharCodeCaseInsensitive = /**
  86650. * @param {?} charCode
  86651. * @return {?}
  86652. */
  86653. function (charCode) {
  86654. if (compareCharCodeCaseInsensitive(this._peek, charCode)) {
  86655. this._advance();
  86656. return true;
  86657. }
  86658. return false;
  86659. };
  86660. /**
  86661. * @param {?} charCode
  86662. * @return {?}
  86663. */
  86664. _Tokenizer.prototype._requireCharCode = /**
  86665. * @param {?} charCode
  86666. * @return {?}
  86667. */
  86668. function (charCode) {
  86669. var /** @type {?} */ location = this._getLocation();
  86670. if (!this._attemptCharCode(charCode)) {
  86671. throw this._createError(_unexpectedCharacterErrorMsg(this._peek), this._getSpan(location, location));
  86672. }
  86673. };
  86674. /**
  86675. * @param {?} chars
  86676. * @return {?}
  86677. */
  86678. _Tokenizer.prototype._attemptStr = /**
  86679. * @param {?} chars
  86680. * @return {?}
  86681. */
  86682. function (chars) {
  86683. var /** @type {?} */ len = chars.length;
  86684. if (this._index + len > this._length) {
  86685. return false;
  86686. }
  86687. var /** @type {?} */ initialPosition = this._savePosition();
  86688. for (var /** @type {?} */ i = 0; i < len; i++) {
  86689. if (!this._attemptCharCode(chars.charCodeAt(i))) {
  86690. // If attempting to parse the string fails, we want to reset the parser
  86691. // to where it was before the attempt
  86692. this._restorePosition(initialPosition);
  86693. return false;
  86694. }
  86695. }
  86696. return true;
  86697. };
  86698. /**
  86699. * @param {?} chars
  86700. * @return {?}
  86701. */
  86702. _Tokenizer.prototype._attemptStrCaseInsensitive = /**
  86703. * @param {?} chars
  86704. * @return {?}
  86705. */
  86706. function (chars) {
  86707. for (var /** @type {?} */ i = 0; i < chars.length; i++) {
  86708. if (!this._attemptCharCodeCaseInsensitive(chars.charCodeAt(i))) {
  86709. return false;
  86710. }
  86711. }
  86712. return true;
  86713. };
  86714. /**
  86715. * @param {?} chars
  86716. * @return {?}
  86717. */
  86718. _Tokenizer.prototype._requireStr = /**
  86719. * @param {?} chars
  86720. * @return {?}
  86721. */
  86722. function (chars) {
  86723. var /** @type {?} */ location = this._getLocation();
  86724. if (!this._attemptStr(chars)) {
  86725. throw this._createError(_unexpectedCharacterErrorMsg(this._peek), this._getSpan(location));
  86726. }
  86727. };
  86728. /**
  86729. * @param {?} predicate
  86730. * @return {?}
  86731. */
  86732. _Tokenizer.prototype._attemptCharCodeUntilFn = /**
  86733. * @param {?} predicate
  86734. * @return {?}
  86735. */
  86736. function (predicate) {
  86737. while (!predicate(this._peek)) {
  86738. this._advance();
  86739. }
  86740. };
  86741. /**
  86742. * @param {?} predicate
  86743. * @param {?} len
  86744. * @return {?}
  86745. */
  86746. _Tokenizer.prototype._requireCharCodeUntilFn = /**
  86747. * @param {?} predicate
  86748. * @param {?} len
  86749. * @return {?}
  86750. */
  86751. function (predicate, len) {
  86752. var /** @type {?} */ start = this._getLocation();
  86753. this._attemptCharCodeUntilFn(predicate);
  86754. if (this._index - start.offset < len) {
  86755. throw this._createError(_unexpectedCharacterErrorMsg(this._peek), this._getSpan(start, start));
  86756. }
  86757. };
  86758. /**
  86759. * @param {?} char
  86760. * @return {?}
  86761. */
  86762. _Tokenizer.prototype._attemptUntilChar = /**
  86763. * @param {?} char
  86764. * @return {?}
  86765. */
  86766. function (char) {
  86767. while (this._peek !== char) {
  86768. this._advance();
  86769. }
  86770. };
  86771. /**
  86772. * @param {?} decodeEntities
  86773. * @return {?}
  86774. */
  86775. _Tokenizer.prototype._readChar = /**
  86776. * @param {?} decodeEntities
  86777. * @return {?}
  86778. */
  86779. function (decodeEntities) {
  86780. if (decodeEntities && this._peek === $AMPERSAND) {
  86781. return this._decodeEntity();
  86782. }
  86783. else {
  86784. var /** @type {?} */ index = this._index;
  86785. this._advance();
  86786. return this._input[index];
  86787. }
  86788. };
  86789. /**
  86790. * @return {?}
  86791. */
  86792. _Tokenizer.prototype._decodeEntity = /**
  86793. * @return {?}
  86794. */
  86795. function () {
  86796. var /** @type {?} */ start = this._getLocation();
  86797. this._advance();
  86798. if (this._attemptCharCode($HASH)) {
  86799. var /** @type {?} */ isHex = this._attemptCharCode($x) || this._attemptCharCode($X);
  86800. var /** @type {?} */ numberStart = this._getLocation().offset;
  86801. this._attemptCharCodeUntilFn(isDigitEntityEnd);
  86802. if (this._peek != $SEMICOLON) {
  86803. throw this._createError(_unexpectedCharacterErrorMsg(this._peek), this._getSpan());
  86804. }
  86805. this._advance();
  86806. var /** @type {?} */ strNum = this._input.substring(numberStart, this._index - 1);
  86807. try {
  86808. var /** @type {?} */ charCode = parseInt(strNum, isHex ? 16 : 10);
  86809. return String.fromCharCode(charCode);
  86810. }
  86811. catch (/** @type {?} */ e) {
  86812. var /** @type {?} */ entity = this._input.substring(start.offset + 1, this._index - 1);
  86813. throw this._createError(_unknownEntityErrorMsg(entity), this._getSpan(start));
  86814. }
  86815. }
  86816. else {
  86817. var /** @type {?} */ startPosition = this._savePosition();
  86818. this._attemptCharCodeUntilFn(isNamedEntityEnd);
  86819. if (this._peek != $SEMICOLON) {
  86820. this._restorePosition(startPosition);
  86821. return '&';
  86822. }
  86823. this._advance();
  86824. var /** @type {?} */ name_1 = this._input.substring(start.offset + 1, this._index - 1);
  86825. var /** @type {?} */ char = NAMED_ENTITIES[name_1];
  86826. if (!char) {
  86827. throw this._createError(_unknownEntityErrorMsg(name_1), this._getSpan(start));
  86828. }
  86829. return char;
  86830. }
  86831. };
  86832. /**
  86833. * @param {?} decodeEntities
  86834. * @param {?} firstCharOfEnd
  86835. * @param {?} attemptEndRest
  86836. * @return {?}
  86837. */
  86838. _Tokenizer.prototype._consumeRawText = /**
  86839. * @param {?} decodeEntities
  86840. * @param {?} firstCharOfEnd
  86841. * @param {?} attemptEndRest
  86842. * @return {?}
  86843. */
  86844. function (decodeEntities, firstCharOfEnd, attemptEndRest) {
  86845. var /** @type {?} */ tagCloseStart;
  86846. var /** @type {?} */ textStart = this._getLocation();
  86847. this._beginToken(decodeEntities ? TokenType$1.ESCAPABLE_RAW_TEXT : TokenType$1.RAW_TEXT, textStart);
  86848. var /** @type {?} */ parts = [];
  86849. while (true) {
  86850. tagCloseStart = this._getLocation();
  86851. if (this._attemptCharCode(firstCharOfEnd) && attemptEndRest()) {
  86852. break;
  86853. }
  86854. if (this._index > tagCloseStart.offset) {
  86855. // add the characters consumed by the previous if statement to the output
  86856. parts.push(this._input.substring(tagCloseStart.offset, this._index));
  86857. }
  86858. while (this._peek !== firstCharOfEnd) {
  86859. parts.push(this._readChar(decodeEntities));
  86860. }
  86861. }
  86862. return this._endToken([this._processCarriageReturns(parts.join(''))], tagCloseStart);
  86863. };
  86864. /**
  86865. * @param {?} start
  86866. * @return {?}
  86867. */
  86868. _Tokenizer.prototype._consumeComment = /**
  86869. * @param {?} start
  86870. * @return {?}
  86871. */
  86872. function (start) {
  86873. var _this = this;
  86874. this._beginToken(TokenType$1.COMMENT_START, start);
  86875. this._requireCharCode($MINUS);
  86876. this._endToken([]);
  86877. var /** @type {?} */ textToken = this._consumeRawText(false, $MINUS, function () { return _this._attemptStr('->'); });
  86878. this._beginToken(TokenType$1.COMMENT_END, textToken.sourceSpan.end);
  86879. this._endToken([]);
  86880. };
  86881. /**
  86882. * @param {?} start
  86883. * @return {?}
  86884. */
  86885. _Tokenizer.prototype._consumeCdata = /**
  86886. * @param {?} start
  86887. * @return {?}
  86888. */
  86889. function (start) {
  86890. var _this = this;
  86891. this._beginToken(TokenType$1.CDATA_START, start);
  86892. this._requireStr('CDATA[');
  86893. this._endToken([]);
  86894. var /** @type {?} */ textToken = this._consumeRawText(false, $RBRACKET, function () { return _this._attemptStr(']>'); });
  86895. this._beginToken(TokenType$1.CDATA_END, textToken.sourceSpan.end);
  86896. this._endToken([]);
  86897. };
  86898. /**
  86899. * @param {?} start
  86900. * @return {?}
  86901. */
  86902. _Tokenizer.prototype._consumeDocType = /**
  86903. * @param {?} start
  86904. * @return {?}
  86905. */
  86906. function (start) {
  86907. this._beginToken(TokenType$1.DOC_TYPE, start);
  86908. this._attemptUntilChar($GT);
  86909. this._advance();
  86910. this._endToken([this._input.substring(start.offset + 2, this._index - 1)]);
  86911. };
  86912. /**
  86913. * @return {?}
  86914. */
  86915. _Tokenizer.prototype._consumePrefixAndName = /**
  86916. * @return {?}
  86917. */
  86918. function () {
  86919. var /** @type {?} */ nameOrPrefixStart = this._index;
  86920. var /** @type {?} */ prefix = /** @type {?} */ ((null));
  86921. while (this._peek !== $COLON && !isPrefixEnd(this._peek)) {
  86922. this._advance();
  86923. }
  86924. var /** @type {?} */ nameStart;
  86925. if (this._peek === $COLON) {
  86926. this._advance();
  86927. prefix = this._input.substring(nameOrPrefixStart, this._index - 1);
  86928. nameStart = this._index;
  86929. }
  86930. else {
  86931. nameStart = nameOrPrefixStart;
  86932. }
  86933. this._requireCharCodeUntilFn(isNameEnd, this._index === nameStart ? 1 : 0);
  86934. var /** @type {?} */ name = this._input.substring(nameStart, this._index);
  86935. return [prefix, name];
  86936. };
  86937. /**
  86938. * @param {?} start
  86939. * @return {?}
  86940. */
  86941. _Tokenizer.prototype._consumeTagOpen = /**
  86942. * @param {?} start
  86943. * @return {?}
  86944. */
  86945. function (start) {
  86946. var /** @type {?} */ savedPos = this._savePosition();
  86947. var /** @type {?} */ tagName;
  86948. var /** @type {?} */ lowercaseTagName;
  86949. try {
  86950. if (!isAsciiLetter(this._peek)) {
  86951. throw this._createError(_unexpectedCharacterErrorMsg(this._peek), this._getSpan());
  86952. }
  86953. var /** @type {?} */ nameStart = this._index;
  86954. this._consumeTagOpenStart(start);
  86955. tagName = this._input.substring(nameStart, this._index);
  86956. lowercaseTagName = tagName.toLowerCase();
  86957. this._attemptCharCodeUntilFn(isNotWhitespace);
  86958. while (this._peek !== $SLASH && this._peek !== $GT) {
  86959. this._consumeAttributeName();
  86960. this._attemptCharCodeUntilFn(isNotWhitespace);
  86961. if (this._attemptCharCode($EQ)) {
  86962. this._attemptCharCodeUntilFn(isNotWhitespace);
  86963. this._consumeAttributeValue();
  86964. }
  86965. this._attemptCharCodeUntilFn(isNotWhitespace);
  86966. }
  86967. this._consumeTagOpenEnd();
  86968. }
  86969. catch (/** @type {?} */ e) {
  86970. if (e instanceof _ControlFlowError) {
  86971. // When the start tag is invalid, assume we want a "<"
  86972. this._restorePosition(savedPos);
  86973. // Back to back text tokens are merged at the end
  86974. this._beginToken(TokenType$1.TEXT, start);
  86975. this._endToken(['<']);
  86976. return;
  86977. }
  86978. throw e;
  86979. }
  86980. var /** @type {?} */ contentTokenType = this._getTagDefinition(tagName).contentType;
  86981. if (contentTokenType === TagContentType.RAW_TEXT) {
  86982. this._consumeRawTextWithTagClose(lowercaseTagName, false);
  86983. }
  86984. else if (contentTokenType === TagContentType.ESCAPABLE_RAW_TEXT) {
  86985. this._consumeRawTextWithTagClose(lowercaseTagName, true);
  86986. }
  86987. };
  86988. /**
  86989. * @param {?} lowercaseTagName
  86990. * @param {?} decodeEntities
  86991. * @return {?}
  86992. */
  86993. _Tokenizer.prototype._consumeRawTextWithTagClose = /**
  86994. * @param {?} lowercaseTagName
  86995. * @param {?} decodeEntities
  86996. * @return {?}
  86997. */
  86998. function (lowercaseTagName, decodeEntities) {
  86999. var _this = this;
  87000. var /** @type {?} */ textToken = this._consumeRawText(decodeEntities, $LT, function () {
  87001. if (!_this._attemptCharCode($SLASH))
  87002. return false;
  87003. _this._attemptCharCodeUntilFn(isNotWhitespace);
  87004. if (!_this._attemptStrCaseInsensitive(lowercaseTagName))
  87005. return false;
  87006. _this._attemptCharCodeUntilFn(isNotWhitespace);
  87007. return _this._attemptCharCode($GT);
  87008. });
  87009. this._beginToken(TokenType$1.TAG_CLOSE, textToken.sourceSpan.end);
  87010. this._endToken([/** @type {?} */ ((null)), lowercaseTagName]);
  87011. };
  87012. /**
  87013. * @param {?} start
  87014. * @return {?}
  87015. */
  87016. _Tokenizer.prototype._consumeTagOpenStart = /**
  87017. * @param {?} start
  87018. * @return {?}
  87019. */
  87020. function (start) {
  87021. this._beginToken(TokenType$1.TAG_OPEN_START, start);
  87022. var /** @type {?} */ parts = this._consumePrefixAndName();
  87023. this._endToken(parts);
  87024. };
  87025. /**
  87026. * @return {?}
  87027. */
  87028. _Tokenizer.prototype._consumeAttributeName = /**
  87029. * @return {?}
  87030. */
  87031. function () {
  87032. this._beginToken(TokenType$1.ATTR_NAME);
  87033. var /** @type {?} */ prefixAndName = this._consumePrefixAndName();
  87034. this._endToken(prefixAndName);
  87035. };
  87036. /**
  87037. * @return {?}
  87038. */
  87039. _Tokenizer.prototype._consumeAttributeValue = /**
  87040. * @return {?}
  87041. */
  87042. function () {
  87043. this._beginToken(TokenType$1.ATTR_VALUE);
  87044. var /** @type {?} */ value;
  87045. if (this._peek === $SQ || this._peek === $DQ) {
  87046. var /** @type {?} */ quoteChar = this._peek;
  87047. this._advance();
  87048. var /** @type {?} */ parts = [];
  87049. while (this._peek !== quoteChar) {
  87050. parts.push(this._readChar(true));
  87051. }
  87052. value = parts.join('');
  87053. this._advance();
  87054. }
  87055. else {
  87056. var /** @type {?} */ valueStart = this._index;
  87057. this._requireCharCodeUntilFn(isNameEnd, 1);
  87058. value = this._input.substring(valueStart, this._index);
  87059. }
  87060. this._endToken([this._processCarriageReturns(value)]);
  87061. };
  87062. /**
  87063. * @return {?}
  87064. */
  87065. _Tokenizer.prototype._consumeTagOpenEnd = /**
  87066. * @return {?}
  87067. */
  87068. function () {
  87069. var /** @type {?} */ tokenType = this._attemptCharCode($SLASH) ? TokenType$1.TAG_OPEN_END_VOID : TokenType$1.TAG_OPEN_END;
  87070. this._beginToken(tokenType);
  87071. this._requireCharCode($GT);
  87072. this._endToken([]);
  87073. };
  87074. /**
  87075. * @param {?} start
  87076. * @return {?}
  87077. */
  87078. _Tokenizer.prototype._consumeTagClose = /**
  87079. * @param {?} start
  87080. * @return {?}
  87081. */
  87082. function (start) {
  87083. this._beginToken(TokenType$1.TAG_CLOSE, start);
  87084. this._attemptCharCodeUntilFn(isNotWhitespace);
  87085. var /** @type {?} */ prefixAndName = this._consumePrefixAndName();
  87086. this._attemptCharCodeUntilFn(isNotWhitespace);
  87087. this._requireCharCode($GT);
  87088. this._endToken(prefixAndName);
  87089. };
  87090. /**
  87091. * @return {?}
  87092. */
  87093. _Tokenizer.prototype._consumeExpansionFormStart = /**
  87094. * @return {?}
  87095. */
  87096. function () {
  87097. this._beginToken(TokenType$1.EXPANSION_FORM_START, this._getLocation());
  87098. this._requireCharCode($LBRACE);
  87099. this._endToken([]);
  87100. this._expansionCaseStack.push(TokenType$1.EXPANSION_FORM_START);
  87101. this._beginToken(TokenType$1.RAW_TEXT, this._getLocation());
  87102. var /** @type {?} */ condition = this._readUntil($COMMA);
  87103. this._endToken([condition], this._getLocation());
  87104. this._requireCharCode($COMMA);
  87105. this._attemptCharCodeUntilFn(isNotWhitespace);
  87106. this._beginToken(TokenType$1.RAW_TEXT, this._getLocation());
  87107. var /** @type {?} */ type = this._readUntil($COMMA);
  87108. this._endToken([type], this._getLocation());
  87109. this._requireCharCode($COMMA);
  87110. this._attemptCharCodeUntilFn(isNotWhitespace);
  87111. };
  87112. /**
  87113. * @return {?}
  87114. */
  87115. _Tokenizer.prototype._consumeExpansionCaseStart = /**
  87116. * @return {?}
  87117. */
  87118. function () {
  87119. this._beginToken(TokenType$1.EXPANSION_CASE_VALUE, this._getLocation());
  87120. var /** @type {?} */ value = this._readUntil($LBRACE).trim();
  87121. this._endToken([value], this._getLocation());
  87122. this._attemptCharCodeUntilFn(isNotWhitespace);
  87123. this._beginToken(TokenType$1.EXPANSION_CASE_EXP_START, this._getLocation());
  87124. this._requireCharCode($LBRACE);
  87125. this._endToken([], this._getLocation());
  87126. this._attemptCharCodeUntilFn(isNotWhitespace);
  87127. this._expansionCaseStack.push(TokenType$1.EXPANSION_CASE_EXP_START);
  87128. };
  87129. /**
  87130. * @return {?}
  87131. */
  87132. _Tokenizer.prototype._consumeExpansionCaseEnd = /**
  87133. * @return {?}
  87134. */
  87135. function () {
  87136. this._beginToken(TokenType$1.EXPANSION_CASE_EXP_END, this._getLocation());
  87137. this._requireCharCode($RBRACE);
  87138. this._endToken([], this._getLocation());
  87139. this._attemptCharCodeUntilFn(isNotWhitespace);
  87140. this._expansionCaseStack.pop();
  87141. };
  87142. /**
  87143. * @return {?}
  87144. */
  87145. _Tokenizer.prototype._consumeExpansionFormEnd = /**
  87146. * @return {?}
  87147. */
  87148. function () {
  87149. this._beginToken(TokenType$1.EXPANSION_FORM_END, this._getLocation());
  87150. this._requireCharCode($RBRACE);
  87151. this._endToken([]);
  87152. this._expansionCaseStack.pop();
  87153. };
  87154. /**
  87155. * @return {?}
  87156. */
  87157. _Tokenizer.prototype._consumeText = /**
  87158. * @return {?}
  87159. */
  87160. function () {
  87161. var /** @type {?} */ start = this._getLocation();
  87162. this._beginToken(TokenType$1.TEXT, start);
  87163. var /** @type {?} */ parts = [];
  87164. do {
  87165. if (this._interpolationConfig && this._attemptStr(this._interpolationConfig.start)) {
  87166. parts.push(this._interpolationConfig.start);
  87167. this._inInterpolation = true;
  87168. }
  87169. else if (this._interpolationConfig && this._inInterpolation &&
  87170. this._attemptStr(this._interpolationConfig.end)) {
  87171. parts.push(this._interpolationConfig.end);
  87172. this._inInterpolation = false;
  87173. }
  87174. else {
  87175. parts.push(this._readChar(true));
  87176. }
  87177. } while (!this._isTextEnd());
  87178. this._endToken([this._processCarriageReturns(parts.join(''))]);
  87179. };
  87180. /**
  87181. * @return {?}
  87182. */
  87183. _Tokenizer.prototype._isTextEnd = /**
  87184. * @return {?}
  87185. */
  87186. function () {
  87187. if (this._peek === $LT || this._peek === $EOF) {
  87188. return true;
  87189. }
  87190. if (this._tokenizeIcu && !this._inInterpolation) {
  87191. if (isExpansionFormStart(this._input, this._index, this._interpolationConfig)) {
  87192. // start of an expansion form
  87193. return true;
  87194. }
  87195. if (this._peek === $RBRACE && this._isInExpansionCase()) {
  87196. // end of and expansion case
  87197. return true;
  87198. }
  87199. }
  87200. return false;
  87201. };
  87202. /**
  87203. * @return {?}
  87204. */
  87205. _Tokenizer.prototype._savePosition = /**
  87206. * @return {?}
  87207. */
  87208. function () {
  87209. return [this._peek, this._index, this._column, this._line, this.tokens.length];
  87210. };
  87211. /**
  87212. * @param {?} char
  87213. * @return {?}
  87214. */
  87215. _Tokenizer.prototype._readUntil = /**
  87216. * @param {?} char
  87217. * @return {?}
  87218. */
  87219. function (char) {
  87220. var /** @type {?} */ start = this._index;
  87221. this._attemptUntilChar(char);
  87222. return this._input.substring(start, this._index);
  87223. };
  87224. /**
  87225. * @param {?} position
  87226. * @return {?}
  87227. */
  87228. _Tokenizer.prototype._restorePosition = /**
  87229. * @param {?} position
  87230. * @return {?}
  87231. */
  87232. function (position) {
  87233. this._peek = position[0];
  87234. this._index = position[1];
  87235. this._column = position[2];
  87236. this._line = position[3];
  87237. var /** @type {?} */ nbTokens = position[4];
  87238. if (nbTokens < this.tokens.length) {
  87239. // remove any extra tokens
  87240. this.tokens = this.tokens.slice(0, nbTokens);
  87241. }
  87242. };
  87243. /**
  87244. * @return {?}
  87245. */
  87246. _Tokenizer.prototype._isInExpansionCase = /**
  87247. * @return {?}
  87248. */
  87249. function () {
  87250. return this._expansionCaseStack.length > 0 &&
  87251. this._expansionCaseStack[this._expansionCaseStack.length - 1] ===
  87252. TokenType$1.EXPANSION_CASE_EXP_START;
  87253. };
  87254. /**
  87255. * @return {?}
  87256. */
  87257. _Tokenizer.prototype._isInExpansionForm = /**
  87258. * @return {?}
  87259. */
  87260. function () {
  87261. return this._expansionCaseStack.length > 0 &&
  87262. this._expansionCaseStack[this._expansionCaseStack.length - 1] ===
  87263. TokenType$1.EXPANSION_FORM_START;
  87264. };
  87265. return _Tokenizer;
  87266. }());
  87267. /**
  87268. * @param {?} code
  87269. * @return {?}
  87270. */
  87271. function isNotWhitespace(code) {
  87272. return !isWhitespace(code) || code === $EOF;
  87273. }
  87274. /**
  87275. * @param {?} code
  87276. * @return {?}
  87277. */
  87278. function isNameEnd(code) {
  87279. return isWhitespace(code) || code === $GT || code === $SLASH ||
  87280. code === $SQ || code === $DQ || code === $EQ;
  87281. }
  87282. /**
  87283. * @param {?} code
  87284. * @return {?}
  87285. */
  87286. function isPrefixEnd(code) {
  87287. return (code < $a || $z < code) && (code < $A || $Z < code) &&
  87288. (code < $0 || code > $9);
  87289. }
  87290. /**
  87291. * @param {?} code
  87292. * @return {?}
  87293. */
  87294. function isDigitEntityEnd(code) {
  87295. return code == $SEMICOLON || code == $EOF || !isAsciiHexDigit(code);
  87296. }
  87297. /**
  87298. * @param {?} code
  87299. * @return {?}
  87300. */
  87301. function isNamedEntityEnd(code) {
  87302. return code == $SEMICOLON || code == $EOF || !isAsciiLetter(code);
  87303. }
  87304. /**
  87305. * @param {?} input
  87306. * @param {?} offset
  87307. * @param {?} interpolationConfig
  87308. * @return {?}
  87309. */
  87310. function isExpansionFormStart(input, offset, interpolationConfig) {
  87311. var /** @type {?} */ isInterpolationStart = interpolationConfig ? input.indexOf(interpolationConfig.start, offset) == offset : false;
  87312. return input.charCodeAt(offset) == $LBRACE && !isInterpolationStart;
  87313. }
  87314. /**
  87315. * @param {?} peek
  87316. * @return {?}
  87317. */
  87318. function isExpansionCaseStart(peek) {
  87319. return peek === $EQ || isAsciiLetter(peek) || isDigit(peek);
  87320. }
  87321. /**
  87322. * @param {?} code1
  87323. * @param {?} code2
  87324. * @return {?}
  87325. */
  87326. function compareCharCodeCaseInsensitive(code1, code2) {
  87327. return toUpperCaseCharCode(code1) == toUpperCaseCharCode(code2);
  87328. }
  87329. /**
  87330. * @param {?} code
  87331. * @return {?}
  87332. */
  87333. function toUpperCaseCharCode(code) {
  87334. return code >= $a && code <= $z ? code - $a + $A : code;
  87335. }
  87336. /**
  87337. * @param {?} srcTokens
  87338. * @return {?}
  87339. */
  87340. function mergeTextTokens(srcTokens) {
  87341. var /** @type {?} */ dstTokens = [];
  87342. var /** @type {?} */ lastDstToken = undefined;
  87343. for (var /** @type {?} */ i = 0; i < srcTokens.length; i++) {
  87344. var /** @type {?} */ token = srcTokens[i];
  87345. if (lastDstToken && lastDstToken.type == TokenType$1.TEXT && token.type == TokenType$1.TEXT) {
  87346. lastDstToken.parts[0] += token.parts[0];
  87347. lastDstToken.sourceSpan.end = token.sourceSpan.end;
  87348. }
  87349. else {
  87350. lastDstToken = token;
  87351. dstTokens.push(lastDstToken);
  87352. }
  87353. }
  87354. return dstTokens;
  87355. }
  87356. /**
  87357. * @fileoverview added by tsickle
  87358. * @suppress {checkTypes} checked by tsc
  87359. */
  87360. /**
  87361. * @license
  87362. * Copyright Google Inc. All Rights Reserved.
  87363. *
  87364. * Use of this source code is governed by an MIT-style license that can be
  87365. * found in the LICENSE file at https://angular.io/license
  87366. */
  87367. var TreeError = /** @class */ (function (_super) {
  87368. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(TreeError, _super);
  87369. function TreeError(elementName, span, msg) {
  87370. var _this = _super.call(this, span, msg) || this;
  87371. _this.elementName = elementName;
  87372. return _this;
  87373. }
  87374. /**
  87375. * @param {?} elementName
  87376. * @param {?} span
  87377. * @param {?} msg
  87378. * @return {?}
  87379. */
  87380. TreeError.create = /**
  87381. * @param {?} elementName
  87382. * @param {?} span
  87383. * @param {?} msg
  87384. * @return {?}
  87385. */
  87386. function (elementName, span, msg) {
  87387. return new TreeError(elementName, span, msg);
  87388. };
  87389. return TreeError;
  87390. }(ParseError));
  87391. var ParseTreeResult = /** @class */ (function () {
  87392. function ParseTreeResult(rootNodes, errors) {
  87393. this.rootNodes = rootNodes;
  87394. this.errors = errors;
  87395. }
  87396. return ParseTreeResult;
  87397. }());
  87398. var Parser$1 = /** @class */ (function () {
  87399. function Parser(getTagDefinition) {
  87400. this.getTagDefinition = getTagDefinition;
  87401. }
  87402. /**
  87403. * @param {?} source
  87404. * @param {?} url
  87405. * @param {?=} parseExpansionForms
  87406. * @param {?=} interpolationConfig
  87407. * @return {?}
  87408. */
  87409. Parser.prototype.parse = /**
  87410. * @param {?} source
  87411. * @param {?} url
  87412. * @param {?=} parseExpansionForms
  87413. * @param {?=} interpolationConfig
  87414. * @return {?}
  87415. */
  87416. function (source, url, parseExpansionForms, interpolationConfig) {
  87417. if (parseExpansionForms === void 0) { parseExpansionForms = false; }
  87418. if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }
  87419. var /** @type {?} */ tokensAndErrors = tokenize(source, url, this.getTagDefinition, parseExpansionForms, interpolationConfig);
  87420. var /** @type {?} */ treeAndErrors = new _TreeBuilder(tokensAndErrors.tokens, this.getTagDefinition).build();
  87421. return new ParseTreeResult(treeAndErrors.rootNodes, (/** @type {?} */ (tokensAndErrors.errors)).concat(treeAndErrors.errors));
  87422. };
  87423. return Parser;
  87424. }());
  87425. var _TreeBuilder = /** @class */ (function () {
  87426. function _TreeBuilder(tokens, getTagDefinition) {
  87427. this.tokens = tokens;
  87428. this.getTagDefinition = getTagDefinition;
  87429. this._index = -1;
  87430. this._rootNodes = [];
  87431. this._errors = [];
  87432. this._elementStack = [];
  87433. this._advance();
  87434. }
  87435. /**
  87436. * @return {?}
  87437. */
  87438. _TreeBuilder.prototype.build = /**
  87439. * @return {?}
  87440. */
  87441. function () {
  87442. while (this._peek.type !== TokenType$1.EOF) {
  87443. if (this._peek.type === TokenType$1.TAG_OPEN_START) {
  87444. this._consumeStartTag(this._advance());
  87445. }
  87446. else if (this._peek.type === TokenType$1.TAG_CLOSE) {
  87447. this._consumeEndTag(this._advance());
  87448. }
  87449. else if (this._peek.type === TokenType$1.CDATA_START) {
  87450. this._closeVoidElement();
  87451. this._consumeCdata(this._advance());
  87452. }
  87453. else if (this._peek.type === TokenType$1.COMMENT_START) {
  87454. this._closeVoidElement();
  87455. this._consumeComment(this._advance());
  87456. }
  87457. else if (this._peek.type === TokenType$1.TEXT || this._peek.type === TokenType$1.RAW_TEXT ||
  87458. this._peek.type === TokenType$1.ESCAPABLE_RAW_TEXT) {
  87459. this._closeVoidElement();
  87460. this._consumeText(this._advance());
  87461. }
  87462. else if (this._peek.type === TokenType$1.EXPANSION_FORM_START) {
  87463. this._consumeExpansion(this._advance());
  87464. }
  87465. else {
  87466. // Skip all other tokens...
  87467. this._advance();
  87468. }
  87469. }
  87470. return new ParseTreeResult(this._rootNodes, this._errors);
  87471. };
  87472. /**
  87473. * @return {?}
  87474. */
  87475. _TreeBuilder.prototype._advance = /**
  87476. * @return {?}
  87477. */
  87478. function () {
  87479. var /** @type {?} */ prev = this._peek;
  87480. if (this._index < this.tokens.length - 1) {
  87481. // Note: there is always an EOF token at the end
  87482. this._index++;
  87483. }
  87484. this._peek = this.tokens[this._index];
  87485. return prev;
  87486. };
  87487. /**
  87488. * @param {?} type
  87489. * @return {?}
  87490. */
  87491. _TreeBuilder.prototype._advanceIf = /**
  87492. * @param {?} type
  87493. * @return {?}
  87494. */
  87495. function (type) {
  87496. if (this._peek.type === type) {
  87497. return this._advance();
  87498. }
  87499. return null;
  87500. };
  87501. /**
  87502. * @param {?} startToken
  87503. * @return {?}
  87504. */
  87505. _TreeBuilder.prototype._consumeCdata = /**
  87506. * @param {?} startToken
  87507. * @return {?}
  87508. */
  87509. function (startToken) {
  87510. this._consumeText(this._advance());
  87511. this._advanceIf(TokenType$1.CDATA_END);
  87512. };
  87513. /**
  87514. * @param {?} token
  87515. * @return {?}
  87516. */
  87517. _TreeBuilder.prototype._consumeComment = /**
  87518. * @param {?} token
  87519. * @return {?}
  87520. */
  87521. function (token) {
  87522. var /** @type {?} */ text = this._advanceIf(TokenType$1.RAW_TEXT);
  87523. this._advanceIf(TokenType$1.COMMENT_END);
  87524. var /** @type {?} */ value = text != null ? text.parts[0].trim() : null;
  87525. this._addToParent(new Comment(value, token.sourceSpan));
  87526. };
  87527. /**
  87528. * @param {?} token
  87529. * @return {?}
  87530. */
  87531. _TreeBuilder.prototype._consumeExpansion = /**
  87532. * @param {?} token
  87533. * @return {?}
  87534. */
  87535. function (token) {
  87536. var /** @type {?} */ switchValue = this._advance();
  87537. var /** @type {?} */ type = this._advance();
  87538. var /** @type {?} */ cases = [];
  87539. // read =
  87540. while (this._peek.type === TokenType$1.EXPANSION_CASE_VALUE) {
  87541. var /** @type {?} */ expCase = this._parseExpansionCase();
  87542. if (!expCase)
  87543. return; // error
  87544. cases.push(expCase);
  87545. }
  87546. // read the final }
  87547. if (this._peek.type !== TokenType$1.EXPANSION_FORM_END) {
  87548. this._errors.push(TreeError.create(null, this._peek.sourceSpan, "Invalid ICU message. Missing '}'."));
  87549. return;
  87550. }
  87551. var /** @type {?} */ sourceSpan = new ParseSourceSpan(token.sourceSpan.start, this._peek.sourceSpan.end);
  87552. this._addToParent(new Expansion(switchValue.parts[0], type.parts[0], cases, sourceSpan, switchValue.sourceSpan));
  87553. this._advance();
  87554. };
  87555. /**
  87556. * @return {?}
  87557. */
  87558. _TreeBuilder.prototype._parseExpansionCase = /**
  87559. * @return {?}
  87560. */
  87561. function () {
  87562. var /** @type {?} */ value = this._advance();
  87563. // read {
  87564. if (this._peek.type !== TokenType$1.EXPANSION_CASE_EXP_START) {
  87565. this._errors.push(TreeError.create(null, this._peek.sourceSpan, "Invalid ICU message. Missing '{'."));
  87566. return null;
  87567. }
  87568. // read until }
  87569. var /** @type {?} */ start = this._advance();
  87570. var /** @type {?} */ exp = this._collectExpansionExpTokens(start);
  87571. if (!exp)
  87572. return null;
  87573. var /** @type {?} */ end = this._advance();
  87574. exp.push(new Token$1(TokenType$1.EOF, [], end.sourceSpan));
  87575. // parse everything in between { and }
  87576. var /** @type {?} */ parsedExp = new _TreeBuilder(exp, this.getTagDefinition).build();
  87577. if (parsedExp.errors.length > 0) {
  87578. this._errors = this._errors.concat(/** @type {?} */ (parsedExp.errors));
  87579. return null;
  87580. }
  87581. var /** @type {?} */ sourceSpan = new ParseSourceSpan(value.sourceSpan.start, end.sourceSpan.end);
  87582. var /** @type {?} */ expSourceSpan = new ParseSourceSpan(start.sourceSpan.start, end.sourceSpan.end);
  87583. return new ExpansionCase(value.parts[0], parsedExp.rootNodes, sourceSpan, value.sourceSpan, expSourceSpan);
  87584. };
  87585. /**
  87586. * @param {?} start
  87587. * @return {?}
  87588. */
  87589. _TreeBuilder.prototype._collectExpansionExpTokens = /**
  87590. * @param {?} start
  87591. * @return {?}
  87592. */
  87593. function (start) {
  87594. var /** @type {?} */ exp = [];
  87595. var /** @type {?} */ expansionFormStack = [TokenType$1.EXPANSION_CASE_EXP_START];
  87596. while (true) {
  87597. if (this._peek.type === TokenType$1.EXPANSION_FORM_START ||
  87598. this._peek.type === TokenType$1.EXPANSION_CASE_EXP_START) {
  87599. expansionFormStack.push(this._peek.type);
  87600. }
  87601. if (this._peek.type === TokenType$1.EXPANSION_CASE_EXP_END) {
  87602. if (lastOnStack(expansionFormStack, TokenType$1.EXPANSION_CASE_EXP_START)) {
  87603. expansionFormStack.pop();
  87604. if (expansionFormStack.length == 0)
  87605. return exp;
  87606. }
  87607. else {
  87608. this._errors.push(TreeError.create(null, start.sourceSpan, "Invalid ICU message. Missing '}'."));
  87609. return null;
  87610. }
  87611. }
  87612. if (this._peek.type === TokenType$1.EXPANSION_FORM_END) {
  87613. if (lastOnStack(expansionFormStack, TokenType$1.EXPANSION_FORM_START)) {
  87614. expansionFormStack.pop();
  87615. }
  87616. else {
  87617. this._errors.push(TreeError.create(null, start.sourceSpan, "Invalid ICU message. Missing '}'."));
  87618. return null;
  87619. }
  87620. }
  87621. if (this._peek.type === TokenType$1.EOF) {
  87622. this._errors.push(TreeError.create(null, start.sourceSpan, "Invalid ICU message. Missing '}'."));
  87623. return null;
  87624. }
  87625. exp.push(this._advance());
  87626. }
  87627. };
  87628. /**
  87629. * @param {?} token
  87630. * @return {?}
  87631. */
  87632. _TreeBuilder.prototype._consumeText = /**
  87633. * @param {?} token
  87634. * @return {?}
  87635. */
  87636. function (token) {
  87637. var /** @type {?} */ text = token.parts[0];
  87638. if (text.length > 0 && text[0] == '\n') {
  87639. var /** @type {?} */ parent_1 = this._getParentElement();
  87640. if (parent_1 != null && parent_1.children.length == 0 &&
  87641. this.getTagDefinition(parent_1.name).ignoreFirstLf) {
  87642. text = text.substring(1);
  87643. }
  87644. }
  87645. if (text.length > 0) {
  87646. this._addToParent(new Text(text, token.sourceSpan));
  87647. }
  87648. };
  87649. /**
  87650. * @return {?}
  87651. */
  87652. _TreeBuilder.prototype._closeVoidElement = /**
  87653. * @return {?}
  87654. */
  87655. function () {
  87656. var /** @type {?} */ el = this._getParentElement();
  87657. if (el && this.getTagDefinition(el.name).isVoid) {
  87658. this._elementStack.pop();
  87659. }
  87660. };
  87661. /**
  87662. * @param {?} startTagToken
  87663. * @return {?}
  87664. */
  87665. _TreeBuilder.prototype._consumeStartTag = /**
  87666. * @param {?} startTagToken
  87667. * @return {?}
  87668. */
  87669. function (startTagToken) {
  87670. var /** @type {?} */ prefix = startTagToken.parts[0];
  87671. var /** @type {?} */ name = startTagToken.parts[1];
  87672. var /** @type {?} */ attrs = [];
  87673. while (this._peek.type === TokenType$1.ATTR_NAME) {
  87674. attrs.push(this._consumeAttr(this._advance()));
  87675. }
  87676. var /** @type {?} */ fullName = this._getElementFullName(prefix, name, this._getParentElement());
  87677. var /** @type {?} */ selfClosing = false;
  87678. // Note: There could have been a tokenizer error
  87679. // so that we don't get a token for the end tag...
  87680. if (this._peek.type === TokenType$1.TAG_OPEN_END_VOID) {
  87681. this._advance();
  87682. selfClosing = true;
  87683. var /** @type {?} */ tagDef = this.getTagDefinition(fullName);
  87684. if (!(tagDef.canSelfClose || getNsPrefix(fullName) !== null || tagDef.isVoid)) {
  87685. this._errors.push(TreeError.create(fullName, startTagToken.sourceSpan, "Only void and foreign elements can be self closed \"" + startTagToken.parts[1] + "\""));
  87686. }
  87687. }
  87688. else if (this._peek.type === TokenType$1.TAG_OPEN_END) {
  87689. this._advance();
  87690. selfClosing = false;
  87691. }
  87692. var /** @type {?} */ end = this._peek.sourceSpan.start;
  87693. var /** @type {?} */ span = new ParseSourceSpan(startTagToken.sourceSpan.start, end);
  87694. var /** @type {?} */ el = new Element(fullName, attrs, [], span, span, undefined);
  87695. this._pushElement(el);
  87696. if (selfClosing) {
  87697. this._popElement(fullName);
  87698. el.endSourceSpan = span;
  87699. }
  87700. };
  87701. /**
  87702. * @param {?} el
  87703. * @return {?}
  87704. */
  87705. _TreeBuilder.prototype._pushElement = /**
  87706. * @param {?} el
  87707. * @return {?}
  87708. */
  87709. function (el) {
  87710. var /** @type {?} */ parentEl = this._getParentElement();
  87711. if (parentEl && this.getTagDefinition(parentEl.name).isClosedByChild(el.name)) {
  87712. this._elementStack.pop();
  87713. }
  87714. var /** @type {?} */ tagDef = this.getTagDefinition(el.name);
  87715. var _a = this._getParentElementSkippingContainers(), parent = _a.parent, container = _a.container;
  87716. if (parent && tagDef.requireExtraParent(parent.name)) {
  87717. var /** @type {?} */ newParent = new Element(tagDef.parentToAdd, [], [], el.sourceSpan, el.startSourceSpan, el.endSourceSpan);
  87718. this._insertBeforeContainer(parent, container, newParent);
  87719. }
  87720. this._addToParent(el);
  87721. this._elementStack.push(el);
  87722. };
  87723. /**
  87724. * @param {?} endTagToken
  87725. * @return {?}
  87726. */
  87727. _TreeBuilder.prototype._consumeEndTag = /**
  87728. * @param {?} endTagToken
  87729. * @return {?}
  87730. */
  87731. function (endTagToken) {
  87732. var /** @type {?} */ fullName = this._getElementFullName(endTagToken.parts[0], endTagToken.parts[1], this._getParentElement());
  87733. if (this._getParentElement()) {
  87734. /** @type {?} */ ((this._getParentElement())).endSourceSpan = endTagToken.sourceSpan;
  87735. }
  87736. if (this.getTagDefinition(fullName).isVoid) {
  87737. this._errors.push(TreeError.create(fullName, endTagToken.sourceSpan, "Void elements do not have end tags \"" + endTagToken.parts[1] + "\""));
  87738. }
  87739. else if (!this._popElement(fullName)) {
  87740. var /** @type {?} */ errMsg = "Unexpected closing tag \"" + fullName + "\". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags";
  87741. this._errors.push(TreeError.create(fullName, endTagToken.sourceSpan, errMsg));
  87742. }
  87743. };
  87744. /**
  87745. * @param {?} fullName
  87746. * @return {?}
  87747. */
  87748. _TreeBuilder.prototype._popElement = /**
  87749. * @param {?} fullName
  87750. * @return {?}
  87751. */
  87752. function (fullName) {
  87753. for (var /** @type {?} */ stackIndex = this._elementStack.length - 1; stackIndex >= 0; stackIndex--) {
  87754. var /** @type {?} */ el = this._elementStack[stackIndex];
  87755. if (el.name == fullName) {
  87756. this._elementStack.splice(stackIndex, this._elementStack.length - stackIndex);
  87757. return true;
  87758. }
  87759. if (!this.getTagDefinition(el.name).closedByParent) {
  87760. return false;
  87761. }
  87762. }
  87763. return false;
  87764. };
  87765. /**
  87766. * @param {?} attrName
  87767. * @return {?}
  87768. */
  87769. _TreeBuilder.prototype._consumeAttr = /**
  87770. * @param {?} attrName
  87771. * @return {?}
  87772. */
  87773. function (attrName) {
  87774. var /** @type {?} */ fullName = mergeNsAndName(attrName.parts[0], attrName.parts[1]);
  87775. var /** @type {?} */ end = attrName.sourceSpan.end;
  87776. var /** @type {?} */ value = '';
  87777. var /** @type {?} */ valueSpan = /** @type {?} */ ((undefined));
  87778. if (this._peek.type === TokenType$1.ATTR_VALUE) {
  87779. var /** @type {?} */ valueToken = this._advance();
  87780. value = valueToken.parts[0];
  87781. end = valueToken.sourceSpan.end;
  87782. valueSpan = valueToken.sourceSpan;
  87783. }
  87784. return new Attribute$1(fullName, value, new ParseSourceSpan(attrName.sourceSpan.start, end), valueSpan);
  87785. };
  87786. /**
  87787. * @return {?}
  87788. */
  87789. _TreeBuilder.prototype._getParentElement = /**
  87790. * @return {?}
  87791. */
  87792. function () {
  87793. return this._elementStack.length > 0 ? this._elementStack[this._elementStack.length - 1] : null;
  87794. };
  87795. /**
  87796. * Returns the parent in the DOM and the container.
  87797. *
  87798. * `<ng-container>` elements are skipped as they are not rendered as DOM element.
  87799. * @return {?}
  87800. */
  87801. _TreeBuilder.prototype._getParentElementSkippingContainers = /**
  87802. * Returns the parent in the DOM and the container.
  87803. *
  87804. * `<ng-container>` elements are skipped as they are not rendered as DOM element.
  87805. * @return {?}
  87806. */
  87807. function () {
  87808. var /** @type {?} */ container = null;
  87809. for (var /** @type {?} */ i = this._elementStack.length - 1; i >= 0; i--) {
  87810. if (!isNgContainer(this._elementStack[i].name)) {
  87811. return { parent: this._elementStack[i], container: container };
  87812. }
  87813. container = this._elementStack[i];
  87814. }
  87815. return { parent: null, container: container };
  87816. };
  87817. /**
  87818. * @param {?} node
  87819. * @return {?}
  87820. */
  87821. _TreeBuilder.prototype._addToParent = /**
  87822. * @param {?} node
  87823. * @return {?}
  87824. */
  87825. function (node) {
  87826. var /** @type {?} */ parent = this._getParentElement();
  87827. if (parent != null) {
  87828. parent.children.push(node);
  87829. }
  87830. else {
  87831. this._rootNodes.push(node);
  87832. }
  87833. };
  87834. /**
  87835. * Insert a node between the parent and the container.
  87836. * When no container is given, the node is appended as a child of the parent.
  87837. * Also updates the element stack accordingly.
  87838. *
  87839. * \@internal
  87840. * @param {?} parent
  87841. * @param {?} container
  87842. * @param {?} node
  87843. * @return {?}
  87844. */
  87845. _TreeBuilder.prototype._insertBeforeContainer = /**
  87846. * Insert a node between the parent and the container.
  87847. * When no container is given, the node is appended as a child of the parent.
  87848. * Also updates the element stack accordingly.
  87849. *
  87850. * \@internal
  87851. * @param {?} parent
  87852. * @param {?} container
  87853. * @param {?} node
  87854. * @return {?}
  87855. */
  87856. function (parent, container, node) {
  87857. if (!container) {
  87858. this._addToParent(node);
  87859. this._elementStack.push(node);
  87860. }
  87861. else {
  87862. if (parent) {
  87863. // replace the container with the new node in the children
  87864. var /** @type {?} */ index = parent.children.indexOf(container);
  87865. parent.children[index] = node;
  87866. }
  87867. else {
  87868. this._rootNodes.push(node);
  87869. }
  87870. node.children.push(container);
  87871. this._elementStack.splice(this._elementStack.indexOf(container), 0, node);
  87872. }
  87873. };
  87874. /**
  87875. * @param {?} prefix
  87876. * @param {?} localName
  87877. * @param {?} parentElement
  87878. * @return {?}
  87879. */
  87880. _TreeBuilder.prototype._getElementFullName = /**
  87881. * @param {?} prefix
  87882. * @param {?} localName
  87883. * @param {?} parentElement
  87884. * @return {?}
  87885. */
  87886. function (prefix, localName, parentElement) {
  87887. if (prefix == null) {
  87888. prefix = /** @type {?} */ ((this.getTagDefinition(localName).implicitNamespacePrefix));
  87889. if (prefix == null && parentElement != null) {
  87890. prefix = getNsPrefix(parentElement.name);
  87891. }
  87892. }
  87893. return mergeNsAndName(prefix, localName);
  87894. };
  87895. return _TreeBuilder;
  87896. }());
  87897. /**
  87898. * @param {?} stack
  87899. * @param {?} element
  87900. * @return {?}
  87901. */
  87902. function lastOnStack(stack, element) {
  87903. return stack.length > 0 && stack[stack.length - 1] === element;
  87904. }
  87905. /**
  87906. * @fileoverview added by tsickle
  87907. * @suppress {checkTypes} checked by tsc
  87908. */
  87909. /**
  87910. * @license
  87911. * Copyright Google Inc. All Rights Reserved.
  87912. *
  87913. * Use of this source code is governed by an MIT-style license that can be
  87914. * found in the LICENSE file at https://angular.io/license
  87915. */
  87916. /**
  87917. * @param {?} message
  87918. * @return {?}
  87919. */
  87920. function digest(message) {
  87921. return message.id || sha1(serializeNodes(message.nodes).join('') + ("[" + message.meaning + "]"));
  87922. }
  87923. /**
  87924. * @param {?} message
  87925. * @return {?}
  87926. */
  87927. function decimalDigest(message) {
  87928. if (message.id) {
  87929. return message.id;
  87930. }
  87931. var /** @type {?} */ visitor = new _SerializerIgnoreIcuExpVisitor();
  87932. var /** @type {?} */ parts = message.nodes.map(function (a) { return a.visit(visitor, null); });
  87933. return computeMsgId(parts.join(''), message.meaning);
  87934. }
  87935. /**
  87936. * Serialize the i18n ast to something xml-like in order to generate an UID.
  87937. *
  87938. * The visitor is also used in the i18n parser tests
  87939. *
  87940. * \@internal
  87941. */
  87942. var _SerializerVisitor = /** @class */ (function () {
  87943. function _SerializerVisitor() {
  87944. }
  87945. /**
  87946. * @param {?} text
  87947. * @param {?} context
  87948. * @return {?}
  87949. */
  87950. _SerializerVisitor.prototype.visitText = /**
  87951. * @param {?} text
  87952. * @param {?} context
  87953. * @return {?}
  87954. */
  87955. function (text, context) { return text.value; };
  87956. /**
  87957. * @param {?} container
  87958. * @param {?} context
  87959. * @return {?}
  87960. */
  87961. _SerializerVisitor.prototype.visitContainer = /**
  87962. * @param {?} container
  87963. * @param {?} context
  87964. * @return {?}
  87965. */
  87966. function (container, context) {
  87967. var _this = this;
  87968. return "[" + container.children.map(function (child) { return child.visit(_this); }).join(', ') + "]";
  87969. };
  87970. /**
  87971. * @param {?} icu
  87972. * @param {?} context
  87973. * @return {?}
  87974. */
  87975. _SerializerVisitor.prototype.visitIcu = /**
  87976. * @param {?} icu
  87977. * @param {?} context
  87978. * @return {?}
  87979. */
  87980. function (icu, context) {
  87981. var _this = this;
  87982. var /** @type {?} */ strCases = Object.keys(icu.cases).map(function (k) { return k + " {" + icu.cases[k].visit(_this) + "}"; });
  87983. return "{" + icu.expression + ", " + icu.type + ", " + strCases.join(', ') + "}";
  87984. };
  87985. /**
  87986. * @param {?} ph
  87987. * @param {?} context
  87988. * @return {?}
  87989. */
  87990. _SerializerVisitor.prototype.visitTagPlaceholder = /**
  87991. * @param {?} ph
  87992. * @param {?} context
  87993. * @return {?}
  87994. */
  87995. function (ph, context) {
  87996. var _this = this;
  87997. return ph.isVoid ?
  87998. "<ph tag name=\"" + ph.startName + "\"/>" :
  87999. "<ph tag name=\"" + ph.startName + "\">" + ph.children.map(function (child) { return child.visit(_this); }).join(', ') + "</ph name=\"" + ph.closeName + "\">";
  88000. };
  88001. /**
  88002. * @param {?} ph
  88003. * @param {?} context
  88004. * @return {?}
  88005. */
  88006. _SerializerVisitor.prototype.visitPlaceholder = /**
  88007. * @param {?} ph
  88008. * @param {?} context
  88009. * @return {?}
  88010. */
  88011. function (ph, context) {
  88012. return ph.value ? "<ph name=\"" + ph.name + "\">" + ph.value + "</ph>" : "<ph name=\"" + ph.name + "\"/>";
  88013. };
  88014. /**
  88015. * @param {?} ph
  88016. * @param {?=} context
  88017. * @return {?}
  88018. */
  88019. _SerializerVisitor.prototype.visitIcuPlaceholder = /**
  88020. * @param {?} ph
  88021. * @param {?=} context
  88022. * @return {?}
  88023. */
  88024. function (ph, context) {
  88025. return "<ph icu name=\"" + ph.name + "\">" + ph.value.visit(this) + "</ph>";
  88026. };
  88027. return _SerializerVisitor;
  88028. }());
  88029. var serializerVisitor = new _SerializerVisitor();
  88030. /**
  88031. * @param {?} nodes
  88032. * @return {?}
  88033. */
  88034. function serializeNodes(nodes) {
  88035. return nodes.map(function (a) { return a.visit(serializerVisitor, null); });
  88036. }
  88037. /**
  88038. * Serialize the i18n ast to something xml-like in order to generate an UID.
  88039. *
  88040. * Ignore the ICU expressions so that message IDs stays identical if only the expression changes.
  88041. *
  88042. * \@internal
  88043. */
  88044. var _SerializerIgnoreIcuExpVisitor = /** @class */ (function (_super) {
  88045. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(_SerializerIgnoreIcuExpVisitor, _super);
  88046. function _SerializerIgnoreIcuExpVisitor() {
  88047. return _super !== null && _super.apply(this, arguments) || this;
  88048. }
  88049. /**
  88050. * @param {?} icu
  88051. * @param {?} context
  88052. * @return {?}
  88053. */
  88054. _SerializerIgnoreIcuExpVisitor.prototype.visitIcu = /**
  88055. * @param {?} icu
  88056. * @param {?} context
  88057. * @return {?}
  88058. */
  88059. function (icu, context) {
  88060. var _this = this;
  88061. var /** @type {?} */ strCases = Object.keys(icu.cases).map(function (k) { return k + " {" + icu.cases[k].visit(_this) + "}"; });
  88062. // Do not take the expression into account
  88063. return "{" + icu.type + ", " + strCases.join(', ') + "}";
  88064. };
  88065. return _SerializerIgnoreIcuExpVisitor;
  88066. }(_SerializerVisitor));
  88067. /**
  88068. * Compute the SHA1 of the given string
  88069. *
  88070. * see http://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf
  88071. *
  88072. * WARNING: this function has not been designed not tested with security in mind.
  88073. * DO NOT USE IT IN A SECURITY SENSITIVE CONTEXT.
  88074. * @param {?} str
  88075. * @return {?}
  88076. */
  88077. function sha1(str) {
  88078. var /** @type {?} */ utf8 = utf8Encode(str);
  88079. var /** @type {?} */ words32 = stringToWords32(utf8, Endian.Big);
  88080. var /** @type {?} */ len = utf8.length * 8;
  88081. var /** @type {?} */ w = new Array(80);
  88082. var _a = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0], a = _a[0], b = _a[1], c = _a[2], d = _a[3], e = _a[4];
  88083. words32[len >> 5] |= 0x80 << (24 - len % 32);
  88084. words32[((len + 64 >> 9) << 4) + 15] = len;
  88085. for (var /** @type {?} */ i = 0; i < words32.length; i += 16) {
  88086. var _b = [a, b, c, d, e], h0 = _b[0], h1 = _b[1], h2 = _b[2], h3 = _b[3], h4 = _b[4];
  88087. for (var /** @type {?} */ j = 0; j < 80; j++) {
  88088. if (j < 16) {
  88089. w[j] = words32[i + j];
  88090. }
  88091. else {
  88092. w[j] = rol32(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1);
  88093. }
  88094. var _c = fk(j, b, c, d), f = _c[0], k = _c[1];
  88095. var /** @type {?} */ temp = [rol32(a, 5), f, e, k, w[j]].reduce(add32);
  88096. _d = [d, c, rol32(b, 30), a, temp], e = _d[0], d = _d[1], c = _d[2], b = _d[3], a = _d[4];
  88097. }
  88098. _e = [add32(a, h0), add32(b, h1), add32(c, h2), add32(d, h3), add32(e, h4)], a = _e[0], b = _e[1], c = _e[2], d = _e[3], e = _e[4];
  88099. }
  88100. return byteStringToHexString(words32ToByteString([a, b, c, d, e]));
  88101. var _d, _e;
  88102. }
  88103. /**
  88104. * @param {?} index
  88105. * @param {?} b
  88106. * @param {?} c
  88107. * @param {?} d
  88108. * @return {?}
  88109. */
  88110. function fk(index, b, c, d) {
  88111. if (index < 20) {
  88112. return [(b & c) | (~b & d), 0x5a827999];
  88113. }
  88114. if (index < 40) {
  88115. return [b ^ c ^ d, 0x6ed9eba1];
  88116. }
  88117. if (index < 60) {
  88118. return [(b & c) | (b & d) | (c & d), 0x8f1bbcdc];
  88119. }
  88120. return [b ^ c ^ d, 0xca62c1d6];
  88121. }
  88122. /**
  88123. * Compute the fingerprint of the given string
  88124. *
  88125. * The output is 64 bit number encoded as a decimal string
  88126. *
  88127. * based on:
  88128. * https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/GoogleJsMessageIdGenerator.java
  88129. * @param {?} str
  88130. * @return {?}
  88131. */
  88132. function fingerprint(str) {
  88133. var /** @type {?} */ utf8 = utf8Encode(str);
  88134. var _a = [hash32(utf8, 0), hash32(utf8, 102072)], hi = _a[0], lo = _a[1];
  88135. if (hi == 0 && (lo == 0 || lo == 1)) {
  88136. hi = hi ^ 0x130f9bef;
  88137. lo = lo ^ -0x6b5f56d8;
  88138. }
  88139. return [hi, lo];
  88140. }
  88141. /**
  88142. * @param {?} msg
  88143. * @param {?} meaning
  88144. * @return {?}
  88145. */
  88146. function computeMsgId(msg, meaning) {
  88147. var _a = fingerprint(msg), hi = _a[0], lo = _a[1];
  88148. if (meaning) {
  88149. var _b = fingerprint(meaning), him = _b[0], lom = _b[1];
  88150. _c = add64(rol64([hi, lo], 1), [him, lom]), hi = _c[0], lo = _c[1];
  88151. }
  88152. return byteStringToDecString(words32ToByteString([hi & 0x7fffffff, lo]));
  88153. var _c;
  88154. }
  88155. /**
  88156. * @param {?} str
  88157. * @param {?} c
  88158. * @return {?}
  88159. */
  88160. function hash32(str, c) {
  88161. var _a = [0x9e3779b9, 0x9e3779b9], a = _a[0], b = _a[1];
  88162. var /** @type {?} */ i;
  88163. var /** @type {?} */ len = str.length;
  88164. for (i = 0; i + 12 <= len; i += 12) {
  88165. a = add32(a, wordAt(str, i, Endian.Little));
  88166. b = add32(b, wordAt(str, i + 4, Endian.Little));
  88167. c = add32(c, wordAt(str, i + 8, Endian.Little));
  88168. _b = mix([a, b, c]), a = _b[0], b = _b[1], c = _b[2];
  88169. }
  88170. a = add32(a, wordAt(str, i, Endian.Little));
  88171. b = add32(b, wordAt(str, i + 4, Endian.Little));
  88172. // the first byte of c is reserved for the length
  88173. c = add32(c, len);
  88174. c = add32(c, wordAt(str, i + 8, Endian.Little) << 8);
  88175. return mix([a, b, c])[2];
  88176. var _b;
  88177. }
  88178. /**
  88179. * @param {?} __0
  88180. * @return {?}
  88181. */
  88182. function mix(_a) {
  88183. var a = _a[0], b = _a[1], c = _a[2];
  88184. a = sub32(a, b);
  88185. a = sub32(a, c);
  88186. a ^= c >>> 13;
  88187. b = sub32(b, c);
  88188. b = sub32(b, a);
  88189. b ^= a << 8;
  88190. c = sub32(c, a);
  88191. c = sub32(c, b);
  88192. c ^= b >>> 13;
  88193. a = sub32(a, b);
  88194. a = sub32(a, c);
  88195. a ^= c >>> 12;
  88196. b = sub32(b, c);
  88197. b = sub32(b, a);
  88198. b ^= a << 16;
  88199. c = sub32(c, a);
  88200. c = sub32(c, b);
  88201. c ^= b >>> 5;
  88202. a = sub32(a, b);
  88203. a = sub32(a, c);
  88204. a ^= c >>> 3;
  88205. b = sub32(b, c);
  88206. b = sub32(b, a);
  88207. b ^= a << 10;
  88208. c = sub32(c, a);
  88209. c = sub32(c, b);
  88210. c ^= b >>> 15;
  88211. return [a, b, c];
  88212. }
  88213. /** @enum {number} */
  88214. var Endian = {
  88215. Little: 0,
  88216. Big: 1,
  88217. };
  88218. Endian[Endian.Little] = "Little";
  88219. Endian[Endian.Big] = "Big";
  88220. /**
  88221. * @param {?} a
  88222. * @param {?} b
  88223. * @return {?}
  88224. */
  88225. function add32(a, b) {
  88226. return add32to64(a, b)[1];
  88227. }
  88228. /**
  88229. * @param {?} a
  88230. * @param {?} b
  88231. * @return {?}
  88232. */
  88233. function add32to64(a, b) {
  88234. var /** @type {?} */ low = (a & 0xffff) + (b & 0xffff);
  88235. var /** @type {?} */ high = (a >>> 16) + (b >>> 16) + (low >>> 16);
  88236. return [high >>> 16, (high << 16) | (low & 0xffff)];
  88237. }
  88238. /**
  88239. * @param {?} __0
  88240. * @param {?} __1
  88241. * @return {?}
  88242. */
  88243. function add64(_a, _b) {
  88244. var ah = _a[0], al = _a[1];
  88245. var bh = _b[0], bl = _b[1];
  88246. var _c = add32to64(al, bl), carry = _c[0], l = _c[1];
  88247. var /** @type {?} */ h = add32(add32(ah, bh), carry);
  88248. return [h, l];
  88249. }
  88250. /**
  88251. * @param {?} a
  88252. * @param {?} b
  88253. * @return {?}
  88254. */
  88255. function sub32(a, b) {
  88256. var /** @type {?} */ low = (a & 0xffff) - (b & 0xffff);
  88257. var /** @type {?} */ high = (a >> 16) - (b >> 16) + (low >> 16);
  88258. return (high << 16) | (low & 0xffff);
  88259. }
  88260. /**
  88261. * @param {?} a
  88262. * @param {?} count
  88263. * @return {?}
  88264. */
  88265. function rol32(a, count) {
  88266. return (a << count) | (a >>> (32 - count));
  88267. }
  88268. /**
  88269. * @param {?} __0
  88270. * @param {?} count
  88271. * @return {?}
  88272. */
  88273. function rol64(_a, count) {
  88274. var hi = _a[0], lo = _a[1];
  88275. var /** @type {?} */ h = (hi << count) | (lo >>> (32 - count));
  88276. var /** @type {?} */ l = (lo << count) | (hi >>> (32 - count));
  88277. return [h, l];
  88278. }
  88279. /**
  88280. * @param {?} str
  88281. * @param {?} endian
  88282. * @return {?}
  88283. */
  88284. function stringToWords32(str, endian) {
  88285. var /** @type {?} */ words32 = Array((str.length + 3) >>> 2);
  88286. for (var /** @type {?} */ i = 0; i < words32.length; i++) {
  88287. words32[i] = wordAt(str, i * 4, endian);
  88288. }
  88289. return words32;
  88290. }
  88291. /**
  88292. * @param {?} str
  88293. * @param {?} index
  88294. * @return {?}
  88295. */
  88296. function byteAt(str, index) {
  88297. return index >= str.length ? 0 : str.charCodeAt(index) & 0xff;
  88298. }
  88299. /**
  88300. * @param {?} str
  88301. * @param {?} index
  88302. * @param {?} endian
  88303. * @return {?}
  88304. */
  88305. function wordAt(str, index, endian) {
  88306. var /** @type {?} */ word = 0;
  88307. if (endian === Endian.Big) {
  88308. for (var /** @type {?} */ i = 0; i < 4; i++) {
  88309. word += byteAt(str, index + i) << (24 - 8 * i);
  88310. }
  88311. }
  88312. else {
  88313. for (var /** @type {?} */ i = 0; i < 4; i++) {
  88314. word += byteAt(str, index + i) << 8 * i;
  88315. }
  88316. }
  88317. return word;
  88318. }
  88319. /**
  88320. * @param {?} words32
  88321. * @return {?}
  88322. */
  88323. function words32ToByteString(words32) {
  88324. return words32.reduce(function (str, word) { return str + word32ToByteString(word); }, '');
  88325. }
  88326. /**
  88327. * @param {?} word
  88328. * @return {?}
  88329. */
  88330. function word32ToByteString(word) {
  88331. var /** @type {?} */ str = '';
  88332. for (var /** @type {?} */ i = 0; i < 4; i++) {
  88333. str += String.fromCharCode((word >>> 8 * (3 - i)) & 0xff);
  88334. }
  88335. return str;
  88336. }
  88337. /**
  88338. * @param {?} str
  88339. * @return {?}
  88340. */
  88341. function byteStringToHexString(str) {
  88342. var /** @type {?} */ hex = '';
  88343. for (var /** @type {?} */ i = 0; i < str.length; i++) {
  88344. var /** @type {?} */ b = byteAt(str, i);
  88345. hex += (b >>> 4).toString(16) + (b & 0x0f).toString(16);
  88346. }
  88347. return hex.toLowerCase();
  88348. }
  88349. /**
  88350. * @param {?} str
  88351. * @return {?}
  88352. */
  88353. function byteStringToDecString(str) {
  88354. var /** @type {?} */ decimal = '';
  88355. var /** @type {?} */ toThePower = '1';
  88356. for (var /** @type {?} */ i = str.length - 1; i >= 0; i--) {
  88357. decimal = addBigInt(decimal, numberTimesBigInt(byteAt(str, i), toThePower));
  88358. toThePower = numberTimesBigInt(256, toThePower);
  88359. }
  88360. return decimal.split('').reverse().join('');
  88361. }
  88362. /**
  88363. * @param {?} x
  88364. * @param {?} y
  88365. * @return {?}
  88366. */
  88367. function addBigInt(x, y) {
  88368. var /** @type {?} */ sum = '';
  88369. var /** @type {?} */ len = Math.max(x.length, y.length);
  88370. for (var /** @type {?} */ i = 0, /** @type {?} */ carry = 0; i < len || carry; i++) {
  88371. var /** @type {?} */ tmpSum = carry + +(x[i] || 0) + +(y[i] || 0);
  88372. if (tmpSum >= 10) {
  88373. carry = 1;
  88374. sum += tmpSum - 10;
  88375. }
  88376. else {
  88377. carry = 0;
  88378. sum += tmpSum;
  88379. }
  88380. }
  88381. return sum;
  88382. }
  88383. /**
  88384. * @param {?} num
  88385. * @param {?} b
  88386. * @return {?}
  88387. */
  88388. function numberTimesBigInt(num, b) {
  88389. var /** @type {?} */ product = '';
  88390. var /** @type {?} */ bToThePower = b;
  88391. for (; num !== 0; num = num >>> 1) {
  88392. if (num & 1)
  88393. product = addBigInt(product, bToThePower);
  88394. bToThePower = addBigInt(bToThePower, bToThePower);
  88395. }
  88396. return product;
  88397. }
  88398. /**
  88399. * @fileoverview added by tsickle
  88400. * @suppress {checkTypes} checked by tsc
  88401. */
  88402. /**
  88403. * @license
  88404. * Copyright Google Inc. All Rights Reserved.
  88405. *
  88406. * Use of this source code is governed by an MIT-style license that can be
  88407. * found in the LICENSE file at https://angular.io/license
  88408. */
  88409. var Message = /** @class */ (function () {
  88410. /**
  88411. * @param nodes message AST
  88412. * @param placeholders maps placeholder names to static content
  88413. * @param placeholderToMessage maps placeholder names to messages (used for nested ICU messages)
  88414. * @param meaning
  88415. * @param description
  88416. * @param id
  88417. */
  88418. function Message(nodes, placeholders, placeholderToMessage, meaning, description, id) {
  88419. this.nodes = nodes;
  88420. this.placeholders = placeholders;
  88421. this.placeholderToMessage = placeholderToMessage;
  88422. this.meaning = meaning;
  88423. this.description = description;
  88424. this.id = id;
  88425. if (nodes.length) {
  88426. this.sources = [{
  88427. filePath: nodes[0].sourceSpan.start.file.url,
  88428. startLine: nodes[0].sourceSpan.start.line + 1,
  88429. startCol: nodes[0].sourceSpan.start.col + 1,
  88430. endLine: nodes[nodes.length - 1].sourceSpan.end.line + 1,
  88431. endCol: nodes[0].sourceSpan.start.col + 1
  88432. }];
  88433. }
  88434. else {
  88435. this.sources = [];
  88436. }
  88437. }
  88438. return Message;
  88439. }());
  88440. /**
  88441. * @record
  88442. */
  88443. /**
  88444. * @record
  88445. */
  88446. var Text$1 = /** @class */ (function () {
  88447. function Text(value, sourceSpan) {
  88448. this.value = value;
  88449. this.sourceSpan = sourceSpan;
  88450. }
  88451. /**
  88452. * @param {?} visitor
  88453. * @param {?=} context
  88454. * @return {?}
  88455. */
  88456. Text.prototype.visit = /**
  88457. * @param {?} visitor
  88458. * @param {?=} context
  88459. * @return {?}
  88460. */
  88461. function (visitor, context) { return visitor.visitText(this, context); };
  88462. return Text;
  88463. }());
  88464. var Container = /** @class */ (function () {
  88465. function Container(children, sourceSpan) {
  88466. this.children = children;
  88467. this.sourceSpan = sourceSpan;
  88468. }
  88469. /**
  88470. * @param {?} visitor
  88471. * @param {?=} context
  88472. * @return {?}
  88473. */
  88474. Container.prototype.visit = /**
  88475. * @param {?} visitor
  88476. * @param {?=} context
  88477. * @return {?}
  88478. */
  88479. function (visitor, context) { return visitor.visitContainer(this, context); };
  88480. return Container;
  88481. }());
  88482. var Icu = /** @class */ (function () {
  88483. function Icu(expression, type, cases, sourceSpan) {
  88484. this.expression = expression;
  88485. this.type = type;
  88486. this.cases = cases;
  88487. this.sourceSpan = sourceSpan;
  88488. }
  88489. /**
  88490. * @param {?} visitor
  88491. * @param {?=} context
  88492. * @return {?}
  88493. */
  88494. Icu.prototype.visit = /**
  88495. * @param {?} visitor
  88496. * @param {?=} context
  88497. * @return {?}
  88498. */
  88499. function (visitor, context) { return visitor.visitIcu(this, context); };
  88500. return Icu;
  88501. }());
  88502. var TagPlaceholder = /** @class */ (function () {
  88503. function TagPlaceholder(tag, attrs, startName, closeName, children, isVoid, sourceSpan) {
  88504. this.tag = tag;
  88505. this.attrs = attrs;
  88506. this.startName = startName;
  88507. this.closeName = closeName;
  88508. this.children = children;
  88509. this.isVoid = isVoid;
  88510. this.sourceSpan = sourceSpan;
  88511. }
  88512. /**
  88513. * @param {?} visitor
  88514. * @param {?=} context
  88515. * @return {?}
  88516. */
  88517. TagPlaceholder.prototype.visit = /**
  88518. * @param {?} visitor
  88519. * @param {?=} context
  88520. * @return {?}
  88521. */
  88522. function (visitor, context) { return visitor.visitTagPlaceholder(this, context); };
  88523. return TagPlaceholder;
  88524. }());
  88525. var Placeholder = /** @class */ (function () {
  88526. function Placeholder(value, name, sourceSpan) {
  88527. this.value = value;
  88528. this.name = name;
  88529. this.sourceSpan = sourceSpan;
  88530. }
  88531. /**
  88532. * @param {?} visitor
  88533. * @param {?=} context
  88534. * @return {?}
  88535. */
  88536. Placeholder.prototype.visit = /**
  88537. * @param {?} visitor
  88538. * @param {?=} context
  88539. * @return {?}
  88540. */
  88541. function (visitor, context) { return visitor.visitPlaceholder(this, context); };
  88542. return Placeholder;
  88543. }());
  88544. var IcuPlaceholder = /** @class */ (function () {
  88545. function IcuPlaceholder(value, name, sourceSpan) {
  88546. this.value = value;
  88547. this.name = name;
  88548. this.sourceSpan = sourceSpan;
  88549. }
  88550. /**
  88551. * @param {?} visitor
  88552. * @param {?=} context
  88553. * @return {?}
  88554. */
  88555. IcuPlaceholder.prototype.visit = /**
  88556. * @param {?} visitor
  88557. * @param {?=} context
  88558. * @return {?}
  88559. */
  88560. function (visitor, context) { return visitor.visitIcuPlaceholder(this, context); };
  88561. return IcuPlaceholder;
  88562. }());
  88563. /**
  88564. * @record
  88565. */
  88566. var CloneVisitor = /** @class */ (function () {
  88567. function CloneVisitor() {
  88568. }
  88569. /**
  88570. * @param {?} text
  88571. * @param {?=} context
  88572. * @return {?}
  88573. */
  88574. CloneVisitor.prototype.visitText = /**
  88575. * @param {?} text
  88576. * @param {?=} context
  88577. * @return {?}
  88578. */
  88579. function (text, context) { return new Text$1(text.value, text.sourceSpan); };
  88580. /**
  88581. * @param {?} container
  88582. * @param {?=} context
  88583. * @return {?}
  88584. */
  88585. CloneVisitor.prototype.visitContainer = /**
  88586. * @param {?} container
  88587. * @param {?=} context
  88588. * @return {?}
  88589. */
  88590. function (container, context) {
  88591. var _this = this;
  88592. var /** @type {?} */ children = container.children.map(function (n) { return n.visit(_this, context); });
  88593. return new Container(children, container.sourceSpan);
  88594. };
  88595. /**
  88596. * @param {?} icu
  88597. * @param {?=} context
  88598. * @return {?}
  88599. */
  88600. CloneVisitor.prototype.visitIcu = /**
  88601. * @param {?} icu
  88602. * @param {?=} context
  88603. * @return {?}
  88604. */
  88605. function (icu, context) {
  88606. var _this = this;
  88607. var /** @type {?} */ cases = {};
  88608. Object.keys(icu.cases).forEach(function (key) { return cases[key] = icu.cases[key].visit(_this, context); });
  88609. var /** @type {?} */ msg = new Icu(icu.expression, icu.type, cases, icu.sourceSpan);
  88610. msg.expressionPlaceholder = icu.expressionPlaceholder;
  88611. return msg;
  88612. };
  88613. /**
  88614. * @param {?} ph
  88615. * @param {?=} context
  88616. * @return {?}
  88617. */
  88618. CloneVisitor.prototype.visitTagPlaceholder = /**
  88619. * @param {?} ph
  88620. * @param {?=} context
  88621. * @return {?}
  88622. */
  88623. function (ph, context) {
  88624. var _this = this;
  88625. var /** @type {?} */ children = ph.children.map(function (n) { return n.visit(_this, context); });
  88626. return new TagPlaceholder(ph.tag, ph.attrs, ph.startName, ph.closeName, children, ph.isVoid, ph.sourceSpan);
  88627. };
  88628. /**
  88629. * @param {?} ph
  88630. * @param {?=} context
  88631. * @return {?}
  88632. */
  88633. CloneVisitor.prototype.visitPlaceholder = /**
  88634. * @param {?} ph
  88635. * @param {?=} context
  88636. * @return {?}
  88637. */
  88638. function (ph, context) {
  88639. return new Placeholder(ph.value, ph.name, ph.sourceSpan);
  88640. };
  88641. /**
  88642. * @param {?} ph
  88643. * @param {?=} context
  88644. * @return {?}
  88645. */
  88646. CloneVisitor.prototype.visitIcuPlaceholder = /**
  88647. * @param {?} ph
  88648. * @param {?=} context
  88649. * @return {?}
  88650. */
  88651. function (ph, context) {
  88652. return new IcuPlaceholder(ph.value, ph.name, ph.sourceSpan);
  88653. };
  88654. return CloneVisitor;
  88655. }());
  88656. var RecurseVisitor = /** @class */ (function () {
  88657. function RecurseVisitor() {
  88658. }
  88659. /**
  88660. * @param {?} text
  88661. * @param {?=} context
  88662. * @return {?}
  88663. */
  88664. RecurseVisitor.prototype.visitText = /**
  88665. * @param {?} text
  88666. * @param {?=} context
  88667. * @return {?}
  88668. */
  88669. function (text, context) { };
  88670. /**
  88671. * @param {?} container
  88672. * @param {?=} context
  88673. * @return {?}
  88674. */
  88675. RecurseVisitor.prototype.visitContainer = /**
  88676. * @param {?} container
  88677. * @param {?=} context
  88678. * @return {?}
  88679. */
  88680. function (container, context) {
  88681. var _this = this;
  88682. container.children.forEach(function (child) { return child.visit(_this); });
  88683. };
  88684. /**
  88685. * @param {?} icu
  88686. * @param {?=} context
  88687. * @return {?}
  88688. */
  88689. RecurseVisitor.prototype.visitIcu = /**
  88690. * @param {?} icu
  88691. * @param {?=} context
  88692. * @return {?}
  88693. */
  88694. function (icu, context) {
  88695. var _this = this;
  88696. Object.keys(icu.cases).forEach(function (k) { icu.cases[k].visit(_this); });
  88697. };
  88698. /**
  88699. * @param {?} ph
  88700. * @param {?=} context
  88701. * @return {?}
  88702. */
  88703. RecurseVisitor.prototype.visitTagPlaceholder = /**
  88704. * @param {?} ph
  88705. * @param {?=} context
  88706. * @return {?}
  88707. */
  88708. function (ph, context) {
  88709. var _this = this;
  88710. ph.children.forEach(function (child) { return child.visit(_this); });
  88711. };
  88712. /**
  88713. * @param {?} ph
  88714. * @param {?=} context
  88715. * @return {?}
  88716. */
  88717. RecurseVisitor.prototype.visitPlaceholder = /**
  88718. * @param {?} ph
  88719. * @param {?=} context
  88720. * @return {?}
  88721. */
  88722. function (ph, context) { };
  88723. /**
  88724. * @param {?} ph
  88725. * @param {?=} context
  88726. * @return {?}
  88727. */
  88728. RecurseVisitor.prototype.visitIcuPlaceholder = /**
  88729. * @param {?} ph
  88730. * @param {?=} context
  88731. * @return {?}
  88732. */
  88733. function (ph, context) { };
  88734. return RecurseVisitor;
  88735. }());
  88736. /**
  88737. * @fileoverview added by tsickle
  88738. * @suppress {checkTypes} checked by tsc
  88739. */
  88740. /**
  88741. * @license
  88742. * Copyright Google Inc. All Rights Reserved.
  88743. *
  88744. * Use of this source code is governed by an MIT-style license that can be
  88745. * found in the LICENSE file at https://angular.io/license
  88746. */
  88747. var HtmlTagDefinition = /** @class */ (function () {
  88748. function HtmlTagDefinition(_a) {
  88749. var _b = _a === void 0 ? {} : _a, closedByChildren = _b.closedByChildren, requiredParents = _b.requiredParents, implicitNamespacePrefix = _b.implicitNamespacePrefix, _c = _b.contentType, contentType = _c === void 0 ? TagContentType.PARSABLE_DATA : _c, _d = _b.closedByParent, closedByParent = _d === void 0 ? false : _d, _e = _b.isVoid, isVoid = _e === void 0 ? false : _e, _f = _b.ignoreFirstLf, ignoreFirstLf = _f === void 0 ? false : _f;
  88750. var _this = this;
  88751. this.closedByChildren = {};
  88752. this.closedByParent = false;
  88753. this.canSelfClose = false;
  88754. if (closedByChildren && closedByChildren.length > 0) {
  88755. closedByChildren.forEach(function (tagName) { return _this.closedByChildren[tagName] = true; });
  88756. }
  88757. this.isVoid = isVoid;
  88758. this.closedByParent = closedByParent || isVoid;
  88759. if (requiredParents && requiredParents.length > 0) {
  88760. this.requiredParents = {};
  88761. // The first parent is the list is automatically when none of the listed parents are present
  88762. this.parentToAdd = requiredParents[0];
  88763. requiredParents.forEach(function (tagName) { return _this.requiredParents[tagName] = true; });
  88764. }
  88765. this.implicitNamespacePrefix = implicitNamespacePrefix || null;
  88766. this.contentType = contentType;
  88767. this.ignoreFirstLf = ignoreFirstLf;
  88768. }
  88769. /**
  88770. * @param {?} currentParent
  88771. * @return {?}
  88772. */
  88773. HtmlTagDefinition.prototype.requireExtraParent = /**
  88774. * @param {?} currentParent
  88775. * @return {?}
  88776. */
  88777. function (currentParent) {
  88778. if (!this.requiredParents) {
  88779. return false;
  88780. }
  88781. if (!currentParent) {
  88782. return true;
  88783. }
  88784. var /** @type {?} */ lcParent = currentParent.toLowerCase();
  88785. var /** @type {?} */ isParentTemplate = lcParent === 'template' || currentParent === 'ng-template';
  88786. return !isParentTemplate && this.requiredParents[lcParent] != true;
  88787. };
  88788. /**
  88789. * @param {?} name
  88790. * @return {?}
  88791. */
  88792. HtmlTagDefinition.prototype.isClosedByChild = /**
  88793. * @param {?} name
  88794. * @return {?}
  88795. */
  88796. function (name) {
  88797. return this.isVoid || name.toLowerCase() in this.closedByChildren;
  88798. };
  88799. return HtmlTagDefinition;
  88800. }());
  88801. // see http://www.w3.org/TR/html51/syntax.html#optional-tags
  88802. // This implementation does not fully conform to the HTML5 spec.
  88803. var TAG_DEFINITIONS = {
  88804. 'base': new HtmlTagDefinition({ isVoid: true }),
  88805. 'meta': new HtmlTagDefinition({ isVoid: true }),
  88806. 'area': new HtmlTagDefinition({ isVoid: true }),
  88807. 'embed': new HtmlTagDefinition({ isVoid: true }),
  88808. 'link': new HtmlTagDefinition({ isVoid: true }),
  88809. 'img': new HtmlTagDefinition({ isVoid: true }),
  88810. 'input': new HtmlTagDefinition({ isVoid: true }),
  88811. 'param': new HtmlTagDefinition({ isVoid: true }),
  88812. 'hr': new HtmlTagDefinition({ isVoid: true }),
  88813. 'br': new HtmlTagDefinition({ isVoid: true }),
  88814. 'source': new HtmlTagDefinition({ isVoid: true }),
  88815. 'track': new HtmlTagDefinition({ isVoid: true }),
  88816. 'wbr': new HtmlTagDefinition({ isVoid: true }),
  88817. 'p': new HtmlTagDefinition({
  88818. closedByChildren: [
  88819. 'address', 'article', 'aside', 'blockquote', 'div', 'dl', 'fieldset', 'footer', 'form',
  88820. 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hgroup', 'hr',
  88821. 'main', 'nav', 'ol', 'p', 'pre', 'section', 'table', 'ul'
  88822. ],
  88823. closedByParent: true
  88824. }),
  88825. 'thead': new HtmlTagDefinition({ closedByChildren: ['tbody', 'tfoot'] }),
  88826. 'tbody': new HtmlTagDefinition({ closedByChildren: ['tbody', 'tfoot'], closedByParent: true }),
  88827. 'tfoot': new HtmlTagDefinition({ closedByChildren: ['tbody'], closedByParent: true }),
  88828. 'tr': new HtmlTagDefinition({
  88829. closedByChildren: ['tr'],
  88830. requiredParents: ['tbody', 'tfoot', 'thead'],
  88831. closedByParent: true
  88832. }),
  88833. 'td': new HtmlTagDefinition({ closedByChildren: ['td', 'th'], closedByParent: true }),
  88834. 'th': new HtmlTagDefinition({ closedByChildren: ['td', 'th'], closedByParent: true }),
  88835. 'col': new HtmlTagDefinition({ requiredParents: ['colgroup'], isVoid: true }),
  88836. 'svg': new HtmlTagDefinition({ implicitNamespacePrefix: 'svg' }),
  88837. 'math': new HtmlTagDefinition({ implicitNamespacePrefix: 'math' }),
  88838. 'li': new HtmlTagDefinition({ closedByChildren: ['li'], closedByParent: true }),
  88839. 'dt': new HtmlTagDefinition({ closedByChildren: ['dt', 'dd'] }),
  88840. 'dd': new HtmlTagDefinition({ closedByChildren: ['dt', 'dd'], closedByParent: true }),
  88841. 'rb': new HtmlTagDefinition({ closedByChildren: ['rb', 'rt', 'rtc', 'rp'], closedByParent: true }),
  88842. 'rt': new HtmlTagDefinition({ closedByChildren: ['rb', 'rt', 'rtc', 'rp'], closedByParent: true }),
  88843. 'rtc': new HtmlTagDefinition({ closedByChildren: ['rb', 'rtc', 'rp'], closedByParent: true }),
  88844. 'rp': new HtmlTagDefinition({ closedByChildren: ['rb', 'rt', 'rtc', 'rp'], closedByParent: true }),
  88845. 'optgroup': new HtmlTagDefinition({ closedByChildren: ['optgroup'], closedByParent: true }),
  88846. 'option': new HtmlTagDefinition({ closedByChildren: ['option', 'optgroup'], closedByParent: true }),
  88847. 'pre': new HtmlTagDefinition({ ignoreFirstLf: true }),
  88848. 'listing': new HtmlTagDefinition({ ignoreFirstLf: true }),
  88849. 'style': new HtmlTagDefinition({ contentType: TagContentType.RAW_TEXT }),
  88850. 'script': new HtmlTagDefinition({ contentType: TagContentType.RAW_TEXT }),
  88851. 'title': new HtmlTagDefinition({ contentType: TagContentType.ESCAPABLE_RAW_TEXT }),
  88852. 'textarea': new HtmlTagDefinition({ contentType: TagContentType.ESCAPABLE_RAW_TEXT, ignoreFirstLf: true }),
  88853. };
  88854. var _DEFAULT_TAG_DEFINITION = new HtmlTagDefinition();
  88855. /**
  88856. * @param {?} tagName
  88857. * @return {?}
  88858. */
  88859. function getHtmlTagDefinition(tagName) {
  88860. return TAG_DEFINITIONS[tagName.toLowerCase()] || _DEFAULT_TAG_DEFINITION;
  88861. }
  88862. /**
  88863. * @fileoverview added by tsickle
  88864. * @suppress {checkTypes} checked by tsc
  88865. */
  88866. /**
  88867. * @license
  88868. * Copyright Google Inc. All Rights Reserved.
  88869. *
  88870. * Use of this source code is governed by an MIT-style license that can be
  88871. * found in the LICENSE file at https://angular.io/license
  88872. */
  88873. var TAG_TO_PLACEHOLDER_NAMES = {
  88874. 'A': 'LINK',
  88875. 'B': 'BOLD_TEXT',
  88876. 'BR': 'LINE_BREAK',
  88877. 'EM': 'EMPHASISED_TEXT',
  88878. 'H1': 'HEADING_LEVEL1',
  88879. 'H2': 'HEADING_LEVEL2',
  88880. 'H3': 'HEADING_LEVEL3',
  88881. 'H4': 'HEADING_LEVEL4',
  88882. 'H5': 'HEADING_LEVEL5',
  88883. 'H6': 'HEADING_LEVEL6',
  88884. 'HR': 'HORIZONTAL_RULE',
  88885. 'I': 'ITALIC_TEXT',
  88886. 'LI': 'LIST_ITEM',
  88887. 'LINK': 'MEDIA_LINK',
  88888. 'OL': 'ORDERED_LIST',
  88889. 'P': 'PARAGRAPH',
  88890. 'Q': 'QUOTATION',
  88891. 'S': 'STRIKETHROUGH_TEXT',
  88892. 'SMALL': 'SMALL_TEXT',
  88893. 'SUB': 'SUBSTRIPT',
  88894. 'SUP': 'SUPERSCRIPT',
  88895. 'TBODY': 'TABLE_BODY',
  88896. 'TD': 'TABLE_CELL',
  88897. 'TFOOT': 'TABLE_FOOTER',
  88898. 'TH': 'TABLE_HEADER_CELL',
  88899. 'THEAD': 'TABLE_HEADER',
  88900. 'TR': 'TABLE_ROW',
  88901. 'TT': 'MONOSPACED_TEXT',
  88902. 'U': 'UNDERLINED_TEXT',
  88903. 'UL': 'UNORDERED_LIST',
  88904. };
  88905. /**
  88906. * Creates unique names for placeholder with different content.
  88907. *
  88908. * Returns the same placeholder name when the content is identical.
  88909. */
  88910. var PlaceholderRegistry = /** @class */ (function () {
  88911. function PlaceholderRegistry() {
  88912. this._placeHolderNameCounts = {};
  88913. this._signatureToName = {};
  88914. }
  88915. /**
  88916. * @param {?} tag
  88917. * @param {?} attrs
  88918. * @param {?} isVoid
  88919. * @return {?}
  88920. */
  88921. PlaceholderRegistry.prototype.getStartTagPlaceholderName = /**
  88922. * @param {?} tag
  88923. * @param {?} attrs
  88924. * @param {?} isVoid
  88925. * @return {?}
  88926. */
  88927. function (tag, attrs, isVoid) {
  88928. var /** @type {?} */ signature = this._hashTag(tag, attrs, isVoid);
  88929. if (this._signatureToName[signature]) {
  88930. return this._signatureToName[signature];
  88931. }
  88932. var /** @type {?} */ upperTag = tag.toUpperCase();
  88933. var /** @type {?} */ baseName = TAG_TO_PLACEHOLDER_NAMES[upperTag] || "TAG_" + upperTag;
  88934. var /** @type {?} */ name = this._generateUniqueName(isVoid ? baseName : "START_" + baseName);
  88935. this._signatureToName[signature] = name;
  88936. return name;
  88937. };
  88938. /**
  88939. * @param {?} tag
  88940. * @return {?}
  88941. */
  88942. PlaceholderRegistry.prototype.getCloseTagPlaceholderName = /**
  88943. * @param {?} tag
  88944. * @return {?}
  88945. */
  88946. function (tag) {
  88947. var /** @type {?} */ signature = this._hashClosingTag(tag);
  88948. if (this._signatureToName[signature]) {
  88949. return this._signatureToName[signature];
  88950. }
  88951. var /** @type {?} */ upperTag = tag.toUpperCase();
  88952. var /** @type {?} */ baseName = TAG_TO_PLACEHOLDER_NAMES[upperTag] || "TAG_" + upperTag;
  88953. var /** @type {?} */ name = this._generateUniqueName("CLOSE_" + baseName);
  88954. this._signatureToName[signature] = name;
  88955. return name;
  88956. };
  88957. /**
  88958. * @param {?} name
  88959. * @param {?} content
  88960. * @return {?}
  88961. */
  88962. PlaceholderRegistry.prototype.getPlaceholderName = /**
  88963. * @param {?} name
  88964. * @param {?} content
  88965. * @return {?}
  88966. */
  88967. function (name, content) {
  88968. var /** @type {?} */ upperName = name.toUpperCase();
  88969. var /** @type {?} */ signature = "PH: " + upperName + "=" + content;
  88970. if (this._signatureToName[signature]) {
  88971. return this._signatureToName[signature];
  88972. }
  88973. var /** @type {?} */ uniqueName = this._generateUniqueName(upperName);
  88974. this._signatureToName[signature] = uniqueName;
  88975. return uniqueName;
  88976. };
  88977. /**
  88978. * @param {?} name
  88979. * @return {?}
  88980. */
  88981. PlaceholderRegistry.prototype.getUniquePlaceholder = /**
  88982. * @param {?} name
  88983. * @return {?}
  88984. */
  88985. function (name) {
  88986. return this._generateUniqueName(name.toUpperCase());
  88987. };
  88988. /**
  88989. * @param {?} tag
  88990. * @param {?} attrs
  88991. * @param {?} isVoid
  88992. * @return {?}
  88993. */
  88994. PlaceholderRegistry.prototype._hashTag = /**
  88995. * @param {?} tag
  88996. * @param {?} attrs
  88997. * @param {?} isVoid
  88998. * @return {?}
  88999. */
  89000. function (tag, attrs, isVoid) {
  89001. var /** @type {?} */ start = "<" + tag;
  89002. var /** @type {?} */ strAttrs = Object.keys(attrs).sort().map(function (name) { return " " + name + "=" + attrs[name]; }).join('');
  89003. var /** @type {?} */ end = isVoid ? '/>' : "></" + tag + ">";
  89004. return start + strAttrs + end;
  89005. };
  89006. /**
  89007. * @param {?} tag
  89008. * @return {?}
  89009. */
  89010. PlaceholderRegistry.prototype._hashClosingTag = /**
  89011. * @param {?} tag
  89012. * @return {?}
  89013. */
  89014. function (tag) { return this._hashTag("/" + tag, {}, false); };
  89015. /**
  89016. * @param {?} base
  89017. * @return {?}
  89018. */
  89019. PlaceholderRegistry.prototype._generateUniqueName = /**
  89020. * @param {?} base
  89021. * @return {?}
  89022. */
  89023. function (base) {
  89024. var /** @type {?} */ seen = this._placeHolderNameCounts.hasOwnProperty(base);
  89025. if (!seen) {
  89026. this._placeHolderNameCounts[base] = 1;
  89027. return base;
  89028. }
  89029. var /** @type {?} */ id = this._placeHolderNameCounts[base];
  89030. this._placeHolderNameCounts[base] = id + 1;
  89031. return base + "_" + id;
  89032. };
  89033. return PlaceholderRegistry;
  89034. }());
  89035. /**
  89036. * @fileoverview added by tsickle
  89037. * @suppress {checkTypes} checked by tsc
  89038. */
  89039. /**
  89040. * @license
  89041. * Copyright Google Inc. All Rights Reserved.
  89042. *
  89043. * Use of this source code is governed by an MIT-style license that can be
  89044. * found in the LICENSE file at https://angular.io/license
  89045. */
  89046. var _expParser = new Parser(new Lexer());
  89047. /**
  89048. * Returns a function converting html nodes to an i18n Message given an interpolationConfig
  89049. * @param {?} interpolationConfig
  89050. * @return {?}
  89051. */
  89052. function createI18nMessageFactory(interpolationConfig) {
  89053. var /** @type {?} */ visitor = new _I18nVisitor(_expParser, interpolationConfig);
  89054. return function (nodes, meaning, description, id) {
  89055. return visitor.toI18nMessage(nodes, meaning, description, id);
  89056. };
  89057. }
  89058. var _I18nVisitor = /** @class */ (function () {
  89059. function _I18nVisitor(_expressionParser, _interpolationConfig) {
  89060. this._expressionParser = _expressionParser;
  89061. this._interpolationConfig = _interpolationConfig;
  89062. }
  89063. /**
  89064. * @param {?} nodes
  89065. * @param {?} meaning
  89066. * @param {?} description
  89067. * @param {?} id
  89068. * @return {?}
  89069. */
  89070. _I18nVisitor.prototype.toI18nMessage = /**
  89071. * @param {?} nodes
  89072. * @param {?} meaning
  89073. * @param {?} description
  89074. * @param {?} id
  89075. * @return {?}
  89076. */
  89077. function (nodes, meaning, description, id) {
  89078. this._isIcu = nodes.length == 1 && nodes[0] instanceof Expansion;
  89079. this._icuDepth = 0;
  89080. this._placeholderRegistry = new PlaceholderRegistry();
  89081. this._placeholderToContent = {};
  89082. this._placeholderToMessage = {};
  89083. var /** @type {?} */ i18nodes = visitAll(this, nodes, {});
  89084. return new Message(i18nodes, this._placeholderToContent, this._placeholderToMessage, meaning, description, id);
  89085. };
  89086. /**
  89087. * @param {?} el
  89088. * @param {?} context
  89089. * @return {?}
  89090. */
  89091. _I18nVisitor.prototype.visitElement = /**
  89092. * @param {?} el
  89093. * @param {?} context
  89094. * @return {?}
  89095. */
  89096. function (el, context) {
  89097. var /** @type {?} */ children = visitAll(this, el.children);
  89098. var /** @type {?} */ attrs = {};
  89099. el.attrs.forEach(function (attr) {
  89100. // Do not visit the attributes, translatable ones are top-level ASTs
  89101. attrs[attr.name] = attr.value;
  89102. });
  89103. var /** @type {?} */ isVoid = getHtmlTagDefinition(el.name).isVoid;
  89104. var /** @type {?} */ startPhName = this._placeholderRegistry.getStartTagPlaceholderName(el.name, attrs, isVoid);
  89105. this._placeholderToContent[startPhName] = /** @type {?} */ ((el.sourceSpan)).toString();
  89106. var /** @type {?} */ closePhName = '';
  89107. if (!isVoid) {
  89108. closePhName = this._placeholderRegistry.getCloseTagPlaceholderName(el.name);
  89109. this._placeholderToContent[closePhName] = "</" + el.name + ">";
  89110. }
  89111. return new TagPlaceholder(el.name, attrs, startPhName, closePhName, children, isVoid, /** @type {?} */ ((el.sourceSpan)));
  89112. };
  89113. /**
  89114. * @param {?} attribute
  89115. * @param {?} context
  89116. * @return {?}
  89117. */
  89118. _I18nVisitor.prototype.visitAttribute = /**
  89119. * @param {?} attribute
  89120. * @param {?} context
  89121. * @return {?}
  89122. */
  89123. function (attribute, context) {
  89124. return this._visitTextWithInterpolation(attribute.value, attribute.sourceSpan);
  89125. };
  89126. /**
  89127. * @param {?} text
  89128. * @param {?} context
  89129. * @return {?}
  89130. */
  89131. _I18nVisitor.prototype.visitText = /**
  89132. * @param {?} text
  89133. * @param {?} context
  89134. * @return {?}
  89135. */
  89136. function (text, context) {
  89137. return this._visitTextWithInterpolation(text.value, /** @type {?} */ ((text.sourceSpan)));
  89138. };
  89139. /**
  89140. * @param {?} comment
  89141. * @param {?} context
  89142. * @return {?}
  89143. */
  89144. _I18nVisitor.prototype.visitComment = /**
  89145. * @param {?} comment
  89146. * @param {?} context
  89147. * @return {?}
  89148. */
  89149. function (comment, context) { return null; };
  89150. /**
  89151. * @param {?} icu
  89152. * @param {?} context
  89153. * @return {?}
  89154. */
  89155. _I18nVisitor.prototype.visitExpansion = /**
  89156. * @param {?} icu
  89157. * @param {?} context
  89158. * @return {?}
  89159. */
  89160. function (icu, context) {
  89161. var _this = this;
  89162. this._icuDepth++;
  89163. var /** @type {?} */ i18nIcuCases = {};
  89164. var /** @type {?} */ i18nIcu = new Icu(icu.switchValue, icu.type, i18nIcuCases, icu.sourceSpan);
  89165. icu.cases.forEach(function (caze) {
  89166. i18nIcuCases[caze.value] = new Container(caze.expression.map(function (node) { return node.visit(_this, {}); }), caze.expSourceSpan);
  89167. });
  89168. this._icuDepth--;
  89169. if (this._isIcu || this._icuDepth > 0) {
  89170. // Returns an ICU node when:
  89171. // - the message (vs a part of the message) is an ICU message, or
  89172. // - the ICU message is nested.
  89173. var /** @type {?} */ expPh = this._placeholderRegistry.getUniquePlaceholder("VAR_" + icu.type);
  89174. i18nIcu.expressionPlaceholder = expPh;
  89175. this._placeholderToContent[expPh] = icu.switchValue;
  89176. return i18nIcu;
  89177. }
  89178. // Else returns a placeholder
  89179. // ICU placeholders should not be replaced with their original content but with the their
  89180. // translations. We need to create a new visitor (they are not re-entrant) to compute the
  89181. // message id.
  89182. // TODO(vicb): add a html.Node -> i18n.Message cache to avoid having to re-create the msg
  89183. var /** @type {?} */ phName = this._placeholderRegistry.getPlaceholderName('ICU', icu.sourceSpan.toString());
  89184. var /** @type {?} */ visitor = new _I18nVisitor(this._expressionParser, this._interpolationConfig);
  89185. this._placeholderToMessage[phName] = visitor.toI18nMessage([icu], '', '', '');
  89186. return new IcuPlaceholder(i18nIcu, phName, icu.sourceSpan);
  89187. };
  89188. /**
  89189. * @param {?} icuCase
  89190. * @param {?} context
  89191. * @return {?}
  89192. */
  89193. _I18nVisitor.prototype.visitExpansionCase = /**
  89194. * @param {?} icuCase
  89195. * @param {?} context
  89196. * @return {?}
  89197. */
  89198. function (icuCase, context) {
  89199. throw new Error('Unreachable code');
  89200. };
  89201. /**
  89202. * @param {?} text
  89203. * @param {?} sourceSpan
  89204. * @return {?}
  89205. */
  89206. _I18nVisitor.prototype._visitTextWithInterpolation = /**
  89207. * @param {?} text
  89208. * @param {?} sourceSpan
  89209. * @return {?}
  89210. */
  89211. function (text, sourceSpan) {
  89212. var /** @type {?} */ splitInterpolation = this._expressionParser.splitInterpolation(text, sourceSpan.start.toString(), this._interpolationConfig);
  89213. if (!splitInterpolation) {
  89214. // No expression, return a single text
  89215. return new Text$1(text, sourceSpan);
  89216. }
  89217. // Return a group of text + expressions
  89218. var /** @type {?} */ nodes = [];
  89219. var /** @type {?} */ container = new Container(nodes, sourceSpan);
  89220. var _a = this._interpolationConfig, sDelimiter = _a.start, eDelimiter = _a.end;
  89221. for (var /** @type {?} */ i = 0; i < splitInterpolation.strings.length - 1; i++) {
  89222. var /** @type {?} */ expression = splitInterpolation.expressions[i];
  89223. var /** @type {?} */ baseName = _extractPlaceholderName(expression) || 'INTERPOLATION';
  89224. var /** @type {?} */ phName = this._placeholderRegistry.getPlaceholderName(baseName, expression);
  89225. if (splitInterpolation.strings[i].length) {
  89226. // No need to add empty strings
  89227. nodes.push(new Text$1(splitInterpolation.strings[i], sourceSpan));
  89228. }
  89229. nodes.push(new Placeholder(expression, phName, sourceSpan));
  89230. this._placeholderToContent[phName] = sDelimiter + expression + eDelimiter;
  89231. }
  89232. // The last index contains no expression
  89233. var /** @type {?} */ lastStringIdx = splitInterpolation.strings.length - 1;
  89234. if (splitInterpolation.strings[lastStringIdx].length) {
  89235. nodes.push(new Text$1(splitInterpolation.strings[lastStringIdx], sourceSpan));
  89236. }
  89237. return container;
  89238. };
  89239. return _I18nVisitor;
  89240. }());
  89241. var _CUSTOM_PH_EXP = /\/\/[\s\S]*i18n[\s\S]*\([\s\S]*ph[\s\S]*=[\s\S]*("|')([\s\S]*?)\1[\s\S]*\)/g;
  89242. /**
  89243. * @param {?} input
  89244. * @return {?}
  89245. */
  89246. function _extractPlaceholderName(input) {
  89247. return input.split(_CUSTOM_PH_EXP)[2];
  89248. }
  89249. /**
  89250. * @fileoverview added by tsickle
  89251. * @suppress {checkTypes} checked by tsc
  89252. */
  89253. /**
  89254. * @license
  89255. * Copyright Google Inc. All Rights Reserved.
  89256. *
  89257. * Use of this source code is governed by an MIT-style license that can be
  89258. * found in the LICENSE file at https://angular.io/license
  89259. */
  89260. /**
  89261. * An i18n error.
  89262. */
  89263. var I18nError = /** @class */ (function (_super) {
  89264. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(I18nError, _super);
  89265. function I18nError(span, msg) {
  89266. return _super.call(this, span, msg) || this;
  89267. }
  89268. return I18nError;
  89269. }(ParseError));
  89270. /**
  89271. * @fileoverview added by tsickle
  89272. * @suppress {checkTypes} checked by tsc
  89273. */
  89274. /**
  89275. * @license
  89276. * Copyright Google Inc. All Rights Reserved.
  89277. *
  89278. * Use of this source code is governed by an MIT-style license that can be
  89279. * found in the LICENSE file at https://angular.io/license
  89280. */
  89281. var _I18N_ATTR = 'i18n';
  89282. var _I18N_ATTR_PREFIX = 'i18n-';
  89283. var _I18N_COMMENT_PREFIX_REGEXP = /^i18n:?/;
  89284. var MEANING_SEPARATOR = '|';
  89285. var ID_SEPARATOR = '@@';
  89286. var i18nCommentsWarned = false;
  89287. /**
  89288. * Extract translatable messages from an html AST
  89289. * @param {?} nodes
  89290. * @param {?} interpolationConfig
  89291. * @param {?} implicitTags
  89292. * @param {?} implicitAttrs
  89293. * @return {?}
  89294. */
  89295. function extractMessages(nodes, interpolationConfig, implicitTags, implicitAttrs) {
  89296. var /** @type {?} */ visitor = new _Visitor(implicitTags, implicitAttrs);
  89297. return visitor.extract(nodes, interpolationConfig);
  89298. }
  89299. /**
  89300. * @param {?} nodes
  89301. * @param {?} translations
  89302. * @param {?} interpolationConfig
  89303. * @param {?} implicitTags
  89304. * @param {?} implicitAttrs
  89305. * @return {?}
  89306. */
  89307. function mergeTranslations(nodes, translations, interpolationConfig, implicitTags, implicitAttrs) {
  89308. var /** @type {?} */ visitor = new _Visitor(implicitTags, implicitAttrs);
  89309. return visitor.merge(nodes, translations, interpolationConfig);
  89310. }
  89311. var ExtractionResult = /** @class */ (function () {
  89312. function ExtractionResult(messages, errors) {
  89313. this.messages = messages;
  89314. this.errors = errors;
  89315. }
  89316. return ExtractionResult;
  89317. }());
  89318. /** @enum {number} */
  89319. var _VisitorMode = {
  89320. Extract: 0,
  89321. Merge: 1,
  89322. };
  89323. _VisitorMode[_VisitorMode.Extract] = "Extract";
  89324. _VisitorMode[_VisitorMode.Merge] = "Merge";
  89325. /**
  89326. * This Visitor is used:
  89327. * 1. to extract all the translatable strings from an html AST (see `extract()`),
  89328. * 2. to replace the translatable strings with the actual translations (see `merge()`)
  89329. *
  89330. * \@internal
  89331. */
  89332. var _Visitor = /** @class */ (function () {
  89333. function _Visitor(_implicitTags, _implicitAttrs) {
  89334. this._implicitTags = _implicitTags;
  89335. this._implicitAttrs = _implicitAttrs;
  89336. }
  89337. /**
  89338. * Extracts the messages from the tree
  89339. */
  89340. /**
  89341. * Extracts the messages from the tree
  89342. * @param {?} nodes
  89343. * @param {?} interpolationConfig
  89344. * @return {?}
  89345. */
  89346. _Visitor.prototype.extract = /**
  89347. * Extracts the messages from the tree
  89348. * @param {?} nodes
  89349. * @param {?} interpolationConfig
  89350. * @return {?}
  89351. */
  89352. function (nodes, interpolationConfig) {
  89353. var _this = this;
  89354. this._init(_VisitorMode.Extract, interpolationConfig);
  89355. nodes.forEach(function (node) { return node.visit(_this, null); });
  89356. if (this._inI18nBlock) {
  89357. this._reportError(nodes[nodes.length - 1], 'Unclosed block');
  89358. }
  89359. return new ExtractionResult(this._messages, this._errors);
  89360. };
  89361. /**
  89362. * Returns a tree where all translatable nodes are translated
  89363. */
  89364. /**
  89365. * Returns a tree where all translatable nodes are translated
  89366. * @param {?} nodes
  89367. * @param {?} translations
  89368. * @param {?} interpolationConfig
  89369. * @return {?}
  89370. */
  89371. _Visitor.prototype.merge = /**
  89372. * Returns a tree where all translatable nodes are translated
  89373. * @param {?} nodes
  89374. * @param {?} translations
  89375. * @param {?} interpolationConfig
  89376. * @return {?}
  89377. */
  89378. function (nodes, translations, interpolationConfig) {
  89379. this._init(_VisitorMode.Merge, interpolationConfig);
  89380. this._translations = translations;
  89381. // Construct a single fake root element
  89382. var /** @type {?} */ wrapper = new Element('wrapper', [], nodes, /** @type {?} */ ((undefined)), undefined, undefined);
  89383. var /** @type {?} */ translatedNode = wrapper.visit(this, null);
  89384. if (this._inI18nBlock) {
  89385. this._reportError(nodes[nodes.length - 1], 'Unclosed block');
  89386. }
  89387. return new ParseTreeResult(translatedNode.children, this._errors);
  89388. };
  89389. /**
  89390. * @param {?} icuCase
  89391. * @param {?} context
  89392. * @return {?}
  89393. */
  89394. _Visitor.prototype.visitExpansionCase = /**
  89395. * @param {?} icuCase
  89396. * @param {?} context
  89397. * @return {?}
  89398. */
  89399. function (icuCase, context) {
  89400. // Parse cases for translatable html attributes
  89401. var /** @type {?} */ expression = visitAll(this, icuCase.expression, context);
  89402. if (this._mode === _VisitorMode.Merge) {
  89403. return new ExpansionCase(icuCase.value, expression, icuCase.sourceSpan, icuCase.valueSourceSpan, icuCase.expSourceSpan);
  89404. }
  89405. };
  89406. /**
  89407. * @param {?} icu
  89408. * @param {?} context
  89409. * @return {?}
  89410. */
  89411. _Visitor.prototype.visitExpansion = /**
  89412. * @param {?} icu
  89413. * @param {?} context
  89414. * @return {?}
  89415. */
  89416. function (icu, context) {
  89417. this._mayBeAddBlockChildren(icu);
  89418. var /** @type {?} */ wasInIcu = this._inIcu;
  89419. if (!this._inIcu) {
  89420. // nested ICU messages should not be extracted but top-level translated as a whole
  89421. if (this._isInTranslatableSection) {
  89422. this._addMessage([icu]);
  89423. }
  89424. this._inIcu = true;
  89425. }
  89426. var /** @type {?} */ cases = visitAll(this, icu.cases, context);
  89427. if (this._mode === _VisitorMode.Merge) {
  89428. icu = new Expansion(icu.switchValue, icu.type, cases, icu.sourceSpan, icu.switchValueSourceSpan);
  89429. }
  89430. this._inIcu = wasInIcu;
  89431. return icu;
  89432. };
  89433. /**
  89434. * @param {?} comment
  89435. * @param {?} context
  89436. * @return {?}
  89437. */
  89438. _Visitor.prototype.visitComment = /**
  89439. * @param {?} comment
  89440. * @param {?} context
  89441. * @return {?}
  89442. */
  89443. function (comment, context) {
  89444. var /** @type {?} */ isOpening = _isOpeningComment(comment);
  89445. if (isOpening && this._isInTranslatableSection) {
  89446. this._reportError(comment, 'Could not start a block inside a translatable section');
  89447. return;
  89448. }
  89449. var /** @type {?} */ isClosing = _isClosingComment(comment);
  89450. if (isClosing && !this._inI18nBlock) {
  89451. this._reportError(comment, 'Trying to close an unopened block');
  89452. return;
  89453. }
  89454. if (!this._inI18nNode && !this._inIcu) {
  89455. if (!this._inI18nBlock) {
  89456. if (isOpening) {
  89457. // deprecated from v5 you should use <ng-container i18n> instead of i18n comments
  89458. if (!i18nCommentsWarned && /** @type {?} */ (console) && /** @type {?} */ (console.warn)) {
  89459. i18nCommentsWarned = true;
  89460. var /** @type {?} */ details = comment.sourceSpan.details ? ", " + comment.sourceSpan.details : '';
  89461. // TODO(ocombe): use a log service once there is a public one available
  89462. console.warn("I18n comments are deprecated, use an <ng-container> element instead (" + comment.sourceSpan.start + details + ")");
  89463. }
  89464. this._inI18nBlock = true;
  89465. this._blockStartDepth = this._depth;
  89466. this._blockChildren = [];
  89467. this._blockMeaningAndDesc = /** @type {?} */ ((comment.value)).replace(_I18N_COMMENT_PREFIX_REGEXP, '').trim();
  89468. this._openTranslatableSection(comment);
  89469. }
  89470. }
  89471. else {
  89472. if (isClosing) {
  89473. if (this._depth == this._blockStartDepth) {
  89474. this._closeTranslatableSection(comment, this._blockChildren);
  89475. this._inI18nBlock = false;
  89476. var /** @type {?} */ message = /** @type {?} */ ((this._addMessage(this._blockChildren, this._blockMeaningAndDesc)));
  89477. // merge attributes in sections
  89478. var /** @type {?} */ nodes = this._translateMessage(comment, message);
  89479. return visitAll(this, nodes);
  89480. }
  89481. else {
  89482. this._reportError(comment, 'I18N blocks should not cross element boundaries');
  89483. return;
  89484. }
  89485. }
  89486. }
  89487. }
  89488. };
  89489. /**
  89490. * @param {?} text
  89491. * @param {?} context
  89492. * @return {?}
  89493. */
  89494. _Visitor.prototype.visitText = /**
  89495. * @param {?} text
  89496. * @param {?} context
  89497. * @return {?}
  89498. */
  89499. function (text, context) {
  89500. if (this._isInTranslatableSection) {
  89501. this._mayBeAddBlockChildren(text);
  89502. }
  89503. return text;
  89504. };
  89505. /**
  89506. * @param {?} el
  89507. * @param {?} context
  89508. * @return {?}
  89509. */
  89510. _Visitor.prototype.visitElement = /**
  89511. * @param {?} el
  89512. * @param {?} context
  89513. * @return {?}
  89514. */
  89515. function (el, context) {
  89516. var _this = this;
  89517. this._mayBeAddBlockChildren(el);
  89518. this._depth++;
  89519. var /** @type {?} */ wasInI18nNode = this._inI18nNode;
  89520. var /** @type {?} */ wasInImplicitNode = this._inImplicitNode;
  89521. var /** @type {?} */ childNodes = [];
  89522. var /** @type {?} */ translatedChildNodes = /** @type {?} */ ((undefined));
  89523. // Extract:
  89524. // - top level nodes with the (implicit) "i18n" attribute if not already in a section
  89525. // - ICU messages
  89526. var /** @type {?} */ i18nAttr = _getI18nAttr(el);
  89527. var /** @type {?} */ i18nMeta = i18nAttr ? i18nAttr.value : '';
  89528. var /** @type {?} */ isImplicit = this._implicitTags.some(function (tag) { return el.name === tag; }) && !this._inIcu &&
  89529. !this._isInTranslatableSection;
  89530. var /** @type {?} */ isTopLevelImplicit = !wasInImplicitNode && isImplicit;
  89531. this._inImplicitNode = wasInImplicitNode || isImplicit;
  89532. if (!this._isInTranslatableSection && !this._inIcu) {
  89533. if (i18nAttr || isTopLevelImplicit) {
  89534. this._inI18nNode = true;
  89535. var /** @type {?} */ message = /** @type {?} */ ((this._addMessage(el.children, i18nMeta)));
  89536. translatedChildNodes = this._translateMessage(el, message);
  89537. }
  89538. if (this._mode == _VisitorMode.Extract) {
  89539. var /** @type {?} */ isTranslatable = i18nAttr || isTopLevelImplicit;
  89540. if (isTranslatable)
  89541. this._openTranslatableSection(el);
  89542. visitAll(this, el.children);
  89543. if (isTranslatable)
  89544. this._closeTranslatableSection(el, el.children);
  89545. }
  89546. }
  89547. else {
  89548. if (i18nAttr || isTopLevelImplicit) {
  89549. this._reportError(el, 'Could not mark an element as translatable inside a translatable section');
  89550. }
  89551. if (this._mode == _VisitorMode.Extract) {
  89552. // Descend into child nodes for extraction
  89553. visitAll(this, el.children);
  89554. }
  89555. }
  89556. if (this._mode === _VisitorMode.Merge) {
  89557. var /** @type {?} */ visitNodes = translatedChildNodes || el.children;
  89558. visitNodes.forEach(function (child) {
  89559. var /** @type {?} */ visited = child.visit(_this, context);
  89560. if (visited && !_this._isInTranslatableSection) {
  89561. // Do not add the children from translatable sections (= i18n blocks here)
  89562. // They will be added later in this loop when the block closes (i.e. on `<!-- /i18n -->`)
  89563. childNodes = childNodes.concat(visited);
  89564. }
  89565. });
  89566. }
  89567. this._visitAttributesOf(el);
  89568. this._depth--;
  89569. this._inI18nNode = wasInI18nNode;
  89570. this._inImplicitNode = wasInImplicitNode;
  89571. if (this._mode === _VisitorMode.Merge) {
  89572. var /** @type {?} */ translatedAttrs = this._translateAttributes(el);
  89573. return new Element(el.name, translatedAttrs, childNodes, el.sourceSpan, el.startSourceSpan, el.endSourceSpan);
  89574. }
  89575. return null;
  89576. };
  89577. /**
  89578. * @param {?} attribute
  89579. * @param {?} context
  89580. * @return {?}
  89581. */
  89582. _Visitor.prototype.visitAttribute = /**
  89583. * @param {?} attribute
  89584. * @param {?} context
  89585. * @return {?}
  89586. */
  89587. function (attribute, context) {
  89588. throw new Error('unreachable code');
  89589. };
  89590. /**
  89591. * @param {?} mode
  89592. * @param {?} interpolationConfig
  89593. * @return {?}
  89594. */
  89595. _Visitor.prototype._init = /**
  89596. * @param {?} mode
  89597. * @param {?} interpolationConfig
  89598. * @return {?}
  89599. */
  89600. function (mode, interpolationConfig) {
  89601. this._mode = mode;
  89602. this._inI18nBlock = false;
  89603. this._inI18nNode = false;
  89604. this._depth = 0;
  89605. this._inIcu = false;
  89606. this._msgCountAtSectionStart = undefined;
  89607. this._errors = [];
  89608. this._messages = [];
  89609. this._inImplicitNode = false;
  89610. this._createI18nMessage = createI18nMessageFactory(interpolationConfig);
  89611. };
  89612. /**
  89613. * @param {?} el
  89614. * @return {?}
  89615. */
  89616. _Visitor.prototype._visitAttributesOf = /**
  89617. * @param {?} el
  89618. * @return {?}
  89619. */
  89620. function (el) {
  89621. var _this = this;
  89622. var /** @type {?} */ explicitAttrNameToValue = {};
  89623. var /** @type {?} */ implicitAttrNames = this._implicitAttrs[el.name] || [];
  89624. el.attrs.filter(function (attr) { return attr.name.startsWith(_I18N_ATTR_PREFIX); })
  89625. .forEach(function (attr) {
  89626. return explicitAttrNameToValue[attr.name.slice(_I18N_ATTR_PREFIX.length)] =
  89627. attr.value;
  89628. });
  89629. el.attrs.forEach(function (attr) {
  89630. if (attr.name in explicitAttrNameToValue) {
  89631. _this._addMessage([attr], explicitAttrNameToValue[attr.name]);
  89632. }
  89633. else if (implicitAttrNames.some(function (name) { return attr.name === name; })) {
  89634. _this._addMessage([attr]);
  89635. }
  89636. });
  89637. };
  89638. /**
  89639. * @param {?} ast
  89640. * @param {?=} msgMeta
  89641. * @return {?}
  89642. */
  89643. _Visitor.prototype._addMessage = /**
  89644. * @param {?} ast
  89645. * @param {?=} msgMeta
  89646. * @return {?}
  89647. */
  89648. function (ast, msgMeta) {
  89649. if (ast.length == 0 ||
  89650. ast.length == 1 && ast[0] instanceof Attribute$1 && !(/** @type {?} */ (ast[0])).value) {
  89651. // Do not create empty messages
  89652. return null;
  89653. }
  89654. var _a = _parseMessageMeta(msgMeta), meaning = _a.meaning, description = _a.description, id = _a.id;
  89655. var /** @type {?} */ message = this._createI18nMessage(ast, meaning, description, id);
  89656. this._messages.push(message);
  89657. return message;
  89658. };
  89659. /**
  89660. * @param {?} el
  89661. * @param {?} message
  89662. * @return {?}
  89663. */
  89664. _Visitor.prototype._translateMessage = /**
  89665. * @param {?} el
  89666. * @param {?} message
  89667. * @return {?}
  89668. */
  89669. function (el, message) {
  89670. if (message && this._mode === _VisitorMode.Merge) {
  89671. var /** @type {?} */ nodes = this._translations.get(message);
  89672. if (nodes) {
  89673. return nodes;
  89674. }
  89675. this._reportError(el, "Translation unavailable for message id=\"" + this._translations.digest(message) + "\"");
  89676. }
  89677. return [];
  89678. };
  89679. /**
  89680. * @param {?} el
  89681. * @return {?}
  89682. */
  89683. _Visitor.prototype._translateAttributes = /**
  89684. * @param {?} el
  89685. * @return {?}
  89686. */
  89687. function (el) {
  89688. var _this = this;
  89689. var /** @type {?} */ attributes = el.attrs;
  89690. var /** @type {?} */ i18nParsedMessageMeta = {};
  89691. attributes.forEach(function (attr) {
  89692. if (attr.name.startsWith(_I18N_ATTR_PREFIX)) {
  89693. i18nParsedMessageMeta[attr.name.slice(_I18N_ATTR_PREFIX.length)] =
  89694. _parseMessageMeta(attr.value);
  89695. }
  89696. });
  89697. var /** @type {?} */ translatedAttributes = [];
  89698. attributes.forEach(function (attr) {
  89699. if (attr.name === _I18N_ATTR || attr.name.startsWith(_I18N_ATTR_PREFIX)) {
  89700. // strip i18n specific attributes
  89701. return;
  89702. }
  89703. if (attr.value && attr.value != '' && i18nParsedMessageMeta.hasOwnProperty(attr.name)) {
  89704. var _a = i18nParsedMessageMeta[attr.name], meaning = _a.meaning, description = _a.description, id = _a.id;
  89705. var /** @type {?} */ message = _this._createI18nMessage([attr], meaning, description, id);
  89706. var /** @type {?} */ nodes = _this._translations.get(message);
  89707. if (nodes) {
  89708. if (nodes.length == 0) {
  89709. translatedAttributes.push(new Attribute$1(attr.name, '', attr.sourceSpan));
  89710. }
  89711. else if (nodes[0] instanceof Text) {
  89712. var /** @type {?} */ value = (/** @type {?} */ (nodes[0])).value;
  89713. translatedAttributes.push(new Attribute$1(attr.name, value, attr.sourceSpan));
  89714. }
  89715. else {
  89716. _this._reportError(el, "Unexpected translation for attribute \"" + attr.name + "\" (id=\"" + (id || _this._translations.digest(message)) + "\")");
  89717. }
  89718. }
  89719. else {
  89720. _this._reportError(el, "Translation unavailable for attribute \"" + attr.name + "\" (id=\"" + (id || _this._translations.digest(message)) + "\")");
  89721. }
  89722. }
  89723. else {
  89724. translatedAttributes.push(attr);
  89725. }
  89726. });
  89727. return translatedAttributes;
  89728. };
  89729. /**
  89730. * Add the node as a child of the block when:
  89731. * - we are in a block,
  89732. * - we are not inside a ICU message (those are handled separately),
  89733. * - the node is a "direct child" of the block
  89734. * @param {?} node
  89735. * @return {?}
  89736. */
  89737. _Visitor.prototype._mayBeAddBlockChildren = /**
  89738. * Add the node as a child of the block when:
  89739. * - we are in a block,
  89740. * - we are not inside a ICU message (those are handled separately),
  89741. * - the node is a "direct child" of the block
  89742. * @param {?} node
  89743. * @return {?}
  89744. */
  89745. function (node) {
  89746. if (this._inI18nBlock && !this._inIcu && this._depth == this._blockStartDepth) {
  89747. this._blockChildren.push(node);
  89748. }
  89749. };
  89750. /**
  89751. * Marks the start of a section, see `_closeTranslatableSection`
  89752. * @param {?} node
  89753. * @return {?}
  89754. */
  89755. _Visitor.prototype._openTranslatableSection = /**
  89756. * Marks the start of a section, see `_closeTranslatableSection`
  89757. * @param {?} node
  89758. * @return {?}
  89759. */
  89760. function (node) {
  89761. if (this._isInTranslatableSection) {
  89762. this._reportError(node, 'Unexpected section start');
  89763. }
  89764. else {
  89765. this._msgCountAtSectionStart = this._messages.length;
  89766. }
  89767. };
  89768. Object.defineProperty(_Visitor.prototype, "_isInTranslatableSection", {
  89769. get: /**
  89770. * A translatable section could be:
  89771. * - the content of translatable element,
  89772. * - nodes between `<!-- i18n -->` and `<!-- /i18n -->` comments
  89773. * @return {?}
  89774. */
  89775. function () {
  89776. return this._msgCountAtSectionStart !== void 0;
  89777. },
  89778. enumerable: true,
  89779. configurable: true
  89780. });
  89781. /**
  89782. * Terminates a section.
  89783. *
  89784. * If a section has only one significant children (comments not significant) then we should not
  89785. * keep the message from this children:
  89786. *
  89787. * `<p i18n="meaning|description">{ICU message}</p>` would produce two messages:
  89788. * - one for the <p> content with meaning and description,
  89789. * - another one for the ICU message.
  89790. *
  89791. * In this case the last message is discarded as it contains less information (the AST is
  89792. * otherwise identical).
  89793. *
  89794. * Note that we should still keep messages extracted from attributes inside the section (ie in the
  89795. * ICU message here)
  89796. * @param {?} node
  89797. * @param {?} directChildren
  89798. * @return {?}
  89799. */
  89800. _Visitor.prototype._closeTranslatableSection = /**
  89801. * Terminates a section.
  89802. *
  89803. * If a section has only one significant children (comments not significant) then we should not
  89804. * keep the message from this children:
  89805. *
  89806. * `<p i18n="meaning|description">{ICU message}</p>` would produce two messages:
  89807. * - one for the <p> content with meaning and description,
  89808. * - another one for the ICU message.
  89809. *
  89810. * In this case the last message is discarded as it contains less information (the AST is
  89811. * otherwise identical).
  89812. *
  89813. * Note that we should still keep messages extracted from attributes inside the section (ie in the
  89814. * ICU message here)
  89815. * @param {?} node
  89816. * @param {?} directChildren
  89817. * @return {?}
  89818. */
  89819. function (node, directChildren) {
  89820. if (!this._isInTranslatableSection) {
  89821. this._reportError(node, 'Unexpected section end');
  89822. return;
  89823. }
  89824. var /** @type {?} */ startIndex = this._msgCountAtSectionStart;
  89825. var /** @type {?} */ significantChildren = directChildren.reduce(function (count, node) { return count + (node instanceof Comment ? 0 : 1); }, 0);
  89826. if (significantChildren == 1) {
  89827. for (var /** @type {?} */ i = this._messages.length - 1; i >= /** @type {?} */ ((startIndex)); i--) {
  89828. var /** @type {?} */ ast = this._messages[i].nodes;
  89829. if (!(ast.length == 1 && ast[0] instanceof Text$1)) {
  89830. this._messages.splice(i, 1);
  89831. break;
  89832. }
  89833. }
  89834. }
  89835. this._msgCountAtSectionStart = undefined;
  89836. };
  89837. /**
  89838. * @param {?} node
  89839. * @param {?} msg
  89840. * @return {?}
  89841. */
  89842. _Visitor.prototype._reportError = /**
  89843. * @param {?} node
  89844. * @param {?} msg
  89845. * @return {?}
  89846. */
  89847. function (node, msg) {
  89848. this._errors.push(new I18nError(/** @type {?} */ ((node.sourceSpan)), msg));
  89849. };
  89850. return _Visitor;
  89851. }());
  89852. /**
  89853. * @param {?} n
  89854. * @return {?}
  89855. */
  89856. function _isOpeningComment(n) {
  89857. return !!(n instanceof Comment && n.value && n.value.startsWith('i18n'));
  89858. }
  89859. /**
  89860. * @param {?} n
  89861. * @return {?}
  89862. */
  89863. function _isClosingComment(n) {
  89864. return !!(n instanceof Comment && n.value && n.value === '/i18n');
  89865. }
  89866. /**
  89867. * @param {?} p
  89868. * @return {?}
  89869. */
  89870. function _getI18nAttr(p) {
  89871. return p.attrs.find(function (attr) { return attr.name === _I18N_ATTR; }) || null;
  89872. }
  89873. /**
  89874. * @param {?=} i18n
  89875. * @return {?}
  89876. */
  89877. function _parseMessageMeta(i18n) {
  89878. if (!i18n)
  89879. return { meaning: '', description: '', id: '' };
  89880. var /** @type {?} */ idIndex = i18n.indexOf(ID_SEPARATOR);
  89881. var /** @type {?} */ descIndex = i18n.indexOf(MEANING_SEPARATOR);
  89882. var _a = (idIndex > -1) ? [i18n.slice(0, idIndex), i18n.slice(idIndex + 2)] : [i18n, ''], meaningAndDesc = _a[0], id = _a[1];
  89883. var _b = (descIndex > -1) ?
  89884. [meaningAndDesc.slice(0, descIndex), meaningAndDesc.slice(descIndex + 1)] :
  89885. ['', meaningAndDesc], meaning = _b[0], description = _b[1];
  89886. return { meaning: meaning, description: description, id: id };
  89887. }
  89888. /**
  89889. * @fileoverview added by tsickle
  89890. * @suppress {checkTypes} checked by tsc
  89891. */
  89892. /**
  89893. * @license
  89894. * Copyright Google Inc. All Rights Reserved.
  89895. *
  89896. * Use of this source code is governed by an MIT-style license that can be
  89897. * found in the LICENSE file at https://angular.io/license
  89898. */
  89899. var XmlTagDefinition = /** @class */ (function () {
  89900. function XmlTagDefinition() {
  89901. this.closedByParent = false;
  89902. this.contentType = TagContentType.PARSABLE_DATA;
  89903. this.isVoid = false;
  89904. this.ignoreFirstLf = false;
  89905. this.canSelfClose = true;
  89906. }
  89907. /**
  89908. * @param {?} currentParent
  89909. * @return {?}
  89910. */
  89911. XmlTagDefinition.prototype.requireExtraParent = /**
  89912. * @param {?} currentParent
  89913. * @return {?}
  89914. */
  89915. function (currentParent) { return false; };
  89916. /**
  89917. * @param {?} name
  89918. * @return {?}
  89919. */
  89920. XmlTagDefinition.prototype.isClosedByChild = /**
  89921. * @param {?} name
  89922. * @return {?}
  89923. */
  89924. function (name) { return false; };
  89925. return XmlTagDefinition;
  89926. }());
  89927. var _TAG_DEFINITION = new XmlTagDefinition();
  89928. /**
  89929. * @param {?} tagName
  89930. * @return {?}
  89931. */
  89932. function getXmlTagDefinition(tagName) {
  89933. return _TAG_DEFINITION;
  89934. }
  89935. /**
  89936. * @fileoverview added by tsickle
  89937. * @suppress {checkTypes} checked by tsc
  89938. */
  89939. /**
  89940. * @license
  89941. * Copyright Google Inc. All Rights Reserved.
  89942. *
  89943. * Use of this source code is governed by an MIT-style license that can be
  89944. * found in the LICENSE file at https://angular.io/license
  89945. */
  89946. var XmlParser = /** @class */ (function (_super) {
  89947. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(XmlParser, _super);
  89948. function XmlParser() {
  89949. return _super.call(this, getXmlTagDefinition) || this;
  89950. }
  89951. /**
  89952. * @param {?} source
  89953. * @param {?} url
  89954. * @param {?=} parseExpansionForms
  89955. * @return {?}
  89956. */
  89957. XmlParser.prototype.parse = /**
  89958. * @param {?} source
  89959. * @param {?} url
  89960. * @param {?=} parseExpansionForms
  89961. * @return {?}
  89962. */
  89963. function (source, url, parseExpansionForms) {
  89964. if (parseExpansionForms === void 0) { parseExpansionForms = false; }
  89965. return _super.prototype.parse.call(this, source, url, parseExpansionForms);
  89966. };
  89967. return XmlParser;
  89968. }(Parser$1));
  89969. /**
  89970. * @fileoverview added by tsickle
  89971. * @suppress {checkTypes} checked by tsc
  89972. */
  89973. /**
  89974. * @license
  89975. * Copyright Google Inc. All Rights Reserved.
  89976. *
  89977. * Use of this source code is governed by an MIT-style license that can be
  89978. * found in the LICENSE file at https://angular.io/license
  89979. */
  89980. /**
  89981. * @abstract
  89982. */
  89983. var Serializer = /** @class */ (function () {
  89984. function Serializer() {
  89985. }
  89986. // Creates a name mapper, see `PlaceholderMapper`
  89987. // Returning `null` means that no name mapping is used.
  89988. /**
  89989. * @param {?} message
  89990. * @return {?}
  89991. */
  89992. Serializer.prototype.createNameMapper = /**
  89993. * @param {?} message
  89994. * @return {?}
  89995. */
  89996. function (message) { return null; };
  89997. return Serializer;
  89998. }());
  89999. /**
  90000. * A `PlaceholderMapper` converts placeholder names from internal to serialized representation and
  90001. * back.
  90002. *
  90003. * It should be used for serialization format that put constraints on the placeholder names.
  90004. * @record
  90005. */
  90006. /**
  90007. * A simple mapper that take a function to transform an internal name to a public name
  90008. */
  90009. var SimplePlaceholderMapper = /** @class */ (function (_super) {
  90010. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(SimplePlaceholderMapper, _super);
  90011. // create a mapping from the message
  90012. function SimplePlaceholderMapper(message, mapName) {
  90013. var _this = _super.call(this) || this;
  90014. _this.mapName = mapName;
  90015. _this.internalToPublic = {};
  90016. _this.publicToNextId = {};
  90017. _this.publicToInternal = {};
  90018. message.nodes.forEach(function (node) { return node.visit(_this); });
  90019. return _this;
  90020. }
  90021. /**
  90022. * @param {?} internalName
  90023. * @return {?}
  90024. */
  90025. SimplePlaceholderMapper.prototype.toPublicName = /**
  90026. * @param {?} internalName
  90027. * @return {?}
  90028. */
  90029. function (internalName) {
  90030. return this.internalToPublic.hasOwnProperty(internalName) ?
  90031. this.internalToPublic[internalName] :
  90032. null;
  90033. };
  90034. /**
  90035. * @param {?} publicName
  90036. * @return {?}
  90037. */
  90038. SimplePlaceholderMapper.prototype.toInternalName = /**
  90039. * @param {?} publicName
  90040. * @return {?}
  90041. */
  90042. function (publicName) {
  90043. return this.publicToInternal.hasOwnProperty(publicName) ? this.publicToInternal[publicName] :
  90044. null;
  90045. };
  90046. /**
  90047. * @param {?} text
  90048. * @param {?=} context
  90049. * @return {?}
  90050. */
  90051. SimplePlaceholderMapper.prototype.visitText = /**
  90052. * @param {?} text
  90053. * @param {?=} context
  90054. * @return {?}
  90055. */
  90056. function (text, context) { return null; };
  90057. /**
  90058. * @param {?} ph
  90059. * @param {?=} context
  90060. * @return {?}
  90061. */
  90062. SimplePlaceholderMapper.prototype.visitTagPlaceholder = /**
  90063. * @param {?} ph
  90064. * @param {?=} context
  90065. * @return {?}
  90066. */
  90067. function (ph, context) {
  90068. this.visitPlaceholderName(ph.startName);
  90069. _super.prototype.visitTagPlaceholder.call(this, ph, context);
  90070. this.visitPlaceholderName(ph.closeName);
  90071. };
  90072. /**
  90073. * @param {?} ph
  90074. * @param {?=} context
  90075. * @return {?}
  90076. */
  90077. SimplePlaceholderMapper.prototype.visitPlaceholder = /**
  90078. * @param {?} ph
  90079. * @param {?=} context
  90080. * @return {?}
  90081. */
  90082. function (ph, context) { this.visitPlaceholderName(ph.name); };
  90083. /**
  90084. * @param {?} ph
  90085. * @param {?=} context
  90086. * @return {?}
  90087. */
  90088. SimplePlaceholderMapper.prototype.visitIcuPlaceholder = /**
  90089. * @param {?} ph
  90090. * @param {?=} context
  90091. * @return {?}
  90092. */
  90093. function (ph, context) {
  90094. this.visitPlaceholderName(ph.name);
  90095. };
  90096. /**
  90097. * @param {?} internalName
  90098. * @return {?}
  90099. */
  90100. SimplePlaceholderMapper.prototype.visitPlaceholderName = /**
  90101. * @param {?} internalName
  90102. * @return {?}
  90103. */
  90104. function (internalName) {
  90105. if (!internalName || this.internalToPublic.hasOwnProperty(internalName)) {
  90106. return;
  90107. }
  90108. var /** @type {?} */ publicName = this.mapName(internalName);
  90109. if (this.publicToInternal.hasOwnProperty(publicName)) {
  90110. // Create a new XMB when it has already been used
  90111. var /** @type {?} */ nextId = this.publicToNextId[publicName];
  90112. this.publicToNextId[publicName] = nextId + 1;
  90113. publicName = publicName + "_" + nextId;
  90114. }
  90115. else {
  90116. this.publicToNextId[publicName] = 1;
  90117. }
  90118. this.internalToPublic[internalName] = publicName;
  90119. this.publicToInternal[publicName] = internalName;
  90120. };
  90121. return SimplePlaceholderMapper;
  90122. }(RecurseVisitor));
  90123. /**
  90124. * @fileoverview added by tsickle
  90125. * @suppress {checkTypes} checked by tsc
  90126. */
  90127. /**
  90128. * @license
  90129. * Copyright Google Inc. All Rights Reserved.
  90130. *
  90131. * Use of this source code is governed by an MIT-style license that can be
  90132. * found in the LICENSE file at https://angular.io/license
  90133. */
  90134. /**
  90135. * @record
  90136. */
  90137. var _Visitor$1 = /** @class */ (function () {
  90138. function _Visitor() {
  90139. }
  90140. /**
  90141. * @param {?} tag
  90142. * @return {?}
  90143. */
  90144. _Visitor.prototype.visitTag = /**
  90145. * @param {?} tag
  90146. * @return {?}
  90147. */
  90148. function (tag) {
  90149. var _this = this;
  90150. var /** @type {?} */ strAttrs = this._serializeAttributes(tag.attrs);
  90151. if (tag.children.length == 0) {
  90152. return "<" + tag.name + strAttrs + "/>";
  90153. }
  90154. var /** @type {?} */ strChildren = tag.children.map(function (node) { return node.visit(_this); });
  90155. return "<" + tag.name + strAttrs + ">" + strChildren.join('') + "</" + tag.name + ">";
  90156. };
  90157. /**
  90158. * @param {?} text
  90159. * @return {?}
  90160. */
  90161. _Visitor.prototype.visitText = /**
  90162. * @param {?} text
  90163. * @return {?}
  90164. */
  90165. function (text) { return text.value; };
  90166. /**
  90167. * @param {?} decl
  90168. * @return {?}
  90169. */
  90170. _Visitor.prototype.visitDeclaration = /**
  90171. * @param {?} decl
  90172. * @return {?}
  90173. */
  90174. function (decl) {
  90175. return "<?xml" + this._serializeAttributes(decl.attrs) + " ?>";
  90176. };
  90177. /**
  90178. * @param {?} attrs
  90179. * @return {?}
  90180. */
  90181. _Visitor.prototype._serializeAttributes = /**
  90182. * @param {?} attrs
  90183. * @return {?}
  90184. */
  90185. function (attrs) {
  90186. var /** @type {?} */ strAttrs = Object.keys(attrs).map(function (name) { return name + "=\"" + attrs[name] + "\""; }).join(' ');
  90187. return strAttrs.length > 0 ? ' ' + strAttrs : '';
  90188. };
  90189. /**
  90190. * @param {?} doctype
  90191. * @return {?}
  90192. */
  90193. _Visitor.prototype.visitDoctype = /**
  90194. * @param {?} doctype
  90195. * @return {?}
  90196. */
  90197. function (doctype) {
  90198. return "<!DOCTYPE " + doctype.rootTag + " [\n" + doctype.dtd + "\n]>";
  90199. };
  90200. return _Visitor;
  90201. }());
  90202. var _visitor = new _Visitor$1();
  90203. /**
  90204. * @param {?} nodes
  90205. * @return {?}
  90206. */
  90207. function serialize(nodes) {
  90208. return nodes.map(function (node) { return node.visit(_visitor); }).join('');
  90209. }
  90210. /**
  90211. * @record
  90212. */
  90213. var Declaration = /** @class */ (function () {
  90214. function Declaration(unescapedAttrs) {
  90215. var _this = this;
  90216. this.attrs = {};
  90217. Object.keys(unescapedAttrs).forEach(function (k) {
  90218. _this.attrs[k] = escapeXml(unescapedAttrs[k]);
  90219. });
  90220. }
  90221. /**
  90222. * @param {?} visitor
  90223. * @return {?}
  90224. */
  90225. Declaration.prototype.visit = /**
  90226. * @param {?} visitor
  90227. * @return {?}
  90228. */
  90229. function (visitor) { return visitor.visitDeclaration(this); };
  90230. return Declaration;
  90231. }());
  90232. var Doctype = /** @class */ (function () {
  90233. function Doctype(rootTag, dtd) {
  90234. this.rootTag = rootTag;
  90235. this.dtd = dtd;
  90236. }
  90237. /**
  90238. * @param {?} visitor
  90239. * @return {?}
  90240. */
  90241. Doctype.prototype.visit = /**
  90242. * @param {?} visitor
  90243. * @return {?}
  90244. */
  90245. function (visitor) { return visitor.visitDoctype(this); };
  90246. return Doctype;
  90247. }());
  90248. var Tag = /** @class */ (function () {
  90249. function Tag(name, unescapedAttrs, children) {
  90250. if (unescapedAttrs === void 0) { unescapedAttrs = {}; }
  90251. if (children === void 0) { children = []; }
  90252. var _this = this;
  90253. this.name = name;
  90254. this.children = children;
  90255. this.attrs = {};
  90256. Object.keys(unescapedAttrs).forEach(function (k) {
  90257. _this.attrs[k] = escapeXml(unescapedAttrs[k]);
  90258. });
  90259. }
  90260. /**
  90261. * @param {?} visitor
  90262. * @return {?}
  90263. */
  90264. Tag.prototype.visit = /**
  90265. * @param {?} visitor
  90266. * @return {?}
  90267. */
  90268. function (visitor) { return visitor.visitTag(this); };
  90269. return Tag;
  90270. }());
  90271. var Text$2 = /** @class */ (function () {
  90272. function Text(unescapedValue) {
  90273. this.value = escapeXml(unescapedValue);
  90274. }
  90275. /**
  90276. * @param {?} visitor
  90277. * @return {?}
  90278. */
  90279. Text.prototype.visit = /**
  90280. * @param {?} visitor
  90281. * @return {?}
  90282. */
  90283. function (visitor) { return visitor.visitText(this); };
  90284. return Text;
  90285. }());
  90286. var CR = /** @class */ (function (_super) {
  90287. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(CR, _super);
  90288. function CR(ws) {
  90289. if (ws === void 0) { ws = 0; }
  90290. return _super.call(this, "\n" + new Array(ws + 1).join(' ')) || this;
  90291. }
  90292. return CR;
  90293. }(Text$2));
  90294. var _ESCAPED_CHARS = [
  90295. [/&/g, '&amp;'],
  90296. [/"/g, '&quot;'],
  90297. [/'/g, '&apos;'],
  90298. [/</g, '&lt;'],
  90299. [/>/g, '&gt;'],
  90300. ];
  90301. /**
  90302. * @param {?} text
  90303. * @return {?}
  90304. */
  90305. function escapeXml(text) {
  90306. return _ESCAPED_CHARS.reduce(function (text, entry) { return text.replace(entry[0], entry[1]); }, text);
  90307. }
  90308. /**
  90309. * @fileoverview added by tsickle
  90310. * @suppress {checkTypes} checked by tsc
  90311. */
  90312. /**
  90313. * @license
  90314. * Copyright Google Inc. All Rights Reserved.
  90315. *
  90316. * Use of this source code is governed by an MIT-style license that can be
  90317. * found in the LICENSE file at https://angular.io/license
  90318. */
  90319. var _VERSION = '1.2';
  90320. var _XMLNS = 'urn:oasis:names:tc:xliff:document:1.2';
  90321. // TODO(vicb): make this a param (s/_/-/)
  90322. var _DEFAULT_SOURCE_LANG = 'en';
  90323. var _PLACEHOLDER_TAG = 'x';
  90324. var _MARKER_TAG = 'mrk';
  90325. var _FILE_TAG = 'file';
  90326. var _SOURCE_TAG = 'source';
  90327. var _SEGMENT_SOURCE_TAG = 'seg-source';
  90328. var _TARGET_TAG = 'target';
  90329. var _UNIT_TAG = 'trans-unit';
  90330. var _CONTEXT_GROUP_TAG = 'context-group';
  90331. var _CONTEXT_TAG = 'context';
  90332. var Xliff = /** @class */ (function (_super) {
  90333. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(Xliff, _super);
  90334. function Xliff() {
  90335. return _super !== null && _super.apply(this, arguments) || this;
  90336. }
  90337. /**
  90338. * @param {?} messages
  90339. * @param {?} locale
  90340. * @return {?}
  90341. */
  90342. Xliff.prototype.write = /**
  90343. * @param {?} messages
  90344. * @param {?} locale
  90345. * @return {?}
  90346. */
  90347. function (messages, locale) {
  90348. var /** @type {?} */ visitor = new _WriteVisitor();
  90349. var /** @type {?} */ transUnits = [];
  90350. messages.forEach(function (message) {
  90351. var /** @type {?} */ contextTags = [];
  90352. message.sources.forEach(function (source) {
  90353. var /** @type {?} */ contextGroupTag = new Tag(_CONTEXT_GROUP_TAG, { purpose: 'location' });
  90354. contextGroupTag.children.push(new CR(10), new Tag(_CONTEXT_TAG, { 'context-type': 'sourcefile' }, [new Text$2(source.filePath)]), new CR(10), new Tag(_CONTEXT_TAG, { 'context-type': 'linenumber' }, [new Text$2("" + source.startLine)]), new CR(8));
  90355. contextTags.push(new CR(8), contextGroupTag);
  90356. });
  90357. var /** @type {?} */ transUnit = new Tag(_UNIT_TAG, { id: message.id, datatype: 'html' });
  90358. (_a = transUnit.children).push.apply(_a, [new CR(8), new Tag(_SOURCE_TAG, {}, visitor.serialize(message.nodes))].concat(contextTags));
  90359. if (message.description) {
  90360. transUnit.children.push(new CR(8), new Tag('note', { priority: '1', from: 'description' }, [new Text$2(message.description)]));
  90361. }
  90362. if (message.meaning) {
  90363. transUnit.children.push(new CR(8), new Tag('note', { priority: '1', from: 'meaning' }, [new Text$2(message.meaning)]));
  90364. }
  90365. transUnit.children.push(new CR(6));
  90366. transUnits.push(new CR(6), transUnit);
  90367. var _a;
  90368. });
  90369. var /** @type {?} */ body = new Tag('body', {}, transUnits.concat([new CR(4)]));
  90370. var /** @type {?} */ file = new Tag('file', {
  90371. 'source-language': locale || _DEFAULT_SOURCE_LANG,
  90372. datatype: 'plaintext',
  90373. original: 'ng2.template',
  90374. }, [new CR(4), body, new CR(2)]);
  90375. var /** @type {?} */ xliff = new Tag('xliff', { version: _VERSION, xmlns: _XMLNS }, [new CR(2), file, new CR()]);
  90376. return serialize([
  90377. new Declaration({ version: '1.0', encoding: 'UTF-8' }), new CR(), xliff, new CR()
  90378. ]);
  90379. };
  90380. /**
  90381. * @param {?} content
  90382. * @param {?} url
  90383. * @return {?}
  90384. */
  90385. Xliff.prototype.load = /**
  90386. * @param {?} content
  90387. * @param {?} url
  90388. * @return {?}
  90389. */
  90390. function (content, url) {
  90391. // xliff to xml nodes
  90392. var /** @type {?} */ xliffParser = new XliffParser();
  90393. var _a = xliffParser.parse(content, url), locale = _a.locale, msgIdToHtml = _a.msgIdToHtml, errors = _a.errors;
  90394. // xml nodes to i18n nodes
  90395. var /** @type {?} */ i18nNodesByMsgId = {};
  90396. var /** @type {?} */ converter = new XmlToI18n();
  90397. Object.keys(msgIdToHtml).forEach(function (msgId) {
  90398. var _a = converter.convert(msgIdToHtml[msgId], url), i18nNodes = _a.i18nNodes, e = _a.errors;
  90399. errors.push.apply(errors, e);
  90400. i18nNodesByMsgId[msgId] = i18nNodes;
  90401. });
  90402. if (errors.length) {
  90403. throw new Error("xliff parse errors:\n" + errors.join('\n'));
  90404. }
  90405. return { locale: /** @type {?} */ ((locale)), i18nNodesByMsgId: i18nNodesByMsgId };
  90406. };
  90407. /**
  90408. * @param {?} message
  90409. * @return {?}
  90410. */
  90411. Xliff.prototype.digest = /**
  90412. * @param {?} message
  90413. * @return {?}
  90414. */
  90415. function (message) { return digest(message); };
  90416. return Xliff;
  90417. }(Serializer));
  90418. var _WriteVisitor = /** @class */ (function () {
  90419. function _WriteVisitor() {
  90420. }
  90421. /**
  90422. * @param {?} text
  90423. * @param {?=} context
  90424. * @return {?}
  90425. */
  90426. _WriteVisitor.prototype.visitText = /**
  90427. * @param {?} text
  90428. * @param {?=} context
  90429. * @return {?}
  90430. */
  90431. function (text, context) { return [new Text$2(text.value)]; };
  90432. /**
  90433. * @param {?} container
  90434. * @param {?=} context
  90435. * @return {?}
  90436. */
  90437. _WriteVisitor.prototype.visitContainer = /**
  90438. * @param {?} container
  90439. * @param {?=} context
  90440. * @return {?}
  90441. */
  90442. function (container, context) {
  90443. var _this = this;
  90444. var /** @type {?} */ nodes = [];
  90445. container.children.forEach(function (node) { return nodes.push.apply(nodes, node.visit(_this)); });
  90446. return nodes;
  90447. };
  90448. /**
  90449. * @param {?} icu
  90450. * @param {?=} context
  90451. * @return {?}
  90452. */
  90453. _WriteVisitor.prototype.visitIcu = /**
  90454. * @param {?} icu
  90455. * @param {?=} context
  90456. * @return {?}
  90457. */
  90458. function (icu, context) {
  90459. var _this = this;
  90460. var /** @type {?} */ nodes = [new Text$2("{" + icu.expressionPlaceholder + ", " + icu.type + ", ")];
  90461. Object.keys(icu.cases).forEach(function (c) {
  90462. nodes.push.apply(nodes, [new Text$2(c + " {")].concat(icu.cases[c].visit(_this), [new Text$2("} ")]));
  90463. });
  90464. nodes.push(new Text$2("}"));
  90465. return nodes;
  90466. };
  90467. /**
  90468. * @param {?} ph
  90469. * @param {?=} context
  90470. * @return {?}
  90471. */
  90472. _WriteVisitor.prototype.visitTagPlaceholder = /**
  90473. * @param {?} ph
  90474. * @param {?=} context
  90475. * @return {?}
  90476. */
  90477. function (ph, context) {
  90478. var /** @type {?} */ ctype = getCtypeForTag(ph.tag);
  90479. if (ph.isVoid) {
  90480. // void tags have no children nor closing tags
  90481. return [new Tag(_PLACEHOLDER_TAG, { id: ph.startName, ctype: ctype, 'equiv-text': "<" + ph.tag + "/>" })];
  90482. }
  90483. var /** @type {?} */ startTagPh = new Tag(_PLACEHOLDER_TAG, { id: ph.startName, ctype: ctype, 'equiv-text': "<" + ph.tag + ">" });
  90484. var /** @type {?} */ closeTagPh = new Tag(_PLACEHOLDER_TAG, { id: ph.closeName, ctype: ctype, 'equiv-text': "</" + ph.tag + ">" });
  90485. return [startTagPh].concat(this.serialize(ph.children), [closeTagPh]);
  90486. };
  90487. /**
  90488. * @param {?} ph
  90489. * @param {?=} context
  90490. * @return {?}
  90491. */
  90492. _WriteVisitor.prototype.visitPlaceholder = /**
  90493. * @param {?} ph
  90494. * @param {?=} context
  90495. * @return {?}
  90496. */
  90497. function (ph, context) {
  90498. return [new Tag(_PLACEHOLDER_TAG, { id: ph.name, 'equiv-text': "{{" + ph.value + "}}" })];
  90499. };
  90500. /**
  90501. * @param {?} ph
  90502. * @param {?=} context
  90503. * @return {?}
  90504. */
  90505. _WriteVisitor.prototype.visitIcuPlaceholder = /**
  90506. * @param {?} ph
  90507. * @param {?=} context
  90508. * @return {?}
  90509. */
  90510. function (ph, context) {
  90511. var /** @type {?} */ equivText = "{" + ph.value.expression + ", " + ph.value.type + ", " + Object.keys(ph.value.cases).map(function (value) { return value + ' {...}'; }).join(' ') + "}";
  90512. return [new Tag(_PLACEHOLDER_TAG, { id: ph.name, 'equiv-text': equivText })];
  90513. };
  90514. /**
  90515. * @param {?} nodes
  90516. * @return {?}
  90517. */
  90518. _WriteVisitor.prototype.serialize = /**
  90519. * @param {?} nodes
  90520. * @return {?}
  90521. */
  90522. function (nodes) {
  90523. var _this = this;
  90524. return [].concat.apply([], nodes.map(function (node) { return node.visit(_this); }));
  90525. };
  90526. return _WriteVisitor;
  90527. }());
  90528. var XliffParser = /** @class */ (function () {
  90529. function XliffParser() {
  90530. this._locale = null;
  90531. }
  90532. /**
  90533. * @param {?} xliff
  90534. * @param {?} url
  90535. * @return {?}
  90536. */
  90537. XliffParser.prototype.parse = /**
  90538. * @param {?} xliff
  90539. * @param {?} url
  90540. * @return {?}
  90541. */
  90542. function (xliff, url) {
  90543. this._unitMlString = null;
  90544. this._msgIdToHtml = {};
  90545. var /** @type {?} */ xml = new XmlParser().parse(xliff, url, false);
  90546. this._errors = xml.errors;
  90547. visitAll(this, xml.rootNodes, null);
  90548. return {
  90549. msgIdToHtml: this._msgIdToHtml,
  90550. errors: this._errors,
  90551. locale: this._locale,
  90552. };
  90553. };
  90554. /**
  90555. * @param {?} element
  90556. * @param {?} context
  90557. * @return {?}
  90558. */
  90559. XliffParser.prototype.visitElement = /**
  90560. * @param {?} element
  90561. * @param {?} context
  90562. * @return {?}
  90563. */
  90564. function (element, context) {
  90565. switch (element.name) {
  90566. case _UNIT_TAG:
  90567. this._unitMlString = /** @type {?} */ ((null));
  90568. var /** @type {?} */ idAttr = element.attrs.find(function (attr) { return attr.name === 'id'; });
  90569. if (!idAttr) {
  90570. this._addError(element, "<" + _UNIT_TAG + "> misses the \"id\" attribute");
  90571. }
  90572. else {
  90573. var /** @type {?} */ id = idAttr.value;
  90574. if (this._msgIdToHtml.hasOwnProperty(id)) {
  90575. this._addError(element, "Duplicated translations for msg " + id);
  90576. }
  90577. else {
  90578. visitAll(this, element.children, null);
  90579. if (typeof this._unitMlString === 'string') {
  90580. this._msgIdToHtml[id] = this._unitMlString;
  90581. }
  90582. else {
  90583. this._addError(element, "Message " + id + " misses a translation");
  90584. }
  90585. }
  90586. }
  90587. break;
  90588. // ignore those tags
  90589. case _SOURCE_TAG:
  90590. case _SEGMENT_SOURCE_TAG:
  90591. break;
  90592. case _TARGET_TAG:
  90593. var /** @type {?} */ innerTextStart = /** @type {?} */ ((element.startSourceSpan)).end.offset;
  90594. var /** @type {?} */ innerTextEnd = /** @type {?} */ ((element.endSourceSpan)).start.offset;
  90595. var /** @type {?} */ content = /** @type {?} */ ((element.startSourceSpan)).start.file.content;
  90596. var /** @type {?} */ innerText = content.slice(innerTextStart, innerTextEnd);
  90597. this._unitMlString = innerText;
  90598. break;
  90599. case _FILE_TAG:
  90600. var /** @type {?} */ localeAttr = element.attrs.find(function (attr) { return attr.name === 'target-language'; });
  90601. if (localeAttr) {
  90602. this._locale = localeAttr.value;
  90603. }
  90604. visitAll(this, element.children, null);
  90605. break;
  90606. default:
  90607. // TODO(vicb): assert file structure, xliff version
  90608. // For now only recurse on unhandled nodes
  90609. visitAll(this, element.children, null);
  90610. }
  90611. };
  90612. /**
  90613. * @param {?} attribute
  90614. * @param {?} context
  90615. * @return {?}
  90616. */
  90617. XliffParser.prototype.visitAttribute = /**
  90618. * @param {?} attribute
  90619. * @param {?} context
  90620. * @return {?}
  90621. */
  90622. function (attribute, context) { };
  90623. /**
  90624. * @param {?} text
  90625. * @param {?} context
  90626. * @return {?}
  90627. */
  90628. XliffParser.prototype.visitText = /**
  90629. * @param {?} text
  90630. * @param {?} context
  90631. * @return {?}
  90632. */
  90633. function (text, context) { };
  90634. /**
  90635. * @param {?} comment
  90636. * @param {?} context
  90637. * @return {?}
  90638. */
  90639. XliffParser.prototype.visitComment = /**
  90640. * @param {?} comment
  90641. * @param {?} context
  90642. * @return {?}
  90643. */
  90644. function (comment, context) { };
  90645. /**
  90646. * @param {?} expansion
  90647. * @param {?} context
  90648. * @return {?}
  90649. */
  90650. XliffParser.prototype.visitExpansion = /**
  90651. * @param {?} expansion
  90652. * @param {?} context
  90653. * @return {?}
  90654. */
  90655. function (expansion, context) { };
  90656. /**
  90657. * @param {?} expansionCase
  90658. * @param {?} context
  90659. * @return {?}
  90660. */
  90661. XliffParser.prototype.visitExpansionCase = /**
  90662. * @param {?} expansionCase
  90663. * @param {?} context
  90664. * @return {?}
  90665. */
  90666. function (expansionCase, context) { };
  90667. /**
  90668. * @param {?} node
  90669. * @param {?} message
  90670. * @return {?}
  90671. */
  90672. XliffParser.prototype._addError = /**
  90673. * @param {?} node
  90674. * @param {?} message
  90675. * @return {?}
  90676. */
  90677. function (node, message) {
  90678. this._errors.push(new I18nError(/** @type {?} */ ((node.sourceSpan)), message));
  90679. };
  90680. return XliffParser;
  90681. }());
  90682. var XmlToI18n = /** @class */ (function () {
  90683. function XmlToI18n() {
  90684. }
  90685. /**
  90686. * @param {?} message
  90687. * @param {?} url
  90688. * @return {?}
  90689. */
  90690. XmlToI18n.prototype.convert = /**
  90691. * @param {?} message
  90692. * @param {?} url
  90693. * @return {?}
  90694. */
  90695. function (message, url) {
  90696. var /** @type {?} */ xmlIcu = new XmlParser().parse(message, url, true);
  90697. this._errors = xmlIcu.errors;
  90698. var /** @type {?} */ i18nNodes = this._errors.length > 0 || xmlIcu.rootNodes.length == 0 ?
  90699. [] : [].concat.apply([], visitAll(this, xmlIcu.rootNodes));
  90700. return {
  90701. i18nNodes: i18nNodes,
  90702. errors: this._errors,
  90703. };
  90704. };
  90705. /**
  90706. * @param {?} text
  90707. * @param {?} context
  90708. * @return {?}
  90709. */
  90710. XmlToI18n.prototype.visitText = /**
  90711. * @param {?} text
  90712. * @param {?} context
  90713. * @return {?}
  90714. */
  90715. function (text, context) { return new Text$1(text.value, /** @type {?} */ ((text.sourceSpan))); };
  90716. /**
  90717. * @param {?} el
  90718. * @param {?} context
  90719. * @return {?}
  90720. */
  90721. XmlToI18n.prototype.visitElement = /**
  90722. * @param {?} el
  90723. * @param {?} context
  90724. * @return {?}
  90725. */
  90726. function (el, context) {
  90727. if (el.name === _PLACEHOLDER_TAG) {
  90728. var /** @type {?} */ nameAttr = el.attrs.find(function (attr) { return attr.name === 'id'; });
  90729. if (nameAttr) {
  90730. return new Placeholder('', nameAttr.value, /** @type {?} */ ((el.sourceSpan)));
  90731. }
  90732. this._addError(el, "<" + _PLACEHOLDER_TAG + "> misses the \"id\" attribute");
  90733. return null;
  90734. }
  90735. if (el.name === _MARKER_TAG) {
  90736. return [].concat.apply([], visitAll(this, el.children));
  90737. }
  90738. this._addError(el, "Unexpected tag");
  90739. return null;
  90740. };
  90741. /**
  90742. * @param {?} icu
  90743. * @param {?} context
  90744. * @return {?}
  90745. */
  90746. XmlToI18n.prototype.visitExpansion = /**
  90747. * @param {?} icu
  90748. * @param {?} context
  90749. * @return {?}
  90750. */
  90751. function (icu, context) {
  90752. var /** @type {?} */ caseMap = {};
  90753. visitAll(this, icu.cases).forEach(function (c) {
  90754. caseMap[c.value] = new Container(c.nodes, icu.sourceSpan);
  90755. });
  90756. return new Icu(icu.switchValue, icu.type, caseMap, icu.sourceSpan);
  90757. };
  90758. /**
  90759. * @param {?} icuCase
  90760. * @param {?} context
  90761. * @return {?}
  90762. */
  90763. XmlToI18n.prototype.visitExpansionCase = /**
  90764. * @param {?} icuCase
  90765. * @param {?} context
  90766. * @return {?}
  90767. */
  90768. function (icuCase, context) {
  90769. return {
  90770. value: icuCase.value,
  90771. nodes: visitAll(this, icuCase.expression),
  90772. };
  90773. };
  90774. /**
  90775. * @param {?} comment
  90776. * @param {?} context
  90777. * @return {?}
  90778. */
  90779. XmlToI18n.prototype.visitComment = /**
  90780. * @param {?} comment
  90781. * @param {?} context
  90782. * @return {?}
  90783. */
  90784. function (comment, context) { };
  90785. /**
  90786. * @param {?} attribute
  90787. * @param {?} context
  90788. * @return {?}
  90789. */
  90790. XmlToI18n.prototype.visitAttribute = /**
  90791. * @param {?} attribute
  90792. * @param {?} context
  90793. * @return {?}
  90794. */
  90795. function (attribute, context) { };
  90796. /**
  90797. * @param {?} node
  90798. * @param {?} message
  90799. * @return {?}
  90800. */
  90801. XmlToI18n.prototype._addError = /**
  90802. * @param {?} node
  90803. * @param {?} message
  90804. * @return {?}
  90805. */
  90806. function (node, message) {
  90807. this._errors.push(new I18nError(/** @type {?} */ ((node.sourceSpan)), message));
  90808. };
  90809. return XmlToI18n;
  90810. }());
  90811. /**
  90812. * @param {?} tag
  90813. * @return {?}
  90814. */
  90815. function getCtypeForTag(tag) {
  90816. switch (tag.toLowerCase()) {
  90817. case 'br':
  90818. return 'lb';
  90819. case 'img':
  90820. return 'image';
  90821. default:
  90822. return "x-" + tag;
  90823. }
  90824. }
  90825. /**
  90826. * @fileoverview added by tsickle
  90827. * @suppress {checkTypes} checked by tsc
  90828. */
  90829. /**
  90830. * @license
  90831. * Copyright Google Inc. All Rights Reserved.
  90832. *
  90833. * Use of this source code is governed by an MIT-style license that can be
  90834. * found in the LICENSE file at https://angular.io/license
  90835. */
  90836. var _VERSION$1 = '2.0';
  90837. var _XMLNS$1 = 'urn:oasis:names:tc:xliff:document:2.0';
  90838. // TODO(vicb): make this a param (s/_/-/)
  90839. var _DEFAULT_SOURCE_LANG$1 = 'en';
  90840. var _PLACEHOLDER_TAG$1 = 'ph';
  90841. var _PLACEHOLDER_SPANNING_TAG = 'pc';
  90842. var _MARKER_TAG$1 = 'mrk';
  90843. var _XLIFF_TAG = 'xliff';
  90844. var _SOURCE_TAG$1 = 'source';
  90845. var _TARGET_TAG$1 = 'target';
  90846. var _UNIT_TAG$1 = 'unit';
  90847. var Xliff2 = /** @class */ (function (_super) {
  90848. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(Xliff2, _super);
  90849. function Xliff2() {
  90850. return _super !== null && _super.apply(this, arguments) || this;
  90851. }
  90852. /**
  90853. * @param {?} messages
  90854. * @param {?} locale
  90855. * @return {?}
  90856. */
  90857. Xliff2.prototype.write = /**
  90858. * @param {?} messages
  90859. * @param {?} locale
  90860. * @return {?}
  90861. */
  90862. function (messages, locale) {
  90863. var /** @type {?} */ visitor = new _WriteVisitor$1();
  90864. var /** @type {?} */ units = [];
  90865. messages.forEach(function (message) {
  90866. var /** @type {?} */ unit = new Tag(_UNIT_TAG$1, { id: message.id });
  90867. var /** @type {?} */ notes = new Tag('notes');
  90868. if (message.description || message.meaning) {
  90869. if (message.description) {
  90870. notes.children.push(new CR(8), new Tag('note', { category: 'description' }, [new Text$2(message.description)]));
  90871. }
  90872. if (message.meaning) {
  90873. notes.children.push(new CR(8), new Tag('note', { category: 'meaning' }, [new Text$2(message.meaning)]));
  90874. }
  90875. }
  90876. message.sources.forEach(function (source) {
  90877. notes.children.push(new CR(8), new Tag('note', { category: 'location' }, [
  90878. new Text$2(source.filePath + ":" + source.startLine + (source.endLine !== source.startLine ? ',' + source.endLine : ''))
  90879. ]));
  90880. });
  90881. notes.children.push(new CR(6));
  90882. unit.children.push(new CR(6), notes);
  90883. var /** @type {?} */ segment = new Tag('segment');
  90884. segment.children.push(new CR(8), new Tag(_SOURCE_TAG$1, {}, visitor.serialize(message.nodes)), new CR(6));
  90885. unit.children.push(new CR(6), segment, new CR(4));
  90886. units.push(new CR(4), unit);
  90887. });
  90888. var /** @type {?} */ file = new Tag('file', { 'original': 'ng.template', id: 'ngi18n' }, units.concat([new CR(2)]));
  90889. var /** @type {?} */ xliff = new Tag(_XLIFF_TAG, { version: _VERSION$1, xmlns: _XMLNS$1, srcLang: locale || _DEFAULT_SOURCE_LANG$1 }, [new CR(2), file, new CR()]);
  90890. return serialize([
  90891. new Declaration({ version: '1.0', encoding: 'UTF-8' }), new CR(), xliff, new CR()
  90892. ]);
  90893. };
  90894. /**
  90895. * @param {?} content
  90896. * @param {?} url
  90897. * @return {?}
  90898. */
  90899. Xliff2.prototype.load = /**
  90900. * @param {?} content
  90901. * @param {?} url
  90902. * @return {?}
  90903. */
  90904. function (content, url) {
  90905. // xliff to xml nodes
  90906. var /** @type {?} */ xliff2Parser = new Xliff2Parser();
  90907. var _a = xliff2Parser.parse(content, url), locale = _a.locale, msgIdToHtml = _a.msgIdToHtml, errors = _a.errors;
  90908. // xml nodes to i18n nodes
  90909. var /** @type {?} */ i18nNodesByMsgId = {};
  90910. var /** @type {?} */ converter = new XmlToI18n$1();
  90911. Object.keys(msgIdToHtml).forEach(function (msgId) {
  90912. var _a = converter.convert(msgIdToHtml[msgId], url), i18nNodes = _a.i18nNodes, e = _a.errors;
  90913. errors.push.apply(errors, e);
  90914. i18nNodesByMsgId[msgId] = i18nNodes;
  90915. });
  90916. if (errors.length) {
  90917. throw new Error("xliff2 parse errors:\n" + errors.join('\n'));
  90918. }
  90919. return { locale: /** @type {?} */ ((locale)), i18nNodesByMsgId: i18nNodesByMsgId };
  90920. };
  90921. /**
  90922. * @param {?} message
  90923. * @return {?}
  90924. */
  90925. Xliff2.prototype.digest = /**
  90926. * @param {?} message
  90927. * @return {?}
  90928. */
  90929. function (message) { return decimalDigest(message); };
  90930. return Xliff2;
  90931. }(Serializer));
  90932. var _WriteVisitor$1 = /** @class */ (function () {
  90933. function _WriteVisitor() {
  90934. }
  90935. /**
  90936. * @param {?} text
  90937. * @param {?=} context
  90938. * @return {?}
  90939. */
  90940. _WriteVisitor.prototype.visitText = /**
  90941. * @param {?} text
  90942. * @param {?=} context
  90943. * @return {?}
  90944. */
  90945. function (text, context) { return [new Text$2(text.value)]; };
  90946. /**
  90947. * @param {?} container
  90948. * @param {?=} context
  90949. * @return {?}
  90950. */
  90951. _WriteVisitor.prototype.visitContainer = /**
  90952. * @param {?} container
  90953. * @param {?=} context
  90954. * @return {?}
  90955. */
  90956. function (container, context) {
  90957. var _this = this;
  90958. var /** @type {?} */ nodes = [];
  90959. container.children.forEach(function (node) { return nodes.push.apply(nodes, node.visit(_this)); });
  90960. return nodes;
  90961. };
  90962. /**
  90963. * @param {?} icu
  90964. * @param {?=} context
  90965. * @return {?}
  90966. */
  90967. _WriteVisitor.prototype.visitIcu = /**
  90968. * @param {?} icu
  90969. * @param {?=} context
  90970. * @return {?}
  90971. */
  90972. function (icu, context) {
  90973. var _this = this;
  90974. var /** @type {?} */ nodes = [new Text$2("{" + icu.expressionPlaceholder + ", " + icu.type + ", ")];
  90975. Object.keys(icu.cases).forEach(function (c) {
  90976. nodes.push.apply(nodes, [new Text$2(c + " {")].concat(icu.cases[c].visit(_this), [new Text$2("} ")]));
  90977. });
  90978. nodes.push(new Text$2("}"));
  90979. return nodes;
  90980. };
  90981. /**
  90982. * @param {?} ph
  90983. * @param {?=} context
  90984. * @return {?}
  90985. */
  90986. _WriteVisitor.prototype.visitTagPlaceholder = /**
  90987. * @param {?} ph
  90988. * @param {?=} context
  90989. * @return {?}
  90990. */
  90991. function (ph, context) {
  90992. var _this = this;
  90993. var /** @type {?} */ type = getTypeForTag(ph.tag);
  90994. if (ph.isVoid) {
  90995. var /** @type {?} */ tagPh = new Tag(_PLACEHOLDER_TAG$1, {
  90996. id: (this._nextPlaceholderId++).toString(),
  90997. equiv: ph.startName,
  90998. type: type,
  90999. disp: "<" + ph.tag + "/>",
  91000. });
  91001. return [tagPh];
  91002. }
  91003. var /** @type {?} */ tagPc = new Tag(_PLACEHOLDER_SPANNING_TAG, {
  91004. id: (this._nextPlaceholderId++).toString(),
  91005. equivStart: ph.startName,
  91006. equivEnd: ph.closeName,
  91007. type: type,
  91008. dispStart: "<" + ph.tag + ">",
  91009. dispEnd: "</" + ph.tag + ">",
  91010. });
  91011. var /** @type {?} */ nodes = [].concat.apply([], ph.children.map(function (node) { return node.visit(_this); }));
  91012. if (nodes.length) {
  91013. nodes.forEach(function (node) { return tagPc.children.push(node); });
  91014. }
  91015. else {
  91016. tagPc.children.push(new Text$2(''));
  91017. }
  91018. return [tagPc];
  91019. };
  91020. /**
  91021. * @param {?} ph
  91022. * @param {?=} context
  91023. * @return {?}
  91024. */
  91025. _WriteVisitor.prototype.visitPlaceholder = /**
  91026. * @param {?} ph
  91027. * @param {?=} context
  91028. * @return {?}
  91029. */
  91030. function (ph, context) {
  91031. var /** @type {?} */ idStr = (this._nextPlaceholderId++).toString();
  91032. return [new Tag(_PLACEHOLDER_TAG$1, {
  91033. id: idStr,
  91034. equiv: ph.name,
  91035. disp: "{{" + ph.value + "}}",
  91036. })];
  91037. };
  91038. /**
  91039. * @param {?} ph
  91040. * @param {?=} context
  91041. * @return {?}
  91042. */
  91043. _WriteVisitor.prototype.visitIcuPlaceholder = /**
  91044. * @param {?} ph
  91045. * @param {?=} context
  91046. * @return {?}
  91047. */
  91048. function (ph, context) {
  91049. var /** @type {?} */ cases = Object.keys(ph.value.cases).map(function (value) { return value + ' {...}'; }).join(' ');
  91050. var /** @type {?} */ idStr = (this._nextPlaceholderId++).toString();
  91051. return [new Tag(_PLACEHOLDER_TAG$1, { id: idStr, equiv: ph.name, disp: "{" + ph.value.expression + ", " + ph.value.type + ", " + cases + "}" })];
  91052. };
  91053. /**
  91054. * @param {?} nodes
  91055. * @return {?}
  91056. */
  91057. _WriteVisitor.prototype.serialize = /**
  91058. * @param {?} nodes
  91059. * @return {?}
  91060. */
  91061. function (nodes) {
  91062. var _this = this;
  91063. this._nextPlaceholderId = 0;
  91064. return [].concat.apply([], nodes.map(function (node) { return node.visit(_this); }));
  91065. };
  91066. return _WriteVisitor;
  91067. }());
  91068. var Xliff2Parser = /** @class */ (function () {
  91069. function Xliff2Parser() {
  91070. this._locale = null;
  91071. }
  91072. /**
  91073. * @param {?} xliff
  91074. * @param {?} url
  91075. * @return {?}
  91076. */
  91077. Xliff2Parser.prototype.parse = /**
  91078. * @param {?} xliff
  91079. * @param {?} url
  91080. * @return {?}
  91081. */
  91082. function (xliff, url) {
  91083. this._unitMlString = null;
  91084. this._msgIdToHtml = {};
  91085. var /** @type {?} */ xml = new XmlParser().parse(xliff, url, false);
  91086. this._errors = xml.errors;
  91087. visitAll(this, xml.rootNodes, null);
  91088. return {
  91089. msgIdToHtml: this._msgIdToHtml,
  91090. errors: this._errors,
  91091. locale: this._locale,
  91092. };
  91093. };
  91094. /**
  91095. * @param {?} element
  91096. * @param {?} context
  91097. * @return {?}
  91098. */
  91099. Xliff2Parser.prototype.visitElement = /**
  91100. * @param {?} element
  91101. * @param {?} context
  91102. * @return {?}
  91103. */
  91104. function (element, context) {
  91105. switch (element.name) {
  91106. case _UNIT_TAG$1:
  91107. this._unitMlString = null;
  91108. var /** @type {?} */ idAttr = element.attrs.find(function (attr) { return attr.name === 'id'; });
  91109. if (!idAttr) {
  91110. this._addError(element, "<" + _UNIT_TAG$1 + "> misses the \"id\" attribute");
  91111. }
  91112. else {
  91113. var /** @type {?} */ id = idAttr.value;
  91114. if (this._msgIdToHtml.hasOwnProperty(id)) {
  91115. this._addError(element, "Duplicated translations for msg " + id);
  91116. }
  91117. else {
  91118. visitAll(this, element.children, null);
  91119. if (typeof this._unitMlString === 'string') {
  91120. this._msgIdToHtml[id] = this._unitMlString;
  91121. }
  91122. else {
  91123. this._addError(element, "Message " + id + " misses a translation");
  91124. }
  91125. }
  91126. }
  91127. break;
  91128. case _SOURCE_TAG$1:
  91129. // ignore source message
  91130. break;
  91131. case _TARGET_TAG$1:
  91132. var /** @type {?} */ innerTextStart = /** @type {?} */ ((element.startSourceSpan)).end.offset;
  91133. var /** @type {?} */ innerTextEnd = /** @type {?} */ ((element.endSourceSpan)).start.offset;
  91134. var /** @type {?} */ content = /** @type {?} */ ((element.startSourceSpan)).start.file.content;
  91135. var /** @type {?} */ innerText = content.slice(innerTextStart, innerTextEnd);
  91136. this._unitMlString = innerText;
  91137. break;
  91138. case _XLIFF_TAG:
  91139. var /** @type {?} */ localeAttr = element.attrs.find(function (attr) { return attr.name === 'trgLang'; });
  91140. if (localeAttr) {
  91141. this._locale = localeAttr.value;
  91142. }
  91143. var /** @type {?} */ versionAttr = element.attrs.find(function (attr) { return attr.name === 'version'; });
  91144. if (versionAttr) {
  91145. var /** @type {?} */ version = versionAttr.value;
  91146. if (version !== '2.0') {
  91147. this._addError(element, "The XLIFF file version " + version + " is not compatible with XLIFF 2.0 serializer");
  91148. }
  91149. else {
  91150. visitAll(this, element.children, null);
  91151. }
  91152. }
  91153. break;
  91154. default:
  91155. visitAll(this, element.children, null);
  91156. }
  91157. };
  91158. /**
  91159. * @param {?} attribute
  91160. * @param {?} context
  91161. * @return {?}
  91162. */
  91163. Xliff2Parser.prototype.visitAttribute = /**
  91164. * @param {?} attribute
  91165. * @param {?} context
  91166. * @return {?}
  91167. */
  91168. function (attribute, context) { };
  91169. /**
  91170. * @param {?} text
  91171. * @param {?} context
  91172. * @return {?}
  91173. */
  91174. Xliff2Parser.prototype.visitText = /**
  91175. * @param {?} text
  91176. * @param {?} context
  91177. * @return {?}
  91178. */
  91179. function (text, context) { };
  91180. /**
  91181. * @param {?} comment
  91182. * @param {?} context
  91183. * @return {?}
  91184. */
  91185. Xliff2Parser.prototype.visitComment = /**
  91186. * @param {?} comment
  91187. * @param {?} context
  91188. * @return {?}
  91189. */
  91190. function (comment, context) { };
  91191. /**
  91192. * @param {?} expansion
  91193. * @param {?} context
  91194. * @return {?}
  91195. */
  91196. Xliff2Parser.prototype.visitExpansion = /**
  91197. * @param {?} expansion
  91198. * @param {?} context
  91199. * @return {?}
  91200. */
  91201. function (expansion, context) { };
  91202. /**
  91203. * @param {?} expansionCase
  91204. * @param {?} context
  91205. * @return {?}
  91206. */
  91207. Xliff2Parser.prototype.visitExpansionCase = /**
  91208. * @param {?} expansionCase
  91209. * @param {?} context
  91210. * @return {?}
  91211. */
  91212. function (expansionCase, context) { };
  91213. /**
  91214. * @param {?} node
  91215. * @param {?} message
  91216. * @return {?}
  91217. */
  91218. Xliff2Parser.prototype._addError = /**
  91219. * @param {?} node
  91220. * @param {?} message
  91221. * @return {?}
  91222. */
  91223. function (node, message) {
  91224. this._errors.push(new I18nError(node.sourceSpan, message));
  91225. };
  91226. return Xliff2Parser;
  91227. }());
  91228. var XmlToI18n$1 = /** @class */ (function () {
  91229. function XmlToI18n() {
  91230. }
  91231. /**
  91232. * @param {?} message
  91233. * @param {?} url
  91234. * @return {?}
  91235. */
  91236. XmlToI18n.prototype.convert = /**
  91237. * @param {?} message
  91238. * @param {?} url
  91239. * @return {?}
  91240. */
  91241. function (message, url) {
  91242. var /** @type {?} */ xmlIcu = new XmlParser().parse(message, url, true);
  91243. this._errors = xmlIcu.errors;
  91244. var /** @type {?} */ i18nNodes = this._errors.length > 0 || xmlIcu.rootNodes.length == 0 ?
  91245. [] : [].concat.apply([], visitAll(this, xmlIcu.rootNodes));
  91246. return {
  91247. i18nNodes: i18nNodes,
  91248. errors: this._errors,
  91249. };
  91250. };
  91251. /**
  91252. * @param {?} text
  91253. * @param {?} context
  91254. * @return {?}
  91255. */
  91256. XmlToI18n.prototype.visitText = /**
  91257. * @param {?} text
  91258. * @param {?} context
  91259. * @return {?}
  91260. */
  91261. function (text, context) { return new Text$1(text.value, text.sourceSpan); };
  91262. /**
  91263. * @param {?} el
  91264. * @param {?} context
  91265. * @return {?}
  91266. */
  91267. XmlToI18n.prototype.visitElement = /**
  91268. * @param {?} el
  91269. * @param {?} context
  91270. * @return {?}
  91271. */
  91272. function (el, context) {
  91273. var _this = this;
  91274. switch (el.name) {
  91275. case _PLACEHOLDER_TAG$1:
  91276. var /** @type {?} */ nameAttr = el.attrs.find(function (attr) { return attr.name === 'equiv'; });
  91277. if (nameAttr) {
  91278. return [new Placeholder('', nameAttr.value, el.sourceSpan)];
  91279. }
  91280. this._addError(el, "<" + _PLACEHOLDER_TAG$1 + "> misses the \"equiv\" attribute");
  91281. break;
  91282. case _PLACEHOLDER_SPANNING_TAG:
  91283. var /** @type {?} */ startAttr = el.attrs.find(function (attr) { return attr.name === 'equivStart'; });
  91284. var /** @type {?} */ endAttr = el.attrs.find(function (attr) { return attr.name === 'equivEnd'; });
  91285. if (!startAttr) {
  91286. this._addError(el, "<" + _PLACEHOLDER_TAG$1 + "> misses the \"equivStart\" attribute");
  91287. }
  91288. else if (!endAttr) {
  91289. this._addError(el, "<" + _PLACEHOLDER_TAG$1 + "> misses the \"equivEnd\" attribute");
  91290. }
  91291. else {
  91292. var /** @type {?} */ startId = startAttr.value;
  91293. var /** @type {?} */ endId = endAttr.value;
  91294. var /** @type {?} */ nodes = [];
  91295. return nodes.concat.apply(nodes, [new Placeholder('', startId, el.sourceSpan)].concat(el.children.map(function (node) { return node.visit(_this, null); }), [new Placeholder('', endId, el.sourceSpan)]));
  91296. }
  91297. break;
  91298. case _MARKER_TAG$1:
  91299. return [].concat.apply([], visitAll(this, el.children));
  91300. default:
  91301. this._addError(el, "Unexpected tag");
  91302. }
  91303. return null;
  91304. };
  91305. /**
  91306. * @param {?} icu
  91307. * @param {?} context
  91308. * @return {?}
  91309. */
  91310. XmlToI18n.prototype.visitExpansion = /**
  91311. * @param {?} icu
  91312. * @param {?} context
  91313. * @return {?}
  91314. */
  91315. function (icu, context) {
  91316. var /** @type {?} */ caseMap = {};
  91317. visitAll(this, icu.cases).forEach(function (c) {
  91318. caseMap[c.value] = new Container(c.nodes, icu.sourceSpan);
  91319. });
  91320. return new Icu(icu.switchValue, icu.type, caseMap, icu.sourceSpan);
  91321. };
  91322. /**
  91323. * @param {?} icuCase
  91324. * @param {?} context
  91325. * @return {?}
  91326. */
  91327. XmlToI18n.prototype.visitExpansionCase = /**
  91328. * @param {?} icuCase
  91329. * @param {?} context
  91330. * @return {?}
  91331. */
  91332. function (icuCase, context) {
  91333. return {
  91334. value: icuCase.value,
  91335. nodes: [].concat.apply([], visitAll(this, icuCase.expression)),
  91336. };
  91337. };
  91338. /**
  91339. * @param {?} comment
  91340. * @param {?} context
  91341. * @return {?}
  91342. */
  91343. XmlToI18n.prototype.visitComment = /**
  91344. * @param {?} comment
  91345. * @param {?} context
  91346. * @return {?}
  91347. */
  91348. function (comment, context) { };
  91349. /**
  91350. * @param {?} attribute
  91351. * @param {?} context
  91352. * @return {?}
  91353. */
  91354. XmlToI18n.prototype.visitAttribute = /**
  91355. * @param {?} attribute
  91356. * @param {?} context
  91357. * @return {?}
  91358. */
  91359. function (attribute, context) { };
  91360. /**
  91361. * @param {?} node
  91362. * @param {?} message
  91363. * @return {?}
  91364. */
  91365. XmlToI18n.prototype._addError = /**
  91366. * @param {?} node
  91367. * @param {?} message
  91368. * @return {?}
  91369. */
  91370. function (node, message) {
  91371. this._errors.push(new I18nError(node.sourceSpan, message));
  91372. };
  91373. return XmlToI18n;
  91374. }());
  91375. /**
  91376. * @param {?} tag
  91377. * @return {?}
  91378. */
  91379. function getTypeForTag(tag) {
  91380. switch (tag.toLowerCase()) {
  91381. case 'br':
  91382. case 'b':
  91383. case 'i':
  91384. case 'u':
  91385. return 'fmt';
  91386. case 'img':
  91387. return 'image';
  91388. case 'a':
  91389. return 'link';
  91390. default:
  91391. return 'other';
  91392. }
  91393. }
  91394. /**
  91395. * @fileoverview added by tsickle
  91396. * @suppress {checkTypes} checked by tsc
  91397. */
  91398. /**
  91399. * @license
  91400. * Copyright Google Inc. All Rights Reserved.
  91401. *
  91402. * Use of this source code is governed by an MIT-style license that can be
  91403. * found in the LICENSE file at https://angular.io/license
  91404. */
  91405. var _MESSAGES_TAG = 'messagebundle';
  91406. var _MESSAGE_TAG = 'msg';
  91407. var _PLACEHOLDER_TAG$2 = 'ph';
  91408. var _EXEMPLE_TAG = 'ex';
  91409. var _SOURCE_TAG$2 = 'source';
  91410. var _DOCTYPE = "<!ELEMENT messagebundle (msg)*>\n<!ATTLIST messagebundle class CDATA #IMPLIED>\n\n<!ELEMENT msg (#PCDATA|ph|source)*>\n<!ATTLIST msg id CDATA #IMPLIED>\n<!ATTLIST msg seq CDATA #IMPLIED>\n<!ATTLIST msg name CDATA #IMPLIED>\n<!ATTLIST msg desc CDATA #IMPLIED>\n<!ATTLIST msg meaning CDATA #IMPLIED>\n<!ATTLIST msg obsolete (obsolete) #IMPLIED>\n<!ATTLIST msg xml:space (default|preserve) \"default\">\n<!ATTLIST msg is_hidden CDATA #IMPLIED>\n\n<!ELEMENT source (#PCDATA)>\n\n<!ELEMENT ph (#PCDATA|ex)*>\n<!ATTLIST ph name CDATA #REQUIRED>\n\n<!ELEMENT ex (#PCDATA)>";
  91411. var Xmb = /** @class */ (function (_super) {
  91412. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(Xmb, _super);
  91413. function Xmb() {
  91414. return _super !== null && _super.apply(this, arguments) || this;
  91415. }
  91416. /**
  91417. * @param {?} messages
  91418. * @param {?} locale
  91419. * @return {?}
  91420. */
  91421. Xmb.prototype.write = /**
  91422. * @param {?} messages
  91423. * @param {?} locale
  91424. * @return {?}
  91425. */
  91426. function (messages, locale) {
  91427. var /** @type {?} */ exampleVisitor = new ExampleVisitor();
  91428. var /** @type {?} */ visitor = new _Visitor$2();
  91429. var /** @type {?} */ rootNode = new Tag(_MESSAGES_TAG);
  91430. messages.forEach(function (message) {
  91431. var /** @type {?} */ attrs = { id: message.id };
  91432. if (message.description) {
  91433. attrs['desc'] = message.description;
  91434. }
  91435. if (message.meaning) {
  91436. attrs['meaning'] = message.meaning;
  91437. }
  91438. var /** @type {?} */ sourceTags = [];
  91439. message.sources.forEach(function (source) {
  91440. sourceTags.push(new Tag(_SOURCE_TAG$2, {}, [
  91441. new Text$2(source.filePath + ":" + source.startLine + (source.endLine !== source.startLine ? ',' + source.endLine : ''))
  91442. ]));
  91443. });
  91444. rootNode.children.push(new CR(2), new Tag(_MESSAGE_TAG, attrs, sourceTags.concat(visitor.serialize(message.nodes))));
  91445. });
  91446. rootNode.children.push(new CR());
  91447. return serialize([
  91448. new Declaration({ version: '1.0', encoding: 'UTF-8' }),
  91449. new CR(),
  91450. new Doctype(_MESSAGES_TAG, _DOCTYPE),
  91451. new CR(),
  91452. exampleVisitor.addDefaultExamples(rootNode),
  91453. new CR(),
  91454. ]);
  91455. };
  91456. /**
  91457. * @param {?} content
  91458. * @param {?} url
  91459. * @return {?}
  91460. */
  91461. Xmb.prototype.load = /**
  91462. * @param {?} content
  91463. * @param {?} url
  91464. * @return {?}
  91465. */
  91466. function (content, url) {
  91467. throw new Error('Unsupported');
  91468. };
  91469. /**
  91470. * @param {?} message
  91471. * @return {?}
  91472. */
  91473. Xmb.prototype.digest = /**
  91474. * @param {?} message
  91475. * @return {?}
  91476. */
  91477. function (message) { return digest$1(message); };
  91478. /**
  91479. * @param {?} message
  91480. * @return {?}
  91481. */
  91482. Xmb.prototype.createNameMapper = /**
  91483. * @param {?} message
  91484. * @return {?}
  91485. */
  91486. function (message) {
  91487. return new SimplePlaceholderMapper(message, toPublicName);
  91488. };
  91489. return Xmb;
  91490. }(Serializer));
  91491. var _Visitor$2 = /** @class */ (function () {
  91492. function _Visitor() {
  91493. }
  91494. /**
  91495. * @param {?} text
  91496. * @param {?=} context
  91497. * @return {?}
  91498. */
  91499. _Visitor.prototype.visitText = /**
  91500. * @param {?} text
  91501. * @param {?=} context
  91502. * @return {?}
  91503. */
  91504. function (text, context) { return [new Text$2(text.value)]; };
  91505. /**
  91506. * @param {?} container
  91507. * @param {?} context
  91508. * @return {?}
  91509. */
  91510. _Visitor.prototype.visitContainer = /**
  91511. * @param {?} container
  91512. * @param {?} context
  91513. * @return {?}
  91514. */
  91515. function (container, context) {
  91516. var _this = this;
  91517. var /** @type {?} */ nodes = [];
  91518. container.children.forEach(function (node) { return nodes.push.apply(nodes, node.visit(_this)); });
  91519. return nodes;
  91520. };
  91521. /**
  91522. * @param {?} icu
  91523. * @param {?=} context
  91524. * @return {?}
  91525. */
  91526. _Visitor.prototype.visitIcu = /**
  91527. * @param {?} icu
  91528. * @param {?=} context
  91529. * @return {?}
  91530. */
  91531. function (icu, context) {
  91532. var _this = this;
  91533. var /** @type {?} */ nodes = [new Text$2("{" + icu.expressionPlaceholder + ", " + icu.type + ", ")];
  91534. Object.keys(icu.cases).forEach(function (c) {
  91535. nodes.push.apply(nodes, [new Text$2(c + " {")].concat(icu.cases[c].visit(_this), [new Text$2("} ")]));
  91536. });
  91537. nodes.push(new Text$2("}"));
  91538. return nodes;
  91539. };
  91540. /**
  91541. * @param {?} ph
  91542. * @param {?=} context
  91543. * @return {?}
  91544. */
  91545. _Visitor.prototype.visitTagPlaceholder = /**
  91546. * @param {?} ph
  91547. * @param {?=} context
  91548. * @return {?}
  91549. */
  91550. function (ph, context) {
  91551. var /** @type {?} */ startEx = new Tag(_EXEMPLE_TAG, {}, [new Text$2("<" + ph.tag + ">")]);
  91552. var /** @type {?} */ startTagPh = new Tag(_PLACEHOLDER_TAG$2, { name: ph.startName }, [startEx]);
  91553. if (ph.isVoid) {
  91554. // void tags have no children nor closing tags
  91555. return [startTagPh];
  91556. }
  91557. var /** @type {?} */ closeEx = new Tag(_EXEMPLE_TAG, {}, [new Text$2("</" + ph.tag + ">")]);
  91558. var /** @type {?} */ closeTagPh = new Tag(_PLACEHOLDER_TAG$2, { name: ph.closeName }, [closeEx]);
  91559. return [startTagPh].concat(this.serialize(ph.children), [closeTagPh]);
  91560. };
  91561. /**
  91562. * @param {?} ph
  91563. * @param {?=} context
  91564. * @return {?}
  91565. */
  91566. _Visitor.prototype.visitPlaceholder = /**
  91567. * @param {?} ph
  91568. * @param {?=} context
  91569. * @return {?}
  91570. */
  91571. function (ph, context) {
  91572. var /** @type {?} */ exTag = new Tag(_EXEMPLE_TAG, {}, [new Text$2("{{" + ph.value + "}}")]);
  91573. return [new Tag(_PLACEHOLDER_TAG$2, { name: ph.name }, [exTag])];
  91574. };
  91575. /**
  91576. * @param {?} ph
  91577. * @param {?=} context
  91578. * @return {?}
  91579. */
  91580. _Visitor.prototype.visitIcuPlaceholder = /**
  91581. * @param {?} ph
  91582. * @param {?=} context
  91583. * @return {?}
  91584. */
  91585. function (ph, context) {
  91586. var /** @type {?} */ exTag = new Tag(_EXEMPLE_TAG, {}, [
  91587. new Text$2("{" + ph.value.expression + ", " + ph.value.type + ", " + Object.keys(ph.value.cases).map(function (value) { return value + ' {...}'; }).join(' ') + "}")
  91588. ]);
  91589. return [new Tag(_PLACEHOLDER_TAG$2, { name: ph.name }, [exTag])];
  91590. };
  91591. /**
  91592. * @param {?} nodes
  91593. * @return {?}
  91594. */
  91595. _Visitor.prototype.serialize = /**
  91596. * @param {?} nodes
  91597. * @return {?}
  91598. */
  91599. function (nodes) {
  91600. var _this = this;
  91601. return [].concat.apply([], nodes.map(function (node) { return node.visit(_this); }));
  91602. };
  91603. return _Visitor;
  91604. }());
  91605. /**
  91606. * @param {?} message
  91607. * @return {?}
  91608. */
  91609. function digest$1(message) {
  91610. return decimalDigest(message);
  91611. }
  91612. var ExampleVisitor = /** @class */ (function () {
  91613. function ExampleVisitor() {
  91614. }
  91615. /**
  91616. * @param {?} node
  91617. * @return {?}
  91618. */
  91619. ExampleVisitor.prototype.addDefaultExamples = /**
  91620. * @param {?} node
  91621. * @return {?}
  91622. */
  91623. function (node) {
  91624. node.visit(this);
  91625. return node;
  91626. };
  91627. /**
  91628. * @param {?} tag
  91629. * @return {?}
  91630. */
  91631. ExampleVisitor.prototype.visitTag = /**
  91632. * @param {?} tag
  91633. * @return {?}
  91634. */
  91635. function (tag) {
  91636. var _this = this;
  91637. if (tag.name === _PLACEHOLDER_TAG$2) {
  91638. if (!tag.children || tag.children.length == 0) {
  91639. var /** @type {?} */ exText = new Text$2(tag.attrs['name'] || '...');
  91640. tag.children = [new Tag(_EXEMPLE_TAG, {}, [exText])];
  91641. }
  91642. }
  91643. else if (tag.children) {
  91644. tag.children.forEach(function (node) { return node.visit(_this); });
  91645. }
  91646. };
  91647. /**
  91648. * @param {?} text
  91649. * @return {?}
  91650. */
  91651. ExampleVisitor.prototype.visitText = /**
  91652. * @param {?} text
  91653. * @return {?}
  91654. */
  91655. function (text) { };
  91656. /**
  91657. * @param {?} decl
  91658. * @return {?}
  91659. */
  91660. ExampleVisitor.prototype.visitDeclaration = /**
  91661. * @param {?} decl
  91662. * @return {?}
  91663. */
  91664. function (decl) { };
  91665. /**
  91666. * @param {?} doctype
  91667. * @return {?}
  91668. */
  91669. ExampleVisitor.prototype.visitDoctype = /**
  91670. * @param {?} doctype
  91671. * @return {?}
  91672. */
  91673. function (doctype) { };
  91674. return ExampleVisitor;
  91675. }());
  91676. /**
  91677. * @param {?} internalName
  91678. * @return {?}
  91679. */
  91680. function toPublicName(internalName) {
  91681. return internalName.toUpperCase().replace(/[^A-Z0-9_]/g, '_');
  91682. }
  91683. /**
  91684. * @fileoverview added by tsickle
  91685. * @suppress {checkTypes} checked by tsc
  91686. */
  91687. /**
  91688. * @license
  91689. * Copyright Google Inc. All Rights Reserved.
  91690. *
  91691. * Use of this source code is governed by an MIT-style license that can be
  91692. * found in the LICENSE file at https://angular.io/license
  91693. */
  91694. var _TRANSLATIONS_TAG = 'translationbundle';
  91695. var _TRANSLATION_TAG = 'translation';
  91696. var _PLACEHOLDER_TAG$3 = 'ph';
  91697. var Xtb = /** @class */ (function (_super) {
  91698. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(Xtb, _super);
  91699. function Xtb() {
  91700. return _super !== null && _super.apply(this, arguments) || this;
  91701. }
  91702. /**
  91703. * @param {?} messages
  91704. * @param {?} locale
  91705. * @return {?}
  91706. */
  91707. Xtb.prototype.write = /**
  91708. * @param {?} messages
  91709. * @param {?} locale
  91710. * @return {?}
  91711. */
  91712. function (messages, locale) { throw new Error('Unsupported'); };
  91713. /**
  91714. * @param {?} content
  91715. * @param {?} url
  91716. * @return {?}
  91717. */
  91718. Xtb.prototype.load = /**
  91719. * @param {?} content
  91720. * @param {?} url
  91721. * @return {?}
  91722. */
  91723. function (content, url) {
  91724. // xtb to xml nodes
  91725. var /** @type {?} */ xtbParser = new XtbParser();
  91726. var _a = xtbParser.parse(content, url), locale = _a.locale, msgIdToHtml = _a.msgIdToHtml, errors = _a.errors;
  91727. // xml nodes to i18n nodes
  91728. var /** @type {?} */ i18nNodesByMsgId = {};
  91729. var /** @type {?} */ converter = new XmlToI18n$2();
  91730. // Because we should be able to load xtb files that rely on features not supported by angular,
  91731. // we need to delay the conversion of html to i18n nodes so that non angular messages are not
  91732. // converted
  91733. Object.keys(msgIdToHtml).forEach(function (msgId) {
  91734. var /** @type {?} */ valueFn = function () {
  91735. var _a = converter.convert(msgIdToHtml[msgId], url), i18nNodes = _a.i18nNodes, errors = _a.errors;
  91736. if (errors.length) {
  91737. throw new Error("xtb parse errors:\n" + errors.join('\n'));
  91738. }
  91739. return i18nNodes;
  91740. };
  91741. createLazyProperty(i18nNodesByMsgId, msgId, valueFn);
  91742. });
  91743. if (errors.length) {
  91744. throw new Error("xtb parse errors:\n" + errors.join('\n'));
  91745. }
  91746. return { locale: /** @type {?} */ ((locale)), i18nNodesByMsgId: i18nNodesByMsgId };
  91747. };
  91748. /**
  91749. * @param {?} message
  91750. * @return {?}
  91751. */
  91752. Xtb.prototype.digest = /**
  91753. * @param {?} message
  91754. * @return {?}
  91755. */
  91756. function (message) { return digest$1(message); };
  91757. /**
  91758. * @param {?} message
  91759. * @return {?}
  91760. */
  91761. Xtb.prototype.createNameMapper = /**
  91762. * @param {?} message
  91763. * @return {?}
  91764. */
  91765. function (message) {
  91766. return new SimplePlaceholderMapper(message, toPublicName);
  91767. };
  91768. return Xtb;
  91769. }(Serializer));
  91770. /**
  91771. * @param {?} messages
  91772. * @param {?} id
  91773. * @param {?} valueFn
  91774. * @return {?}
  91775. */
  91776. function createLazyProperty(messages, id, valueFn) {
  91777. Object.defineProperty(messages, id, {
  91778. configurable: true,
  91779. enumerable: true,
  91780. get: function () {
  91781. var /** @type {?} */ value = valueFn();
  91782. Object.defineProperty(messages, id, { enumerable: true, value: value });
  91783. return value;
  91784. },
  91785. set: function (_) { throw new Error('Could not overwrite an XTB translation'); },
  91786. });
  91787. }
  91788. var XtbParser = /** @class */ (function () {
  91789. function XtbParser() {
  91790. this._locale = null;
  91791. }
  91792. /**
  91793. * @param {?} xtb
  91794. * @param {?} url
  91795. * @return {?}
  91796. */
  91797. XtbParser.prototype.parse = /**
  91798. * @param {?} xtb
  91799. * @param {?} url
  91800. * @return {?}
  91801. */
  91802. function (xtb, url) {
  91803. this._bundleDepth = 0;
  91804. this._msgIdToHtml = {};
  91805. // We can not parse the ICU messages at this point as some messages might not originate
  91806. // from Angular that could not be lex'd.
  91807. var /** @type {?} */ xml = new XmlParser().parse(xtb, url, false);
  91808. this._errors = xml.errors;
  91809. visitAll(this, xml.rootNodes);
  91810. return {
  91811. msgIdToHtml: this._msgIdToHtml,
  91812. errors: this._errors,
  91813. locale: this._locale,
  91814. };
  91815. };
  91816. /**
  91817. * @param {?} element
  91818. * @param {?} context
  91819. * @return {?}
  91820. */
  91821. XtbParser.prototype.visitElement = /**
  91822. * @param {?} element
  91823. * @param {?} context
  91824. * @return {?}
  91825. */
  91826. function (element, context) {
  91827. switch (element.name) {
  91828. case _TRANSLATIONS_TAG:
  91829. this._bundleDepth++;
  91830. if (this._bundleDepth > 1) {
  91831. this._addError(element, "<" + _TRANSLATIONS_TAG + "> elements can not be nested");
  91832. }
  91833. var /** @type {?} */ langAttr = element.attrs.find(function (attr) { return attr.name === 'lang'; });
  91834. if (langAttr) {
  91835. this._locale = langAttr.value;
  91836. }
  91837. visitAll(this, element.children, null);
  91838. this._bundleDepth--;
  91839. break;
  91840. case _TRANSLATION_TAG:
  91841. var /** @type {?} */ idAttr = element.attrs.find(function (attr) { return attr.name === 'id'; });
  91842. if (!idAttr) {
  91843. this._addError(element, "<" + _TRANSLATION_TAG + "> misses the \"id\" attribute");
  91844. }
  91845. else {
  91846. var /** @type {?} */ id = idAttr.value;
  91847. if (this._msgIdToHtml.hasOwnProperty(id)) {
  91848. this._addError(element, "Duplicated translations for msg " + id);
  91849. }
  91850. else {
  91851. var /** @type {?} */ innerTextStart = /** @type {?} */ ((element.startSourceSpan)).end.offset;
  91852. var /** @type {?} */ innerTextEnd = /** @type {?} */ ((element.endSourceSpan)).start.offset;
  91853. var /** @type {?} */ content = /** @type {?} */ ((element.startSourceSpan)).start.file.content;
  91854. var /** @type {?} */ innerText = content.slice(/** @type {?} */ ((innerTextStart)), /** @type {?} */ ((innerTextEnd)));
  91855. this._msgIdToHtml[id] = innerText;
  91856. }
  91857. }
  91858. break;
  91859. default:
  91860. this._addError(element, 'Unexpected tag');
  91861. }
  91862. };
  91863. /**
  91864. * @param {?} attribute
  91865. * @param {?} context
  91866. * @return {?}
  91867. */
  91868. XtbParser.prototype.visitAttribute = /**
  91869. * @param {?} attribute
  91870. * @param {?} context
  91871. * @return {?}
  91872. */
  91873. function (attribute, context) { };
  91874. /**
  91875. * @param {?} text
  91876. * @param {?} context
  91877. * @return {?}
  91878. */
  91879. XtbParser.prototype.visitText = /**
  91880. * @param {?} text
  91881. * @param {?} context
  91882. * @return {?}
  91883. */
  91884. function (text, context) { };
  91885. /**
  91886. * @param {?} comment
  91887. * @param {?} context
  91888. * @return {?}
  91889. */
  91890. XtbParser.prototype.visitComment = /**
  91891. * @param {?} comment
  91892. * @param {?} context
  91893. * @return {?}
  91894. */
  91895. function (comment, context) { };
  91896. /**
  91897. * @param {?} expansion
  91898. * @param {?} context
  91899. * @return {?}
  91900. */
  91901. XtbParser.prototype.visitExpansion = /**
  91902. * @param {?} expansion
  91903. * @param {?} context
  91904. * @return {?}
  91905. */
  91906. function (expansion, context) { };
  91907. /**
  91908. * @param {?} expansionCase
  91909. * @param {?} context
  91910. * @return {?}
  91911. */
  91912. XtbParser.prototype.visitExpansionCase = /**
  91913. * @param {?} expansionCase
  91914. * @param {?} context
  91915. * @return {?}
  91916. */
  91917. function (expansionCase, context) { };
  91918. /**
  91919. * @param {?} node
  91920. * @param {?} message
  91921. * @return {?}
  91922. */
  91923. XtbParser.prototype._addError = /**
  91924. * @param {?} node
  91925. * @param {?} message
  91926. * @return {?}
  91927. */
  91928. function (node, message) {
  91929. this._errors.push(new I18nError(/** @type {?} */ ((node.sourceSpan)), message));
  91930. };
  91931. return XtbParser;
  91932. }());
  91933. var XmlToI18n$2 = /** @class */ (function () {
  91934. function XmlToI18n() {
  91935. }
  91936. /**
  91937. * @param {?} message
  91938. * @param {?} url
  91939. * @return {?}
  91940. */
  91941. XmlToI18n.prototype.convert = /**
  91942. * @param {?} message
  91943. * @param {?} url
  91944. * @return {?}
  91945. */
  91946. function (message, url) {
  91947. var /** @type {?} */ xmlIcu = new XmlParser().parse(message, url, true);
  91948. this._errors = xmlIcu.errors;
  91949. var /** @type {?} */ i18nNodes = this._errors.length > 0 || xmlIcu.rootNodes.length == 0 ?
  91950. [] :
  91951. visitAll(this, xmlIcu.rootNodes);
  91952. return {
  91953. i18nNodes: i18nNodes,
  91954. errors: this._errors,
  91955. };
  91956. };
  91957. /**
  91958. * @param {?} text
  91959. * @param {?} context
  91960. * @return {?}
  91961. */
  91962. XmlToI18n.prototype.visitText = /**
  91963. * @param {?} text
  91964. * @param {?} context
  91965. * @return {?}
  91966. */
  91967. function (text, context) { return new Text$1(text.value, /** @type {?} */ ((text.sourceSpan))); };
  91968. /**
  91969. * @param {?} icu
  91970. * @param {?} context
  91971. * @return {?}
  91972. */
  91973. XmlToI18n.prototype.visitExpansion = /**
  91974. * @param {?} icu
  91975. * @param {?} context
  91976. * @return {?}
  91977. */
  91978. function (icu, context) {
  91979. var /** @type {?} */ caseMap = {};
  91980. visitAll(this, icu.cases).forEach(function (c) {
  91981. caseMap[c.value] = new Container(c.nodes, icu.sourceSpan);
  91982. });
  91983. return new Icu(icu.switchValue, icu.type, caseMap, icu.sourceSpan);
  91984. };
  91985. /**
  91986. * @param {?} icuCase
  91987. * @param {?} context
  91988. * @return {?}
  91989. */
  91990. XmlToI18n.prototype.visitExpansionCase = /**
  91991. * @param {?} icuCase
  91992. * @param {?} context
  91993. * @return {?}
  91994. */
  91995. function (icuCase, context) {
  91996. return {
  91997. value: icuCase.value,
  91998. nodes: visitAll(this, icuCase.expression),
  91999. };
  92000. };
  92001. /**
  92002. * @param {?} el
  92003. * @param {?} context
  92004. * @return {?}
  92005. */
  92006. XmlToI18n.prototype.visitElement = /**
  92007. * @param {?} el
  92008. * @param {?} context
  92009. * @return {?}
  92010. */
  92011. function (el, context) {
  92012. if (el.name === _PLACEHOLDER_TAG$3) {
  92013. var /** @type {?} */ nameAttr = el.attrs.find(function (attr) { return attr.name === 'name'; });
  92014. if (nameAttr) {
  92015. return new Placeholder('', nameAttr.value, /** @type {?} */ ((el.sourceSpan)));
  92016. }
  92017. this._addError(el, "<" + _PLACEHOLDER_TAG$3 + "> misses the \"name\" attribute");
  92018. }
  92019. else {
  92020. this._addError(el, "Unexpected tag");
  92021. }
  92022. return null;
  92023. };
  92024. /**
  92025. * @param {?} comment
  92026. * @param {?} context
  92027. * @return {?}
  92028. */
  92029. XmlToI18n.prototype.visitComment = /**
  92030. * @param {?} comment
  92031. * @param {?} context
  92032. * @return {?}
  92033. */
  92034. function (comment, context) { };
  92035. /**
  92036. * @param {?} attribute
  92037. * @param {?} context
  92038. * @return {?}
  92039. */
  92040. XmlToI18n.prototype.visitAttribute = /**
  92041. * @param {?} attribute
  92042. * @param {?} context
  92043. * @return {?}
  92044. */
  92045. function (attribute, context) { };
  92046. /**
  92047. * @param {?} node
  92048. * @param {?} message
  92049. * @return {?}
  92050. */
  92051. XmlToI18n.prototype._addError = /**
  92052. * @param {?} node
  92053. * @param {?} message
  92054. * @return {?}
  92055. */
  92056. function (node, message) {
  92057. this._errors.push(new I18nError(/** @type {?} */ ((node.sourceSpan)), message));
  92058. };
  92059. return XmlToI18n;
  92060. }());
  92061. /**
  92062. * @fileoverview added by tsickle
  92063. * @suppress {checkTypes} checked by tsc
  92064. */
  92065. /**
  92066. * @license
  92067. * Copyright Google Inc. All Rights Reserved.
  92068. *
  92069. * Use of this source code is governed by an MIT-style license that can be
  92070. * found in the LICENSE file at https://angular.io/license
  92071. */
  92072. var HtmlParser = /** @class */ (function (_super) {
  92073. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(HtmlParser, _super);
  92074. function HtmlParser() {
  92075. return _super.call(this, getHtmlTagDefinition) || this;
  92076. }
  92077. /**
  92078. * @param {?} source
  92079. * @param {?} url
  92080. * @param {?=} parseExpansionForms
  92081. * @param {?=} interpolationConfig
  92082. * @return {?}
  92083. */
  92084. HtmlParser.prototype.parse = /**
  92085. * @param {?} source
  92086. * @param {?} url
  92087. * @param {?=} parseExpansionForms
  92088. * @param {?=} interpolationConfig
  92089. * @return {?}
  92090. */
  92091. function (source, url, parseExpansionForms, interpolationConfig) {
  92092. if (parseExpansionForms === void 0) { parseExpansionForms = false; }
  92093. if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }
  92094. return _super.prototype.parse.call(this, source, url, parseExpansionForms, interpolationConfig);
  92095. };
  92096. return HtmlParser;
  92097. }(Parser$1));
  92098. /**
  92099. * @fileoverview added by tsickle
  92100. * @suppress {checkTypes} checked by tsc
  92101. */
  92102. /**
  92103. * @license
  92104. * Copyright Google Inc. All Rights Reserved.
  92105. *
  92106. * Use of this source code is governed by an MIT-style license that can be
  92107. * found in the LICENSE file at https://angular.io/license
  92108. */
  92109. /**
  92110. * A container for translated messages
  92111. */
  92112. var TranslationBundle = /** @class */ (function () {
  92113. function TranslationBundle(_i18nNodesByMsgId, locale, digest, mapperFactory, missingTranslationStrategy, console) {
  92114. if (_i18nNodesByMsgId === void 0) { _i18nNodesByMsgId = {}; }
  92115. if (missingTranslationStrategy === void 0) { missingTranslationStrategy = MissingTranslationStrategy.Warning; }
  92116. this._i18nNodesByMsgId = _i18nNodesByMsgId;
  92117. this.digest = digest;
  92118. this.mapperFactory = mapperFactory;
  92119. this._i18nToHtml = new I18nToHtmlVisitor(_i18nNodesByMsgId, locale, digest, /** @type {?} */ ((mapperFactory)), missingTranslationStrategy, console);
  92120. }
  92121. // Creates a `TranslationBundle` by parsing the given `content` with the `serializer`.
  92122. /**
  92123. * @param {?} content
  92124. * @param {?} url
  92125. * @param {?} serializer
  92126. * @param {?} missingTranslationStrategy
  92127. * @param {?=} console
  92128. * @return {?}
  92129. */
  92130. TranslationBundle.load = /**
  92131. * @param {?} content
  92132. * @param {?} url
  92133. * @param {?} serializer
  92134. * @param {?} missingTranslationStrategy
  92135. * @param {?=} console
  92136. * @return {?}
  92137. */
  92138. function (content, url, serializer, missingTranslationStrategy, console) {
  92139. var _a = serializer.load(content, url), locale = _a.locale, i18nNodesByMsgId = _a.i18nNodesByMsgId;
  92140. var /** @type {?} */ digestFn = function (m) { return serializer.digest(m); };
  92141. var /** @type {?} */ mapperFactory = function (m) { return ((serializer.createNameMapper(m))); };
  92142. return new TranslationBundle(i18nNodesByMsgId, locale, digestFn, mapperFactory, missingTranslationStrategy, console);
  92143. };
  92144. // Returns the translation as HTML nodes from the given source message.
  92145. /**
  92146. * @param {?} srcMsg
  92147. * @return {?}
  92148. */
  92149. TranslationBundle.prototype.get = /**
  92150. * @param {?} srcMsg
  92151. * @return {?}
  92152. */
  92153. function (srcMsg) {
  92154. var /** @type {?} */ html = this._i18nToHtml.convert(srcMsg);
  92155. if (html.errors.length) {
  92156. throw new Error(html.errors.join('\n'));
  92157. }
  92158. return html.nodes;
  92159. };
  92160. /**
  92161. * @param {?} srcMsg
  92162. * @return {?}
  92163. */
  92164. TranslationBundle.prototype.has = /**
  92165. * @param {?} srcMsg
  92166. * @return {?}
  92167. */
  92168. function (srcMsg) { return this.digest(srcMsg) in this._i18nNodesByMsgId; };
  92169. return TranslationBundle;
  92170. }());
  92171. var I18nToHtmlVisitor = /** @class */ (function () {
  92172. function I18nToHtmlVisitor(_i18nNodesByMsgId, _locale, _digest, _mapperFactory, _missingTranslationStrategy, _console) {
  92173. if (_i18nNodesByMsgId === void 0) { _i18nNodesByMsgId = {}; }
  92174. this._i18nNodesByMsgId = _i18nNodesByMsgId;
  92175. this._locale = _locale;
  92176. this._digest = _digest;
  92177. this._mapperFactory = _mapperFactory;
  92178. this._missingTranslationStrategy = _missingTranslationStrategy;
  92179. this._console = _console;
  92180. this._contextStack = [];
  92181. this._errors = [];
  92182. }
  92183. /**
  92184. * @param {?} srcMsg
  92185. * @return {?}
  92186. */
  92187. I18nToHtmlVisitor.prototype.convert = /**
  92188. * @param {?} srcMsg
  92189. * @return {?}
  92190. */
  92191. function (srcMsg) {
  92192. this._contextStack.length = 0;
  92193. this._errors.length = 0;
  92194. // i18n to text
  92195. var /** @type {?} */ text = this._convertToText(srcMsg);
  92196. // text to html
  92197. var /** @type {?} */ url = srcMsg.nodes[0].sourceSpan.start.file.url;
  92198. var /** @type {?} */ html = new HtmlParser().parse(text, url, true);
  92199. return {
  92200. nodes: html.rootNodes,
  92201. errors: this._errors.concat(html.errors),
  92202. };
  92203. };
  92204. /**
  92205. * @param {?} text
  92206. * @param {?=} context
  92207. * @return {?}
  92208. */
  92209. I18nToHtmlVisitor.prototype.visitText = /**
  92210. * @param {?} text
  92211. * @param {?=} context
  92212. * @return {?}
  92213. */
  92214. function (text, context) {
  92215. // `convert()` uses an `HtmlParser` to return `html.Node`s
  92216. // we should then make sure that any special characters are escaped
  92217. return escapeXml(text.value);
  92218. };
  92219. /**
  92220. * @param {?} container
  92221. * @param {?=} context
  92222. * @return {?}
  92223. */
  92224. I18nToHtmlVisitor.prototype.visitContainer = /**
  92225. * @param {?} container
  92226. * @param {?=} context
  92227. * @return {?}
  92228. */
  92229. function (container, context) {
  92230. var _this = this;
  92231. return container.children.map(function (n) { return n.visit(_this); }).join('');
  92232. };
  92233. /**
  92234. * @param {?} icu
  92235. * @param {?=} context
  92236. * @return {?}
  92237. */
  92238. I18nToHtmlVisitor.prototype.visitIcu = /**
  92239. * @param {?} icu
  92240. * @param {?=} context
  92241. * @return {?}
  92242. */
  92243. function (icu, context) {
  92244. var _this = this;
  92245. var /** @type {?} */ cases = Object.keys(icu.cases).map(function (k) { return k + " {" + icu.cases[k].visit(_this) + "}"; });
  92246. // TODO(vicb): Once all format switch to using expression placeholders
  92247. // we should throw when the placeholder is not in the source message
  92248. var /** @type {?} */ exp = this._srcMsg.placeholders.hasOwnProperty(icu.expression) ?
  92249. this._srcMsg.placeholders[icu.expression] :
  92250. icu.expression;
  92251. return "{" + exp + ", " + icu.type + ", " + cases.join(' ') + "}";
  92252. };
  92253. /**
  92254. * @param {?} ph
  92255. * @param {?=} context
  92256. * @return {?}
  92257. */
  92258. I18nToHtmlVisitor.prototype.visitPlaceholder = /**
  92259. * @param {?} ph
  92260. * @param {?=} context
  92261. * @return {?}
  92262. */
  92263. function (ph, context) {
  92264. var /** @type {?} */ phName = this._mapper(ph.name);
  92265. if (this._srcMsg.placeholders.hasOwnProperty(phName)) {
  92266. return this._srcMsg.placeholders[phName];
  92267. }
  92268. if (this._srcMsg.placeholderToMessage.hasOwnProperty(phName)) {
  92269. return this._convertToText(this._srcMsg.placeholderToMessage[phName]);
  92270. }
  92271. this._addError(ph, "Unknown placeholder \"" + ph.name + "\"");
  92272. return '';
  92273. };
  92274. // Loaded message contains only placeholders (vs tag and icu placeholders).
  92275. // However when a translation can not be found, we need to serialize the source message
  92276. // which can contain tag placeholders
  92277. /**
  92278. * @param {?} ph
  92279. * @param {?=} context
  92280. * @return {?}
  92281. */
  92282. I18nToHtmlVisitor.prototype.visitTagPlaceholder = /**
  92283. * @param {?} ph
  92284. * @param {?=} context
  92285. * @return {?}
  92286. */
  92287. function (ph, context) {
  92288. var _this = this;
  92289. var /** @type {?} */ tag = "" + ph.tag;
  92290. var /** @type {?} */ attrs = Object.keys(ph.attrs).map(function (name) { return name + "=\"" + ph.attrs[name] + "\""; }).join(' ');
  92291. if (ph.isVoid) {
  92292. return "<" + tag + " " + attrs + "/>";
  92293. }
  92294. var /** @type {?} */ children = ph.children.map(function (c) { return c.visit(_this); }).join('');
  92295. return "<" + tag + " " + attrs + ">" + children + "</" + tag + ">";
  92296. };
  92297. // Loaded message contains only placeholders (vs tag and icu placeholders).
  92298. // However when a translation can not be found, we need to serialize the source message
  92299. // which can contain tag placeholders
  92300. /**
  92301. * @param {?} ph
  92302. * @param {?=} context
  92303. * @return {?}
  92304. */
  92305. I18nToHtmlVisitor.prototype.visitIcuPlaceholder = /**
  92306. * @param {?} ph
  92307. * @param {?=} context
  92308. * @return {?}
  92309. */
  92310. function (ph, context) {
  92311. // An ICU placeholder references the source message to be serialized
  92312. return this._convertToText(this._srcMsg.placeholderToMessage[ph.name]);
  92313. };
  92314. /**
  92315. * Convert a source message to a translated text string:
  92316. * - text nodes are replaced with their translation,
  92317. * - placeholders are replaced with their content,
  92318. * - ICU nodes are converted to ICU expressions.
  92319. * @param {?} srcMsg
  92320. * @return {?}
  92321. */
  92322. I18nToHtmlVisitor.prototype._convertToText = /**
  92323. * Convert a source message to a translated text string:
  92324. * - text nodes are replaced with their translation,
  92325. * - placeholders are replaced with their content,
  92326. * - ICU nodes are converted to ICU expressions.
  92327. * @param {?} srcMsg
  92328. * @return {?}
  92329. */
  92330. function (srcMsg) {
  92331. var _this = this;
  92332. var /** @type {?} */ id = this._digest(srcMsg);
  92333. var /** @type {?} */ mapper = this._mapperFactory ? this._mapperFactory(srcMsg) : null;
  92334. var /** @type {?} */ nodes;
  92335. this._contextStack.push({ msg: this._srcMsg, mapper: this._mapper });
  92336. this._srcMsg = srcMsg;
  92337. if (this._i18nNodesByMsgId.hasOwnProperty(id)) {
  92338. // When there is a translation use its nodes as the source
  92339. // And create a mapper to convert serialized placeholder names to internal names
  92340. nodes = this._i18nNodesByMsgId[id];
  92341. this._mapper = function (name) { return mapper ? /** @type {?} */ ((mapper.toInternalName(name))) : name; };
  92342. }
  92343. else {
  92344. // When no translation has been found
  92345. // - report an error / a warning / nothing,
  92346. // - use the nodes from the original message
  92347. // - placeholders are already internal and need no mapper
  92348. if (this._missingTranslationStrategy === MissingTranslationStrategy.Error) {
  92349. var /** @type {?} */ ctx = this._locale ? " for locale \"" + this._locale + "\"" : '';
  92350. this._addError(srcMsg.nodes[0], "Missing translation for message \"" + id + "\"" + ctx);
  92351. }
  92352. else if (this._console &&
  92353. this._missingTranslationStrategy === MissingTranslationStrategy.Warning) {
  92354. var /** @type {?} */ ctx = this._locale ? " for locale \"" + this._locale + "\"" : '';
  92355. this._console.warn("Missing translation for message \"" + id + "\"" + ctx);
  92356. }
  92357. nodes = srcMsg.nodes;
  92358. this._mapper = function (name) { return name; };
  92359. }
  92360. var /** @type {?} */ text = nodes.map(function (node) { return node.visit(_this); }).join('');
  92361. var /** @type {?} */ context = /** @type {?} */ ((this._contextStack.pop()));
  92362. this._srcMsg = context.msg;
  92363. this._mapper = context.mapper;
  92364. return text;
  92365. };
  92366. /**
  92367. * @param {?} el
  92368. * @param {?} msg
  92369. * @return {?}
  92370. */
  92371. I18nToHtmlVisitor.prototype._addError = /**
  92372. * @param {?} el
  92373. * @param {?} msg
  92374. * @return {?}
  92375. */
  92376. function (el, msg) {
  92377. this._errors.push(new I18nError(el.sourceSpan, msg));
  92378. };
  92379. return I18nToHtmlVisitor;
  92380. }());
  92381. /**
  92382. * @fileoverview added by tsickle
  92383. * @suppress {checkTypes} checked by tsc
  92384. */
  92385. /**
  92386. * @license
  92387. * Copyright Google Inc. All Rights Reserved.
  92388. *
  92389. * Use of this source code is governed by an MIT-style license that can be
  92390. * found in the LICENSE file at https://angular.io/license
  92391. */
  92392. var I18NHtmlParser = /** @class */ (function () {
  92393. function I18NHtmlParser(_htmlParser, translations, translationsFormat, missingTranslation, console) {
  92394. if (missingTranslation === void 0) { missingTranslation = MissingTranslationStrategy.Warning; }
  92395. this._htmlParser = _htmlParser;
  92396. if (translations) {
  92397. var /** @type {?} */ serializer = createSerializer(translationsFormat);
  92398. this._translationBundle =
  92399. TranslationBundle.load(translations, 'i18n', serializer, missingTranslation, console);
  92400. }
  92401. else {
  92402. this._translationBundle =
  92403. new TranslationBundle({}, null, digest, undefined, missingTranslation, console);
  92404. }
  92405. }
  92406. /**
  92407. * @param {?} source
  92408. * @param {?} url
  92409. * @param {?=} parseExpansionForms
  92410. * @param {?=} interpolationConfig
  92411. * @return {?}
  92412. */
  92413. I18NHtmlParser.prototype.parse = /**
  92414. * @param {?} source
  92415. * @param {?} url
  92416. * @param {?=} parseExpansionForms
  92417. * @param {?=} interpolationConfig
  92418. * @return {?}
  92419. */
  92420. function (source, url, parseExpansionForms, interpolationConfig) {
  92421. if (parseExpansionForms === void 0) { parseExpansionForms = false; }
  92422. if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }
  92423. var /** @type {?} */ parseResult = this._htmlParser.parse(source, url, parseExpansionForms, interpolationConfig);
  92424. if (parseResult.errors.length) {
  92425. return new ParseTreeResult(parseResult.rootNodes, parseResult.errors);
  92426. }
  92427. return mergeTranslations(parseResult.rootNodes, this._translationBundle, interpolationConfig, [], {});
  92428. };
  92429. return I18NHtmlParser;
  92430. }());
  92431. /**
  92432. * @param {?=} format
  92433. * @return {?}
  92434. */
  92435. function createSerializer(format) {
  92436. format = (format || 'xlf').toLowerCase();
  92437. switch (format) {
  92438. case 'xmb':
  92439. return new Xmb();
  92440. case 'xtb':
  92441. return new Xtb();
  92442. case 'xliff2':
  92443. case 'xlf2':
  92444. return new Xliff2();
  92445. case 'xliff':
  92446. case 'xlf':
  92447. default:
  92448. return new Xliff();
  92449. }
  92450. }
  92451. /**
  92452. * @fileoverview added by tsickle
  92453. * @suppress {checkTypes} checked by tsc
  92454. */
  92455. /**
  92456. * @license
  92457. * Copyright Google Inc. All Rights Reserved.
  92458. *
  92459. * Use of this source code is governed by an MIT-style license that can be
  92460. * found in the LICENSE file at https://angular.io/license
  92461. */
  92462. var STRIP_SRC_FILE_SUFFIXES = /(\.ts|\.d\.ts|\.js|\.jsx|\.tsx)$/;
  92463. var GENERATED_FILE = /\.ngfactory\.|\.ngsummary\./;
  92464. var JIT_SUMMARY_FILE = /\.ngsummary\./;
  92465. var JIT_SUMMARY_NAME = /NgSummary$/;
  92466. /**
  92467. * @param {?} filePath
  92468. * @param {?=} forceSourceFile
  92469. * @return {?}
  92470. */
  92471. function ngfactoryFilePath(filePath, forceSourceFile) {
  92472. if (forceSourceFile === void 0) { forceSourceFile = false; }
  92473. var /** @type {?} */ urlWithSuffix = splitTypescriptSuffix(filePath, forceSourceFile);
  92474. return urlWithSuffix[0] + ".ngfactory" + normalizeGenFileSuffix(urlWithSuffix[1]);
  92475. }
  92476. /**
  92477. * @param {?} filePath
  92478. * @return {?}
  92479. */
  92480. function stripGeneratedFileSuffix(filePath) {
  92481. return filePath.replace(GENERATED_FILE, '.');
  92482. }
  92483. /**
  92484. * @param {?} filePath
  92485. * @return {?}
  92486. */
  92487. function isGeneratedFile(filePath) {
  92488. return GENERATED_FILE.test(filePath);
  92489. }
  92490. /**
  92491. * @param {?} path
  92492. * @param {?=} forceSourceFile
  92493. * @return {?}
  92494. */
  92495. function splitTypescriptSuffix(path, forceSourceFile) {
  92496. if (forceSourceFile === void 0) { forceSourceFile = false; }
  92497. if (path.endsWith('.d.ts')) {
  92498. return [path.slice(0, -5), forceSourceFile ? '.ts' : '.d.ts'];
  92499. }
  92500. var /** @type {?} */ lastDot = path.lastIndexOf('.');
  92501. if (lastDot !== -1) {
  92502. return [path.substring(0, lastDot), path.substring(lastDot)];
  92503. }
  92504. return [path, ''];
  92505. }
  92506. /**
  92507. * @param {?} srcFileSuffix
  92508. * @return {?}
  92509. */
  92510. function normalizeGenFileSuffix(srcFileSuffix) {
  92511. return srcFileSuffix === '.tsx' ? '.ts' : srcFileSuffix;
  92512. }
  92513. /**
  92514. * @param {?} fileName
  92515. * @return {?}
  92516. */
  92517. function summaryFileName(fileName) {
  92518. var /** @type {?} */ fileNameWithoutSuffix = fileName.replace(STRIP_SRC_FILE_SUFFIXES, '');
  92519. return fileNameWithoutSuffix + ".ngsummary.json";
  92520. }
  92521. /**
  92522. * @param {?} fileName
  92523. * @param {?=} forceSourceFile
  92524. * @return {?}
  92525. */
  92526. function summaryForJitFileName(fileName, forceSourceFile) {
  92527. if (forceSourceFile === void 0) { forceSourceFile = false; }
  92528. var /** @type {?} */ urlWithSuffix = splitTypescriptSuffix(stripGeneratedFileSuffix(fileName), forceSourceFile);
  92529. return urlWithSuffix[0] + ".ngsummary" + urlWithSuffix[1];
  92530. }
  92531. /**
  92532. * @param {?} filePath
  92533. * @return {?}
  92534. */
  92535. function stripSummaryForJitFileSuffix(filePath) {
  92536. return filePath.replace(JIT_SUMMARY_FILE, '.');
  92537. }
  92538. /**
  92539. * @param {?} symbolName
  92540. * @return {?}
  92541. */
  92542. function summaryForJitName(symbolName) {
  92543. return symbolName + "NgSummary";
  92544. }
  92545. /**
  92546. * @param {?} symbolName
  92547. * @return {?}
  92548. */
  92549. function stripSummaryForJitNameSuffix(symbolName) {
  92550. return symbolName.replace(JIT_SUMMARY_NAME, '');
  92551. }
  92552. var LOWERED_SYMBOL = /\u0275\d+/;
  92553. /**
  92554. * @param {?} name
  92555. * @return {?}
  92556. */
  92557. function isLoweredSymbol(name) {
  92558. return LOWERED_SYMBOL.test(name);
  92559. }
  92560. /**
  92561. * @param {?} id
  92562. * @return {?}
  92563. */
  92564. function createLoweredSymbol(id) {
  92565. return "\u0275" + id;
  92566. }
  92567. /**
  92568. * @fileoverview added by tsickle
  92569. * @suppress {checkTypes} checked by tsc
  92570. */
  92571. /**
  92572. * @license
  92573. * Copyright Google Inc. All Rights Reserved.
  92574. *
  92575. * Use of this source code is governed by an MIT-style license that can be
  92576. * found in the LICENSE file at https://angular.io/license
  92577. */
  92578. var CORE = '@angular/core';
  92579. var Identifiers = /** @class */ (function () {
  92580. function Identifiers() {
  92581. }
  92582. Identifiers.ANALYZE_FOR_ENTRY_COMPONENTS = {
  92583. name: 'ANALYZE_FOR_ENTRY_COMPONENTS',
  92584. moduleName: CORE,
  92585. };
  92586. Identifiers.ElementRef = { name: 'ElementRef', moduleName: CORE };
  92587. Identifiers.NgModuleRef = { name: 'NgModuleRef', moduleName: CORE };
  92588. Identifiers.ViewContainerRef = { name: 'ViewContainerRef', moduleName: CORE };
  92589. Identifiers.ChangeDetectorRef = {
  92590. name: 'ChangeDetectorRef',
  92591. moduleName: CORE,
  92592. };
  92593. Identifiers.QueryList = { name: 'QueryList', moduleName: CORE };
  92594. Identifiers.TemplateRef = { name: 'TemplateRef', moduleName: CORE };
  92595. Identifiers.CodegenComponentFactoryResolver = {
  92596. name: 'ɵCodegenComponentFactoryResolver',
  92597. moduleName: CORE,
  92598. };
  92599. Identifiers.ComponentFactoryResolver = {
  92600. name: 'ComponentFactoryResolver',
  92601. moduleName: CORE,
  92602. };
  92603. Identifiers.ComponentFactory = { name: 'ComponentFactory', moduleName: CORE };
  92604. Identifiers.ComponentRef = { name: 'ComponentRef', moduleName: CORE };
  92605. Identifiers.NgModuleFactory = { name: 'NgModuleFactory', moduleName: CORE };
  92606. Identifiers.createModuleFactory = {
  92607. name: 'ɵcmf',
  92608. moduleName: CORE,
  92609. };
  92610. Identifiers.moduleDef = {
  92611. name: 'ɵmod',
  92612. moduleName: CORE,
  92613. };
  92614. Identifiers.moduleProviderDef = {
  92615. name: 'ɵmpd',
  92616. moduleName: CORE,
  92617. };
  92618. Identifiers.RegisterModuleFactoryFn = {
  92619. name: 'ɵregisterModuleFactory',
  92620. moduleName: CORE,
  92621. };
  92622. Identifiers.Injector = { name: 'Injector', moduleName: CORE };
  92623. Identifiers.ViewEncapsulation = {
  92624. name: 'ViewEncapsulation',
  92625. moduleName: CORE,
  92626. };
  92627. Identifiers.ChangeDetectionStrategy = {
  92628. name: 'ChangeDetectionStrategy',
  92629. moduleName: CORE,
  92630. };
  92631. Identifiers.SecurityContext = {
  92632. name: 'SecurityContext',
  92633. moduleName: CORE,
  92634. };
  92635. Identifiers.LOCALE_ID = { name: 'LOCALE_ID', moduleName: CORE };
  92636. Identifiers.TRANSLATIONS_FORMAT = {
  92637. name: 'TRANSLATIONS_FORMAT',
  92638. moduleName: CORE,
  92639. };
  92640. Identifiers.inlineInterpolate = {
  92641. name: 'ɵinlineInterpolate',
  92642. moduleName: CORE,
  92643. };
  92644. Identifiers.interpolate = { name: 'ɵinterpolate', moduleName: CORE };
  92645. Identifiers.EMPTY_ARRAY = { name: 'ɵEMPTY_ARRAY', moduleName: CORE };
  92646. Identifiers.EMPTY_MAP = { name: 'ɵEMPTY_MAP', moduleName: CORE };
  92647. Identifiers.Renderer = { name: 'Renderer', moduleName: CORE };
  92648. Identifiers.viewDef = { name: 'ɵvid', moduleName: CORE };
  92649. Identifiers.elementDef = { name: 'ɵeld', moduleName: CORE };
  92650. Identifiers.anchorDef = { name: 'ɵand', moduleName: CORE };
  92651. Identifiers.textDef = { name: 'ɵted', moduleName: CORE };
  92652. Identifiers.directiveDef = { name: 'ɵdid', moduleName: CORE };
  92653. Identifiers.providerDef = { name: 'ɵprd', moduleName: CORE };
  92654. Identifiers.queryDef = { name: 'ɵqud', moduleName: CORE };
  92655. Identifiers.pureArrayDef = { name: 'ɵpad', moduleName: CORE };
  92656. Identifiers.pureObjectDef = { name: 'ɵpod', moduleName: CORE };
  92657. Identifiers.purePipeDef = { name: 'ɵppd', moduleName: CORE };
  92658. Identifiers.pipeDef = { name: 'ɵpid', moduleName: CORE };
  92659. Identifiers.nodeValue = { name: 'ɵnov', moduleName: CORE };
  92660. Identifiers.ngContentDef = { name: 'ɵncd', moduleName: CORE };
  92661. Identifiers.unwrapValue = { name: 'ɵunv', moduleName: CORE };
  92662. Identifiers.createRendererType2 = { name: 'ɵcrt', moduleName: CORE };
  92663. // type only
  92664. Identifiers.RendererType2 = {
  92665. name: 'RendererType2',
  92666. moduleName: CORE,
  92667. };
  92668. // type only
  92669. Identifiers.ViewDefinition = {
  92670. name: 'ɵViewDefinition',
  92671. moduleName: CORE,
  92672. };
  92673. Identifiers.createComponentFactory = { name: 'ɵccf', moduleName: CORE };
  92674. return Identifiers;
  92675. }());
  92676. /**
  92677. * @param {?} reference
  92678. * @return {?}
  92679. */
  92680. function createTokenForReference(reference) {
  92681. return { identifier: { reference: reference } };
  92682. }
  92683. /**
  92684. * @param {?} reflector
  92685. * @param {?} reference
  92686. * @return {?}
  92687. */
  92688. function createTokenForExternalReference(reflector, reference) {
  92689. return createTokenForReference(reflector.resolveExternalReference(reference));
  92690. }
  92691. /**
  92692. * @fileoverview added by tsickle
  92693. * @suppress {checkTypes} checked by tsc
  92694. */
  92695. /**
  92696. * @license
  92697. * Copyright Google Inc. All Rights Reserved.
  92698. *
  92699. * Use of this source code is governed by an MIT-style license that can be
  92700. * found in the LICENSE file at https://angular.io/license
  92701. */
  92702. /** @enum {number} */
  92703. var LifecycleHooks = {
  92704. OnInit: 0,
  92705. OnDestroy: 1,
  92706. DoCheck: 2,
  92707. OnChanges: 3,
  92708. AfterContentInit: 4,
  92709. AfterContentChecked: 5,
  92710. AfterViewInit: 6,
  92711. AfterViewChecked: 7,
  92712. };
  92713. LifecycleHooks[LifecycleHooks.OnInit] = "OnInit";
  92714. LifecycleHooks[LifecycleHooks.OnDestroy] = "OnDestroy";
  92715. LifecycleHooks[LifecycleHooks.DoCheck] = "DoCheck";
  92716. LifecycleHooks[LifecycleHooks.OnChanges] = "OnChanges";
  92717. LifecycleHooks[LifecycleHooks.AfterContentInit] = "AfterContentInit";
  92718. LifecycleHooks[LifecycleHooks.AfterContentChecked] = "AfterContentChecked";
  92719. LifecycleHooks[LifecycleHooks.AfterViewInit] = "AfterViewInit";
  92720. LifecycleHooks[LifecycleHooks.AfterViewChecked] = "AfterViewChecked";
  92721. var LIFECYCLE_HOOKS_VALUES = [
  92722. LifecycleHooks.OnInit, LifecycleHooks.OnDestroy, LifecycleHooks.DoCheck, LifecycleHooks.OnChanges,
  92723. LifecycleHooks.AfterContentInit, LifecycleHooks.AfterContentChecked, LifecycleHooks.AfterViewInit,
  92724. LifecycleHooks.AfterViewChecked
  92725. ];
  92726. /**
  92727. * @param {?} reflector
  92728. * @param {?} hook
  92729. * @param {?} token
  92730. * @return {?}
  92731. */
  92732. function hasLifecycleHook(reflector, hook, token) {
  92733. return reflector.hasLifecycleHook(token, getHookName(hook));
  92734. }
  92735. /**
  92736. * @param {?} reflector
  92737. * @param {?} token
  92738. * @return {?}
  92739. */
  92740. function getAllLifecycleHooks(reflector, token) {
  92741. return LIFECYCLE_HOOKS_VALUES.filter(function (hook) { return hasLifecycleHook(reflector, hook, token); });
  92742. }
  92743. /**
  92744. * @param {?} hook
  92745. * @return {?}
  92746. */
  92747. function getHookName(hook) {
  92748. switch (hook) {
  92749. case LifecycleHooks.OnInit:
  92750. return 'ngOnInit';
  92751. case LifecycleHooks.OnDestroy:
  92752. return 'ngOnDestroy';
  92753. case LifecycleHooks.DoCheck:
  92754. return 'ngDoCheck';
  92755. case LifecycleHooks.OnChanges:
  92756. return 'ngOnChanges';
  92757. case LifecycleHooks.AfterContentInit:
  92758. return 'ngAfterContentInit';
  92759. case LifecycleHooks.AfterContentChecked:
  92760. return 'ngAfterContentChecked';
  92761. case LifecycleHooks.AfterViewInit:
  92762. return 'ngAfterViewInit';
  92763. case LifecycleHooks.AfterViewChecked:
  92764. return 'ngAfterViewChecked';
  92765. }
  92766. }
  92767. /**
  92768. * @fileoverview added by tsickle
  92769. * @suppress {checkTypes} checked by tsc
  92770. */
  92771. /**
  92772. * @license
  92773. * Copyright Google Inc. All Rights Reserved.
  92774. *
  92775. * Use of this source code is governed by an MIT-style license that can be
  92776. * found in the LICENSE file at https://angular.io/license
  92777. */
  92778. var _SELECTOR_REGEXP = new RegExp('(\\:not\\()|' + //":not("
  92779. '([-\\w]+)|' + // "tag"
  92780. '(?:\\.([-\\w]+))|' + // ".class"
  92781. '(?:\\[([-.\\w*]+)(?:=([\"\']?)([^\\]\"\']*)\\5)?\\])|' + // "[name]", "[name=value]",
  92782. '(\\))|' + // ")"
  92783. '(\\s*,\\s*)', // ","
  92784. 'g');
  92785. /**
  92786. * A css selector contains an element name,
  92787. * css classes and attribute/value pairs with the purpose
  92788. * of selecting subsets out of them.
  92789. */
  92790. var CssSelector = /** @class */ (function () {
  92791. function CssSelector() {
  92792. this.element = null;
  92793. this.classNames = [];
  92794. this.attrs = [];
  92795. this.notSelectors = [];
  92796. }
  92797. /**
  92798. * @param {?} selector
  92799. * @return {?}
  92800. */
  92801. CssSelector.parse = /**
  92802. * @param {?} selector
  92803. * @return {?}
  92804. */
  92805. function (selector) {
  92806. var /** @type {?} */ results = [];
  92807. var /** @type {?} */ _addResult = function (res, cssSel) {
  92808. if (cssSel.notSelectors.length > 0 && !cssSel.element && cssSel.classNames.length == 0 &&
  92809. cssSel.attrs.length == 0) {
  92810. cssSel.element = '*';
  92811. }
  92812. res.push(cssSel);
  92813. };
  92814. var /** @type {?} */ cssSelector = new CssSelector();
  92815. var /** @type {?} */ match;
  92816. var /** @type {?} */ current = cssSelector;
  92817. var /** @type {?} */ inNot = false;
  92818. _SELECTOR_REGEXP.lastIndex = 0;
  92819. while (match = _SELECTOR_REGEXP.exec(selector)) {
  92820. if (match[1]) {
  92821. if (inNot) {
  92822. throw new Error('Nesting :not is not allowed in a selector');
  92823. }
  92824. inNot = true;
  92825. current = new CssSelector();
  92826. cssSelector.notSelectors.push(current);
  92827. }
  92828. if (match[2]) {
  92829. current.setElement(match[2]);
  92830. }
  92831. if (match[3]) {
  92832. current.addClassName(match[3]);
  92833. }
  92834. if (match[4]) {
  92835. current.addAttribute(match[4], match[6]);
  92836. }
  92837. if (match[7]) {
  92838. inNot = false;
  92839. current = cssSelector;
  92840. }
  92841. if (match[8]) {
  92842. if (inNot) {
  92843. throw new Error('Multiple selectors in :not are not supported');
  92844. }
  92845. _addResult(results, cssSelector);
  92846. cssSelector = current = new CssSelector();
  92847. }
  92848. }
  92849. _addResult(results, cssSelector);
  92850. return results;
  92851. };
  92852. /**
  92853. * @return {?}
  92854. */
  92855. CssSelector.prototype.isElementSelector = /**
  92856. * @return {?}
  92857. */
  92858. function () {
  92859. return this.hasElementSelector() && this.classNames.length == 0 && this.attrs.length == 0 &&
  92860. this.notSelectors.length === 0;
  92861. };
  92862. /**
  92863. * @return {?}
  92864. */
  92865. CssSelector.prototype.hasElementSelector = /**
  92866. * @return {?}
  92867. */
  92868. function () { return !!this.element; };
  92869. /**
  92870. * @param {?=} element
  92871. * @return {?}
  92872. */
  92873. CssSelector.prototype.setElement = /**
  92874. * @param {?=} element
  92875. * @return {?}
  92876. */
  92877. function (element) {
  92878. if (element === void 0) { element = null; }
  92879. this.element = element;
  92880. };
  92881. /** Gets a template string for an element that matches the selector. */
  92882. /**
  92883. * Gets a template string for an element that matches the selector.
  92884. * @return {?}
  92885. */
  92886. CssSelector.prototype.getMatchingElementTemplate = /**
  92887. * Gets a template string for an element that matches the selector.
  92888. * @return {?}
  92889. */
  92890. function () {
  92891. var /** @type {?} */ tagName = this.element || 'div';
  92892. var /** @type {?} */ classAttr = this.classNames.length > 0 ? " class=\"" + this.classNames.join(' ') + "\"" : '';
  92893. var /** @type {?} */ attrs = '';
  92894. for (var /** @type {?} */ i = 0; i < this.attrs.length; i += 2) {
  92895. var /** @type {?} */ attrName = this.attrs[i];
  92896. var /** @type {?} */ attrValue = this.attrs[i + 1] !== '' ? "=\"" + this.attrs[i + 1] + "\"" : '';
  92897. attrs += " " + attrName + attrValue;
  92898. }
  92899. return getHtmlTagDefinition(tagName).isVoid ? "<" + tagName + classAttr + attrs + "/>" :
  92900. "<" + tagName + classAttr + attrs + "></" + tagName + ">";
  92901. };
  92902. /**
  92903. * @param {?} name
  92904. * @param {?=} value
  92905. * @return {?}
  92906. */
  92907. CssSelector.prototype.addAttribute = /**
  92908. * @param {?} name
  92909. * @param {?=} value
  92910. * @return {?}
  92911. */
  92912. function (name, value) {
  92913. if (value === void 0) { value = ''; }
  92914. this.attrs.push(name, value && value.toLowerCase() || '');
  92915. };
  92916. /**
  92917. * @param {?} name
  92918. * @return {?}
  92919. */
  92920. CssSelector.prototype.addClassName = /**
  92921. * @param {?} name
  92922. * @return {?}
  92923. */
  92924. function (name) { this.classNames.push(name.toLowerCase()); };
  92925. /**
  92926. * @return {?}
  92927. */
  92928. CssSelector.prototype.toString = /**
  92929. * @return {?}
  92930. */
  92931. function () {
  92932. var /** @type {?} */ res = this.element || '';
  92933. if (this.classNames) {
  92934. this.classNames.forEach(function (klass) { return res += "." + klass; });
  92935. }
  92936. if (this.attrs) {
  92937. for (var /** @type {?} */ i = 0; i < this.attrs.length; i += 2) {
  92938. var /** @type {?} */ name_1 = this.attrs[i];
  92939. var /** @type {?} */ value = this.attrs[i + 1];
  92940. res += "[" + name_1 + (value ? '=' + value : '') + "]";
  92941. }
  92942. }
  92943. this.notSelectors.forEach(function (notSelector) { return res += ":not(" + notSelector + ")"; });
  92944. return res;
  92945. };
  92946. return CssSelector;
  92947. }());
  92948. /**
  92949. * Reads a list of CssSelectors and allows to calculate which ones
  92950. * are contained in a given CssSelector.
  92951. */
  92952. var SelectorMatcher = /** @class */ (function () {
  92953. function SelectorMatcher() {
  92954. this._elementMap = new Map();
  92955. this._elementPartialMap = new Map();
  92956. this._classMap = new Map();
  92957. this._classPartialMap = new Map();
  92958. this._attrValueMap = new Map();
  92959. this._attrValuePartialMap = new Map();
  92960. this._listContexts = [];
  92961. }
  92962. /**
  92963. * @param {?} notSelectors
  92964. * @return {?}
  92965. */
  92966. SelectorMatcher.createNotMatcher = /**
  92967. * @param {?} notSelectors
  92968. * @return {?}
  92969. */
  92970. function (notSelectors) {
  92971. var /** @type {?} */ notMatcher = new SelectorMatcher();
  92972. notMatcher.addSelectables(notSelectors, null);
  92973. return notMatcher;
  92974. };
  92975. /**
  92976. * @param {?} cssSelectors
  92977. * @param {?=} callbackCtxt
  92978. * @return {?}
  92979. */
  92980. SelectorMatcher.prototype.addSelectables = /**
  92981. * @param {?} cssSelectors
  92982. * @param {?=} callbackCtxt
  92983. * @return {?}
  92984. */
  92985. function (cssSelectors, callbackCtxt) {
  92986. var /** @type {?} */ listContext = /** @type {?} */ ((null));
  92987. if (cssSelectors.length > 1) {
  92988. listContext = new SelectorListContext(cssSelectors);
  92989. this._listContexts.push(listContext);
  92990. }
  92991. for (var /** @type {?} */ i = 0; i < cssSelectors.length; i++) {
  92992. this._addSelectable(cssSelectors[i], callbackCtxt, listContext);
  92993. }
  92994. };
  92995. /**
  92996. * Add an object that can be found later on by calling `match`.
  92997. * @param {?} cssSelector A css selector
  92998. * @param {?} callbackCtxt An opaque object that will be given to the callback of the `match` function
  92999. * @param {?} listContext
  93000. * @return {?}
  93001. */
  93002. SelectorMatcher.prototype._addSelectable = /**
  93003. * Add an object that can be found later on by calling `match`.
  93004. * @param {?} cssSelector A css selector
  93005. * @param {?} callbackCtxt An opaque object that will be given to the callback of the `match` function
  93006. * @param {?} listContext
  93007. * @return {?}
  93008. */
  93009. function (cssSelector, callbackCtxt, listContext) {
  93010. var /** @type {?} */ matcher = this;
  93011. var /** @type {?} */ element = cssSelector.element;
  93012. var /** @type {?} */ classNames = cssSelector.classNames;
  93013. var /** @type {?} */ attrs = cssSelector.attrs;
  93014. var /** @type {?} */ selectable = new SelectorContext(cssSelector, callbackCtxt, listContext);
  93015. if (element) {
  93016. var /** @type {?} */ isTerminal = attrs.length === 0 && classNames.length === 0;
  93017. if (isTerminal) {
  93018. this._addTerminal(matcher._elementMap, element, selectable);
  93019. }
  93020. else {
  93021. matcher = this._addPartial(matcher._elementPartialMap, element);
  93022. }
  93023. }
  93024. if (classNames) {
  93025. for (var /** @type {?} */ i = 0; i < classNames.length; i++) {
  93026. var /** @type {?} */ isTerminal = attrs.length === 0 && i === classNames.length - 1;
  93027. var /** @type {?} */ className = classNames[i];
  93028. if (isTerminal) {
  93029. this._addTerminal(matcher._classMap, className, selectable);
  93030. }
  93031. else {
  93032. matcher = this._addPartial(matcher._classPartialMap, className);
  93033. }
  93034. }
  93035. }
  93036. if (attrs) {
  93037. for (var /** @type {?} */ i = 0; i < attrs.length; i += 2) {
  93038. var /** @type {?} */ isTerminal = i === attrs.length - 2;
  93039. var /** @type {?} */ name_2 = attrs[i];
  93040. var /** @type {?} */ value = attrs[i + 1];
  93041. if (isTerminal) {
  93042. var /** @type {?} */ terminalMap = matcher._attrValueMap;
  93043. var /** @type {?} */ terminalValuesMap = terminalMap.get(name_2);
  93044. if (!terminalValuesMap) {
  93045. terminalValuesMap = new Map();
  93046. terminalMap.set(name_2, terminalValuesMap);
  93047. }
  93048. this._addTerminal(terminalValuesMap, value, selectable);
  93049. }
  93050. else {
  93051. var /** @type {?} */ partialMap = matcher._attrValuePartialMap;
  93052. var /** @type {?} */ partialValuesMap = partialMap.get(name_2);
  93053. if (!partialValuesMap) {
  93054. partialValuesMap = new Map();
  93055. partialMap.set(name_2, partialValuesMap);
  93056. }
  93057. matcher = this._addPartial(partialValuesMap, value);
  93058. }
  93059. }
  93060. }
  93061. };
  93062. /**
  93063. * @param {?} map
  93064. * @param {?} name
  93065. * @param {?} selectable
  93066. * @return {?}
  93067. */
  93068. SelectorMatcher.prototype._addTerminal = /**
  93069. * @param {?} map
  93070. * @param {?} name
  93071. * @param {?} selectable
  93072. * @return {?}
  93073. */
  93074. function (map, name, selectable) {
  93075. var /** @type {?} */ terminalList = map.get(name);
  93076. if (!terminalList) {
  93077. terminalList = [];
  93078. map.set(name, terminalList);
  93079. }
  93080. terminalList.push(selectable);
  93081. };
  93082. /**
  93083. * @param {?} map
  93084. * @param {?} name
  93085. * @return {?}
  93086. */
  93087. SelectorMatcher.prototype._addPartial = /**
  93088. * @param {?} map
  93089. * @param {?} name
  93090. * @return {?}
  93091. */
  93092. function (map, name) {
  93093. var /** @type {?} */ matcher = map.get(name);
  93094. if (!matcher) {
  93095. matcher = new SelectorMatcher();
  93096. map.set(name, matcher);
  93097. }
  93098. return matcher;
  93099. };
  93100. /**
  93101. * Find the objects that have been added via `addSelectable`
  93102. * whose css selector is contained in the given css selector.
  93103. * @param cssSelector A css selector
  93104. * @param matchedCallback This callback will be called with the object handed into `addSelectable`
  93105. * @return boolean true if a match was found
  93106. */
  93107. /**
  93108. * Find the objects that have been added via `addSelectable`
  93109. * whose css selector is contained in the given css selector.
  93110. * @param {?} cssSelector A css selector
  93111. * @param {?} matchedCallback This callback will be called with the object handed into `addSelectable`
  93112. * @return {?} boolean true if a match was found
  93113. */
  93114. SelectorMatcher.prototype.match = /**
  93115. * Find the objects that have been added via `addSelectable`
  93116. * whose css selector is contained in the given css selector.
  93117. * @param {?} cssSelector A css selector
  93118. * @param {?} matchedCallback This callback will be called with the object handed into `addSelectable`
  93119. * @return {?} boolean true if a match was found
  93120. */
  93121. function (cssSelector, matchedCallback) {
  93122. var /** @type {?} */ result = false;
  93123. var /** @type {?} */ element = /** @type {?} */ ((cssSelector.element));
  93124. var /** @type {?} */ classNames = cssSelector.classNames;
  93125. var /** @type {?} */ attrs = cssSelector.attrs;
  93126. for (var /** @type {?} */ i = 0; i < this._listContexts.length; i++) {
  93127. this._listContexts[i].alreadyMatched = false;
  93128. }
  93129. result = this._matchTerminal(this._elementMap, element, cssSelector, matchedCallback) || result;
  93130. result = this._matchPartial(this._elementPartialMap, element, cssSelector, matchedCallback) ||
  93131. result;
  93132. if (classNames) {
  93133. for (var /** @type {?} */ i = 0; i < classNames.length; i++) {
  93134. var /** @type {?} */ className = classNames[i];
  93135. result =
  93136. this._matchTerminal(this._classMap, className, cssSelector, matchedCallback) || result;
  93137. result =
  93138. this._matchPartial(this._classPartialMap, className, cssSelector, matchedCallback) ||
  93139. result;
  93140. }
  93141. }
  93142. if (attrs) {
  93143. for (var /** @type {?} */ i = 0; i < attrs.length; i += 2) {
  93144. var /** @type {?} */ name_3 = attrs[i];
  93145. var /** @type {?} */ value = attrs[i + 1];
  93146. var /** @type {?} */ terminalValuesMap = /** @type {?} */ ((this._attrValueMap.get(name_3)));
  93147. if (value) {
  93148. result =
  93149. this._matchTerminal(terminalValuesMap, '', cssSelector, matchedCallback) || result;
  93150. }
  93151. result =
  93152. this._matchTerminal(terminalValuesMap, value, cssSelector, matchedCallback) || result;
  93153. var /** @type {?} */ partialValuesMap = /** @type {?} */ ((this._attrValuePartialMap.get(name_3)));
  93154. if (value) {
  93155. result = this._matchPartial(partialValuesMap, '', cssSelector, matchedCallback) || result;
  93156. }
  93157. result =
  93158. this._matchPartial(partialValuesMap, value, cssSelector, matchedCallback) || result;
  93159. }
  93160. }
  93161. return result;
  93162. };
  93163. /** @internal */
  93164. /**
  93165. * \@internal
  93166. * @param {?} map
  93167. * @param {?} name
  93168. * @param {?} cssSelector
  93169. * @param {?} matchedCallback
  93170. * @return {?}
  93171. */
  93172. SelectorMatcher.prototype._matchTerminal = /**
  93173. * \@internal
  93174. * @param {?} map
  93175. * @param {?} name
  93176. * @param {?} cssSelector
  93177. * @param {?} matchedCallback
  93178. * @return {?}
  93179. */
  93180. function (map, name, cssSelector, matchedCallback) {
  93181. if (!map || typeof name !== 'string') {
  93182. return false;
  93183. }
  93184. var /** @type {?} */ selectables = map.get(name) || [];
  93185. var /** @type {?} */ starSelectables = /** @type {?} */ ((map.get('*')));
  93186. if (starSelectables) {
  93187. selectables = selectables.concat(starSelectables);
  93188. }
  93189. if (selectables.length === 0) {
  93190. return false;
  93191. }
  93192. var /** @type {?} */ selectable;
  93193. var /** @type {?} */ result = false;
  93194. for (var /** @type {?} */ i = 0; i < selectables.length; i++) {
  93195. selectable = selectables[i];
  93196. result = selectable.finalize(cssSelector, matchedCallback) || result;
  93197. }
  93198. return result;
  93199. };
  93200. /** @internal */
  93201. /**
  93202. * \@internal
  93203. * @param {?} map
  93204. * @param {?} name
  93205. * @param {?} cssSelector
  93206. * @param {?} matchedCallback
  93207. * @return {?}
  93208. */
  93209. SelectorMatcher.prototype._matchPartial = /**
  93210. * \@internal
  93211. * @param {?} map
  93212. * @param {?} name
  93213. * @param {?} cssSelector
  93214. * @param {?} matchedCallback
  93215. * @return {?}
  93216. */
  93217. function (map, name, cssSelector, matchedCallback) {
  93218. if (!map || typeof name !== 'string') {
  93219. return false;
  93220. }
  93221. var /** @type {?} */ nestedSelector = map.get(name);
  93222. if (!nestedSelector) {
  93223. return false;
  93224. }
  93225. // TODO(perf): get rid of recursion and measure again
  93226. // TODO(perf): don't pass the whole selector into the recursion,
  93227. // but only the not processed parts
  93228. return nestedSelector.match(cssSelector, matchedCallback);
  93229. };
  93230. return SelectorMatcher;
  93231. }());
  93232. var SelectorListContext = /** @class */ (function () {
  93233. function SelectorListContext(selectors) {
  93234. this.selectors = selectors;
  93235. this.alreadyMatched = false;
  93236. }
  93237. return SelectorListContext;
  93238. }());
  93239. var SelectorContext = /** @class */ (function () {
  93240. function SelectorContext(selector, cbContext, listContext) {
  93241. this.selector = selector;
  93242. this.cbContext = cbContext;
  93243. this.listContext = listContext;
  93244. this.notSelectors = selector.notSelectors;
  93245. }
  93246. /**
  93247. * @param {?} cssSelector
  93248. * @param {?} callback
  93249. * @return {?}
  93250. */
  93251. SelectorContext.prototype.finalize = /**
  93252. * @param {?} cssSelector
  93253. * @param {?} callback
  93254. * @return {?}
  93255. */
  93256. function (cssSelector, callback) {
  93257. var /** @type {?} */ result = true;
  93258. if (this.notSelectors.length > 0 && (!this.listContext || !this.listContext.alreadyMatched)) {
  93259. var /** @type {?} */ notMatcher = SelectorMatcher.createNotMatcher(this.notSelectors);
  93260. result = !notMatcher.match(cssSelector, null);
  93261. }
  93262. if (result && callback && (!this.listContext || !this.listContext.alreadyMatched)) {
  93263. if (this.listContext) {
  93264. this.listContext.alreadyMatched = true;
  93265. }
  93266. callback(this.selector, this.cbContext);
  93267. }
  93268. return result;
  93269. };
  93270. return SelectorContext;
  93271. }());
  93272. /**
  93273. * @fileoverview added by tsickle
  93274. * @suppress {checkTypes} checked by tsc
  93275. */
  93276. /**
  93277. * @license
  93278. * Copyright Google Inc. All Rights Reserved.
  93279. *
  93280. * Use of this source code is governed by an MIT-style license that can be
  93281. * found in the LICENSE file at https://angular.io/license
  93282. */
  93283. var ERROR_COMPONENT_TYPE = 'ngComponentType';
  93284. var CompileMetadataResolver = /** @class */ (function () {
  93285. function CompileMetadataResolver(_config, _htmlParser, _ngModuleResolver, _directiveResolver, _pipeResolver, _summaryResolver, _schemaRegistry, _directiveNormalizer, _console, _staticSymbolCache, _reflector, _errorCollector) {
  93286. this._config = _config;
  93287. this._htmlParser = _htmlParser;
  93288. this._ngModuleResolver = _ngModuleResolver;
  93289. this._directiveResolver = _directiveResolver;
  93290. this._pipeResolver = _pipeResolver;
  93291. this._summaryResolver = _summaryResolver;
  93292. this._schemaRegistry = _schemaRegistry;
  93293. this._directiveNormalizer = _directiveNormalizer;
  93294. this._console = _console;
  93295. this._staticSymbolCache = _staticSymbolCache;
  93296. this._reflector = _reflector;
  93297. this._errorCollector = _errorCollector;
  93298. this._nonNormalizedDirectiveCache = new Map();
  93299. this._directiveCache = new Map();
  93300. this._summaryCache = new Map();
  93301. this._pipeCache = new Map();
  93302. this._ngModuleCache = new Map();
  93303. this._ngModuleOfTypes = new Map();
  93304. }
  93305. /**
  93306. * @return {?}
  93307. */
  93308. CompileMetadataResolver.prototype.getReflector = /**
  93309. * @return {?}
  93310. */
  93311. function () { return this._reflector; };
  93312. /**
  93313. * @param {?} type
  93314. * @return {?}
  93315. */
  93316. CompileMetadataResolver.prototype.clearCacheFor = /**
  93317. * @param {?} type
  93318. * @return {?}
  93319. */
  93320. function (type) {
  93321. var /** @type {?} */ dirMeta = this._directiveCache.get(type);
  93322. this._directiveCache.delete(type);
  93323. this._nonNormalizedDirectiveCache.delete(type);
  93324. this._summaryCache.delete(type);
  93325. this._pipeCache.delete(type);
  93326. this._ngModuleOfTypes.delete(type);
  93327. // Clear all of the NgModule as they contain transitive information!
  93328. this._ngModuleCache.clear();
  93329. if (dirMeta) {
  93330. this._directiveNormalizer.clearCacheFor(dirMeta);
  93331. }
  93332. };
  93333. /**
  93334. * @return {?}
  93335. */
  93336. CompileMetadataResolver.prototype.clearCache = /**
  93337. * @return {?}
  93338. */
  93339. function () {
  93340. this._directiveCache.clear();
  93341. this._nonNormalizedDirectiveCache.clear();
  93342. this._summaryCache.clear();
  93343. this._pipeCache.clear();
  93344. this._ngModuleCache.clear();
  93345. this._ngModuleOfTypes.clear();
  93346. this._directiveNormalizer.clearCache();
  93347. };
  93348. /**
  93349. * @param {?} baseType
  93350. * @param {?} name
  93351. * @return {?}
  93352. */
  93353. CompileMetadataResolver.prototype._createProxyClass = /**
  93354. * @param {?} baseType
  93355. * @param {?} name
  93356. * @return {?}
  93357. */
  93358. function (baseType, name) {
  93359. var /** @type {?} */ delegate = null;
  93360. var /** @type {?} */ proxyClass = /** @type {?} */ (function () {
  93361. if (!delegate) {
  93362. throw new Error("Illegal state: Class " + name + " for type " + stringify(baseType) + " is not compiled yet!");
  93363. }
  93364. return delegate.apply(this, arguments);
  93365. });
  93366. proxyClass.setDelegate = function (d) {
  93367. delegate = d;
  93368. (/** @type {?} */ (proxyClass)).prototype = d.prototype;
  93369. };
  93370. // Make stringify work correctly
  93371. (/** @type {?} */ (proxyClass)).overriddenName = name;
  93372. return proxyClass;
  93373. };
  93374. /**
  93375. * @param {?} dirType
  93376. * @param {?} name
  93377. * @return {?}
  93378. */
  93379. CompileMetadataResolver.prototype.getGeneratedClass = /**
  93380. * @param {?} dirType
  93381. * @param {?} name
  93382. * @return {?}
  93383. */
  93384. function (dirType, name) {
  93385. if (dirType instanceof StaticSymbol) {
  93386. return this._staticSymbolCache.get(ngfactoryFilePath(dirType.filePath), name);
  93387. }
  93388. else {
  93389. return this._createProxyClass(dirType, name);
  93390. }
  93391. };
  93392. /**
  93393. * @param {?} dirType
  93394. * @return {?}
  93395. */
  93396. CompileMetadataResolver.prototype.getComponentViewClass = /**
  93397. * @param {?} dirType
  93398. * @return {?}
  93399. */
  93400. function (dirType) {
  93401. return this.getGeneratedClass(dirType, viewClassName(dirType, 0));
  93402. };
  93403. /**
  93404. * @param {?} dirType
  93405. * @return {?}
  93406. */
  93407. CompileMetadataResolver.prototype.getHostComponentViewClass = /**
  93408. * @param {?} dirType
  93409. * @return {?}
  93410. */
  93411. function (dirType) {
  93412. return this.getGeneratedClass(dirType, hostViewClassName(dirType));
  93413. };
  93414. /**
  93415. * @param {?} dirType
  93416. * @return {?}
  93417. */
  93418. CompileMetadataResolver.prototype.getHostComponentType = /**
  93419. * @param {?} dirType
  93420. * @return {?}
  93421. */
  93422. function (dirType) {
  93423. var /** @type {?} */ name = identifierName({ reference: dirType }) + "_Host";
  93424. if (dirType instanceof StaticSymbol) {
  93425. return this._staticSymbolCache.get(dirType.filePath, name);
  93426. }
  93427. else {
  93428. var /** @type {?} */ HostClass = /** @type {?} */ (function HostClass() { });
  93429. HostClass.overriddenName = name;
  93430. return HostClass;
  93431. }
  93432. };
  93433. /**
  93434. * @param {?} dirType
  93435. * @return {?}
  93436. */
  93437. CompileMetadataResolver.prototype.getRendererType = /**
  93438. * @param {?} dirType
  93439. * @return {?}
  93440. */
  93441. function (dirType) {
  93442. if (dirType instanceof StaticSymbol) {
  93443. return this._staticSymbolCache.get(ngfactoryFilePath(dirType.filePath), rendererTypeName(dirType));
  93444. }
  93445. else {
  93446. // returning an object as proxy,
  93447. // that we fill later during runtime compilation.
  93448. return /** @type {?} */ ({});
  93449. }
  93450. };
  93451. /**
  93452. * @param {?} selector
  93453. * @param {?} dirType
  93454. * @param {?} inputs
  93455. * @param {?} outputs
  93456. * @return {?}
  93457. */
  93458. CompileMetadataResolver.prototype.getComponentFactory = /**
  93459. * @param {?} selector
  93460. * @param {?} dirType
  93461. * @param {?} inputs
  93462. * @param {?} outputs
  93463. * @return {?}
  93464. */
  93465. function (selector, dirType, inputs, outputs) {
  93466. if (dirType instanceof StaticSymbol) {
  93467. return this._staticSymbolCache.get(ngfactoryFilePath(dirType.filePath), componentFactoryName(dirType));
  93468. }
  93469. else {
  93470. var /** @type {?} */ hostView = this.getHostComponentViewClass(dirType);
  93471. // Note: ngContentSelectors will be filled later once the template is
  93472. // loaded.
  93473. var /** @type {?} */ createComponentFactory = this._reflector.resolveExternalReference(Identifiers.createComponentFactory);
  93474. return createComponentFactory(selector, dirType, /** @type {?} */ (hostView), inputs, outputs, []);
  93475. }
  93476. };
  93477. /**
  93478. * @param {?} factory
  93479. * @param {?} ngContentSelectors
  93480. * @return {?}
  93481. */
  93482. CompileMetadataResolver.prototype.initComponentFactory = /**
  93483. * @param {?} factory
  93484. * @param {?} ngContentSelectors
  93485. * @return {?}
  93486. */
  93487. function (factory, ngContentSelectors) {
  93488. if (!(factory instanceof StaticSymbol)) {
  93489. (_a = (/** @type {?} */ (factory)).ngContentSelectors).push.apply(_a, ngContentSelectors);
  93490. }
  93491. var _a;
  93492. };
  93493. /**
  93494. * @param {?} type
  93495. * @param {?} kind
  93496. * @return {?}
  93497. */
  93498. CompileMetadataResolver.prototype._loadSummary = /**
  93499. * @param {?} type
  93500. * @param {?} kind
  93501. * @return {?}
  93502. */
  93503. function (type, kind) {
  93504. var /** @type {?} */ typeSummary = this._summaryCache.get(type);
  93505. if (!typeSummary) {
  93506. var /** @type {?} */ summary = this._summaryResolver.resolveSummary(type);
  93507. typeSummary = summary ? summary.type : null;
  93508. this._summaryCache.set(type, typeSummary || null);
  93509. }
  93510. return typeSummary && typeSummary.summaryKind === kind ? typeSummary : null;
  93511. };
  93512. /**
  93513. * @param {?} compMeta
  93514. * @param {?=} hostViewType
  93515. * @return {?}
  93516. */
  93517. CompileMetadataResolver.prototype.getHostComponentMetadata = /**
  93518. * @param {?} compMeta
  93519. * @param {?=} hostViewType
  93520. * @return {?}
  93521. */
  93522. function (compMeta, hostViewType) {
  93523. var /** @type {?} */ hostType = this.getHostComponentType(compMeta.type.reference);
  93524. if (!hostViewType) {
  93525. hostViewType = this.getHostComponentViewClass(hostType);
  93526. }
  93527. // Note: ! is ok here as this method should only be called with normalized directive
  93528. // metadata, which always fills in the selector.
  93529. var /** @type {?} */ template = CssSelector.parse(/** @type {?} */ ((compMeta.selector)))[0].getMatchingElementTemplate();
  93530. var /** @type {?} */ templateUrl = '';
  93531. var /** @type {?} */ htmlAst = this._htmlParser.parse(template, templateUrl);
  93532. return CompileDirectiveMetadata.create({
  93533. isHost: true,
  93534. type: { reference: hostType, diDeps: [], lifecycleHooks: [] },
  93535. template: new CompileTemplateMetadata({
  93536. encapsulation: ViewEncapsulation.None,
  93537. template: template,
  93538. templateUrl: templateUrl,
  93539. htmlAst: htmlAst,
  93540. styles: [],
  93541. styleUrls: [],
  93542. ngContentSelectors: [],
  93543. animations: [],
  93544. isInline: true,
  93545. externalStylesheets: [],
  93546. interpolation: null,
  93547. preserveWhitespaces: false,
  93548. }),
  93549. exportAs: null,
  93550. changeDetection: ChangeDetectionStrategy.Default,
  93551. inputs: [],
  93552. outputs: [],
  93553. host: {},
  93554. isComponent: true,
  93555. selector: '*',
  93556. providers: [],
  93557. viewProviders: [],
  93558. queries: [],
  93559. guards: {},
  93560. viewQueries: [],
  93561. componentViewType: hostViewType,
  93562. rendererType: /** @type {?} */ ({ id: '__Host__', encapsulation: ViewEncapsulation.None, styles: [], data: {} }),
  93563. entryComponents: [],
  93564. componentFactory: null
  93565. });
  93566. };
  93567. /**
  93568. * @param {?} ngModuleType
  93569. * @param {?} directiveType
  93570. * @param {?} isSync
  93571. * @return {?}
  93572. */
  93573. CompileMetadataResolver.prototype.loadDirectiveMetadata = /**
  93574. * @param {?} ngModuleType
  93575. * @param {?} directiveType
  93576. * @param {?} isSync
  93577. * @return {?}
  93578. */
  93579. function (ngModuleType, directiveType, isSync) {
  93580. var _this = this;
  93581. if (this._directiveCache.has(directiveType)) {
  93582. return null;
  93583. }
  93584. directiveType = resolveForwardRef(directiveType);
  93585. var _a = /** @type {?} */ ((this.getNonNormalizedDirectiveMetadata(directiveType))), annotation = _a.annotation, metadata = _a.metadata;
  93586. var /** @type {?} */ createDirectiveMetadata = function (templateMetadata) {
  93587. var /** @type {?} */ normalizedDirMeta = new CompileDirectiveMetadata({
  93588. isHost: false,
  93589. type: metadata.type,
  93590. isComponent: metadata.isComponent,
  93591. selector: metadata.selector,
  93592. exportAs: metadata.exportAs,
  93593. changeDetection: metadata.changeDetection,
  93594. inputs: metadata.inputs,
  93595. outputs: metadata.outputs,
  93596. hostListeners: metadata.hostListeners,
  93597. hostProperties: metadata.hostProperties,
  93598. hostAttributes: metadata.hostAttributes,
  93599. providers: metadata.providers,
  93600. viewProviders: metadata.viewProviders,
  93601. queries: metadata.queries,
  93602. guards: metadata.guards,
  93603. viewQueries: metadata.viewQueries,
  93604. entryComponents: metadata.entryComponents,
  93605. componentViewType: metadata.componentViewType,
  93606. rendererType: metadata.rendererType,
  93607. componentFactory: metadata.componentFactory,
  93608. template: templateMetadata
  93609. });
  93610. if (templateMetadata) {
  93611. _this.initComponentFactory(/** @type {?} */ ((metadata.componentFactory)), templateMetadata.ngContentSelectors);
  93612. }
  93613. _this._directiveCache.set(directiveType, normalizedDirMeta);
  93614. _this._summaryCache.set(directiveType, normalizedDirMeta.toSummary());
  93615. return null;
  93616. };
  93617. if (metadata.isComponent) {
  93618. var /** @type {?} */ template = /** @type {?} */ ((metadata.template));
  93619. var /** @type {?} */ templateMeta = this._directiveNormalizer.normalizeTemplate({
  93620. ngModuleType: ngModuleType,
  93621. componentType: directiveType,
  93622. moduleUrl: this._reflector.componentModuleUrl(directiveType, annotation),
  93623. encapsulation: template.encapsulation,
  93624. template: template.template,
  93625. templateUrl: template.templateUrl,
  93626. styles: template.styles,
  93627. styleUrls: template.styleUrls,
  93628. animations: template.animations,
  93629. interpolation: template.interpolation,
  93630. preserveWhitespaces: template.preserveWhitespaces
  93631. });
  93632. if (isPromise(templateMeta) && isSync) {
  93633. this._reportError(componentStillLoadingError(directiveType), directiveType);
  93634. return null;
  93635. }
  93636. return SyncAsync.then(templateMeta, createDirectiveMetadata);
  93637. }
  93638. else {
  93639. // directive
  93640. createDirectiveMetadata(null);
  93641. return null;
  93642. }
  93643. };
  93644. /**
  93645. * @param {?} directiveType
  93646. * @return {?}
  93647. */
  93648. CompileMetadataResolver.prototype.getNonNormalizedDirectiveMetadata = /**
  93649. * @param {?} directiveType
  93650. * @return {?}
  93651. */
  93652. function (directiveType) {
  93653. var _this = this;
  93654. directiveType = resolveForwardRef(directiveType);
  93655. if (!directiveType) {
  93656. return null;
  93657. }
  93658. var /** @type {?} */ cacheEntry = this._nonNormalizedDirectiveCache.get(directiveType);
  93659. if (cacheEntry) {
  93660. return cacheEntry;
  93661. }
  93662. var /** @type {?} */ dirMeta = this._directiveResolver.resolve(directiveType, false);
  93663. if (!dirMeta) {
  93664. return null;
  93665. }
  93666. var /** @type {?} */ nonNormalizedTemplateMetadata = /** @type {?} */ ((undefined));
  93667. if (createComponent.isTypeOf(dirMeta)) {
  93668. // component
  93669. var /** @type {?} */ compMeta = /** @type {?} */ (dirMeta);
  93670. assertArrayOfStrings('styles', compMeta.styles);
  93671. assertArrayOfStrings('styleUrls', compMeta.styleUrls);
  93672. assertInterpolationSymbols('interpolation', compMeta.interpolation);
  93673. var /** @type {?} */ animations = compMeta.animations;
  93674. nonNormalizedTemplateMetadata = new CompileTemplateMetadata({
  93675. encapsulation: noUndefined(compMeta.encapsulation),
  93676. template: noUndefined(compMeta.template),
  93677. templateUrl: noUndefined(compMeta.templateUrl),
  93678. htmlAst: null,
  93679. styles: compMeta.styles || [],
  93680. styleUrls: compMeta.styleUrls || [],
  93681. animations: animations || [],
  93682. interpolation: noUndefined(compMeta.interpolation),
  93683. isInline: !!compMeta.template,
  93684. externalStylesheets: [],
  93685. ngContentSelectors: [],
  93686. preserveWhitespaces: noUndefined(dirMeta.preserveWhitespaces),
  93687. });
  93688. }
  93689. var /** @type {?} */ changeDetectionStrategy = /** @type {?} */ ((null));
  93690. var /** @type {?} */ viewProviders = [];
  93691. var /** @type {?} */ entryComponentMetadata = [];
  93692. var /** @type {?} */ selector = dirMeta.selector;
  93693. if (createComponent.isTypeOf(dirMeta)) {
  93694. // Component
  93695. var /** @type {?} */ compMeta = /** @type {?} */ (dirMeta);
  93696. changeDetectionStrategy = /** @type {?} */ ((compMeta.changeDetection));
  93697. if (compMeta.viewProviders) {
  93698. viewProviders = this._getProvidersMetadata(compMeta.viewProviders, entryComponentMetadata, "viewProviders for \"" + stringifyType(directiveType) + "\"", [], directiveType);
  93699. }
  93700. if (compMeta.entryComponents) {
  93701. entryComponentMetadata = flattenAndDedupeArray(compMeta.entryComponents)
  93702. .map(function (type) { return ((_this._getEntryComponentMetadata(type))); })
  93703. .concat(entryComponentMetadata);
  93704. }
  93705. if (!selector) {
  93706. selector = this._schemaRegistry.getDefaultComponentElementName();
  93707. }
  93708. }
  93709. else {
  93710. // Directive
  93711. if (!selector) {
  93712. this._reportError(syntaxError("Directive " + stringifyType(directiveType) + " has no selector, please add it!"), directiveType);
  93713. selector = 'error';
  93714. }
  93715. }
  93716. var /** @type {?} */ providers = [];
  93717. if (dirMeta.providers != null) {
  93718. providers = this._getProvidersMetadata(dirMeta.providers, entryComponentMetadata, "providers for \"" + stringifyType(directiveType) + "\"", [], directiveType);
  93719. }
  93720. var /** @type {?} */ queries = [];
  93721. var /** @type {?} */ viewQueries = [];
  93722. if (dirMeta.queries != null) {
  93723. queries = this._getQueriesMetadata(dirMeta.queries, false, directiveType);
  93724. viewQueries = this._getQueriesMetadata(dirMeta.queries, true, directiveType);
  93725. }
  93726. var /** @type {?} */ metadata = CompileDirectiveMetadata.create({
  93727. isHost: false,
  93728. selector: selector,
  93729. exportAs: noUndefined(dirMeta.exportAs),
  93730. isComponent: !!nonNormalizedTemplateMetadata,
  93731. type: this._getTypeMetadata(directiveType),
  93732. template: nonNormalizedTemplateMetadata,
  93733. changeDetection: changeDetectionStrategy,
  93734. inputs: dirMeta.inputs || [],
  93735. outputs: dirMeta.outputs || [],
  93736. host: dirMeta.host || {},
  93737. providers: providers || [],
  93738. viewProviders: viewProviders || [],
  93739. queries: queries || [],
  93740. guards: dirMeta.guards || {},
  93741. viewQueries: viewQueries || [],
  93742. entryComponents: entryComponentMetadata,
  93743. componentViewType: nonNormalizedTemplateMetadata ? this.getComponentViewClass(directiveType) :
  93744. null,
  93745. rendererType: nonNormalizedTemplateMetadata ? this.getRendererType(directiveType) : null,
  93746. componentFactory: null
  93747. });
  93748. if (nonNormalizedTemplateMetadata) {
  93749. metadata.componentFactory =
  93750. this.getComponentFactory(selector, directiveType, metadata.inputs, metadata.outputs);
  93751. }
  93752. cacheEntry = { metadata: metadata, annotation: dirMeta };
  93753. this._nonNormalizedDirectiveCache.set(directiveType, cacheEntry);
  93754. return cacheEntry;
  93755. };
  93756. /**
  93757. * Gets the metadata for the given directive.
  93758. * This assumes `loadNgModuleDirectiveAndPipeMetadata` has been called first.
  93759. */
  93760. /**
  93761. * Gets the metadata for the given directive.
  93762. * This assumes `loadNgModuleDirectiveAndPipeMetadata` has been called first.
  93763. * @param {?} directiveType
  93764. * @return {?}
  93765. */
  93766. CompileMetadataResolver.prototype.getDirectiveMetadata = /**
  93767. * Gets the metadata for the given directive.
  93768. * This assumes `loadNgModuleDirectiveAndPipeMetadata` has been called first.
  93769. * @param {?} directiveType
  93770. * @return {?}
  93771. */
  93772. function (directiveType) {
  93773. var /** @type {?} */ dirMeta = /** @type {?} */ ((this._directiveCache.get(directiveType)));
  93774. if (!dirMeta) {
  93775. this._reportError(syntaxError("Illegal state: getDirectiveMetadata can only be called after loadNgModuleDirectiveAndPipeMetadata for a module that declares it. Directive " + stringifyType(directiveType) + "."), directiveType);
  93776. }
  93777. return dirMeta;
  93778. };
  93779. /**
  93780. * @param {?} dirType
  93781. * @return {?}
  93782. */
  93783. CompileMetadataResolver.prototype.getDirectiveSummary = /**
  93784. * @param {?} dirType
  93785. * @return {?}
  93786. */
  93787. function (dirType) {
  93788. var /** @type {?} */ dirSummary = /** @type {?} */ (this._loadSummary(dirType, CompileSummaryKind.Directive));
  93789. if (!dirSummary) {
  93790. this._reportError(syntaxError("Illegal state: Could not load the summary for directive " + stringifyType(dirType) + "."), dirType);
  93791. }
  93792. return dirSummary;
  93793. };
  93794. /**
  93795. * @param {?} type
  93796. * @return {?}
  93797. */
  93798. CompileMetadataResolver.prototype.isDirective = /**
  93799. * @param {?} type
  93800. * @return {?}
  93801. */
  93802. function (type) {
  93803. return !!this._loadSummary(type, CompileSummaryKind.Directive) ||
  93804. this._directiveResolver.isDirective(type);
  93805. };
  93806. /**
  93807. * @param {?} type
  93808. * @return {?}
  93809. */
  93810. CompileMetadataResolver.prototype.isPipe = /**
  93811. * @param {?} type
  93812. * @return {?}
  93813. */
  93814. function (type) {
  93815. return !!this._loadSummary(type, CompileSummaryKind.Pipe) ||
  93816. this._pipeResolver.isPipe(type);
  93817. };
  93818. /**
  93819. * @param {?} type
  93820. * @return {?}
  93821. */
  93822. CompileMetadataResolver.prototype.isNgModule = /**
  93823. * @param {?} type
  93824. * @return {?}
  93825. */
  93826. function (type) {
  93827. return !!this._loadSummary(type, CompileSummaryKind.NgModule) ||
  93828. this._ngModuleResolver.isNgModule(type);
  93829. };
  93830. /**
  93831. * @param {?} moduleType
  93832. * @param {?=} alreadyCollecting
  93833. * @return {?}
  93834. */
  93835. CompileMetadataResolver.prototype.getNgModuleSummary = /**
  93836. * @param {?} moduleType
  93837. * @param {?=} alreadyCollecting
  93838. * @return {?}
  93839. */
  93840. function (moduleType, alreadyCollecting) {
  93841. if (alreadyCollecting === void 0) { alreadyCollecting = null; }
  93842. var /** @type {?} */ moduleSummary = /** @type {?} */ (this._loadSummary(moduleType, CompileSummaryKind.NgModule));
  93843. if (!moduleSummary) {
  93844. var /** @type {?} */ moduleMeta = this.getNgModuleMetadata(moduleType, false, alreadyCollecting);
  93845. moduleSummary = moduleMeta ? moduleMeta.toSummary() : null;
  93846. if (moduleSummary) {
  93847. this._summaryCache.set(moduleType, moduleSummary);
  93848. }
  93849. }
  93850. return moduleSummary;
  93851. };
  93852. /**
  93853. * Loads the declared directives and pipes of an NgModule.
  93854. */
  93855. /**
  93856. * Loads the declared directives and pipes of an NgModule.
  93857. * @param {?} moduleType
  93858. * @param {?} isSync
  93859. * @param {?=} throwIfNotFound
  93860. * @return {?}
  93861. */
  93862. CompileMetadataResolver.prototype.loadNgModuleDirectiveAndPipeMetadata = /**
  93863. * Loads the declared directives and pipes of an NgModule.
  93864. * @param {?} moduleType
  93865. * @param {?} isSync
  93866. * @param {?=} throwIfNotFound
  93867. * @return {?}
  93868. */
  93869. function (moduleType, isSync, throwIfNotFound) {
  93870. var _this = this;
  93871. if (throwIfNotFound === void 0) { throwIfNotFound = true; }
  93872. var /** @type {?} */ ngModule = this.getNgModuleMetadata(moduleType, throwIfNotFound);
  93873. var /** @type {?} */ loading = [];
  93874. if (ngModule) {
  93875. ngModule.declaredDirectives.forEach(function (id) {
  93876. var /** @type {?} */ promise = _this.loadDirectiveMetadata(moduleType, id.reference, isSync);
  93877. if (promise) {
  93878. loading.push(promise);
  93879. }
  93880. });
  93881. ngModule.declaredPipes.forEach(function (id) { return _this._loadPipeMetadata(id.reference); });
  93882. }
  93883. return Promise.all(loading);
  93884. };
  93885. /**
  93886. * @param {?} moduleType
  93887. * @param {?=} throwIfNotFound
  93888. * @param {?=} alreadyCollecting
  93889. * @return {?}
  93890. */
  93891. CompileMetadataResolver.prototype.getNgModuleMetadata = /**
  93892. * @param {?} moduleType
  93893. * @param {?=} throwIfNotFound
  93894. * @param {?=} alreadyCollecting
  93895. * @return {?}
  93896. */
  93897. function (moduleType, throwIfNotFound, alreadyCollecting) {
  93898. var _this = this;
  93899. if (throwIfNotFound === void 0) { throwIfNotFound = true; }
  93900. if (alreadyCollecting === void 0) { alreadyCollecting = null; }
  93901. moduleType = resolveForwardRef(moduleType);
  93902. var /** @type {?} */ compileMeta = this._ngModuleCache.get(moduleType);
  93903. if (compileMeta) {
  93904. return compileMeta;
  93905. }
  93906. var /** @type {?} */ meta = this._ngModuleResolver.resolve(moduleType, throwIfNotFound);
  93907. if (!meta) {
  93908. return null;
  93909. }
  93910. var /** @type {?} */ declaredDirectives = [];
  93911. var /** @type {?} */ exportedNonModuleIdentifiers = [];
  93912. var /** @type {?} */ declaredPipes = [];
  93913. var /** @type {?} */ importedModules = [];
  93914. var /** @type {?} */ exportedModules = [];
  93915. var /** @type {?} */ providers = [];
  93916. var /** @type {?} */ entryComponents = [];
  93917. var /** @type {?} */ bootstrapComponents = [];
  93918. var /** @type {?} */ schemas = [];
  93919. if (meta.imports) {
  93920. flattenAndDedupeArray(meta.imports).forEach(function (importedType) {
  93921. var /** @type {?} */ importedModuleType = /** @type {?} */ ((undefined));
  93922. if (isValidType(importedType)) {
  93923. importedModuleType = importedType;
  93924. }
  93925. else if (importedType && importedType.ngModule) {
  93926. var /** @type {?} */ moduleWithProviders = importedType;
  93927. importedModuleType = moduleWithProviders.ngModule;
  93928. if (moduleWithProviders.providers) {
  93929. providers.push.apply(providers, _this._getProvidersMetadata(moduleWithProviders.providers, entryComponents, "provider for the NgModule '" + stringifyType(importedModuleType) + "'", [], importedType));
  93930. }
  93931. }
  93932. if (importedModuleType) {
  93933. if (_this._checkSelfImport(moduleType, importedModuleType))
  93934. return;
  93935. if (!alreadyCollecting)
  93936. alreadyCollecting = new Set();
  93937. if (alreadyCollecting.has(importedModuleType)) {
  93938. _this._reportError(syntaxError(_this._getTypeDescriptor(importedModuleType) + " '" + stringifyType(importedType) + "' is imported recursively by the module '" + stringifyType(moduleType) + "'."), moduleType);
  93939. return;
  93940. }
  93941. alreadyCollecting.add(importedModuleType);
  93942. var /** @type {?} */ importedModuleSummary = _this.getNgModuleSummary(importedModuleType, alreadyCollecting);
  93943. alreadyCollecting.delete(importedModuleType);
  93944. if (!importedModuleSummary) {
  93945. _this._reportError(syntaxError("Unexpected " + _this._getTypeDescriptor(importedType) + " '" + stringifyType(importedType) + "' imported by the module '" + stringifyType(moduleType) + "'. Please add a @NgModule annotation."), moduleType);
  93946. return;
  93947. }
  93948. importedModules.push(importedModuleSummary);
  93949. }
  93950. else {
  93951. _this._reportError(syntaxError("Unexpected value '" + stringifyType(importedType) + "' imported by the module '" + stringifyType(moduleType) + "'"), moduleType);
  93952. return;
  93953. }
  93954. });
  93955. }
  93956. if (meta.exports) {
  93957. flattenAndDedupeArray(meta.exports).forEach(function (exportedType) {
  93958. if (!isValidType(exportedType)) {
  93959. _this._reportError(syntaxError("Unexpected value '" + stringifyType(exportedType) + "' exported by the module '" + stringifyType(moduleType) + "'"), moduleType);
  93960. return;
  93961. }
  93962. if (!alreadyCollecting)
  93963. alreadyCollecting = new Set();
  93964. if (alreadyCollecting.has(exportedType)) {
  93965. _this._reportError(syntaxError(_this._getTypeDescriptor(exportedType) + " '" + stringify(exportedType) + "' is exported recursively by the module '" + stringifyType(moduleType) + "'"), moduleType);
  93966. return;
  93967. }
  93968. alreadyCollecting.add(exportedType);
  93969. var /** @type {?} */ exportedModuleSummary = _this.getNgModuleSummary(exportedType, alreadyCollecting);
  93970. alreadyCollecting.delete(exportedType);
  93971. if (exportedModuleSummary) {
  93972. exportedModules.push(exportedModuleSummary);
  93973. }
  93974. else {
  93975. exportedNonModuleIdentifiers.push(_this._getIdentifierMetadata(exportedType));
  93976. }
  93977. });
  93978. }
  93979. // Note: This will be modified later, so we rely on
  93980. // getting a new instance every time!
  93981. var /** @type {?} */ transitiveModule = this._getTransitiveNgModuleMetadata(importedModules, exportedModules);
  93982. if (meta.declarations) {
  93983. flattenAndDedupeArray(meta.declarations).forEach(function (declaredType) {
  93984. if (!isValidType(declaredType)) {
  93985. _this._reportError(syntaxError("Unexpected value '" + stringifyType(declaredType) + "' declared by the module '" + stringifyType(moduleType) + "'"), moduleType);
  93986. return;
  93987. }
  93988. var /** @type {?} */ declaredIdentifier = _this._getIdentifierMetadata(declaredType);
  93989. if (_this.isDirective(declaredType)) {
  93990. transitiveModule.addDirective(declaredIdentifier);
  93991. declaredDirectives.push(declaredIdentifier);
  93992. _this._addTypeToModule(declaredType, moduleType);
  93993. }
  93994. else if (_this.isPipe(declaredType)) {
  93995. transitiveModule.addPipe(declaredIdentifier);
  93996. transitiveModule.pipes.push(declaredIdentifier);
  93997. declaredPipes.push(declaredIdentifier);
  93998. _this._addTypeToModule(declaredType, moduleType);
  93999. }
  94000. else {
  94001. _this._reportError(syntaxError("Unexpected " + _this._getTypeDescriptor(declaredType) + " '" + stringifyType(declaredType) + "' declared by the module '" + stringifyType(moduleType) + "'. Please add a @Pipe/@Directive/@Component annotation."), moduleType);
  94002. return;
  94003. }
  94004. });
  94005. }
  94006. var /** @type {?} */ exportedDirectives = [];
  94007. var /** @type {?} */ exportedPipes = [];
  94008. exportedNonModuleIdentifiers.forEach(function (exportedId) {
  94009. if (transitiveModule.directivesSet.has(exportedId.reference)) {
  94010. exportedDirectives.push(exportedId);
  94011. transitiveModule.addExportedDirective(exportedId);
  94012. }
  94013. else if (transitiveModule.pipesSet.has(exportedId.reference)) {
  94014. exportedPipes.push(exportedId);
  94015. transitiveModule.addExportedPipe(exportedId);
  94016. }
  94017. else {
  94018. _this._reportError(syntaxError("Can't export " + _this._getTypeDescriptor(exportedId.reference) + " " + stringifyType(exportedId.reference) + " from " + stringifyType(moduleType) + " as it was neither declared nor imported!"), moduleType);
  94019. return;
  94020. }
  94021. });
  94022. // The providers of the module have to go last
  94023. // so that they overwrite any other provider we already added.
  94024. if (meta.providers) {
  94025. providers.push.apply(providers, this._getProvidersMetadata(meta.providers, entryComponents, "provider for the NgModule '" + stringifyType(moduleType) + "'", [], moduleType));
  94026. }
  94027. if (meta.entryComponents) {
  94028. entryComponents.push.apply(entryComponents, flattenAndDedupeArray(meta.entryComponents)
  94029. .map(function (type) { return ((_this._getEntryComponentMetadata(type))); }));
  94030. }
  94031. if (meta.bootstrap) {
  94032. flattenAndDedupeArray(meta.bootstrap).forEach(function (type) {
  94033. if (!isValidType(type)) {
  94034. _this._reportError(syntaxError("Unexpected value '" + stringifyType(type) + "' used in the bootstrap property of module '" + stringifyType(moduleType) + "'"), moduleType);
  94035. return;
  94036. }
  94037. bootstrapComponents.push(_this._getIdentifierMetadata(type));
  94038. });
  94039. }
  94040. entryComponents.push.apply(entryComponents, bootstrapComponents.map(function (type) { return ((_this._getEntryComponentMetadata(type.reference))); }));
  94041. if (meta.schemas) {
  94042. schemas.push.apply(schemas, flattenAndDedupeArray(meta.schemas));
  94043. }
  94044. compileMeta = new CompileNgModuleMetadata({
  94045. type: this._getTypeMetadata(moduleType),
  94046. providers: providers,
  94047. entryComponents: entryComponents,
  94048. bootstrapComponents: bootstrapComponents,
  94049. schemas: schemas,
  94050. declaredDirectives: declaredDirectives,
  94051. exportedDirectives: exportedDirectives,
  94052. declaredPipes: declaredPipes,
  94053. exportedPipes: exportedPipes,
  94054. importedModules: importedModules,
  94055. exportedModules: exportedModules,
  94056. transitiveModule: transitiveModule,
  94057. id: meta.id || null,
  94058. });
  94059. entryComponents.forEach(function (id) { return transitiveModule.addEntryComponent(id); });
  94060. providers.forEach(function (provider) { return transitiveModule.addProvider(provider, /** @type {?} */ ((compileMeta)).type); });
  94061. transitiveModule.addModule(compileMeta.type);
  94062. this._ngModuleCache.set(moduleType, compileMeta);
  94063. return compileMeta;
  94064. };
  94065. /**
  94066. * @param {?} moduleType
  94067. * @param {?} importedModuleType
  94068. * @return {?}
  94069. */
  94070. CompileMetadataResolver.prototype._checkSelfImport = /**
  94071. * @param {?} moduleType
  94072. * @param {?} importedModuleType
  94073. * @return {?}
  94074. */
  94075. function (moduleType, importedModuleType) {
  94076. if (moduleType === importedModuleType) {
  94077. this._reportError(syntaxError("'" + stringifyType(moduleType) + "' module can't import itself"), moduleType);
  94078. return true;
  94079. }
  94080. return false;
  94081. };
  94082. /**
  94083. * @param {?} type
  94084. * @return {?}
  94085. */
  94086. CompileMetadataResolver.prototype._getTypeDescriptor = /**
  94087. * @param {?} type
  94088. * @return {?}
  94089. */
  94090. function (type) {
  94091. if (isValidType(type)) {
  94092. if (this.isDirective(type)) {
  94093. return 'directive';
  94094. }
  94095. if (this.isPipe(type)) {
  94096. return 'pipe';
  94097. }
  94098. if (this.isNgModule(type)) {
  94099. return 'module';
  94100. }
  94101. }
  94102. if ((/** @type {?} */ (type)).provide) {
  94103. return 'provider';
  94104. }
  94105. return 'value';
  94106. };
  94107. /**
  94108. * @param {?} type
  94109. * @param {?} moduleType
  94110. * @return {?}
  94111. */
  94112. CompileMetadataResolver.prototype._addTypeToModule = /**
  94113. * @param {?} type
  94114. * @param {?} moduleType
  94115. * @return {?}
  94116. */
  94117. function (type, moduleType) {
  94118. var /** @type {?} */ oldModule = this._ngModuleOfTypes.get(type);
  94119. if (oldModule && oldModule !== moduleType) {
  94120. this._reportError(syntaxError("Type " + stringifyType(type) + " is part of the declarations of 2 modules: " + stringifyType(oldModule) + " and " + stringifyType(moduleType) + "! " +
  94121. ("Please consider moving " + stringifyType(type) + " to a higher module that imports " + stringifyType(oldModule) + " and " + stringifyType(moduleType) + ". ") +
  94122. ("You can also create a new NgModule that exports and includes " + stringifyType(type) + " then import that NgModule in " + stringifyType(oldModule) + " and " + stringifyType(moduleType) + ".")), moduleType);
  94123. return;
  94124. }
  94125. this._ngModuleOfTypes.set(type, moduleType);
  94126. };
  94127. /**
  94128. * @param {?} importedModules
  94129. * @param {?} exportedModules
  94130. * @return {?}
  94131. */
  94132. CompileMetadataResolver.prototype._getTransitiveNgModuleMetadata = /**
  94133. * @param {?} importedModules
  94134. * @param {?} exportedModules
  94135. * @return {?}
  94136. */
  94137. function (importedModules, exportedModules) {
  94138. // collect `providers` / `entryComponents` from all imported and all exported modules
  94139. var /** @type {?} */ result = new TransitiveCompileNgModuleMetadata();
  94140. var /** @type {?} */ modulesByToken = new Map();
  94141. importedModules.concat(exportedModules).forEach(function (modSummary) {
  94142. modSummary.modules.forEach(function (mod) { return result.addModule(mod); });
  94143. modSummary.entryComponents.forEach(function (comp) { return result.addEntryComponent(comp); });
  94144. var /** @type {?} */ addedTokens = new Set();
  94145. modSummary.providers.forEach(function (entry) {
  94146. var /** @type {?} */ tokenRef = tokenReference(entry.provider.token);
  94147. var /** @type {?} */ prevModules = modulesByToken.get(tokenRef);
  94148. if (!prevModules) {
  94149. prevModules = new Set();
  94150. modulesByToken.set(tokenRef, prevModules);
  94151. }
  94152. var /** @type {?} */ moduleRef = entry.module.reference;
  94153. // Note: the providers of one module may still contain multiple providers
  94154. // per token (e.g. for multi providers), and we need to preserve these.
  94155. if (addedTokens.has(tokenRef) || !prevModules.has(moduleRef)) {
  94156. prevModules.add(moduleRef);
  94157. addedTokens.add(tokenRef);
  94158. result.addProvider(entry.provider, entry.module);
  94159. }
  94160. });
  94161. });
  94162. exportedModules.forEach(function (modSummary) {
  94163. modSummary.exportedDirectives.forEach(function (id) { return result.addExportedDirective(id); });
  94164. modSummary.exportedPipes.forEach(function (id) { return result.addExportedPipe(id); });
  94165. });
  94166. importedModules.forEach(function (modSummary) {
  94167. modSummary.exportedDirectives.forEach(function (id) { return result.addDirective(id); });
  94168. modSummary.exportedPipes.forEach(function (id) { return result.addPipe(id); });
  94169. });
  94170. return result;
  94171. };
  94172. /**
  94173. * @param {?} type
  94174. * @return {?}
  94175. */
  94176. CompileMetadataResolver.prototype._getIdentifierMetadata = /**
  94177. * @param {?} type
  94178. * @return {?}
  94179. */
  94180. function (type) {
  94181. type = resolveForwardRef(type);
  94182. return { reference: type };
  94183. };
  94184. /**
  94185. * @param {?} type
  94186. * @return {?}
  94187. */
  94188. CompileMetadataResolver.prototype.isInjectable = /**
  94189. * @param {?} type
  94190. * @return {?}
  94191. */
  94192. function (type) {
  94193. var /** @type {?} */ annotations = this._reflector.annotations(type);
  94194. return annotations.some(function (ann) { return createInjectable.isTypeOf(ann); });
  94195. };
  94196. /**
  94197. * @param {?} type
  94198. * @return {?}
  94199. */
  94200. CompileMetadataResolver.prototype.getInjectableSummary = /**
  94201. * @param {?} type
  94202. * @return {?}
  94203. */
  94204. function (type) {
  94205. return {
  94206. summaryKind: CompileSummaryKind.Injectable,
  94207. type: this._getTypeMetadata(type, null, false)
  94208. };
  94209. };
  94210. /**
  94211. * @param {?} type
  94212. * @param {?=} dependencies
  94213. * @return {?}
  94214. */
  94215. CompileMetadataResolver.prototype._getInjectableMetadata = /**
  94216. * @param {?} type
  94217. * @param {?=} dependencies
  94218. * @return {?}
  94219. */
  94220. function (type, dependencies) {
  94221. if (dependencies === void 0) { dependencies = null; }
  94222. var /** @type {?} */ typeSummary = this._loadSummary(type, CompileSummaryKind.Injectable);
  94223. if (typeSummary) {
  94224. return typeSummary.type;
  94225. }
  94226. return this._getTypeMetadata(type, dependencies);
  94227. };
  94228. /**
  94229. * @param {?} type
  94230. * @param {?=} dependencies
  94231. * @param {?=} throwOnUnknownDeps
  94232. * @return {?}
  94233. */
  94234. CompileMetadataResolver.prototype._getTypeMetadata = /**
  94235. * @param {?} type
  94236. * @param {?=} dependencies
  94237. * @param {?=} throwOnUnknownDeps
  94238. * @return {?}
  94239. */
  94240. function (type, dependencies, throwOnUnknownDeps) {
  94241. if (dependencies === void 0) { dependencies = null; }
  94242. if (throwOnUnknownDeps === void 0) { throwOnUnknownDeps = true; }
  94243. var /** @type {?} */ identifier = this._getIdentifierMetadata(type);
  94244. return {
  94245. reference: identifier.reference,
  94246. diDeps: this._getDependenciesMetadata(identifier.reference, dependencies, throwOnUnknownDeps),
  94247. lifecycleHooks: getAllLifecycleHooks(this._reflector, identifier.reference),
  94248. };
  94249. };
  94250. /**
  94251. * @param {?} factory
  94252. * @param {?=} dependencies
  94253. * @return {?}
  94254. */
  94255. CompileMetadataResolver.prototype._getFactoryMetadata = /**
  94256. * @param {?} factory
  94257. * @param {?=} dependencies
  94258. * @return {?}
  94259. */
  94260. function (factory, dependencies) {
  94261. if (dependencies === void 0) { dependencies = null; }
  94262. factory = resolveForwardRef(factory);
  94263. return { reference: factory, diDeps: this._getDependenciesMetadata(factory, dependencies) };
  94264. };
  94265. /**
  94266. * Gets the metadata for the given pipe.
  94267. * This assumes `loadNgModuleDirectiveAndPipeMetadata` has been called first.
  94268. */
  94269. /**
  94270. * Gets the metadata for the given pipe.
  94271. * This assumes `loadNgModuleDirectiveAndPipeMetadata` has been called first.
  94272. * @param {?} pipeType
  94273. * @return {?}
  94274. */
  94275. CompileMetadataResolver.prototype.getPipeMetadata = /**
  94276. * Gets the metadata for the given pipe.
  94277. * This assumes `loadNgModuleDirectiveAndPipeMetadata` has been called first.
  94278. * @param {?} pipeType
  94279. * @return {?}
  94280. */
  94281. function (pipeType) {
  94282. var /** @type {?} */ pipeMeta = this._pipeCache.get(pipeType);
  94283. if (!pipeMeta) {
  94284. this._reportError(syntaxError("Illegal state: getPipeMetadata can only be called after loadNgModuleDirectiveAndPipeMetadata for a module that declares it. Pipe " + stringifyType(pipeType) + "."), pipeType);
  94285. }
  94286. return pipeMeta || null;
  94287. };
  94288. /**
  94289. * @param {?} pipeType
  94290. * @return {?}
  94291. */
  94292. CompileMetadataResolver.prototype.getPipeSummary = /**
  94293. * @param {?} pipeType
  94294. * @return {?}
  94295. */
  94296. function (pipeType) {
  94297. var /** @type {?} */ pipeSummary = /** @type {?} */ (this._loadSummary(pipeType, CompileSummaryKind.Pipe));
  94298. if (!pipeSummary) {
  94299. this._reportError(syntaxError("Illegal state: Could not load the summary for pipe " + stringifyType(pipeType) + "."), pipeType);
  94300. }
  94301. return pipeSummary;
  94302. };
  94303. /**
  94304. * @param {?} pipeType
  94305. * @return {?}
  94306. */
  94307. CompileMetadataResolver.prototype.getOrLoadPipeMetadata = /**
  94308. * @param {?} pipeType
  94309. * @return {?}
  94310. */
  94311. function (pipeType) {
  94312. var /** @type {?} */ pipeMeta = this._pipeCache.get(pipeType);
  94313. if (!pipeMeta) {
  94314. pipeMeta = this._loadPipeMetadata(pipeType);
  94315. }
  94316. return pipeMeta;
  94317. };
  94318. /**
  94319. * @param {?} pipeType
  94320. * @return {?}
  94321. */
  94322. CompileMetadataResolver.prototype._loadPipeMetadata = /**
  94323. * @param {?} pipeType
  94324. * @return {?}
  94325. */
  94326. function (pipeType) {
  94327. pipeType = resolveForwardRef(pipeType);
  94328. var /** @type {?} */ pipeAnnotation = /** @type {?} */ ((this._pipeResolver.resolve(pipeType)));
  94329. var /** @type {?} */ pipeMeta = new CompilePipeMetadata({
  94330. type: this._getTypeMetadata(pipeType),
  94331. name: pipeAnnotation.name,
  94332. pure: !!pipeAnnotation.pure
  94333. });
  94334. this._pipeCache.set(pipeType, pipeMeta);
  94335. this._summaryCache.set(pipeType, pipeMeta.toSummary());
  94336. return pipeMeta;
  94337. };
  94338. /**
  94339. * @param {?} typeOrFunc
  94340. * @param {?} dependencies
  94341. * @param {?=} throwOnUnknownDeps
  94342. * @return {?}
  94343. */
  94344. CompileMetadataResolver.prototype._getDependenciesMetadata = /**
  94345. * @param {?} typeOrFunc
  94346. * @param {?} dependencies
  94347. * @param {?=} throwOnUnknownDeps
  94348. * @return {?}
  94349. */
  94350. function (typeOrFunc, dependencies, throwOnUnknownDeps) {
  94351. var _this = this;
  94352. if (throwOnUnknownDeps === void 0) { throwOnUnknownDeps = true; }
  94353. var /** @type {?} */ hasUnknownDeps = false;
  94354. var /** @type {?} */ params = dependencies || this._reflector.parameters(typeOrFunc) || [];
  94355. var /** @type {?} */ dependenciesMetadata = params.map(function (param) {
  94356. var /** @type {?} */ isAttribute = false;
  94357. var /** @type {?} */ isHost = false;
  94358. var /** @type {?} */ isSelf = false;
  94359. var /** @type {?} */ isSkipSelf = false;
  94360. var /** @type {?} */ isOptional = false;
  94361. var /** @type {?} */ token = null;
  94362. if (Array.isArray(param)) {
  94363. param.forEach(function (paramEntry) {
  94364. if (createHost.isTypeOf(paramEntry)) {
  94365. isHost = true;
  94366. }
  94367. else if (createSelf.isTypeOf(paramEntry)) {
  94368. isSelf = true;
  94369. }
  94370. else if (createSkipSelf.isTypeOf(paramEntry)) {
  94371. isSkipSelf = true;
  94372. }
  94373. else if (createOptional.isTypeOf(paramEntry)) {
  94374. isOptional = true;
  94375. }
  94376. else if (createAttribute.isTypeOf(paramEntry)) {
  94377. isAttribute = true;
  94378. token = paramEntry.attributeName;
  94379. }
  94380. else if (createInject.isTypeOf(paramEntry)) {
  94381. token = paramEntry.token;
  94382. }
  94383. else if (createInjectionToken.isTypeOf(paramEntry) || paramEntry instanceof StaticSymbol) {
  94384. token = paramEntry;
  94385. }
  94386. else if (isValidType(paramEntry) && token == null) {
  94387. token = paramEntry;
  94388. }
  94389. });
  94390. }
  94391. else {
  94392. token = param;
  94393. }
  94394. if (token == null) {
  94395. hasUnknownDeps = true;
  94396. return /** @type {?} */ ((null));
  94397. }
  94398. return {
  94399. isAttribute: isAttribute,
  94400. isHost: isHost,
  94401. isSelf: isSelf,
  94402. isSkipSelf: isSkipSelf,
  94403. isOptional: isOptional,
  94404. token: _this._getTokenMetadata(token)
  94405. };
  94406. });
  94407. if (hasUnknownDeps) {
  94408. var /** @type {?} */ depsTokens = dependenciesMetadata.map(function (dep) { return dep ? stringifyType(dep.token) : '?'; }).join(', ');
  94409. var /** @type {?} */ message = "Can't resolve all parameters for " + stringifyType(typeOrFunc) + ": (" + depsTokens + ").";
  94410. if (throwOnUnknownDeps || this._config.strictInjectionParameters) {
  94411. this._reportError(syntaxError(message), typeOrFunc);
  94412. }
  94413. else {
  94414. this._console.warn("Warning: " + message + " This will become an error in Angular v6.x");
  94415. }
  94416. }
  94417. return dependenciesMetadata;
  94418. };
  94419. /**
  94420. * @param {?} token
  94421. * @return {?}
  94422. */
  94423. CompileMetadataResolver.prototype._getTokenMetadata = /**
  94424. * @param {?} token
  94425. * @return {?}
  94426. */
  94427. function (token) {
  94428. token = resolveForwardRef(token);
  94429. var /** @type {?} */ compileToken;
  94430. if (typeof token === 'string') {
  94431. compileToken = { value: token };
  94432. }
  94433. else {
  94434. compileToken = { identifier: { reference: token } };
  94435. }
  94436. return compileToken;
  94437. };
  94438. /**
  94439. * @param {?} providers
  94440. * @param {?} targetEntryComponents
  94441. * @param {?=} debugInfo
  94442. * @param {?=} compileProviders
  94443. * @param {?=} type
  94444. * @return {?}
  94445. */
  94446. CompileMetadataResolver.prototype._getProvidersMetadata = /**
  94447. * @param {?} providers
  94448. * @param {?} targetEntryComponents
  94449. * @param {?=} debugInfo
  94450. * @param {?=} compileProviders
  94451. * @param {?=} type
  94452. * @return {?}
  94453. */
  94454. function (providers, targetEntryComponents, debugInfo, compileProviders, type) {
  94455. var _this = this;
  94456. if (compileProviders === void 0) { compileProviders = []; }
  94457. providers.forEach(function (provider, providerIdx) {
  94458. if (Array.isArray(provider)) {
  94459. _this._getProvidersMetadata(provider, targetEntryComponents, debugInfo, compileProviders);
  94460. }
  94461. else {
  94462. provider = resolveForwardRef(provider);
  94463. var /** @type {?} */ providerMeta = /** @type {?} */ ((undefined));
  94464. if (provider && typeof provider === 'object' && provider.hasOwnProperty('provide')) {
  94465. _this._validateProvider(provider);
  94466. providerMeta = new ProviderMeta(provider.provide, provider);
  94467. }
  94468. else if (isValidType(provider)) {
  94469. providerMeta = new ProviderMeta(provider, { useClass: provider });
  94470. }
  94471. else if (provider === void 0) {
  94472. _this._reportError(syntaxError("Encountered undefined provider! Usually this means you have a circular dependencies (might be caused by using 'barrel' index.ts files."));
  94473. return;
  94474. }
  94475. else {
  94476. var /** @type {?} */ providersInfo = (/** @type {?} */ (providers.reduce(function (soFar, seenProvider, seenProviderIdx) {
  94477. if (seenProviderIdx < providerIdx) {
  94478. soFar.push("" + stringifyType(seenProvider));
  94479. }
  94480. else if (seenProviderIdx == providerIdx) {
  94481. soFar.push("?" + stringifyType(seenProvider) + "?");
  94482. }
  94483. else if (seenProviderIdx == providerIdx + 1) {
  94484. soFar.push('...');
  94485. }
  94486. return soFar;
  94487. }, [])))
  94488. .join(', ');
  94489. _this._reportError(syntaxError("Invalid " + (debugInfo ? debugInfo : 'provider') + " - only instances of Provider and Type are allowed, got: [" + providersInfo + "]"), type);
  94490. return;
  94491. }
  94492. if (providerMeta.token ===
  94493. _this._reflector.resolveExternalReference(Identifiers.ANALYZE_FOR_ENTRY_COMPONENTS)) {
  94494. targetEntryComponents.push.apply(targetEntryComponents, _this._getEntryComponentsFromProvider(providerMeta, type));
  94495. }
  94496. else {
  94497. compileProviders.push(_this.getProviderMetadata(providerMeta));
  94498. }
  94499. }
  94500. });
  94501. return compileProviders;
  94502. };
  94503. /**
  94504. * @param {?} provider
  94505. * @return {?}
  94506. */
  94507. CompileMetadataResolver.prototype._validateProvider = /**
  94508. * @param {?} provider
  94509. * @return {?}
  94510. */
  94511. function (provider) {
  94512. if (provider.hasOwnProperty('useClass') && provider.useClass == null) {
  94513. this._reportError(syntaxError("Invalid provider for " + stringifyType(provider.provide) + ". useClass cannot be " + provider.useClass + ".\n Usually it happens when:\n 1. There's a circular dependency (might be caused by using index.ts (barrel) files).\n 2. Class was used before it was declared. Use forwardRef in this case."));
  94514. }
  94515. };
  94516. /**
  94517. * @param {?} provider
  94518. * @param {?=} type
  94519. * @return {?}
  94520. */
  94521. CompileMetadataResolver.prototype._getEntryComponentsFromProvider = /**
  94522. * @param {?} provider
  94523. * @param {?=} type
  94524. * @return {?}
  94525. */
  94526. function (provider, type) {
  94527. var _this = this;
  94528. var /** @type {?} */ components = [];
  94529. var /** @type {?} */ collectedIdentifiers = [];
  94530. if (provider.useFactory || provider.useExisting || provider.useClass) {
  94531. this._reportError(syntaxError("The ANALYZE_FOR_ENTRY_COMPONENTS token only supports useValue!"), type);
  94532. return [];
  94533. }
  94534. if (!provider.multi) {
  94535. this._reportError(syntaxError("The ANALYZE_FOR_ENTRY_COMPONENTS token only supports 'multi = true'!"), type);
  94536. return [];
  94537. }
  94538. extractIdentifiers(provider.useValue, collectedIdentifiers);
  94539. collectedIdentifiers.forEach(function (identifier) {
  94540. var /** @type {?} */ entry = _this._getEntryComponentMetadata(identifier.reference, false);
  94541. if (entry) {
  94542. components.push(entry);
  94543. }
  94544. });
  94545. return components;
  94546. };
  94547. /**
  94548. * @param {?} dirType
  94549. * @param {?=} throwIfNotFound
  94550. * @return {?}
  94551. */
  94552. CompileMetadataResolver.prototype._getEntryComponentMetadata = /**
  94553. * @param {?} dirType
  94554. * @param {?=} throwIfNotFound
  94555. * @return {?}
  94556. */
  94557. function (dirType, throwIfNotFound) {
  94558. if (throwIfNotFound === void 0) { throwIfNotFound = true; }
  94559. var /** @type {?} */ dirMeta = this.getNonNormalizedDirectiveMetadata(dirType);
  94560. if (dirMeta && dirMeta.metadata.isComponent) {
  94561. return { componentType: dirType, componentFactory: /** @type {?} */ ((dirMeta.metadata.componentFactory)) };
  94562. }
  94563. var /** @type {?} */ dirSummary = /** @type {?} */ (this._loadSummary(dirType, CompileSummaryKind.Directive));
  94564. if (dirSummary && dirSummary.isComponent) {
  94565. return { componentType: dirType, componentFactory: /** @type {?} */ ((dirSummary.componentFactory)) };
  94566. }
  94567. if (throwIfNotFound) {
  94568. throw syntaxError(dirType.name + " cannot be used as an entry component.");
  94569. }
  94570. return null;
  94571. };
  94572. /**
  94573. * @param {?} provider
  94574. * @return {?}
  94575. */
  94576. CompileMetadataResolver.prototype.getProviderMetadata = /**
  94577. * @param {?} provider
  94578. * @return {?}
  94579. */
  94580. function (provider) {
  94581. var /** @type {?} */ compileDeps = /** @type {?} */ ((undefined));
  94582. var /** @type {?} */ compileTypeMetadata = /** @type {?} */ ((null));
  94583. var /** @type {?} */ compileFactoryMetadata = /** @type {?} */ ((null));
  94584. var /** @type {?} */ token = this._getTokenMetadata(provider.token);
  94585. if (provider.useClass) {
  94586. compileTypeMetadata = this._getInjectableMetadata(provider.useClass, provider.dependencies);
  94587. compileDeps = compileTypeMetadata.diDeps;
  94588. if (provider.token === provider.useClass) {
  94589. // use the compileTypeMetadata as it contains information about lifecycleHooks...
  94590. token = { identifier: compileTypeMetadata };
  94591. }
  94592. }
  94593. else if (provider.useFactory) {
  94594. compileFactoryMetadata = this._getFactoryMetadata(provider.useFactory, provider.dependencies);
  94595. compileDeps = compileFactoryMetadata.diDeps;
  94596. }
  94597. return {
  94598. token: token,
  94599. useClass: compileTypeMetadata,
  94600. useValue: provider.useValue,
  94601. useFactory: compileFactoryMetadata,
  94602. useExisting: provider.useExisting ? this._getTokenMetadata(provider.useExisting) : undefined,
  94603. deps: compileDeps,
  94604. multi: provider.multi
  94605. };
  94606. };
  94607. /**
  94608. * @param {?} queries
  94609. * @param {?} isViewQuery
  94610. * @param {?} directiveType
  94611. * @return {?}
  94612. */
  94613. CompileMetadataResolver.prototype._getQueriesMetadata = /**
  94614. * @param {?} queries
  94615. * @param {?} isViewQuery
  94616. * @param {?} directiveType
  94617. * @return {?}
  94618. */
  94619. function (queries, isViewQuery, directiveType) {
  94620. var _this = this;
  94621. var /** @type {?} */ res = [];
  94622. Object.keys(queries).forEach(function (propertyName) {
  94623. var /** @type {?} */ query = queries[propertyName];
  94624. if (query.isViewQuery === isViewQuery) {
  94625. res.push(_this._getQueryMetadata(query, propertyName, directiveType));
  94626. }
  94627. });
  94628. return res;
  94629. };
  94630. /**
  94631. * @param {?} selector
  94632. * @return {?}
  94633. */
  94634. CompileMetadataResolver.prototype._queryVarBindings = /**
  94635. * @param {?} selector
  94636. * @return {?}
  94637. */
  94638. function (selector) { return selector.split(/\s*,\s*/); };
  94639. /**
  94640. * @param {?} q
  94641. * @param {?} propertyName
  94642. * @param {?} typeOrFunc
  94643. * @return {?}
  94644. */
  94645. CompileMetadataResolver.prototype._getQueryMetadata = /**
  94646. * @param {?} q
  94647. * @param {?} propertyName
  94648. * @param {?} typeOrFunc
  94649. * @return {?}
  94650. */
  94651. function (q, propertyName, typeOrFunc) {
  94652. var _this = this;
  94653. var /** @type {?} */ selectors;
  94654. if (typeof q.selector === 'string') {
  94655. selectors =
  94656. this._queryVarBindings(q.selector).map(function (varName) { return _this._getTokenMetadata(varName); });
  94657. }
  94658. else {
  94659. if (!q.selector) {
  94660. this._reportError(syntaxError("Can't construct a query for the property \"" + propertyName + "\" of \"" + stringifyType(typeOrFunc) + "\" since the query selector wasn't defined."), typeOrFunc);
  94661. selectors = [];
  94662. }
  94663. else {
  94664. selectors = [this._getTokenMetadata(q.selector)];
  94665. }
  94666. }
  94667. return {
  94668. selectors: selectors,
  94669. first: q.first,
  94670. descendants: q.descendants, propertyName: propertyName,
  94671. read: q.read ? this._getTokenMetadata(q.read) : /** @type {?} */ ((null))
  94672. };
  94673. };
  94674. /**
  94675. * @param {?} error
  94676. * @param {?=} type
  94677. * @param {?=} otherType
  94678. * @return {?}
  94679. */
  94680. CompileMetadataResolver.prototype._reportError = /**
  94681. * @param {?} error
  94682. * @param {?=} type
  94683. * @param {?=} otherType
  94684. * @return {?}
  94685. */
  94686. function (error, type, otherType) {
  94687. if (this._errorCollector) {
  94688. this._errorCollector(error, type);
  94689. if (otherType) {
  94690. this._errorCollector(error, otherType);
  94691. }
  94692. }
  94693. else {
  94694. throw error;
  94695. }
  94696. };
  94697. return CompileMetadataResolver;
  94698. }());
  94699. /**
  94700. * @param {?} tree
  94701. * @param {?=} out
  94702. * @return {?}
  94703. */
  94704. function flattenArray(tree, out) {
  94705. if (out === void 0) { out = []; }
  94706. if (tree) {
  94707. for (var /** @type {?} */ i = 0; i < tree.length; i++) {
  94708. var /** @type {?} */ item = resolveForwardRef(tree[i]);
  94709. if (Array.isArray(item)) {
  94710. flattenArray(item, out);
  94711. }
  94712. else {
  94713. out.push(item);
  94714. }
  94715. }
  94716. }
  94717. return out;
  94718. }
  94719. /**
  94720. * @param {?} array
  94721. * @return {?}
  94722. */
  94723. function dedupeArray(array) {
  94724. if (array) {
  94725. return Array.from(new Set(array));
  94726. }
  94727. return [];
  94728. }
  94729. /**
  94730. * @param {?} tree
  94731. * @return {?}
  94732. */
  94733. function flattenAndDedupeArray(tree) {
  94734. return dedupeArray(flattenArray(tree));
  94735. }
  94736. /**
  94737. * @param {?} value
  94738. * @return {?}
  94739. */
  94740. function isValidType(value) {
  94741. return (value instanceof StaticSymbol) || (value instanceof Type);
  94742. }
  94743. /**
  94744. * @param {?} value
  94745. * @param {?} targetIdentifiers
  94746. * @return {?}
  94747. */
  94748. function extractIdentifiers(value, targetIdentifiers) {
  94749. visitValue(value, new _CompileValueConverter(), targetIdentifiers);
  94750. }
  94751. var _CompileValueConverter = /** @class */ (function (_super) {
  94752. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(_CompileValueConverter, _super);
  94753. function _CompileValueConverter() {
  94754. return _super !== null && _super.apply(this, arguments) || this;
  94755. }
  94756. /**
  94757. * @param {?} value
  94758. * @param {?} targetIdentifiers
  94759. * @return {?}
  94760. */
  94761. _CompileValueConverter.prototype.visitOther = /**
  94762. * @param {?} value
  94763. * @param {?} targetIdentifiers
  94764. * @return {?}
  94765. */
  94766. function (value, targetIdentifiers) {
  94767. targetIdentifiers.push({ reference: value });
  94768. };
  94769. return _CompileValueConverter;
  94770. }(ValueTransformer));
  94771. /**
  94772. * @param {?} type
  94773. * @return {?}
  94774. */
  94775. function stringifyType(type) {
  94776. if (type instanceof StaticSymbol) {
  94777. return type.name + " in " + type.filePath;
  94778. }
  94779. else {
  94780. return stringify(type);
  94781. }
  94782. }
  94783. /**
  94784. * Indicates that a component is still being loaded in a synchronous compile.
  94785. * @param {?} compType
  94786. * @return {?}
  94787. */
  94788. function componentStillLoadingError(compType) {
  94789. var /** @type {?} */ error = Error("Can't compile synchronously as " + stringify(compType) + " is still being loaded!");
  94790. (/** @type {?} */ (error))[ERROR_COMPONENT_TYPE] = compType;
  94791. return error;
  94792. }
  94793. /**
  94794. * @fileoverview added by tsickle
  94795. * @suppress {checkTypes} checked by tsc
  94796. */
  94797. /**
  94798. * @license
  94799. * Copyright Google Inc. All Rights Reserved.
  94800. *
  94801. * Use of this source code is governed by an MIT-style license that can be
  94802. * found in the LICENSE file at https://angular.io/license
  94803. */
  94804. /** @enum {number} */
  94805. var TypeModifier = {
  94806. Const: 0,
  94807. };
  94808. TypeModifier[TypeModifier.Const] = "Const";
  94809. /**
  94810. * @abstract
  94811. */
  94812. var Type$1 = /** @class */ (function () {
  94813. function Type(modifiers) {
  94814. if (modifiers === void 0) { modifiers = null; }
  94815. this.modifiers = modifiers;
  94816. if (!modifiers) {
  94817. this.modifiers = [];
  94818. }
  94819. }
  94820. /**
  94821. * @param {?} modifier
  94822. * @return {?}
  94823. */
  94824. Type.prototype.hasModifier = /**
  94825. * @param {?} modifier
  94826. * @return {?}
  94827. */
  94828. function (modifier) { return /** @type {?} */ ((this.modifiers)).indexOf(modifier) !== -1; };
  94829. return Type;
  94830. }());
  94831. /** @enum {number} */
  94832. var BuiltinTypeName = {
  94833. Dynamic: 0,
  94834. Bool: 1,
  94835. String: 2,
  94836. Int: 3,
  94837. Number: 4,
  94838. Function: 5,
  94839. Inferred: 6,
  94840. };
  94841. BuiltinTypeName[BuiltinTypeName.Dynamic] = "Dynamic";
  94842. BuiltinTypeName[BuiltinTypeName.Bool] = "Bool";
  94843. BuiltinTypeName[BuiltinTypeName.String] = "String";
  94844. BuiltinTypeName[BuiltinTypeName.Int] = "Int";
  94845. BuiltinTypeName[BuiltinTypeName.Number] = "Number";
  94846. BuiltinTypeName[BuiltinTypeName.Function] = "Function";
  94847. BuiltinTypeName[BuiltinTypeName.Inferred] = "Inferred";
  94848. var BuiltinType = /** @class */ (function (_super) {
  94849. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(BuiltinType, _super);
  94850. function BuiltinType(name, modifiers) {
  94851. if (modifiers === void 0) { modifiers = null; }
  94852. var _this = _super.call(this, modifiers) || this;
  94853. _this.name = name;
  94854. return _this;
  94855. }
  94856. /**
  94857. * @param {?} visitor
  94858. * @param {?} context
  94859. * @return {?}
  94860. */
  94861. BuiltinType.prototype.visitType = /**
  94862. * @param {?} visitor
  94863. * @param {?} context
  94864. * @return {?}
  94865. */
  94866. function (visitor, context) {
  94867. return visitor.visitBuiltintType(this, context);
  94868. };
  94869. return BuiltinType;
  94870. }(Type$1));
  94871. var ExpressionType = /** @class */ (function (_super) {
  94872. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(ExpressionType, _super);
  94873. function ExpressionType(value, modifiers) {
  94874. if (modifiers === void 0) { modifiers = null; }
  94875. var _this = _super.call(this, modifiers) || this;
  94876. _this.value = value;
  94877. return _this;
  94878. }
  94879. /**
  94880. * @param {?} visitor
  94881. * @param {?} context
  94882. * @return {?}
  94883. */
  94884. ExpressionType.prototype.visitType = /**
  94885. * @param {?} visitor
  94886. * @param {?} context
  94887. * @return {?}
  94888. */
  94889. function (visitor, context) {
  94890. return visitor.visitExpressionType(this, context);
  94891. };
  94892. return ExpressionType;
  94893. }(Type$1));
  94894. var ArrayType = /** @class */ (function (_super) {
  94895. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(ArrayType, _super);
  94896. function ArrayType(of, modifiers) {
  94897. if (modifiers === void 0) { modifiers = null; }
  94898. var _this = _super.call(this, modifiers) || this;
  94899. _this.of = of;
  94900. return _this;
  94901. }
  94902. /**
  94903. * @param {?} visitor
  94904. * @param {?} context
  94905. * @return {?}
  94906. */
  94907. ArrayType.prototype.visitType = /**
  94908. * @param {?} visitor
  94909. * @param {?} context
  94910. * @return {?}
  94911. */
  94912. function (visitor, context) {
  94913. return visitor.visitArrayType(this, context);
  94914. };
  94915. return ArrayType;
  94916. }(Type$1));
  94917. var MapType = /** @class */ (function (_super) {
  94918. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(MapType, _super);
  94919. function MapType(valueType, modifiers) {
  94920. if (modifiers === void 0) { modifiers = null; }
  94921. var _this = _super.call(this, modifiers) || this;
  94922. _this.valueType = valueType || null;
  94923. return _this;
  94924. }
  94925. /**
  94926. * @param {?} visitor
  94927. * @param {?} context
  94928. * @return {?}
  94929. */
  94930. MapType.prototype.visitType = /**
  94931. * @param {?} visitor
  94932. * @param {?} context
  94933. * @return {?}
  94934. */
  94935. function (visitor, context) { return visitor.visitMapType(this, context); };
  94936. return MapType;
  94937. }(Type$1));
  94938. var DYNAMIC_TYPE = new BuiltinType(BuiltinTypeName.Dynamic);
  94939. var INFERRED_TYPE = new BuiltinType(BuiltinTypeName.Inferred);
  94940. var BOOL_TYPE = new BuiltinType(BuiltinTypeName.Bool);
  94941. var INT_TYPE = new BuiltinType(BuiltinTypeName.Int);
  94942. var NUMBER_TYPE = new BuiltinType(BuiltinTypeName.Number);
  94943. var STRING_TYPE = new BuiltinType(BuiltinTypeName.String);
  94944. var FUNCTION_TYPE = new BuiltinType(BuiltinTypeName.Function);
  94945. /**
  94946. * @record
  94947. */
  94948. /** @enum {number} */
  94949. var BinaryOperator = {
  94950. Equals: 0,
  94951. NotEquals: 1,
  94952. Identical: 2,
  94953. NotIdentical: 3,
  94954. Minus: 4,
  94955. Plus: 5,
  94956. Divide: 6,
  94957. Multiply: 7,
  94958. Modulo: 8,
  94959. And: 9,
  94960. Or: 10,
  94961. Lower: 11,
  94962. LowerEquals: 12,
  94963. Bigger: 13,
  94964. BiggerEquals: 14,
  94965. };
  94966. BinaryOperator[BinaryOperator.Equals] = "Equals";
  94967. BinaryOperator[BinaryOperator.NotEquals] = "NotEquals";
  94968. BinaryOperator[BinaryOperator.Identical] = "Identical";
  94969. BinaryOperator[BinaryOperator.NotIdentical] = "NotIdentical";
  94970. BinaryOperator[BinaryOperator.Minus] = "Minus";
  94971. BinaryOperator[BinaryOperator.Plus] = "Plus";
  94972. BinaryOperator[BinaryOperator.Divide] = "Divide";
  94973. BinaryOperator[BinaryOperator.Multiply] = "Multiply";
  94974. BinaryOperator[BinaryOperator.Modulo] = "Modulo";
  94975. BinaryOperator[BinaryOperator.And] = "And";
  94976. BinaryOperator[BinaryOperator.Or] = "Or";
  94977. BinaryOperator[BinaryOperator.Lower] = "Lower";
  94978. BinaryOperator[BinaryOperator.LowerEquals] = "LowerEquals";
  94979. BinaryOperator[BinaryOperator.Bigger] = "Bigger";
  94980. BinaryOperator[BinaryOperator.BiggerEquals] = "BiggerEquals";
  94981. /**
  94982. * @template T
  94983. * @param {?} base
  94984. * @param {?} other
  94985. * @return {?}
  94986. */
  94987. function nullSafeIsEquivalent(base, other) {
  94988. if (base == null || other == null) {
  94989. return base == other;
  94990. }
  94991. return base.isEquivalent(other);
  94992. }
  94993. /**
  94994. * @template T
  94995. * @param {?} base
  94996. * @param {?} other
  94997. * @return {?}
  94998. */
  94999. function areAllEquivalent(base, other) {
  95000. var /** @type {?} */ len = base.length;
  95001. if (len !== other.length) {
  95002. return false;
  95003. }
  95004. for (var /** @type {?} */ i = 0; i < len; i++) {
  95005. if (!base[i].isEquivalent(other[i])) {
  95006. return false;
  95007. }
  95008. }
  95009. return true;
  95010. }
  95011. /**
  95012. * @abstract
  95013. */
  95014. var Expression = /** @class */ (function () {
  95015. function Expression(type, sourceSpan) {
  95016. this.type = type || null;
  95017. this.sourceSpan = sourceSpan || null;
  95018. }
  95019. /**
  95020. * @param {?} name
  95021. * @param {?=} sourceSpan
  95022. * @return {?}
  95023. */
  95024. Expression.prototype.prop = /**
  95025. * @param {?} name
  95026. * @param {?=} sourceSpan
  95027. * @return {?}
  95028. */
  95029. function (name, sourceSpan) {
  95030. return new ReadPropExpr(this, name, null, sourceSpan);
  95031. };
  95032. /**
  95033. * @param {?} index
  95034. * @param {?=} type
  95035. * @param {?=} sourceSpan
  95036. * @return {?}
  95037. */
  95038. Expression.prototype.key = /**
  95039. * @param {?} index
  95040. * @param {?=} type
  95041. * @param {?=} sourceSpan
  95042. * @return {?}
  95043. */
  95044. function (index, type, sourceSpan) {
  95045. return new ReadKeyExpr(this, index, type, sourceSpan);
  95046. };
  95047. /**
  95048. * @param {?} name
  95049. * @param {?} params
  95050. * @param {?=} sourceSpan
  95051. * @return {?}
  95052. */
  95053. Expression.prototype.callMethod = /**
  95054. * @param {?} name
  95055. * @param {?} params
  95056. * @param {?=} sourceSpan
  95057. * @return {?}
  95058. */
  95059. function (name, params, sourceSpan) {
  95060. return new InvokeMethodExpr(this, name, params, null, sourceSpan);
  95061. };
  95062. /**
  95063. * @param {?} params
  95064. * @param {?=} sourceSpan
  95065. * @return {?}
  95066. */
  95067. Expression.prototype.callFn = /**
  95068. * @param {?} params
  95069. * @param {?=} sourceSpan
  95070. * @return {?}
  95071. */
  95072. function (params, sourceSpan) {
  95073. return new InvokeFunctionExpr(this, params, null, sourceSpan);
  95074. };
  95075. /**
  95076. * @param {?} params
  95077. * @param {?=} type
  95078. * @param {?=} sourceSpan
  95079. * @return {?}
  95080. */
  95081. Expression.prototype.instantiate = /**
  95082. * @param {?} params
  95083. * @param {?=} type
  95084. * @param {?=} sourceSpan
  95085. * @return {?}
  95086. */
  95087. function (params, type, sourceSpan) {
  95088. return new InstantiateExpr(this, params, type, sourceSpan);
  95089. };
  95090. /**
  95091. * @param {?} trueCase
  95092. * @param {?=} falseCase
  95093. * @param {?=} sourceSpan
  95094. * @return {?}
  95095. */
  95096. Expression.prototype.conditional = /**
  95097. * @param {?} trueCase
  95098. * @param {?=} falseCase
  95099. * @param {?=} sourceSpan
  95100. * @return {?}
  95101. */
  95102. function (trueCase, falseCase, sourceSpan) {
  95103. if (falseCase === void 0) { falseCase = null; }
  95104. return new ConditionalExpr(this, trueCase, falseCase, null, sourceSpan);
  95105. };
  95106. /**
  95107. * @param {?} rhs
  95108. * @param {?=} sourceSpan
  95109. * @return {?}
  95110. */
  95111. Expression.prototype.equals = /**
  95112. * @param {?} rhs
  95113. * @param {?=} sourceSpan
  95114. * @return {?}
  95115. */
  95116. function (rhs, sourceSpan) {
  95117. return new BinaryOperatorExpr(BinaryOperator.Equals, this, rhs, null, sourceSpan);
  95118. };
  95119. /**
  95120. * @param {?} rhs
  95121. * @param {?=} sourceSpan
  95122. * @return {?}
  95123. */
  95124. Expression.prototype.notEquals = /**
  95125. * @param {?} rhs
  95126. * @param {?=} sourceSpan
  95127. * @return {?}
  95128. */
  95129. function (rhs, sourceSpan) {
  95130. return new BinaryOperatorExpr(BinaryOperator.NotEquals, this, rhs, null, sourceSpan);
  95131. };
  95132. /**
  95133. * @param {?} rhs
  95134. * @param {?=} sourceSpan
  95135. * @return {?}
  95136. */
  95137. Expression.prototype.identical = /**
  95138. * @param {?} rhs
  95139. * @param {?=} sourceSpan
  95140. * @return {?}
  95141. */
  95142. function (rhs, sourceSpan) {
  95143. return new BinaryOperatorExpr(BinaryOperator.Identical, this, rhs, null, sourceSpan);
  95144. };
  95145. /**
  95146. * @param {?} rhs
  95147. * @param {?=} sourceSpan
  95148. * @return {?}
  95149. */
  95150. Expression.prototype.notIdentical = /**
  95151. * @param {?} rhs
  95152. * @param {?=} sourceSpan
  95153. * @return {?}
  95154. */
  95155. function (rhs, sourceSpan) {
  95156. return new BinaryOperatorExpr(BinaryOperator.NotIdentical, this, rhs, null, sourceSpan);
  95157. };
  95158. /**
  95159. * @param {?} rhs
  95160. * @param {?=} sourceSpan
  95161. * @return {?}
  95162. */
  95163. Expression.prototype.minus = /**
  95164. * @param {?} rhs
  95165. * @param {?=} sourceSpan
  95166. * @return {?}
  95167. */
  95168. function (rhs, sourceSpan) {
  95169. return new BinaryOperatorExpr(BinaryOperator.Minus, this, rhs, null, sourceSpan);
  95170. };
  95171. /**
  95172. * @param {?} rhs
  95173. * @param {?=} sourceSpan
  95174. * @return {?}
  95175. */
  95176. Expression.prototype.plus = /**
  95177. * @param {?} rhs
  95178. * @param {?=} sourceSpan
  95179. * @return {?}
  95180. */
  95181. function (rhs, sourceSpan) {
  95182. return new BinaryOperatorExpr(BinaryOperator.Plus, this, rhs, null, sourceSpan);
  95183. };
  95184. /**
  95185. * @param {?} rhs
  95186. * @param {?=} sourceSpan
  95187. * @return {?}
  95188. */
  95189. Expression.prototype.divide = /**
  95190. * @param {?} rhs
  95191. * @param {?=} sourceSpan
  95192. * @return {?}
  95193. */
  95194. function (rhs, sourceSpan) {
  95195. return new BinaryOperatorExpr(BinaryOperator.Divide, this, rhs, null, sourceSpan);
  95196. };
  95197. /**
  95198. * @param {?} rhs
  95199. * @param {?=} sourceSpan
  95200. * @return {?}
  95201. */
  95202. Expression.prototype.multiply = /**
  95203. * @param {?} rhs
  95204. * @param {?=} sourceSpan
  95205. * @return {?}
  95206. */
  95207. function (rhs, sourceSpan) {
  95208. return new BinaryOperatorExpr(BinaryOperator.Multiply, this, rhs, null, sourceSpan);
  95209. };
  95210. /**
  95211. * @param {?} rhs
  95212. * @param {?=} sourceSpan
  95213. * @return {?}
  95214. */
  95215. Expression.prototype.modulo = /**
  95216. * @param {?} rhs
  95217. * @param {?=} sourceSpan
  95218. * @return {?}
  95219. */
  95220. function (rhs, sourceSpan) {
  95221. return new BinaryOperatorExpr(BinaryOperator.Modulo, this, rhs, null, sourceSpan);
  95222. };
  95223. /**
  95224. * @param {?} rhs
  95225. * @param {?=} sourceSpan
  95226. * @return {?}
  95227. */
  95228. Expression.prototype.and = /**
  95229. * @param {?} rhs
  95230. * @param {?=} sourceSpan
  95231. * @return {?}
  95232. */
  95233. function (rhs, sourceSpan) {
  95234. return new BinaryOperatorExpr(BinaryOperator.And, this, rhs, null, sourceSpan);
  95235. };
  95236. /**
  95237. * @param {?} rhs
  95238. * @param {?=} sourceSpan
  95239. * @return {?}
  95240. */
  95241. Expression.prototype.or = /**
  95242. * @param {?} rhs
  95243. * @param {?=} sourceSpan
  95244. * @return {?}
  95245. */
  95246. function (rhs, sourceSpan) {
  95247. return new BinaryOperatorExpr(BinaryOperator.Or, this, rhs, null, sourceSpan);
  95248. };
  95249. /**
  95250. * @param {?} rhs
  95251. * @param {?=} sourceSpan
  95252. * @return {?}
  95253. */
  95254. Expression.prototype.lower = /**
  95255. * @param {?} rhs
  95256. * @param {?=} sourceSpan
  95257. * @return {?}
  95258. */
  95259. function (rhs, sourceSpan) {
  95260. return new BinaryOperatorExpr(BinaryOperator.Lower, this, rhs, null, sourceSpan);
  95261. };
  95262. /**
  95263. * @param {?} rhs
  95264. * @param {?=} sourceSpan
  95265. * @return {?}
  95266. */
  95267. Expression.prototype.lowerEquals = /**
  95268. * @param {?} rhs
  95269. * @param {?=} sourceSpan
  95270. * @return {?}
  95271. */
  95272. function (rhs, sourceSpan) {
  95273. return new BinaryOperatorExpr(BinaryOperator.LowerEquals, this, rhs, null, sourceSpan);
  95274. };
  95275. /**
  95276. * @param {?} rhs
  95277. * @param {?=} sourceSpan
  95278. * @return {?}
  95279. */
  95280. Expression.prototype.bigger = /**
  95281. * @param {?} rhs
  95282. * @param {?=} sourceSpan
  95283. * @return {?}
  95284. */
  95285. function (rhs, sourceSpan) {
  95286. return new BinaryOperatorExpr(BinaryOperator.Bigger, this, rhs, null, sourceSpan);
  95287. };
  95288. /**
  95289. * @param {?} rhs
  95290. * @param {?=} sourceSpan
  95291. * @return {?}
  95292. */
  95293. Expression.prototype.biggerEquals = /**
  95294. * @param {?} rhs
  95295. * @param {?=} sourceSpan
  95296. * @return {?}
  95297. */
  95298. function (rhs, sourceSpan) {
  95299. return new BinaryOperatorExpr(BinaryOperator.BiggerEquals, this, rhs, null, sourceSpan);
  95300. };
  95301. /**
  95302. * @param {?=} sourceSpan
  95303. * @return {?}
  95304. */
  95305. Expression.prototype.isBlank = /**
  95306. * @param {?=} sourceSpan
  95307. * @return {?}
  95308. */
  95309. function (sourceSpan) {
  95310. // Note: We use equals by purpose here to compare to null and undefined in JS.
  95311. // We use the typed null to allow strictNullChecks to narrow types.
  95312. return this.equals(TYPED_NULL_EXPR, sourceSpan);
  95313. };
  95314. /**
  95315. * @param {?} type
  95316. * @param {?=} sourceSpan
  95317. * @return {?}
  95318. */
  95319. Expression.prototype.cast = /**
  95320. * @param {?} type
  95321. * @param {?=} sourceSpan
  95322. * @return {?}
  95323. */
  95324. function (type, sourceSpan) {
  95325. return new CastExpr(this, type, sourceSpan);
  95326. };
  95327. /**
  95328. * @return {?}
  95329. */
  95330. Expression.prototype.toStmt = /**
  95331. * @return {?}
  95332. */
  95333. function () { return new ExpressionStatement(this, null); };
  95334. return Expression;
  95335. }());
  95336. /** @enum {number} */
  95337. var BuiltinVar = {
  95338. This: 0,
  95339. Super: 1,
  95340. CatchError: 2,
  95341. CatchStack: 3,
  95342. };
  95343. BuiltinVar[BuiltinVar.This] = "This";
  95344. BuiltinVar[BuiltinVar.Super] = "Super";
  95345. BuiltinVar[BuiltinVar.CatchError] = "CatchError";
  95346. BuiltinVar[BuiltinVar.CatchStack] = "CatchStack";
  95347. var ReadVarExpr = /** @class */ (function (_super) {
  95348. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(ReadVarExpr, _super);
  95349. function ReadVarExpr(name, type, sourceSpan) {
  95350. var _this = _super.call(this, type, sourceSpan) || this;
  95351. if (typeof name === 'string') {
  95352. _this.name = name;
  95353. _this.builtin = null;
  95354. }
  95355. else {
  95356. _this.name = null;
  95357. _this.builtin = /** @type {?} */ (name);
  95358. }
  95359. return _this;
  95360. }
  95361. /**
  95362. * @param {?} e
  95363. * @return {?}
  95364. */
  95365. ReadVarExpr.prototype.isEquivalent = /**
  95366. * @param {?} e
  95367. * @return {?}
  95368. */
  95369. function (e) {
  95370. return e instanceof ReadVarExpr && this.name === e.name && this.builtin === e.builtin;
  95371. };
  95372. /**
  95373. * @param {?} visitor
  95374. * @param {?} context
  95375. * @return {?}
  95376. */
  95377. ReadVarExpr.prototype.visitExpression = /**
  95378. * @param {?} visitor
  95379. * @param {?} context
  95380. * @return {?}
  95381. */
  95382. function (visitor, context) {
  95383. return visitor.visitReadVarExpr(this, context);
  95384. };
  95385. /**
  95386. * @param {?} value
  95387. * @return {?}
  95388. */
  95389. ReadVarExpr.prototype.set = /**
  95390. * @param {?} value
  95391. * @return {?}
  95392. */
  95393. function (value) {
  95394. if (!this.name) {
  95395. throw new Error("Built in variable " + this.builtin + " can not be assigned to.");
  95396. }
  95397. return new WriteVarExpr(this.name, value, null, this.sourceSpan);
  95398. };
  95399. return ReadVarExpr;
  95400. }(Expression));
  95401. var WriteVarExpr = /** @class */ (function (_super) {
  95402. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(WriteVarExpr, _super);
  95403. function WriteVarExpr(name, value, type, sourceSpan) {
  95404. var _this = _super.call(this, type || value.type, sourceSpan) || this;
  95405. _this.name = name;
  95406. _this.value = value;
  95407. return _this;
  95408. }
  95409. /**
  95410. * @param {?} e
  95411. * @return {?}
  95412. */
  95413. WriteVarExpr.prototype.isEquivalent = /**
  95414. * @param {?} e
  95415. * @return {?}
  95416. */
  95417. function (e) {
  95418. return e instanceof WriteVarExpr && this.name === e.name && this.value.isEquivalent(e.value);
  95419. };
  95420. /**
  95421. * @param {?} visitor
  95422. * @param {?} context
  95423. * @return {?}
  95424. */
  95425. WriteVarExpr.prototype.visitExpression = /**
  95426. * @param {?} visitor
  95427. * @param {?} context
  95428. * @return {?}
  95429. */
  95430. function (visitor, context) {
  95431. return visitor.visitWriteVarExpr(this, context);
  95432. };
  95433. /**
  95434. * @param {?=} type
  95435. * @param {?=} modifiers
  95436. * @return {?}
  95437. */
  95438. WriteVarExpr.prototype.toDeclStmt = /**
  95439. * @param {?=} type
  95440. * @param {?=} modifiers
  95441. * @return {?}
  95442. */
  95443. function (type, modifiers) {
  95444. return new DeclareVarStmt(this.name, this.value, type, modifiers, this.sourceSpan);
  95445. };
  95446. return WriteVarExpr;
  95447. }(Expression));
  95448. var WriteKeyExpr = /** @class */ (function (_super) {
  95449. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(WriteKeyExpr, _super);
  95450. function WriteKeyExpr(receiver, index, value, type, sourceSpan) {
  95451. var _this = _super.call(this, type || value.type, sourceSpan) || this;
  95452. _this.receiver = receiver;
  95453. _this.index = index;
  95454. _this.value = value;
  95455. return _this;
  95456. }
  95457. /**
  95458. * @param {?} e
  95459. * @return {?}
  95460. */
  95461. WriteKeyExpr.prototype.isEquivalent = /**
  95462. * @param {?} e
  95463. * @return {?}
  95464. */
  95465. function (e) {
  95466. return e instanceof WriteKeyExpr && this.receiver.isEquivalent(e.receiver) &&
  95467. this.index.isEquivalent(e.index) && this.value.isEquivalent(e.value);
  95468. };
  95469. /**
  95470. * @param {?} visitor
  95471. * @param {?} context
  95472. * @return {?}
  95473. */
  95474. WriteKeyExpr.prototype.visitExpression = /**
  95475. * @param {?} visitor
  95476. * @param {?} context
  95477. * @return {?}
  95478. */
  95479. function (visitor, context) {
  95480. return visitor.visitWriteKeyExpr(this, context);
  95481. };
  95482. return WriteKeyExpr;
  95483. }(Expression));
  95484. var WritePropExpr = /** @class */ (function (_super) {
  95485. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(WritePropExpr, _super);
  95486. function WritePropExpr(receiver, name, value, type, sourceSpan) {
  95487. var _this = _super.call(this, type || value.type, sourceSpan) || this;
  95488. _this.receiver = receiver;
  95489. _this.name = name;
  95490. _this.value = value;
  95491. return _this;
  95492. }
  95493. /**
  95494. * @param {?} e
  95495. * @return {?}
  95496. */
  95497. WritePropExpr.prototype.isEquivalent = /**
  95498. * @param {?} e
  95499. * @return {?}
  95500. */
  95501. function (e) {
  95502. return e instanceof WritePropExpr && this.receiver.isEquivalent(e.receiver) &&
  95503. this.name === e.name && this.value.isEquivalent(e.value);
  95504. };
  95505. /**
  95506. * @param {?} visitor
  95507. * @param {?} context
  95508. * @return {?}
  95509. */
  95510. WritePropExpr.prototype.visitExpression = /**
  95511. * @param {?} visitor
  95512. * @param {?} context
  95513. * @return {?}
  95514. */
  95515. function (visitor, context) {
  95516. return visitor.visitWritePropExpr(this, context);
  95517. };
  95518. return WritePropExpr;
  95519. }(Expression));
  95520. /** @enum {number} */
  95521. var BuiltinMethod = {
  95522. ConcatArray: 0,
  95523. SubscribeObservable: 1,
  95524. Bind: 2,
  95525. };
  95526. BuiltinMethod[BuiltinMethod.ConcatArray] = "ConcatArray";
  95527. BuiltinMethod[BuiltinMethod.SubscribeObservable] = "SubscribeObservable";
  95528. BuiltinMethod[BuiltinMethod.Bind] = "Bind";
  95529. var InvokeMethodExpr = /** @class */ (function (_super) {
  95530. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(InvokeMethodExpr, _super);
  95531. function InvokeMethodExpr(receiver, method, args, type, sourceSpan) {
  95532. var _this = _super.call(this, type, sourceSpan) || this;
  95533. _this.receiver = receiver;
  95534. _this.args = args;
  95535. if (typeof method === 'string') {
  95536. _this.name = method;
  95537. _this.builtin = null;
  95538. }
  95539. else {
  95540. _this.name = null;
  95541. _this.builtin = /** @type {?} */ (method);
  95542. }
  95543. return _this;
  95544. }
  95545. /**
  95546. * @param {?} e
  95547. * @return {?}
  95548. */
  95549. InvokeMethodExpr.prototype.isEquivalent = /**
  95550. * @param {?} e
  95551. * @return {?}
  95552. */
  95553. function (e) {
  95554. return e instanceof InvokeMethodExpr && this.receiver.isEquivalent(e.receiver) &&
  95555. this.name === e.name && this.builtin === e.builtin && areAllEquivalent(this.args, e.args);
  95556. };
  95557. /**
  95558. * @param {?} visitor
  95559. * @param {?} context
  95560. * @return {?}
  95561. */
  95562. InvokeMethodExpr.prototype.visitExpression = /**
  95563. * @param {?} visitor
  95564. * @param {?} context
  95565. * @return {?}
  95566. */
  95567. function (visitor, context) {
  95568. return visitor.visitInvokeMethodExpr(this, context);
  95569. };
  95570. return InvokeMethodExpr;
  95571. }(Expression));
  95572. var InvokeFunctionExpr = /** @class */ (function (_super) {
  95573. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(InvokeFunctionExpr, _super);
  95574. function InvokeFunctionExpr(fn, args, type, sourceSpan) {
  95575. var _this = _super.call(this, type, sourceSpan) || this;
  95576. _this.fn = fn;
  95577. _this.args = args;
  95578. return _this;
  95579. }
  95580. /**
  95581. * @param {?} e
  95582. * @return {?}
  95583. */
  95584. InvokeFunctionExpr.prototype.isEquivalent = /**
  95585. * @param {?} e
  95586. * @return {?}
  95587. */
  95588. function (e) {
  95589. return e instanceof InvokeFunctionExpr && this.fn.isEquivalent(e.fn) &&
  95590. areAllEquivalent(this.args, e.args);
  95591. };
  95592. /**
  95593. * @param {?} visitor
  95594. * @param {?} context
  95595. * @return {?}
  95596. */
  95597. InvokeFunctionExpr.prototype.visitExpression = /**
  95598. * @param {?} visitor
  95599. * @param {?} context
  95600. * @return {?}
  95601. */
  95602. function (visitor, context) {
  95603. return visitor.visitInvokeFunctionExpr(this, context);
  95604. };
  95605. return InvokeFunctionExpr;
  95606. }(Expression));
  95607. var InstantiateExpr = /** @class */ (function (_super) {
  95608. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(InstantiateExpr, _super);
  95609. function InstantiateExpr(classExpr, args, type, sourceSpan) {
  95610. var _this = _super.call(this, type, sourceSpan) || this;
  95611. _this.classExpr = classExpr;
  95612. _this.args = args;
  95613. return _this;
  95614. }
  95615. /**
  95616. * @param {?} e
  95617. * @return {?}
  95618. */
  95619. InstantiateExpr.prototype.isEquivalent = /**
  95620. * @param {?} e
  95621. * @return {?}
  95622. */
  95623. function (e) {
  95624. return e instanceof InstantiateExpr && this.classExpr.isEquivalent(e.classExpr) &&
  95625. areAllEquivalent(this.args, e.args);
  95626. };
  95627. /**
  95628. * @param {?} visitor
  95629. * @param {?} context
  95630. * @return {?}
  95631. */
  95632. InstantiateExpr.prototype.visitExpression = /**
  95633. * @param {?} visitor
  95634. * @param {?} context
  95635. * @return {?}
  95636. */
  95637. function (visitor, context) {
  95638. return visitor.visitInstantiateExpr(this, context);
  95639. };
  95640. return InstantiateExpr;
  95641. }(Expression));
  95642. var LiteralExpr = /** @class */ (function (_super) {
  95643. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(LiteralExpr, _super);
  95644. function LiteralExpr(value, type, sourceSpan) {
  95645. var _this = _super.call(this, type, sourceSpan) || this;
  95646. _this.value = value;
  95647. return _this;
  95648. }
  95649. /**
  95650. * @param {?} e
  95651. * @return {?}
  95652. */
  95653. LiteralExpr.prototype.isEquivalent = /**
  95654. * @param {?} e
  95655. * @return {?}
  95656. */
  95657. function (e) {
  95658. return e instanceof LiteralExpr && this.value === e.value;
  95659. };
  95660. /**
  95661. * @param {?} visitor
  95662. * @param {?} context
  95663. * @return {?}
  95664. */
  95665. LiteralExpr.prototype.visitExpression = /**
  95666. * @param {?} visitor
  95667. * @param {?} context
  95668. * @return {?}
  95669. */
  95670. function (visitor, context) {
  95671. return visitor.visitLiteralExpr(this, context);
  95672. };
  95673. return LiteralExpr;
  95674. }(Expression));
  95675. var ExternalExpr = /** @class */ (function (_super) {
  95676. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(ExternalExpr, _super);
  95677. function ExternalExpr(value, type, typeParams, sourceSpan) {
  95678. if (typeParams === void 0) { typeParams = null; }
  95679. var _this = _super.call(this, type, sourceSpan) || this;
  95680. _this.value = value;
  95681. _this.typeParams = typeParams;
  95682. return _this;
  95683. }
  95684. /**
  95685. * @param {?} e
  95686. * @return {?}
  95687. */
  95688. ExternalExpr.prototype.isEquivalent = /**
  95689. * @param {?} e
  95690. * @return {?}
  95691. */
  95692. function (e) {
  95693. return e instanceof ExternalExpr && this.value.name === e.value.name &&
  95694. this.value.moduleName === e.value.moduleName && this.value.runtime === e.value.runtime;
  95695. };
  95696. /**
  95697. * @param {?} visitor
  95698. * @param {?} context
  95699. * @return {?}
  95700. */
  95701. ExternalExpr.prototype.visitExpression = /**
  95702. * @param {?} visitor
  95703. * @param {?} context
  95704. * @return {?}
  95705. */
  95706. function (visitor, context) {
  95707. return visitor.visitExternalExpr(this, context);
  95708. };
  95709. return ExternalExpr;
  95710. }(Expression));
  95711. var ExternalReference = /** @class */ (function () {
  95712. function ExternalReference(moduleName, name, runtime) {
  95713. this.moduleName = moduleName;
  95714. this.name = name;
  95715. this.runtime = runtime;
  95716. }
  95717. return ExternalReference;
  95718. }());
  95719. var ConditionalExpr = /** @class */ (function (_super) {
  95720. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(ConditionalExpr, _super);
  95721. function ConditionalExpr(condition, trueCase, falseCase, type, sourceSpan) {
  95722. if (falseCase === void 0) { falseCase = null; }
  95723. var _this = _super.call(this, type || trueCase.type, sourceSpan) || this;
  95724. _this.condition = condition;
  95725. _this.falseCase = falseCase;
  95726. _this.trueCase = trueCase;
  95727. return _this;
  95728. }
  95729. /**
  95730. * @param {?} e
  95731. * @return {?}
  95732. */
  95733. ConditionalExpr.prototype.isEquivalent = /**
  95734. * @param {?} e
  95735. * @return {?}
  95736. */
  95737. function (e) {
  95738. return e instanceof ConditionalExpr && this.condition.isEquivalent(e.condition) &&
  95739. this.trueCase.isEquivalent(e.trueCase) && nullSafeIsEquivalent(this.falseCase, e.falseCase);
  95740. };
  95741. /**
  95742. * @param {?} visitor
  95743. * @param {?} context
  95744. * @return {?}
  95745. */
  95746. ConditionalExpr.prototype.visitExpression = /**
  95747. * @param {?} visitor
  95748. * @param {?} context
  95749. * @return {?}
  95750. */
  95751. function (visitor, context) {
  95752. return visitor.visitConditionalExpr(this, context);
  95753. };
  95754. return ConditionalExpr;
  95755. }(Expression));
  95756. var NotExpr = /** @class */ (function (_super) {
  95757. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(NotExpr, _super);
  95758. function NotExpr(condition, sourceSpan) {
  95759. var _this = _super.call(this, BOOL_TYPE, sourceSpan) || this;
  95760. _this.condition = condition;
  95761. return _this;
  95762. }
  95763. /**
  95764. * @param {?} e
  95765. * @return {?}
  95766. */
  95767. NotExpr.prototype.isEquivalent = /**
  95768. * @param {?} e
  95769. * @return {?}
  95770. */
  95771. function (e) {
  95772. return e instanceof NotExpr && this.condition.isEquivalent(e.condition);
  95773. };
  95774. /**
  95775. * @param {?} visitor
  95776. * @param {?} context
  95777. * @return {?}
  95778. */
  95779. NotExpr.prototype.visitExpression = /**
  95780. * @param {?} visitor
  95781. * @param {?} context
  95782. * @return {?}
  95783. */
  95784. function (visitor, context) {
  95785. return visitor.visitNotExpr(this, context);
  95786. };
  95787. return NotExpr;
  95788. }(Expression));
  95789. var AssertNotNull = /** @class */ (function (_super) {
  95790. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(AssertNotNull, _super);
  95791. function AssertNotNull(condition, sourceSpan) {
  95792. var _this = _super.call(this, condition.type, sourceSpan) || this;
  95793. _this.condition = condition;
  95794. return _this;
  95795. }
  95796. /**
  95797. * @param {?} e
  95798. * @return {?}
  95799. */
  95800. AssertNotNull.prototype.isEquivalent = /**
  95801. * @param {?} e
  95802. * @return {?}
  95803. */
  95804. function (e) {
  95805. return e instanceof AssertNotNull && this.condition.isEquivalent(e.condition);
  95806. };
  95807. /**
  95808. * @param {?} visitor
  95809. * @param {?} context
  95810. * @return {?}
  95811. */
  95812. AssertNotNull.prototype.visitExpression = /**
  95813. * @param {?} visitor
  95814. * @param {?} context
  95815. * @return {?}
  95816. */
  95817. function (visitor, context) {
  95818. return visitor.visitAssertNotNullExpr(this, context);
  95819. };
  95820. return AssertNotNull;
  95821. }(Expression));
  95822. var CastExpr = /** @class */ (function (_super) {
  95823. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(CastExpr, _super);
  95824. function CastExpr(value, type, sourceSpan) {
  95825. var _this = _super.call(this, type, sourceSpan) || this;
  95826. _this.value = value;
  95827. return _this;
  95828. }
  95829. /**
  95830. * @param {?} e
  95831. * @return {?}
  95832. */
  95833. CastExpr.prototype.isEquivalent = /**
  95834. * @param {?} e
  95835. * @return {?}
  95836. */
  95837. function (e) {
  95838. return e instanceof CastExpr && this.value.isEquivalent(e.value);
  95839. };
  95840. /**
  95841. * @param {?} visitor
  95842. * @param {?} context
  95843. * @return {?}
  95844. */
  95845. CastExpr.prototype.visitExpression = /**
  95846. * @param {?} visitor
  95847. * @param {?} context
  95848. * @return {?}
  95849. */
  95850. function (visitor, context) {
  95851. return visitor.visitCastExpr(this, context);
  95852. };
  95853. return CastExpr;
  95854. }(Expression));
  95855. var FnParam = /** @class */ (function () {
  95856. function FnParam(name, type) {
  95857. if (type === void 0) { type = null; }
  95858. this.name = name;
  95859. this.type = type;
  95860. }
  95861. /**
  95862. * @param {?} param
  95863. * @return {?}
  95864. */
  95865. FnParam.prototype.isEquivalent = /**
  95866. * @param {?} param
  95867. * @return {?}
  95868. */
  95869. function (param) { return this.name === param.name; };
  95870. return FnParam;
  95871. }());
  95872. var FunctionExpr = /** @class */ (function (_super) {
  95873. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(FunctionExpr, _super);
  95874. function FunctionExpr(params, statements, type, sourceSpan) {
  95875. var _this = _super.call(this, type, sourceSpan) || this;
  95876. _this.params = params;
  95877. _this.statements = statements;
  95878. return _this;
  95879. }
  95880. /**
  95881. * @param {?} e
  95882. * @return {?}
  95883. */
  95884. FunctionExpr.prototype.isEquivalent = /**
  95885. * @param {?} e
  95886. * @return {?}
  95887. */
  95888. function (e) {
  95889. return e instanceof FunctionExpr && areAllEquivalent(this.params, e.params) &&
  95890. areAllEquivalent(this.statements, e.statements);
  95891. };
  95892. /**
  95893. * @param {?} visitor
  95894. * @param {?} context
  95895. * @return {?}
  95896. */
  95897. FunctionExpr.prototype.visitExpression = /**
  95898. * @param {?} visitor
  95899. * @param {?} context
  95900. * @return {?}
  95901. */
  95902. function (visitor, context) {
  95903. return visitor.visitFunctionExpr(this, context);
  95904. };
  95905. /**
  95906. * @param {?} name
  95907. * @param {?=} modifiers
  95908. * @return {?}
  95909. */
  95910. FunctionExpr.prototype.toDeclStmt = /**
  95911. * @param {?} name
  95912. * @param {?=} modifiers
  95913. * @return {?}
  95914. */
  95915. function (name, modifiers) {
  95916. if (modifiers === void 0) { modifiers = null; }
  95917. return new DeclareFunctionStmt(name, this.params, this.statements, this.type, modifiers, this.sourceSpan);
  95918. };
  95919. return FunctionExpr;
  95920. }(Expression));
  95921. var BinaryOperatorExpr = /** @class */ (function (_super) {
  95922. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(BinaryOperatorExpr, _super);
  95923. function BinaryOperatorExpr(operator, lhs, rhs, type, sourceSpan) {
  95924. var _this = _super.call(this, type || lhs.type, sourceSpan) || this;
  95925. _this.operator = operator;
  95926. _this.rhs = rhs;
  95927. _this.lhs = lhs;
  95928. return _this;
  95929. }
  95930. /**
  95931. * @param {?} e
  95932. * @return {?}
  95933. */
  95934. BinaryOperatorExpr.prototype.isEquivalent = /**
  95935. * @param {?} e
  95936. * @return {?}
  95937. */
  95938. function (e) {
  95939. return e instanceof BinaryOperatorExpr && this.operator === e.operator &&
  95940. this.lhs.isEquivalent(e.lhs) && this.rhs.isEquivalent(e.rhs);
  95941. };
  95942. /**
  95943. * @param {?} visitor
  95944. * @param {?} context
  95945. * @return {?}
  95946. */
  95947. BinaryOperatorExpr.prototype.visitExpression = /**
  95948. * @param {?} visitor
  95949. * @param {?} context
  95950. * @return {?}
  95951. */
  95952. function (visitor, context) {
  95953. return visitor.visitBinaryOperatorExpr(this, context);
  95954. };
  95955. return BinaryOperatorExpr;
  95956. }(Expression));
  95957. var ReadPropExpr = /** @class */ (function (_super) {
  95958. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(ReadPropExpr, _super);
  95959. function ReadPropExpr(receiver, name, type, sourceSpan) {
  95960. var _this = _super.call(this, type, sourceSpan) || this;
  95961. _this.receiver = receiver;
  95962. _this.name = name;
  95963. return _this;
  95964. }
  95965. /**
  95966. * @param {?} e
  95967. * @return {?}
  95968. */
  95969. ReadPropExpr.prototype.isEquivalent = /**
  95970. * @param {?} e
  95971. * @return {?}
  95972. */
  95973. function (e) {
  95974. return e instanceof ReadPropExpr && this.receiver.isEquivalent(e.receiver) &&
  95975. this.name === e.name;
  95976. };
  95977. /**
  95978. * @param {?} visitor
  95979. * @param {?} context
  95980. * @return {?}
  95981. */
  95982. ReadPropExpr.prototype.visitExpression = /**
  95983. * @param {?} visitor
  95984. * @param {?} context
  95985. * @return {?}
  95986. */
  95987. function (visitor, context) {
  95988. return visitor.visitReadPropExpr(this, context);
  95989. };
  95990. /**
  95991. * @param {?} value
  95992. * @return {?}
  95993. */
  95994. ReadPropExpr.prototype.set = /**
  95995. * @param {?} value
  95996. * @return {?}
  95997. */
  95998. function (value) {
  95999. return new WritePropExpr(this.receiver, this.name, value, null, this.sourceSpan);
  96000. };
  96001. return ReadPropExpr;
  96002. }(Expression));
  96003. var ReadKeyExpr = /** @class */ (function (_super) {
  96004. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(ReadKeyExpr, _super);
  96005. function ReadKeyExpr(receiver, index, type, sourceSpan) {
  96006. var _this = _super.call(this, type, sourceSpan) || this;
  96007. _this.receiver = receiver;
  96008. _this.index = index;
  96009. return _this;
  96010. }
  96011. /**
  96012. * @param {?} e
  96013. * @return {?}
  96014. */
  96015. ReadKeyExpr.prototype.isEquivalent = /**
  96016. * @param {?} e
  96017. * @return {?}
  96018. */
  96019. function (e) {
  96020. return e instanceof ReadKeyExpr && this.receiver.isEquivalent(e.receiver) &&
  96021. this.index.isEquivalent(e.index);
  96022. };
  96023. /**
  96024. * @param {?} visitor
  96025. * @param {?} context
  96026. * @return {?}
  96027. */
  96028. ReadKeyExpr.prototype.visitExpression = /**
  96029. * @param {?} visitor
  96030. * @param {?} context
  96031. * @return {?}
  96032. */
  96033. function (visitor, context) {
  96034. return visitor.visitReadKeyExpr(this, context);
  96035. };
  96036. /**
  96037. * @param {?} value
  96038. * @return {?}
  96039. */
  96040. ReadKeyExpr.prototype.set = /**
  96041. * @param {?} value
  96042. * @return {?}
  96043. */
  96044. function (value) {
  96045. return new WriteKeyExpr(this.receiver, this.index, value, null, this.sourceSpan);
  96046. };
  96047. return ReadKeyExpr;
  96048. }(Expression));
  96049. var LiteralArrayExpr = /** @class */ (function (_super) {
  96050. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(LiteralArrayExpr, _super);
  96051. function LiteralArrayExpr(entries, type, sourceSpan) {
  96052. var _this = _super.call(this, type, sourceSpan) || this;
  96053. _this.entries = entries;
  96054. return _this;
  96055. }
  96056. /**
  96057. * @param {?} e
  96058. * @return {?}
  96059. */
  96060. LiteralArrayExpr.prototype.isEquivalent = /**
  96061. * @param {?} e
  96062. * @return {?}
  96063. */
  96064. function (e) {
  96065. return e instanceof LiteralArrayExpr && areAllEquivalent(this.entries, e.entries);
  96066. };
  96067. /**
  96068. * @param {?} visitor
  96069. * @param {?} context
  96070. * @return {?}
  96071. */
  96072. LiteralArrayExpr.prototype.visitExpression = /**
  96073. * @param {?} visitor
  96074. * @param {?} context
  96075. * @return {?}
  96076. */
  96077. function (visitor, context) {
  96078. return visitor.visitLiteralArrayExpr(this, context);
  96079. };
  96080. return LiteralArrayExpr;
  96081. }(Expression));
  96082. var LiteralMapEntry = /** @class */ (function () {
  96083. function LiteralMapEntry(key, value, quoted) {
  96084. this.key = key;
  96085. this.value = value;
  96086. this.quoted = quoted;
  96087. }
  96088. /**
  96089. * @param {?} e
  96090. * @return {?}
  96091. */
  96092. LiteralMapEntry.prototype.isEquivalent = /**
  96093. * @param {?} e
  96094. * @return {?}
  96095. */
  96096. function (e) {
  96097. return this.key === e.key && this.value.isEquivalent(e.value);
  96098. };
  96099. return LiteralMapEntry;
  96100. }());
  96101. var LiteralMapExpr = /** @class */ (function (_super) {
  96102. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(LiteralMapExpr, _super);
  96103. function LiteralMapExpr(entries, type, sourceSpan) {
  96104. var _this = _super.call(this, type, sourceSpan) || this;
  96105. _this.entries = entries;
  96106. _this.valueType = null;
  96107. if (type) {
  96108. _this.valueType = type.valueType;
  96109. }
  96110. return _this;
  96111. }
  96112. /**
  96113. * @param {?} e
  96114. * @return {?}
  96115. */
  96116. LiteralMapExpr.prototype.isEquivalent = /**
  96117. * @param {?} e
  96118. * @return {?}
  96119. */
  96120. function (e) {
  96121. return e instanceof LiteralMapExpr && areAllEquivalent(this.entries, e.entries);
  96122. };
  96123. /**
  96124. * @param {?} visitor
  96125. * @param {?} context
  96126. * @return {?}
  96127. */
  96128. LiteralMapExpr.prototype.visitExpression = /**
  96129. * @param {?} visitor
  96130. * @param {?} context
  96131. * @return {?}
  96132. */
  96133. function (visitor, context) {
  96134. return visitor.visitLiteralMapExpr(this, context);
  96135. };
  96136. return LiteralMapExpr;
  96137. }(Expression));
  96138. var CommaExpr = /** @class */ (function (_super) {
  96139. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(CommaExpr, _super);
  96140. function CommaExpr(parts, sourceSpan) {
  96141. var _this = _super.call(this, parts[parts.length - 1].type, sourceSpan) || this;
  96142. _this.parts = parts;
  96143. return _this;
  96144. }
  96145. /**
  96146. * @param {?} e
  96147. * @return {?}
  96148. */
  96149. CommaExpr.prototype.isEquivalent = /**
  96150. * @param {?} e
  96151. * @return {?}
  96152. */
  96153. function (e) {
  96154. return e instanceof CommaExpr && areAllEquivalent(this.parts, e.parts);
  96155. };
  96156. /**
  96157. * @param {?} visitor
  96158. * @param {?} context
  96159. * @return {?}
  96160. */
  96161. CommaExpr.prototype.visitExpression = /**
  96162. * @param {?} visitor
  96163. * @param {?} context
  96164. * @return {?}
  96165. */
  96166. function (visitor, context) {
  96167. return visitor.visitCommaExpr(this, context);
  96168. };
  96169. return CommaExpr;
  96170. }(Expression));
  96171. /**
  96172. * @record
  96173. */
  96174. var THIS_EXPR = new ReadVarExpr(BuiltinVar.This, null, null);
  96175. var SUPER_EXPR = new ReadVarExpr(BuiltinVar.Super, null, null);
  96176. var CATCH_ERROR_VAR = new ReadVarExpr(BuiltinVar.CatchError, null, null);
  96177. var CATCH_STACK_VAR = new ReadVarExpr(BuiltinVar.CatchStack, null, null);
  96178. var NULL_EXPR = new LiteralExpr(null, null, null);
  96179. var TYPED_NULL_EXPR = new LiteralExpr(null, INFERRED_TYPE, null);
  96180. /** @enum {number} */
  96181. var StmtModifier = {
  96182. Final: 0,
  96183. Private: 1,
  96184. Exported: 2,
  96185. };
  96186. StmtModifier[StmtModifier.Final] = "Final";
  96187. StmtModifier[StmtModifier.Private] = "Private";
  96188. StmtModifier[StmtModifier.Exported] = "Exported";
  96189. /**
  96190. * @abstract
  96191. */
  96192. var Statement = /** @class */ (function () {
  96193. function Statement(modifiers, sourceSpan) {
  96194. this.modifiers = modifiers || [];
  96195. this.sourceSpan = sourceSpan || null;
  96196. }
  96197. /**
  96198. * @param {?} modifier
  96199. * @return {?}
  96200. */
  96201. Statement.prototype.hasModifier = /**
  96202. * @param {?} modifier
  96203. * @return {?}
  96204. */
  96205. function (modifier) { return /** @type {?} */ ((this.modifiers)).indexOf(modifier) !== -1; };
  96206. return Statement;
  96207. }());
  96208. var DeclareVarStmt = /** @class */ (function (_super) {
  96209. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(DeclareVarStmt, _super);
  96210. function DeclareVarStmt(name, value, type, modifiers, sourceSpan) {
  96211. if (modifiers === void 0) { modifiers = null; }
  96212. var _this = _super.call(this, modifiers, sourceSpan) || this;
  96213. _this.name = name;
  96214. _this.value = value;
  96215. _this.type = type || value.type;
  96216. return _this;
  96217. }
  96218. /**
  96219. * @param {?} stmt
  96220. * @return {?}
  96221. */
  96222. DeclareVarStmt.prototype.isEquivalent = /**
  96223. * @param {?} stmt
  96224. * @return {?}
  96225. */
  96226. function (stmt) {
  96227. return stmt instanceof DeclareVarStmt && this.name === stmt.name &&
  96228. this.value.isEquivalent(stmt.value);
  96229. };
  96230. /**
  96231. * @param {?} visitor
  96232. * @param {?} context
  96233. * @return {?}
  96234. */
  96235. DeclareVarStmt.prototype.visitStatement = /**
  96236. * @param {?} visitor
  96237. * @param {?} context
  96238. * @return {?}
  96239. */
  96240. function (visitor, context) {
  96241. return visitor.visitDeclareVarStmt(this, context);
  96242. };
  96243. return DeclareVarStmt;
  96244. }(Statement));
  96245. var DeclareFunctionStmt = /** @class */ (function (_super) {
  96246. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(DeclareFunctionStmt, _super);
  96247. function DeclareFunctionStmt(name, params, statements, type, modifiers, sourceSpan) {
  96248. if (modifiers === void 0) { modifiers = null; }
  96249. var _this = _super.call(this, modifiers, sourceSpan) || this;
  96250. _this.name = name;
  96251. _this.params = params;
  96252. _this.statements = statements;
  96253. _this.type = type || null;
  96254. return _this;
  96255. }
  96256. /**
  96257. * @param {?} stmt
  96258. * @return {?}
  96259. */
  96260. DeclareFunctionStmt.prototype.isEquivalent = /**
  96261. * @param {?} stmt
  96262. * @return {?}
  96263. */
  96264. function (stmt) {
  96265. return stmt instanceof DeclareFunctionStmt && areAllEquivalent(this.params, stmt.params) &&
  96266. areAllEquivalent(this.statements, stmt.statements);
  96267. };
  96268. /**
  96269. * @param {?} visitor
  96270. * @param {?} context
  96271. * @return {?}
  96272. */
  96273. DeclareFunctionStmt.prototype.visitStatement = /**
  96274. * @param {?} visitor
  96275. * @param {?} context
  96276. * @return {?}
  96277. */
  96278. function (visitor, context) {
  96279. return visitor.visitDeclareFunctionStmt(this, context);
  96280. };
  96281. return DeclareFunctionStmt;
  96282. }(Statement));
  96283. var ExpressionStatement = /** @class */ (function (_super) {
  96284. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(ExpressionStatement, _super);
  96285. function ExpressionStatement(expr, sourceSpan) {
  96286. var _this = _super.call(this, null, sourceSpan) || this;
  96287. _this.expr = expr;
  96288. return _this;
  96289. }
  96290. /**
  96291. * @param {?} stmt
  96292. * @return {?}
  96293. */
  96294. ExpressionStatement.prototype.isEquivalent = /**
  96295. * @param {?} stmt
  96296. * @return {?}
  96297. */
  96298. function (stmt) {
  96299. return stmt instanceof ExpressionStatement && this.expr.isEquivalent(stmt.expr);
  96300. };
  96301. /**
  96302. * @param {?} visitor
  96303. * @param {?} context
  96304. * @return {?}
  96305. */
  96306. ExpressionStatement.prototype.visitStatement = /**
  96307. * @param {?} visitor
  96308. * @param {?} context
  96309. * @return {?}
  96310. */
  96311. function (visitor, context) {
  96312. return visitor.visitExpressionStmt(this, context);
  96313. };
  96314. return ExpressionStatement;
  96315. }(Statement));
  96316. var ReturnStatement = /** @class */ (function (_super) {
  96317. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(ReturnStatement, _super);
  96318. function ReturnStatement(value, sourceSpan) {
  96319. var _this = _super.call(this, null, sourceSpan) || this;
  96320. _this.value = value;
  96321. return _this;
  96322. }
  96323. /**
  96324. * @param {?} stmt
  96325. * @return {?}
  96326. */
  96327. ReturnStatement.prototype.isEquivalent = /**
  96328. * @param {?} stmt
  96329. * @return {?}
  96330. */
  96331. function (stmt) {
  96332. return stmt instanceof ReturnStatement && this.value.isEquivalent(stmt.value);
  96333. };
  96334. /**
  96335. * @param {?} visitor
  96336. * @param {?} context
  96337. * @return {?}
  96338. */
  96339. ReturnStatement.prototype.visitStatement = /**
  96340. * @param {?} visitor
  96341. * @param {?} context
  96342. * @return {?}
  96343. */
  96344. function (visitor, context) {
  96345. return visitor.visitReturnStmt(this, context);
  96346. };
  96347. return ReturnStatement;
  96348. }(Statement));
  96349. var AbstractClassPart = /** @class */ (function () {
  96350. function AbstractClassPart(type, modifiers) {
  96351. this.modifiers = modifiers;
  96352. if (!modifiers) {
  96353. this.modifiers = [];
  96354. }
  96355. this.type = type || null;
  96356. }
  96357. /**
  96358. * @param {?} modifier
  96359. * @return {?}
  96360. */
  96361. AbstractClassPart.prototype.hasModifier = /**
  96362. * @param {?} modifier
  96363. * @return {?}
  96364. */
  96365. function (modifier) { return /** @type {?} */ ((this.modifiers)).indexOf(modifier) !== -1; };
  96366. return AbstractClassPart;
  96367. }());
  96368. var ClassField = /** @class */ (function (_super) {
  96369. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(ClassField, _super);
  96370. function ClassField(name, type, modifiers) {
  96371. if (modifiers === void 0) { modifiers = null; }
  96372. var _this = _super.call(this, type, modifiers) || this;
  96373. _this.name = name;
  96374. return _this;
  96375. }
  96376. /**
  96377. * @param {?} f
  96378. * @return {?}
  96379. */
  96380. ClassField.prototype.isEquivalent = /**
  96381. * @param {?} f
  96382. * @return {?}
  96383. */
  96384. function (f) { return this.name === f.name; };
  96385. return ClassField;
  96386. }(AbstractClassPart));
  96387. var ClassMethod = /** @class */ (function (_super) {
  96388. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(ClassMethod, _super);
  96389. function ClassMethod(name, params, body, type, modifiers) {
  96390. if (modifiers === void 0) { modifiers = null; }
  96391. var _this = _super.call(this, type, modifiers) || this;
  96392. _this.name = name;
  96393. _this.params = params;
  96394. _this.body = body;
  96395. return _this;
  96396. }
  96397. /**
  96398. * @param {?} m
  96399. * @return {?}
  96400. */
  96401. ClassMethod.prototype.isEquivalent = /**
  96402. * @param {?} m
  96403. * @return {?}
  96404. */
  96405. function (m) {
  96406. return this.name === m.name && areAllEquivalent(this.body, m.body);
  96407. };
  96408. return ClassMethod;
  96409. }(AbstractClassPart));
  96410. var ClassGetter = /** @class */ (function (_super) {
  96411. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(ClassGetter, _super);
  96412. function ClassGetter(name, body, type, modifiers) {
  96413. if (modifiers === void 0) { modifiers = null; }
  96414. var _this = _super.call(this, type, modifiers) || this;
  96415. _this.name = name;
  96416. _this.body = body;
  96417. return _this;
  96418. }
  96419. /**
  96420. * @param {?} m
  96421. * @return {?}
  96422. */
  96423. ClassGetter.prototype.isEquivalent = /**
  96424. * @param {?} m
  96425. * @return {?}
  96426. */
  96427. function (m) {
  96428. return this.name === m.name && areAllEquivalent(this.body, m.body);
  96429. };
  96430. return ClassGetter;
  96431. }(AbstractClassPart));
  96432. var ClassStmt = /** @class */ (function (_super) {
  96433. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(ClassStmt, _super);
  96434. function ClassStmt(name, parent, fields, getters, constructorMethod, methods, modifiers, sourceSpan) {
  96435. if (modifiers === void 0) { modifiers = null; }
  96436. var _this = _super.call(this, modifiers, sourceSpan) || this;
  96437. _this.name = name;
  96438. _this.parent = parent;
  96439. _this.fields = fields;
  96440. _this.getters = getters;
  96441. _this.constructorMethod = constructorMethod;
  96442. _this.methods = methods;
  96443. return _this;
  96444. }
  96445. /**
  96446. * @param {?} stmt
  96447. * @return {?}
  96448. */
  96449. ClassStmt.prototype.isEquivalent = /**
  96450. * @param {?} stmt
  96451. * @return {?}
  96452. */
  96453. function (stmt) {
  96454. return stmt instanceof ClassStmt && this.name === stmt.name &&
  96455. nullSafeIsEquivalent(this.parent, stmt.parent) &&
  96456. areAllEquivalent(this.fields, stmt.fields) &&
  96457. areAllEquivalent(this.getters, stmt.getters) &&
  96458. this.constructorMethod.isEquivalent(stmt.constructorMethod) &&
  96459. areAllEquivalent(this.methods, stmt.methods);
  96460. };
  96461. /**
  96462. * @param {?} visitor
  96463. * @param {?} context
  96464. * @return {?}
  96465. */
  96466. ClassStmt.prototype.visitStatement = /**
  96467. * @param {?} visitor
  96468. * @param {?} context
  96469. * @return {?}
  96470. */
  96471. function (visitor, context) {
  96472. return visitor.visitDeclareClassStmt(this, context);
  96473. };
  96474. return ClassStmt;
  96475. }(Statement));
  96476. var IfStmt = /** @class */ (function (_super) {
  96477. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(IfStmt, _super);
  96478. function IfStmt(condition, trueCase, falseCase, sourceSpan) {
  96479. if (falseCase === void 0) { falseCase = []; }
  96480. var _this = _super.call(this, null, sourceSpan) || this;
  96481. _this.condition = condition;
  96482. _this.trueCase = trueCase;
  96483. _this.falseCase = falseCase;
  96484. return _this;
  96485. }
  96486. /**
  96487. * @param {?} stmt
  96488. * @return {?}
  96489. */
  96490. IfStmt.prototype.isEquivalent = /**
  96491. * @param {?} stmt
  96492. * @return {?}
  96493. */
  96494. function (stmt) {
  96495. return stmt instanceof IfStmt && this.condition.isEquivalent(stmt.condition) &&
  96496. areAllEquivalent(this.trueCase, stmt.trueCase) &&
  96497. areAllEquivalent(this.falseCase, stmt.falseCase);
  96498. };
  96499. /**
  96500. * @param {?} visitor
  96501. * @param {?} context
  96502. * @return {?}
  96503. */
  96504. IfStmt.prototype.visitStatement = /**
  96505. * @param {?} visitor
  96506. * @param {?} context
  96507. * @return {?}
  96508. */
  96509. function (visitor, context) {
  96510. return visitor.visitIfStmt(this, context);
  96511. };
  96512. return IfStmt;
  96513. }(Statement));
  96514. var CommentStmt = /** @class */ (function (_super) {
  96515. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(CommentStmt, _super);
  96516. function CommentStmt(comment, sourceSpan) {
  96517. var _this = _super.call(this, null, sourceSpan) || this;
  96518. _this.comment = comment;
  96519. return _this;
  96520. }
  96521. /**
  96522. * @param {?} stmt
  96523. * @return {?}
  96524. */
  96525. CommentStmt.prototype.isEquivalent = /**
  96526. * @param {?} stmt
  96527. * @return {?}
  96528. */
  96529. function (stmt) { return stmt instanceof CommentStmt; };
  96530. /**
  96531. * @param {?} visitor
  96532. * @param {?} context
  96533. * @return {?}
  96534. */
  96535. CommentStmt.prototype.visitStatement = /**
  96536. * @param {?} visitor
  96537. * @param {?} context
  96538. * @return {?}
  96539. */
  96540. function (visitor, context) {
  96541. return visitor.visitCommentStmt(this, context);
  96542. };
  96543. return CommentStmt;
  96544. }(Statement));
  96545. var TryCatchStmt = /** @class */ (function (_super) {
  96546. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(TryCatchStmt, _super);
  96547. function TryCatchStmt(bodyStmts, catchStmts, sourceSpan) {
  96548. var _this = _super.call(this, null, sourceSpan) || this;
  96549. _this.bodyStmts = bodyStmts;
  96550. _this.catchStmts = catchStmts;
  96551. return _this;
  96552. }
  96553. /**
  96554. * @param {?} stmt
  96555. * @return {?}
  96556. */
  96557. TryCatchStmt.prototype.isEquivalent = /**
  96558. * @param {?} stmt
  96559. * @return {?}
  96560. */
  96561. function (stmt) {
  96562. return stmt instanceof TryCatchStmt && areAllEquivalent(this.bodyStmts, stmt.bodyStmts) &&
  96563. areAllEquivalent(this.catchStmts, stmt.catchStmts);
  96564. };
  96565. /**
  96566. * @param {?} visitor
  96567. * @param {?} context
  96568. * @return {?}
  96569. */
  96570. TryCatchStmt.prototype.visitStatement = /**
  96571. * @param {?} visitor
  96572. * @param {?} context
  96573. * @return {?}
  96574. */
  96575. function (visitor, context) {
  96576. return visitor.visitTryCatchStmt(this, context);
  96577. };
  96578. return TryCatchStmt;
  96579. }(Statement));
  96580. var ThrowStmt = /** @class */ (function (_super) {
  96581. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(ThrowStmt, _super);
  96582. function ThrowStmt(error, sourceSpan) {
  96583. var _this = _super.call(this, null, sourceSpan) || this;
  96584. _this.error = error;
  96585. return _this;
  96586. }
  96587. /**
  96588. * @param {?} stmt
  96589. * @return {?}
  96590. */
  96591. ThrowStmt.prototype.isEquivalent = /**
  96592. * @param {?} stmt
  96593. * @return {?}
  96594. */
  96595. function (stmt) {
  96596. return stmt instanceof TryCatchStmt && this.error.isEquivalent(stmt.error);
  96597. };
  96598. /**
  96599. * @param {?} visitor
  96600. * @param {?} context
  96601. * @return {?}
  96602. */
  96603. ThrowStmt.prototype.visitStatement = /**
  96604. * @param {?} visitor
  96605. * @param {?} context
  96606. * @return {?}
  96607. */
  96608. function (visitor, context) {
  96609. return visitor.visitThrowStmt(this, context);
  96610. };
  96611. return ThrowStmt;
  96612. }(Statement));
  96613. /**
  96614. * @record
  96615. */
  96616. var AstTransformer$1 = /** @class */ (function () {
  96617. function AstTransformer() {
  96618. }
  96619. /**
  96620. * @param {?} expr
  96621. * @param {?} context
  96622. * @return {?}
  96623. */
  96624. AstTransformer.prototype.transformExpr = /**
  96625. * @param {?} expr
  96626. * @param {?} context
  96627. * @return {?}
  96628. */
  96629. function (expr, context) { return expr; };
  96630. /**
  96631. * @param {?} stmt
  96632. * @param {?} context
  96633. * @return {?}
  96634. */
  96635. AstTransformer.prototype.transformStmt = /**
  96636. * @param {?} stmt
  96637. * @param {?} context
  96638. * @return {?}
  96639. */
  96640. function (stmt, context) { return stmt; };
  96641. /**
  96642. * @param {?} ast
  96643. * @param {?} context
  96644. * @return {?}
  96645. */
  96646. AstTransformer.prototype.visitReadVarExpr = /**
  96647. * @param {?} ast
  96648. * @param {?} context
  96649. * @return {?}
  96650. */
  96651. function (ast, context) { return this.transformExpr(ast, context); };
  96652. /**
  96653. * @param {?} expr
  96654. * @param {?} context
  96655. * @return {?}
  96656. */
  96657. AstTransformer.prototype.visitWriteVarExpr = /**
  96658. * @param {?} expr
  96659. * @param {?} context
  96660. * @return {?}
  96661. */
  96662. function (expr, context) {
  96663. return this.transformExpr(new WriteVarExpr(expr.name, expr.value.visitExpression(this, context), expr.type, expr.sourceSpan), context);
  96664. };
  96665. /**
  96666. * @param {?} expr
  96667. * @param {?} context
  96668. * @return {?}
  96669. */
  96670. AstTransformer.prototype.visitWriteKeyExpr = /**
  96671. * @param {?} expr
  96672. * @param {?} context
  96673. * @return {?}
  96674. */
  96675. function (expr, context) {
  96676. return this.transformExpr(new WriteKeyExpr(expr.receiver.visitExpression(this, context), expr.index.visitExpression(this, context), expr.value.visitExpression(this, context), expr.type, expr.sourceSpan), context);
  96677. };
  96678. /**
  96679. * @param {?} expr
  96680. * @param {?} context
  96681. * @return {?}
  96682. */
  96683. AstTransformer.prototype.visitWritePropExpr = /**
  96684. * @param {?} expr
  96685. * @param {?} context
  96686. * @return {?}
  96687. */
  96688. function (expr, context) {
  96689. return this.transformExpr(new WritePropExpr(expr.receiver.visitExpression(this, context), expr.name, expr.value.visitExpression(this, context), expr.type, expr.sourceSpan), context);
  96690. };
  96691. /**
  96692. * @param {?} ast
  96693. * @param {?} context
  96694. * @return {?}
  96695. */
  96696. AstTransformer.prototype.visitInvokeMethodExpr = /**
  96697. * @param {?} ast
  96698. * @param {?} context
  96699. * @return {?}
  96700. */
  96701. function (ast, context) {
  96702. var /** @type {?} */ method = ast.builtin || ast.name;
  96703. return this.transformExpr(new InvokeMethodExpr(ast.receiver.visitExpression(this, context), /** @type {?} */ ((method)), this.visitAllExpressions(ast.args, context), ast.type, ast.sourceSpan), context);
  96704. };
  96705. /**
  96706. * @param {?} ast
  96707. * @param {?} context
  96708. * @return {?}
  96709. */
  96710. AstTransformer.prototype.visitInvokeFunctionExpr = /**
  96711. * @param {?} ast
  96712. * @param {?} context
  96713. * @return {?}
  96714. */
  96715. function (ast, context) {
  96716. return this.transformExpr(new InvokeFunctionExpr(ast.fn.visitExpression(this, context), this.visitAllExpressions(ast.args, context), ast.type, ast.sourceSpan), context);
  96717. };
  96718. /**
  96719. * @param {?} ast
  96720. * @param {?} context
  96721. * @return {?}
  96722. */
  96723. AstTransformer.prototype.visitInstantiateExpr = /**
  96724. * @param {?} ast
  96725. * @param {?} context
  96726. * @return {?}
  96727. */
  96728. function (ast, context) {
  96729. return this.transformExpr(new InstantiateExpr(ast.classExpr.visitExpression(this, context), this.visitAllExpressions(ast.args, context), ast.type, ast.sourceSpan), context);
  96730. };
  96731. /**
  96732. * @param {?} ast
  96733. * @param {?} context
  96734. * @return {?}
  96735. */
  96736. AstTransformer.prototype.visitLiteralExpr = /**
  96737. * @param {?} ast
  96738. * @param {?} context
  96739. * @return {?}
  96740. */
  96741. function (ast, context) { return this.transformExpr(ast, context); };
  96742. /**
  96743. * @param {?} ast
  96744. * @param {?} context
  96745. * @return {?}
  96746. */
  96747. AstTransformer.prototype.visitExternalExpr = /**
  96748. * @param {?} ast
  96749. * @param {?} context
  96750. * @return {?}
  96751. */
  96752. function (ast, context) {
  96753. return this.transformExpr(ast, context);
  96754. };
  96755. /**
  96756. * @param {?} ast
  96757. * @param {?} context
  96758. * @return {?}
  96759. */
  96760. AstTransformer.prototype.visitConditionalExpr = /**
  96761. * @param {?} ast
  96762. * @param {?} context
  96763. * @return {?}
  96764. */
  96765. function (ast, context) {
  96766. return this.transformExpr(new ConditionalExpr(ast.condition.visitExpression(this, context), ast.trueCase.visitExpression(this, context), /** @type {?} */ ((ast.falseCase)).visitExpression(this, context), ast.type, ast.sourceSpan), context);
  96767. };
  96768. /**
  96769. * @param {?} ast
  96770. * @param {?} context
  96771. * @return {?}
  96772. */
  96773. AstTransformer.prototype.visitNotExpr = /**
  96774. * @param {?} ast
  96775. * @param {?} context
  96776. * @return {?}
  96777. */
  96778. function (ast, context) {
  96779. return this.transformExpr(new NotExpr(ast.condition.visitExpression(this, context), ast.sourceSpan), context);
  96780. };
  96781. /**
  96782. * @param {?} ast
  96783. * @param {?} context
  96784. * @return {?}
  96785. */
  96786. AstTransformer.prototype.visitAssertNotNullExpr = /**
  96787. * @param {?} ast
  96788. * @param {?} context
  96789. * @return {?}
  96790. */
  96791. function (ast, context) {
  96792. return this.transformExpr(new AssertNotNull(ast.condition.visitExpression(this, context), ast.sourceSpan), context);
  96793. };
  96794. /**
  96795. * @param {?} ast
  96796. * @param {?} context
  96797. * @return {?}
  96798. */
  96799. AstTransformer.prototype.visitCastExpr = /**
  96800. * @param {?} ast
  96801. * @param {?} context
  96802. * @return {?}
  96803. */
  96804. function (ast, context) {
  96805. return this.transformExpr(new CastExpr(ast.value.visitExpression(this, context), ast.type, ast.sourceSpan), context);
  96806. };
  96807. /**
  96808. * @param {?} ast
  96809. * @param {?} context
  96810. * @return {?}
  96811. */
  96812. AstTransformer.prototype.visitFunctionExpr = /**
  96813. * @param {?} ast
  96814. * @param {?} context
  96815. * @return {?}
  96816. */
  96817. function (ast, context) {
  96818. return this.transformExpr(new FunctionExpr(ast.params, this.visitAllStatements(ast.statements, context), ast.type, ast.sourceSpan), context);
  96819. };
  96820. /**
  96821. * @param {?} ast
  96822. * @param {?} context
  96823. * @return {?}
  96824. */
  96825. AstTransformer.prototype.visitBinaryOperatorExpr = /**
  96826. * @param {?} ast
  96827. * @param {?} context
  96828. * @return {?}
  96829. */
  96830. function (ast, context) {
  96831. return this.transformExpr(new BinaryOperatorExpr(ast.operator, ast.lhs.visitExpression(this, context), ast.rhs.visitExpression(this, context), ast.type, ast.sourceSpan), context);
  96832. };
  96833. /**
  96834. * @param {?} ast
  96835. * @param {?} context
  96836. * @return {?}
  96837. */
  96838. AstTransformer.prototype.visitReadPropExpr = /**
  96839. * @param {?} ast
  96840. * @param {?} context
  96841. * @return {?}
  96842. */
  96843. function (ast, context) {
  96844. return this.transformExpr(new ReadPropExpr(ast.receiver.visitExpression(this, context), ast.name, ast.type, ast.sourceSpan), context);
  96845. };
  96846. /**
  96847. * @param {?} ast
  96848. * @param {?} context
  96849. * @return {?}
  96850. */
  96851. AstTransformer.prototype.visitReadKeyExpr = /**
  96852. * @param {?} ast
  96853. * @param {?} context
  96854. * @return {?}
  96855. */
  96856. function (ast, context) {
  96857. return this.transformExpr(new ReadKeyExpr(ast.receiver.visitExpression(this, context), ast.index.visitExpression(this, context), ast.type, ast.sourceSpan), context);
  96858. };
  96859. /**
  96860. * @param {?} ast
  96861. * @param {?} context
  96862. * @return {?}
  96863. */
  96864. AstTransformer.prototype.visitLiteralArrayExpr = /**
  96865. * @param {?} ast
  96866. * @param {?} context
  96867. * @return {?}
  96868. */
  96869. function (ast, context) {
  96870. return this.transformExpr(new LiteralArrayExpr(this.visitAllExpressions(ast.entries, context), ast.type, ast.sourceSpan), context);
  96871. };
  96872. /**
  96873. * @param {?} ast
  96874. * @param {?} context
  96875. * @return {?}
  96876. */
  96877. AstTransformer.prototype.visitLiteralMapExpr = /**
  96878. * @param {?} ast
  96879. * @param {?} context
  96880. * @return {?}
  96881. */
  96882. function (ast, context) {
  96883. var _this = this;
  96884. var /** @type {?} */ entries = ast.entries.map(function (entry) {
  96885. return new LiteralMapEntry(entry.key, entry.value.visitExpression(_this, context), entry.quoted);
  96886. });
  96887. var /** @type {?} */ mapType = new MapType(ast.valueType, null);
  96888. return this.transformExpr(new LiteralMapExpr(entries, mapType, ast.sourceSpan), context);
  96889. };
  96890. /**
  96891. * @param {?} ast
  96892. * @param {?} context
  96893. * @return {?}
  96894. */
  96895. AstTransformer.prototype.visitCommaExpr = /**
  96896. * @param {?} ast
  96897. * @param {?} context
  96898. * @return {?}
  96899. */
  96900. function (ast, context) {
  96901. return this.transformExpr(new CommaExpr(this.visitAllExpressions(ast.parts, context), ast.sourceSpan), context);
  96902. };
  96903. /**
  96904. * @param {?} exprs
  96905. * @param {?} context
  96906. * @return {?}
  96907. */
  96908. AstTransformer.prototype.visitAllExpressions = /**
  96909. * @param {?} exprs
  96910. * @param {?} context
  96911. * @return {?}
  96912. */
  96913. function (exprs, context) {
  96914. var _this = this;
  96915. return exprs.map(function (expr) { return expr.visitExpression(_this, context); });
  96916. };
  96917. /**
  96918. * @param {?} stmt
  96919. * @param {?} context
  96920. * @return {?}
  96921. */
  96922. AstTransformer.prototype.visitDeclareVarStmt = /**
  96923. * @param {?} stmt
  96924. * @param {?} context
  96925. * @return {?}
  96926. */
  96927. function (stmt, context) {
  96928. return this.transformStmt(new DeclareVarStmt(stmt.name, stmt.value.visitExpression(this, context), stmt.type, stmt.modifiers, stmt.sourceSpan), context);
  96929. };
  96930. /**
  96931. * @param {?} stmt
  96932. * @param {?} context
  96933. * @return {?}
  96934. */
  96935. AstTransformer.prototype.visitDeclareFunctionStmt = /**
  96936. * @param {?} stmt
  96937. * @param {?} context
  96938. * @return {?}
  96939. */
  96940. function (stmt, context) {
  96941. return this.transformStmt(new DeclareFunctionStmt(stmt.name, stmt.params, this.visitAllStatements(stmt.statements, context), stmt.type, stmt.modifiers, stmt.sourceSpan), context);
  96942. };
  96943. /**
  96944. * @param {?} stmt
  96945. * @param {?} context
  96946. * @return {?}
  96947. */
  96948. AstTransformer.prototype.visitExpressionStmt = /**
  96949. * @param {?} stmt
  96950. * @param {?} context
  96951. * @return {?}
  96952. */
  96953. function (stmt, context) {
  96954. return this.transformStmt(new ExpressionStatement(stmt.expr.visitExpression(this, context), stmt.sourceSpan), context);
  96955. };
  96956. /**
  96957. * @param {?} stmt
  96958. * @param {?} context
  96959. * @return {?}
  96960. */
  96961. AstTransformer.prototype.visitReturnStmt = /**
  96962. * @param {?} stmt
  96963. * @param {?} context
  96964. * @return {?}
  96965. */
  96966. function (stmt, context) {
  96967. return this.transformStmt(new ReturnStatement(stmt.value.visitExpression(this, context), stmt.sourceSpan), context);
  96968. };
  96969. /**
  96970. * @param {?} stmt
  96971. * @param {?} context
  96972. * @return {?}
  96973. */
  96974. AstTransformer.prototype.visitDeclareClassStmt = /**
  96975. * @param {?} stmt
  96976. * @param {?} context
  96977. * @return {?}
  96978. */
  96979. function (stmt, context) {
  96980. var _this = this;
  96981. var /** @type {?} */ parent = /** @type {?} */ ((stmt.parent)).visitExpression(this, context);
  96982. var /** @type {?} */ getters = stmt.getters.map(function (getter) {
  96983. return new ClassGetter(getter.name, _this.visitAllStatements(getter.body, context), getter.type, getter.modifiers);
  96984. });
  96985. var /** @type {?} */ ctorMethod = stmt.constructorMethod &&
  96986. new ClassMethod(stmt.constructorMethod.name, stmt.constructorMethod.params, this.visitAllStatements(stmt.constructorMethod.body, context), stmt.constructorMethod.type, stmt.constructorMethod.modifiers);
  96987. var /** @type {?} */ methods = stmt.methods.map(function (method) {
  96988. return new ClassMethod(method.name, method.params, _this.visitAllStatements(method.body, context), method.type, method.modifiers);
  96989. });
  96990. return this.transformStmt(new ClassStmt(stmt.name, parent, stmt.fields, getters, ctorMethod, methods, stmt.modifiers, stmt.sourceSpan), context);
  96991. };
  96992. /**
  96993. * @param {?} stmt
  96994. * @param {?} context
  96995. * @return {?}
  96996. */
  96997. AstTransformer.prototype.visitIfStmt = /**
  96998. * @param {?} stmt
  96999. * @param {?} context
  97000. * @return {?}
  97001. */
  97002. function (stmt, context) {
  97003. return this.transformStmt(new IfStmt(stmt.condition.visitExpression(this, context), this.visitAllStatements(stmt.trueCase, context), this.visitAllStatements(stmt.falseCase, context), stmt.sourceSpan), context);
  97004. };
  97005. /**
  97006. * @param {?} stmt
  97007. * @param {?} context
  97008. * @return {?}
  97009. */
  97010. AstTransformer.prototype.visitTryCatchStmt = /**
  97011. * @param {?} stmt
  97012. * @param {?} context
  97013. * @return {?}
  97014. */
  97015. function (stmt, context) {
  97016. return this.transformStmt(new TryCatchStmt(this.visitAllStatements(stmt.bodyStmts, context), this.visitAllStatements(stmt.catchStmts, context), stmt.sourceSpan), context);
  97017. };
  97018. /**
  97019. * @param {?} stmt
  97020. * @param {?} context
  97021. * @return {?}
  97022. */
  97023. AstTransformer.prototype.visitThrowStmt = /**
  97024. * @param {?} stmt
  97025. * @param {?} context
  97026. * @return {?}
  97027. */
  97028. function (stmt, context) {
  97029. return this.transformStmt(new ThrowStmt(stmt.error.visitExpression(this, context), stmt.sourceSpan), context);
  97030. };
  97031. /**
  97032. * @param {?} stmt
  97033. * @param {?} context
  97034. * @return {?}
  97035. */
  97036. AstTransformer.prototype.visitCommentStmt = /**
  97037. * @param {?} stmt
  97038. * @param {?} context
  97039. * @return {?}
  97040. */
  97041. function (stmt, context) {
  97042. return this.transformStmt(stmt, context);
  97043. };
  97044. /**
  97045. * @param {?} stmts
  97046. * @param {?} context
  97047. * @return {?}
  97048. */
  97049. AstTransformer.prototype.visitAllStatements = /**
  97050. * @param {?} stmts
  97051. * @param {?} context
  97052. * @return {?}
  97053. */
  97054. function (stmts, context) {
  97055. var _this = this;
  97056. return stmts.map(function (stmt) { return stmt.visitStatement(_this, context); });
  97057. };
  97058. return AstTransformer;
  97059. }());
  97060. var RecursiveAstVisitor$1 = /** @class */ (function () {
  97061. function RecursiveAstVisitor() {
  97062. }
  97063. /**
  97064. * @param {?} ast
  97065. * @param {?} context
  97066. * @return {?}
  97067. */
  97068. RecursiveAstVisitor.prototype.visitType = /**
  97069. * @param {?} ast
  97070. * @param {?} context
  97071. * @return {?}
  97072. */
  97073. function (ast, context) { return ast; };
  97074. /**
  97075. * @param {?} ast
  97076. * @param {?} context
  97077. * @return {?}
  97078. */
  97079. RecursiveAstVisitor.prototype.visitExpression = /**
  97080. * @param {?} ast
  97081. * @param {?} context
  97082. * @return {?}
  97083. */
  97084. function (ast, context) {
  97085. if (ast.type) {
  97086. ast.type.visitType(this, context);
  97087. }
  97088. return ast;
  97089. };
  97090. /**
  97091. * @param {?} type
  97092. * @param {?} context
  97093. * @return {?}
  97094. */
  97095. RecursiveAstVisitor.prototype.visitBuiltintType = /**
  97096. * @param {?} type
  97097. * @param {?} context
  97098. * @return {?}
  97099. */
  97100. function (type, context) { return this.visitType(type, context); };
  97101. /**
  97102. * @param {?} type
  97103. * @param {?} context
  97104. * @return {?}
  97105. */
  97106. RecursiveAstVisitor.prototype.visitExpressionType = /**
  97107. * @param {?} type
  97108. * @param {?} context
  97109. * @return {?}
  97110. */
  97111. function (type, context) {
  97112. type.value.visitExpression(this, context);
  97113. return this.visitType(type, context);
  97114. };
  97115. /**
  97116. * @param {?} type
  97117. * @param {?} context
  97118. * @return {?}
  97119. */
  97120. RecursiveAstVisitor.prototype.visitArrayType = /**
  97121. * @param {?} type
  97122. * @param {?} context
  97123. * @return {?}
  97124. */
  97125. function (type, context) { return this.visitType(type, context); };
  97126. /**
  97127. * @param {?} type
  97128. * @param {?} context
  97129. * @return {?}
  97130. */
  97131. RecursiveAstVisitor.prototype.visitMapType = /**
  97132. * @param {?} type
  97133. * @param {?} context
  97134. * @return {?}
  97135. */
  97136. function (type, context) { return this.visitType(type, context); };
  97137. /**
  97138. * @param {?} ast
  97139. * @param {?} context
  97140. * @return {?}
  97141. */
  97142. RecursiveAstVisitor.prototype.visitReadVarExpr = /**
  97143. * @param {?} ast
  97144. * @param {?} context
  97145. * @return {?}
  97146. */
  97147. function (ast, context) {
  97148. return this.visitExpression(ast, context);
  97149. };
  97150. /**
  97151. * @param {?} ast
  97152. * @param {?} context
  97153. * @return {?}
  97154. */
  97155. RecursiveAstVisitor.prototype.visitWriteVarExpr = /**
  97156. * @param {?} ast
  97157. * @param {?} context
  97158. * @return {?}
  97159. */
  97160. function (ast, context) {
  97161. ast.value.visitExpression(this, context);
  97162. return this.visitExpression(ast, context);
  97163. };
  97164. /**
  97165. * @param {?} ast
  97166. * @param {?} context
  97167. * @return {?}
  97168. */
  97169. RecursiveAstVisitor.prototype.visitWriteKeyExpr = /**
  97170. * @param {?} ast
  97171. * @param {?} context
  97172. * @return {?}
  97173. */
  97174. function (ast, context) {
  97175. ast.receiver.visitExpression(this, context);
  97176. ast.index.visitExpression(this, context);
  97177. ast.value.visitExpression(this, context);
  97178. return this.visitExpression(ast, context);
  97179. };
  97180. /**
  97181. * @param {?} ast
  97182. * @param {?} context
  97183. * @return {?}
  97184. */
  97185. RecursiveAstVisitor.prototype.visitWritePropExpr = /**
  97186. * @param {?} ast
  97187. * @param {?} context
  97188. * @return {?}
  97189. */
  97190. function (ast, context) {
  97191. ast.receiver.visitExpression(this, context);
  97192. ast.value.visitExpression(this, context);
  97193. return this.visitExpression(ast, context);
  97194. };
  97195. /**
  97196. * @param {?} ast
  97197. * @param {?} context
  97198. * @return {?}
  97199. */
  97200. RecursiveAstVisitor.prototype.visitInvokeMethodExpr = /**
  97201. * @param {?} ast
  97202. * @param {?} context
  97203. * @return {?}
  97204. */
  97205. function (ast, context) {
  97206. ast.receiver.visitExpression(this, context);
  97207. this.visitAllExpressions(ast.args, context);
  97208. return this.visitExpression(ast, context);
  97209. };
  97210. /**
  97211. * @param {?} ast
  97212. * @param {?} context
  97213. * @return {?}
  97214. */
  97215. RecursiveAstVisitor.prototype.visitInvokeFunctionExpr = /**
  97216. * @param {?} ast
  97217. * @param {?} context
  97218. * @return {?}
  97219. */
  97220. function (ast, context) {
  97221. ast.fn.visitExpression(this, context);
  97222. this.visitAllExpressions(ast.args, context);
  97223. return this.visitExpression(ast, context);
  97224. };
  97225. /**
  97226. * @param {?} ast
  97227. * @param {?} context
  97228. * @return {?}
  97229. */
  97230. RecursiveAstVisitor.prototype.visitInstantiateExpr = /**
  97231. * @param {?} ast
  97232. * @param {?} context
  97233. * @return {?}
  97234. */
  97235. function (ast, context) {
  97236. ast.classExpr.visitExpression(this, context);
  97237. this.visitAllExpressions(ast.args, context);
  97238. return this.visitExpression(ast, context);
  97239. };
  97240. /**
  97241. * @param {?} ast
  97242. * @param {?} context
  97243. * @return {?}
  97244. */
  97245. RecursiveAstVisitor.prototype.visitLiteralExpr = /**
  97246. * @param {?} ast
  97247. * @param {?} context
  97248. * @return {?}
  97249. */
  97250. function (ast, context) {
  97251. return this.visitExpression(ast, context);
  97252. };
  97253. /**
  97254. * @param {?} ast
  97255. * @param {?} context
  97256. * @return {?}
  97257. */
  97258. RecursiveAstVisitor.prototype.visitExternalExpr = /**
  97259. * @param {?} ast
  97260. * @param {?} context
  97261. * @return {?}
  97262. */
  97263. function (ast, context) {
  97264. var _this = this;
  97265. if (ast.typeParams) {
  97266. ast.typeParams.forEach(function (type) { return type.visitType(_this, context); });
  97267. }
  97268. return this.visitExpression(ast, context);
  97269. };
  97270. /**
  97271. * @param {?} ast
  97272. * @param {?} context
  97273. * @return {?}
  97274. */
  97275. RecursiveAstVisitor.prototype.visitConditionalExpr = /**
  97276. * @param {?} ast
  97277. * @param {?} context
  97278. * @return {?}
  97279. */
  97280. function (ast, context) {
  97281. ast.condition.visitExpression(this, context);
  97282. ast.trueCase.visitExpression(this, context); /** @type {?} */
  97283. ((ast.falseCase)).visitExpression(this, context);
  97284. return this.visitExpression(ast, context);
  97285. };
  97286. /**
  97287. * @param {?} ast
  97288. * @param {?} context
  97289. * @return {?}
  97290. */
  97291. RecursiveAstVisitor.prototype.visitNotExpr = /**
  97292. * @param {?} ast
  97293. * @param {?} context
  97294. * @return {?}
  97295. */
  97296. function (ast, context) {
  97297. ast.condition.visitExpression(this, context);
  97298. return this.visitExpression(ast, context);
  97299. };
  97300. /**
  97301. * @param {?} ast
  97302. * @param {?} context
  97303. * @return {?}
  97304. */
  97305. RecursiveAstVisitor.prototype.visitAssertNotNullExpr = /**
  97306. * @param {?} ast
  97307. * @param {?} context
  97308. * @return {?}
  97309. */
  97310. function (ast, context) {
  97311. ast.condition.visitExpression(this, context);
  97312. return this.visitExpression(ast, context);
  97313. };
  97314. /**
  97315. * @param {?} ast
  97316. * @param {?} context
  97317. * @return {?}
  97318. */
  97319. RecursiveAstVisitor.prototype.visitCastExpr = /**
  97320. * @param {?} ast
  97321. * @param {?} context
  97322. * @return {?}
  97323. */
  97324. function (ast, context) {
  97325. ast.value.visitExpression(this, context);
  97326. return this.visitExpression(ast, context);
  97327. };
  97328. /**
  97329. * @param {?} ast
  97330. * @param {?} context
  97331. * @return {?}
  97332. */
  97333. RecursiveAstVisitor.prototype.visitFunctionExpr = /**
  97334. * @param {?} ast
  97335. * @param {?} context
  97336. * @return {?}
  97337. */
  97338. function (ast, context) {
  97339. this.visitAllStatements(ast.statements, context);
  97340. return this.visitExpression(ast, context);
  97341. };
  97342. /**
  97343. * @param {?} ast
  97344. * @param {?} context
  97345. * @return {?}
  97346. */
  97347. RecursiveAstVisitor.prototype.visitBinaryOperatorExpr = /**
  97348. * @param {?} ast
  97349. * @param {?} context
  97350. * @return {?}
  97351. */
  97352. function (ast, context) {
  97353. ast.lhs.visitExpression(this, context);
  97354. ast.rhs.visitExpression(this, context);
  97355. return this.visitExpression(ast, context);
  97356. };
  97357. /**
  97358. * @param {?} ast
  97359. * @param {?} context
  97360. * @return {?}
  97361. */
  97362. RecursiveAstVisitor.prototype.visitReadPropExpr = /**
  97363. * @param {?} ast
  97364. * @param {?} context
  97365. * @return {?}
  97366. */
  97367. function (ast, context) {
  97368. ast.receiver.visitExpression(this, context);
  97369. return this.visitExpression(ast, context);
  97370. };
  97371. /**
  97372. * @param {?} ast
  97373. * @param {?} context
  97374. * @return {?}
  97375. */
  97376. RecursiveAstVisitor.prototype.visitReadKeyExpr = /**
  97377. * @param {?} ast
  97378. * @param {?} context
  97379. * @return {?}
  97380. */
  97381. function (ast, context) {
  97382. ast.receiver.visitExpression(this, context);
  97383. ast.index.visitExpression(this, context);
  97384. return this.visitExpression(ast, context);
  97385. };
  97386. /**
  97387. * @param {?} ast
  97388. * @param {?} context
  97389. * @return {?}
  97390. */
  97391. RecursiveAstVisitor.prototype.visitLiteralArrayExpr = /**
  97392. * @param {?} ast
  97393. * @param {?} context
  97394. * @return {?}
  97395. */
  97396. function (ast, context) {
  97397. this.visitAllExpressions(ast.entries, context);
  97398. return this.visitExpression(ast, context);
  97399. };
  97400. /**
  97401. * @param {?} ast
  97402. * @param {?} context
  97403. * @return {?}
  97404. */
  97405. RecursiveAstVisitor.prototype.visitLiteralMapExpr = /**
  97406. * @param {?} ast
  97407. * @param {?} context
  97408. * @return {?}
  97409. */
  97410. function (ast, context) {
  97411. var _this = this;
  97412. ast.entries.forEach(function (entry) { return entry.value.visitExpression(_this, context); });
  97413. return this.visitExpression(ast, context);
  97414. };
  97415. /**
  97416. * @param {?} ast
  97417. * @param {?} context
  97418. * @return {?}
  97419. */
  97420. RecursiveAstVisitor.prototype.visitCommaExpr = /**
  97421. * @param {?} ast
  97422. * @param {?} context
  97423. * @return {?}
  97424. */
  97425. function (ast, context) {
  97426. this.visitAllExpressions(ast.parts, context);
  97427. return this.visitExpression(ast, context);
  97428. };
  97429. /**
  97430. * @param {?} exprs
  97431. * @param {?} context
  97432. * @return {?}
  97433. */
  97434. RecursiveAstVisitor.prototype.visitAllExpressions = /**
  97435. * @param {?} exprs
  97436. * @param {?} context
  97437. * @return {?}
  97438. */
  97439. function (exprs, context) {
  97440. var _this = this;
  97441. exprs.forEach(function (expr) { return expr.visitExpression(_this, context); });
  97442. };
  97443. /**
  97444. * @param {?} stmt
  97445. * @param {?} context
  97446. * @return {?}
  97447. */
  97448. RecursiveAstVisitor.prototype.visitDeclareVarStmt = /**
  97449. * @param {?} stmt
  97450. * @param {?} context
  97451. * @return {?}
  97452. */
  97453. function (stmt, context) {
  97454. stmt.value.visitExpression(this, context);
  97455. if (stmt.type) {
  97456. stmt.type.visitType(this, context);
  97457. }
  97458. return stmt;
  97459. };
  97460. /**
  97461. * @param {?} stmt
  97462. * @param {?} context
  97463. * @return {?}
  97464. */
  97465. RecursiveAstVisitor.prototype.visitDeclareFunctionStmt = /**
  97466. * @param {?} stmt
  97467. * @param {?} context
  97468. * @return {?}
  97469. */
  97470. function (stmt, context) {
  97471. this.visitAllStatements(stmt.statements, context);
  97472. if (stmt.type) {
  97473. stmt.type.visitType(this, context);
  97474. }
  97475. return stmt;
  97476. };
  97477. /**
  97478. * @param {?} stmt
  97479. * @param {?} context
  97480. * @return {?}
  97481. */
  97482. RecursiveAstVisitor.prototype.visitExpressionStmt = /**
  97483. * @param {?} stmt
  97484. * @param {?} context
  97485. * @return {?}
  97486. */
  97487. function (stmt, context) {
  97488. stmt.expr.visitExpression(this, context);
  97489. return stmt;
  97490. };
  97491. /**
  97492. * @param {?} stmt
  97493. * @param {?} context
  97494. * @return {?}
  97495. */
  97496. RecursiveAstVisitor.prototype.visitReturnStmt = /**
  97497. * @param {?} stmt
  97498. * @param {?} context
  97499. * @return {?}
  97500. */
  97501. function (stmt, context) {
  97502. stmt.value.visitExpression(this, context);
  97503. return stmt;
  97504. };
  97505. /**
  97506. * @param {?} stmt
  97507. * @param {?} context
  97508. * @return {?}
  97509. */
  97510. RecursiveAstVisitor.prototype.visitDeclareClassStmt = /**
  97511. * @param {?} stmt
  97512. * @param {?} context
  97513. * @return {?}
  97514. */
  97515. function (stmt, context) {
  97516. var _this = this;
  97517. /** @type {?} */ ((stmt.parent)).visitExpression(this, context);
  97518. stmt.getters.forEach(function (getter) { return _this.visitAllStatements(getter.body, context); });
  97519. if (stmt.constructorMethod) {
  97520. this.visitAllStatements(stmt.constructorMethod.body, context);
  97521. }
  97522. stmt.methods.forEach(function (method) { return _this.visitAllStatements(method.body, context); });
  97523. return stmt;
  97524. };
  97525. /**
  97526. * @param {?} stmt
  97527. * @param {?} context
  97528. * @return {?}
  97529. */
  97530. RecursiveAstVisitor.prototype.visitIfStmt = /**
  97531. * @param {?} stmt
  97532. * @param {?} context
  97533. * @return {?}
  97534. */
  97535. function (stmt, context) {
  97536. stmt.condition.visitExpression(this, context);
  97537. this.visitAllStatements(stmt.trueCase, context);
  97538. this.visitAllStatements(stmt.falseCase, context);
  97539. return stmt;
  97540. };
  97541. /**
  97542. * @param {?} stmt
  97543. * @param {?} context
  97544. * @return {?}
  97545. */
  97546. RecursiveAstVisitor.prototype.visitTryCatchStmt = /**
  97547. * @param {?} stmt
  97548. * @param {?} context
  97549. * @return {?}
  97550. */
  97551. function (stmt, context) {
  97552. this.visitAllStatements(stmt.bodyStmts, context);
  97553. this.visitAllStatements(stmt.catchStmts, context);
  97554. return stmt;
  97555. };
  97556. /**
  97557. * @param {?} stmt
  97558. * @param {?} context
  97559. * @return {?}
  97560. */
  97561. RecursiveAstVisitor.prototype.visitThrowStmt = /**
  97562. * @param {?} stmt
  97563. * @param {?} context
  97564. * @return {?}
  97565. */
  97566. function (stmt, context) {
  97567. stmt.error.visitExpression(this, context);
  97568. return stmt;
  97569. };
  97570. /**
  97571. * @param {?} stmt
  97572. * @param {?} context
  97573. * @return {?}
  97574. */
  97575. RecursiveAstVisitor.prototype.visitCommentStmt = /**
  97576. * @param {?} stmt
  97577. * @param {?} context
  97578. * @return {?}
  97579. */
  97580. function (stmt, context) { return stmt; };
  97581. /**
  97582. * @param {?} stmts
  97583. * @param {?} context
  97584. * @return {?}
  97585. */
  97586. RecursiveAstVisitor.prototype.visitAllStatements = /**
  97587. * @param {?} stmts
  97588. * @param {?} context
  97589. * @return {?}
  97590. */
  97591. function (stmts, context) {
  97592. var _this = this;
  97593. stmts.forEach(function (stmt) { return stmt.visitStatement(_this, context); });
  97594. };
  97595. return RecursiveAstVisitor;
  97596. }());
  97597. /**
  97598. * @param {?} stmts
  97599. * @return {?}
  97600. */
  97601. function findReadVarNames(stmts) {
  97602. var /** @type {?} */ visitor = new _ReadVarVisitor();
  97603. visitor.visitAllStatements(stmts, null);
  97604. return visitor.varNames;
  97605. }
  97606. var _ReadVarVisitor = /** @class */ (function (_super) {
  97607. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(_ReadVarVisitor, _super);
  97608. function _ReadVarVisitor() {
  97609. var _this = _super !== null && _super.apply(this, arguments) || this;
  97610. _this.varNames = new Set();
  97611. return _this;
  97612. }
  97613. /**
  97614. * @param {?} stmt
  97615. * @param {?} context
  97616. * @return {?}
  97617. */
  97618. _ReadVarVisitor.prototype.visitDeclareFunctionStmt = /**
  97619. * @param {?} stmt
  97620. * @param {?} context
  97621. * @return {?}
  97622. */
  97623. function (stmt, context) {
  97624. // Don't descend into nested functions
  97625. return stmt;
  97626. };
  97627. /**
  97628. * @param {?} stmt
  97629. * @param {?} context
  97630. * @return {?}
  97631. */
  97632. _ReadVarVisitor.prototype.visitDeclareClassStmt = /**
  97633. * @param {?} stmt
  97634. * @param {?} context
  97635. * @return {?}
  97636. */
  97637. function (stmt, context) {
  97638. // Don't descend into nested classes
  97639. return stmt;
  97640. };
  97641. /**
  97642. * @param {?} ast
  97643. * @param {?} context
  97644. * @return {?}
  97645. */
  97646. _ReadVarVisitor.prototype.visitReadVarExpr = /**
  97647. * @param {?} ast
  97648. * @param {?} context
  97649. * @return {?}
  97650. */
  97651. function (ast, context) {
  97652. if (ast.name) {
  97653. this.varNames.add(ast.name);
  97654. }
  97655. return null;
  97656. };
  97657. return _ReadVarVisitor;
  97658. }(RecursiveAstVisitor$1));
  97659. /**
  97660. * @param {?} stmts
  97661. * @return {?}
  97662. */
  97663. function collectExternalReferences(stmts) {
  97664. var /** @type {?} */ visitor = new _FindExternalReferencesVisitor();
  97665. visitor.visitAllStatements(stmts, null);
  97666. return visitor.externalReferences;
  97667. }
  97668. var _FindExternalReferencesVisitor = /** @class */ (function (_super) {
  97669. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(_FindExternalReferencesVisitor, _super);
  97670. function _FindExternalReferencesVisitor() {
  97671. var _this = _super !== null && _super.apply(this, arguments) || this;
  97672. _this.externalReferences = [];
  97673. return _this;
  97674. }
  97675. /**
  97676. * @param {?} e
  97677. * @param {?} context
  97678. * @return {?}
  97679. */
  97680. _FindExternalReferencesVisitor.prototype.visitExternalExpr = /**
  97681. * @param {?} e
  97682. * @param {?} context
  97683. * @return {?}
  97684. */
  97685. function (e, context) {
  97686. this.externalReferences.push(e.value);
  97687. return _super.prototype.visitExternalExpr.call(this, e, context);
  97688. };
  97689. return _FindExternalReferencesVisitor;
  97690. }(RecursiveAstVisitor$1));
  97691. /**
  97692. * @param {?} stmt
  97693. * @param {?} sourceSpan
  97694. * @return {?}
  97695. */
  97696. function applySourceSpanToStatementIfNeeded(stmt, sourceSpan) {
  97697. if (!sourceSpan) {
  97698. return stmt;
  97699. }
  97700. var /** @type {?} */ transformer = new _ApplySourceSpanTransformer(sourceSpan);
  97701. return stmt.visitStatement(transformer, null);
  97702. }
  97703. /**
  97704. * @param {?} expr
  97705. * @param {?} sourceSpan
  97706. * @return {?}
  97707. */
  97708. function applySourceSpanToExpressionIfNeeded(expr, sourceSpan) {
  97709. if (!sourceSpan) {
  97710. return expr;
  97711. }
  97712. var /** @type {?} */ transformer = new _ApplySourceSpanTransformer(sourceSpan);
  97713. return expr.visitExpression(transformer, null);
  97714. }
  97715. var _ApplySourceSpanTransformer = /** @class */ (function (_super) {
  97716. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(_ApplySourceSpanTransformer, _super);
  97717. function _ApplySourceSpanTransformer(sourceSpan) {
  97718. var _this = _super.call(this) || this;
  97719. _this.sourceSpan = sourceSpan;
  97720. return _this;
  97721. }
  97722. /**
  97723. * @param {?} obj
  97724. * @return {?}
  97725. */
  97726. _ApplySourceSpanTransformer.prototype._clone = /**
  97727. * @param {?} obj
  97728. * @return {?}
  97729. */
  97730. function (obj) {
  97731. var /** @type {?} */ clone = Object.create(obj.constructor.prototype);
  97732. for (var /** @type {?} */ prop in obj) {
  97733. clone[prop] = obj[prop];
  97734. }
  97735. return clone;
  97736. };
  97737. /**
  97738. * @param {?} expr
  97739. * @param {?} context
  97740. * @return {?}
  97741. */
  97742. _ApplySourceSpanTransformer.prototype.transformExpr = /**
  97743. * @param {?} expr
  97744. * @param {?} context
  97745. * @return {?}
  97746. */
  97747. function (expr, context) {
  97748. if (!expr.sourceSpan) {
  97749. expr = this._clone(expr);
  97750. expr.sourceSpan = this.sourceSpan;
  97751. }
  97752. return expr;
  97753. };
  97754. /**
  97755. * @param {?} stmt
  97756. * @param {?} context
  97757. * @return {?}
  97758. */
  97759. _ApplySourceSpanTransformer.prototype.transformStmt = /**
  97760. * @param {?} stmt
  97761. * @param {?} context
  97762. * @return {?}
  97763. */
  97764. function (stmt, context) {
  97765. if (!stmt.sourceSpan) {
  97766. stmt = this._clone(stmt);
  97767. stmt.sourceSpan = this.sourceSpan;
  97768. }
  97769. return stmt;
  97770. };
  97771. return _ApplySourceSpanTransformer;
  97772. }(AstTransformer$1));
  97773. /**
  97774. * @param {?} name
  97775. * @param {?=} type
  97776. * @param {?=} sourceSpan
  97777. * @return {?}
  97778. */
  97779. function variable(name, type, sourceSpan) {
  97780. return new ReadVarExpr(name, type, sourceSpan);
  97781. }
  97782. /**
  97783. * @param {?} id
  97784. * @param {?=} typeParams
  97785. * @param {?=} sourceSpan
  97786. * @return {?}
  97787. */
  97788. function importExpr(id, typeParams, sourceSpan) {
  97789. if (typeParams === void 0) { typeParams = null; }
  97790. return new ExternalExpr(id, null, typeParams, sourceSpan);
  97791. }
  97792. /**
  97793. * @param {?} id
  97794. * @param {?=} typeParams
  97795. * @param {?=} typeModifiers
  97796. * @return {?}
  97797. */
  97798. function importType(id, typeParams, typeModifiers) {
  97799. if (typeParams === void 0) { typeParams = null; }
  97800. if (typeModifiers === void 0) { typeModifiers = null; }
  97801. return id != null ? expressionType(importExpr(id, typeParams, null), typeModifiers) : null;
  97802. }
  97803. /**
  97804. * @param {?} expr
  97805. * @param {?=} typeModifiers
  97806. * @return {?}
  97807. */
  97808. function expressionType(expr, typeModifiers) {
  97809. if (typeModifiers === void 0) { typeModifiers = null; }
  97810. return new ExpressionType(expr, typeModifiers);
  97811. }
  97812. /**
  97813. * @param {?} values
  97814. * @param {?=} type
  97815. * @param {?=} sourceSpan
  97816. * @return {?}
  97817. */
  97818. function literalArr(values, type, sourceSpan) {
  97819. return new LiteralArrayExpr(values, type, sourceSpan);
  97820. }
  97821. /**
  97822. * @param {?} values
  97823. * @param {?=} type
  97824. * @return {?}
  97825. */
  97826. function literalMap(values, type) {
  97827. if (type === void 0) { type = null; }
  97828. return new LiteralMapExpr(values.map(function (e) { return new LiteralMapEntry(e.key, e.value, e.quoted); }), type, null);
  97829. }
  97830. /**
  97831. * @param {?} expr
  97832. * @param {?=} sourceSpan
  97833. * @return {?}
  97834. */
  97835. function not(expr, sourceSpan) {
  97836. return new NotExpr(expr, sourceSpan);
  97837. }
  97838. /**
  97839. * @param {?} expr
  97840. * @param {?=} sourceSpan
  97841. * @return {?}
  97842. */
  97843. function assertNotNull(expr, sourceSpan) {
  97844. return new AssertNotNull(expr, sourceSpan);
  97845. }
  97846. /**
  97847. * @param {?} params
  97848. * @param {?} body
  97849. * @param {?=} type
  97850. * @param {?=} sourceSpan
  97851. * @return {?}
  97852. */
  97853. function fn(params, body, type, sourceSpan) {
  97854. return new FunctionExpr(params, body, type, sourceSpan);
  97855. }
  97856. /**
  97857. * @param {?} value
  97858. * @param {?=} type
  97859. * @param {?=} sourceSpan
  97860. * @return {?}
  97861. */
  97862. function literal(value, type, sourceSpan) {
  97863. return new LiteralExpr(value, type, sourceSpan);
  97864. }
  97865. /**
  97866. * @fileoverview added by tsickle
  97867. * @suppress {checkTypes} checked by tsc
  97868. */
  97869. /**
  97870. * @license
  97871. * Copyright Google Inc. All Rights Reserved.
  97872. *
  97873. * Use of this source code is governed by an MIT-style license that can be
  97874. * found in the LICENSE file at https://angular.io/license
  97875. */
  97876. var ProviderError = /** @class */ (function (_super) {
  97877. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(ProviderError, _super);
  97878. function ProviderError(message, span) {
  97879. return _super.call(this, span, message) || this;
  97880. }
  97881. return ProviderError;
  97882. }(ParseError));
  97883. /**
  97884. * @record
  97885. */
  97886. var ProviderViewContext = /** @class */ (function () {
  97887. function ProviderViewContext(reflector, component) {
  97888. var _this = this;
  97889. this.reflector = reflector;
  97890. this.component = component;
  97891. this.errors = [];
  97892. this.viewQueries = _getViewQueries(component);
  97893. this.viewProviders = new Map();
  97894. component.viewProviders.forEach(function (provider) {
  97895. if (_this.viewProviders.get(tokenReference(provider.token)) == null) {
  97896. _this.viewProviders.set(tokenReference(provider.token), true);
  97897. }
  97898. });
  97899. }
  97900. return ProviderViewContext;
  97901. }());
  97902. var ProviderElementContext = /** @class */ (function () {
  97903. function ProviderElementContext(viewContext, _parent, _isViewRoot, _directiveAsts, attrs, refs, isTemplate, contentQueryStartId, _sourceSpan) {
  97904. var _this = this;
  97905. this.viewContext = viewContext;
  97906. this._parent = _parent;
  97907. this._isViewRoot = _isViewRoot;
  97908. this._directiveAsts = _directiveAsts;
  97909. this._sourceSpan = _sourceSpan;
  97910. this._transformedProviders = new Map();
  97911. this._seenProviders = new Map();
  97912. this._queriedTokens = new Map();
  97913. this.transformedHasViewContainer = false;
  97914. this._attrs = {};
  97915. attrs.forEach(function (attrAst) { return _this._attrs[attrAst.name] = attrAst.value; });
  97916. var /** @type {?} */ directivesMeta = _directiveAsts.map(function (directiveAst) { return directiveAst.directive; });
  97917. this._allProviders =
  97918. _resolveProvidersFromDirectives(directivesMeta, _sourceSpan, viewContext.errors);
  97919. this._contentQueries = _getContentQueries(contentQueryStartId, directivesMeta);
  97920. Array.from(this._allProviders.values()).forEach(function (provider) {
  97921. _this._addQueryReadsTo(provider.token, provider.token, _this._queriedTokens);
  97922. });
  97923. if (isTemplate) {
  97924. var /** @type {?} */ templateRefId = createTokenForExternalReference(this.viewContext.reflector, Identifiers.TemplateRef);
  97925. this._addQueryReadsTo(templateRefId, templateRefId, this._queriedTokens);
  97926. }
  97927. refs.forEach(function (refAst) {
  97928. var /** @type {?} */ defaultQueryValue = refAst.value ||
  97929. createTokenForExternalReference(_this.viewContext.reflector, Identifiers.ElementRef);
  97930. _this._addQueryReadsTo({ value: refAst.name }, defaultQueryValue, _this._queriedTokens);
  97931. });
  97932. if (this._queriedTokens.get(this.viewContext.reflector.resolveExternalReference(Identifiers.ViewContainerRef))) {
  97933. this.transformedHasViewContainer = true;
  97934. }
  97935. // create the providers that we know are eager first
  97936. Array.from(this._allProviders.values()).forEach(function (provider) {
  97937. var /** @type {?} */ eager = provider.eager || _this._queriedTokens.get(tokenReference(provider.token));
  97938. if (eager) {
  97939. _this._getOrCreateLocalProvider(provider.providerType, provider.token, true);
  97940. }
  97941. });
  97942. }
  97943. /**
  97944. * @return {?}
  97945. */
  97946. ProviderElementContext.prototype.afterElement = /**
  97947. * @return {?}
  97948. */
  97949. function () {
  97950. var _this = this;
  97951. // collect lazy providers
  97952. Array.from(this._allProviders.values()).forEach(function (provider) {
  97953. _this._getOrCreateLocalProvider(provider.providerType, provider.token, false);
  97954. });
  97955. };
  97956. Object.defineProperty(ProviderElementContext.prototype, "transformProviders", {
  97957. get: /**
  97958. * @return {?}
  97959. */
  97960. function () {
  97961. // Note: Maps keep their insertion order.
  97962. var /** @type {?} */ lazyProviders = [];
  97963. var /** @type {?} */ eagerProviders = [];
  97964. this._transformedProviders.forEach(function (provider) {
  97965. if (provider.eager) {
  97966. eagerProviders.push(provider);
  97967. }
  97968. else {
  97969. lazyProviders.push(provider);
  97970. }
  97971. });
  97972. return lazyProviders.concat(eagerProviders);
  97973. },
  97974. enumerable: true,
  97975. configurable: true
  97976. });
  97977. Object.defineProperty(ProviderElementContext.prototype, "transformedDirectiveAsts", {
  97978. get: /**
  97979. * @return {?}
  97980. */
  97981. function () {
  97982. var /** @type {?} */ sortedProviderTypes = this.transformProviders.map(function (provider) { return provider.token.identifier; });
  97983. var /** @type {?} */ sortedDirectives = this._directiveAsts.slice();
  97984. sortedDirectives.sort(function (dir1, dir2) {
  97985. return sortedProviderTypes.indexOf(dir1.directive.type) -
  97986. sortedProviderTypes.indexOf(dir2.directive.type);
  97987. });
  97988. return sortedDirectives;
  97989. },
  97990. enumerable: true,
  97991. configurable: true
  97992. });
  97993. Object.defineProperty(ProviderElementContext.prototype, "queryMatches", {
  97994. get: /**
  97995. * @return {?}
  97996. */
  97997. function () {
  97998. var /** @type {?} */ allMatches = [];
  97999. this._queriedTokens.forEach(function (matches) { allMatches.push.apply(allMatches, matches); });
  98000. return allMatches;
  98001. },
  98002. enumerable: true,
  98003. configurable: true
  98004. });
  98005. /**
  98006. * @param {?} token
  98007. * @param {?} defaultValue
  98008. * @param {?} queryReadTokens
  98009. * @return {?}
  98010. */
  98011. ProviderElementContext.prototype._addQueryReadsTo = /**
  98012. * @param {?} token
  98013. * @param {?} defaultValue
  98014. * @param {?} queryReadTokens
  98015. * @return {?}
  98016. */
  98017. function (token, defaultValue, queryReadTokens) {
  98018. this._getQueriesFor(token).forEach(function (query) {
  98019. var /** @type {?} */ queryValue = query.meta.read || defaultValue;
  98020. var /** @type {?} */ tokenRef = tokenReference(queryValue);
  98021. var /** @type {?} */ queryMatches = queryReadTokens.get(tokenRef);
  98022. if (!queryMatches) {
  98023. queryMatches = [];
  98024. queryReadTokens.set(tokenRef, queryMatches);
  98025. }
  98026. queryMatches.push({ queryId: query.queryId, value: queryValue });
  98027. });
  98028. };
  98029. /**
  98030. * @param {?} token
  98031. * @return {?}
  98032. */
  98033. ProviderElementContext.prototype._getQueriesFor = /**
  98034. * @param {?} token
  98035. * @return {?}
  98036. */
  98037. function (token) {
  98038. var /** @type {?} */ result = [];
  98039. var /** @type {?} */ currentEl = this;
  98040. var /** @type {?} */ distance = 0;
  98041. var /** @type {?} */ queries;
  98042. while (currentEl !== null) {
  98043. queries = currentEl._contentQueries.get(tokenReference(token));
  98044. if (queries) {
  98045. result.push.apply(result, queries.filter(function (query) { return query.meta.descendants || distance <= 1; }));
  98046. }
  98047. if (currentEl._directiveAsts.length > 0) {
  98048. distance++;
  98049. }
  98050. currentEl = currentEl._parent;
  98051. }
  98052. queries = this.viewContext.viewQueries.get(tokenReference(token));
  98053. if (queries) {
  98054. result.push.apply(result, queries);
  98055. }
  98056. return result;
  98057. };
  98058. /**
  98059. * @param {?} requestingProviderType
  98060. * @param {?} token
  98061. * @param {?} eager
  98062. * @return {?}
  98063. */
  98064. ProviderElementContext.prototype._getOrCreateLocalProvider = /**
  98065. * @param {?} requestingProviderType
  98066. * @param {?} token
  98067. * @param {?} eager
  98068. * @return {?}
  98069. */
  98070. function (requestingProviderType, token, eager) {
  98071. var _this = this;
  98072. var /** @type {?} */ resolvedProvider = this._allProviders.get(tokenReference(token));
  98073. if (!resolvedProvider || ((requestingProviderType === ProviderAstType.Directive ||
  98074. requestingProviderType === ProviderAstType.PublicService) &&
  98075. resolvedProvider.providerType === ProviderAstType.PrivateService) ||
  98076. ((requestingProviderType === ProviderAstType.PrivateService ||
  98077. requestingProviderType === ProviderAstType.PublicService) &&
  98078. resolvedProvider.providerType === ProviderAstType.Builtin)) {
  98079. return null;
  98080. }
  98081. var /** @type {?} */ transformedProviderAst = this._transformedProviders.get(tokenReference(token));
  98082. if (transformedProviderAst) {
  98083. return transformedProviderAst;
  98084. }
  98085. if (this._seenProviders.get(tokenReference(token)) != null) {
  98086. this.viewContext.errors.push(new ProviderError("Cannot instantiate cyclic dependency! " + tokenName(token), this._sourceSpan));
  98087. return null;
  98088. }
  98089. this._seenProviders.set(tokenReference(token), true);
  98090. var /** @type {?} */ transformedProviders = resolvedProvider.providers.map(function (provider) {
  98091. var /** @type {?} */ transformedUseValue = provider.useValue;
  98092. var /** @type {?} */ transformedUseExisting = /** @type {?} */ ((provider.useExisting));
  98093. var /** @type {?} */ transformedDeps = /** @type {?} */ ((undefined));
  98094. if (provider.useExisting != null) {
  98095. var /** @type {?} */ existingDiDep = /** @type {?} */ ((_this._getDependency(resolvedProvider.providerType, { token: provider.useExisting }, eager)));
  98096. if (existingDiDep.token != null) {
  98097. transformedUseExisting = existingDiDep.token;
  98098. }
  98099. else {
  98100. transformedUseExisting = /** @type {?} */ ((null));
  98101. transformedUseValue = existingDiDep.value;
  98102. }
  98103. }
  98104. else if (provider.useFactory) {
  98105. var /** @type {?} */ deps = provider.deps || provider.useFactory.diDeps;
  98106. transformedDeps =
  98107. deps.map(function (dep) { return ((_this._getDependency(resolvedProvider.providerType, dep, eager))); });
  98108. }
  98109. else if (provider.useClass) {
  98110. var /** @type {?} */ deps = provider.deps || provider.useClass.diDeps;
  98111. transformedDeps =
  98112. deps.map(function (dep) { return ((_this._getDependency(resolvedProvider.providerType, dep, eager))); });
  98113. }
  98114. return _transformProvider(provider, {
  98115. useExisting: transformedUseExisting,
  98116. useValue: transformedUseValue,
  98117. deps: transformedDeps
  98118. });
  98119. });
  98120. transformedProviderAst =
  98121. _transformProviderAst(resolvedProvider, { eager: eager, providers: transformedProviders });
  98122. this._transformedProviders.set(tokenReference(token), transformedProviderAst);
  98123. return transformedProviderAst;
  98124. };
  98125. /**
  98126. * @param {?} requestingProviderType
  98127. * @param {?} dep
  98128. * @param {?=} eager
  98129. * @return {?}
  98130. */
  98131. ProviderElementContext.prototype._getLocalDependency = /**
  98132. * @param {?} requestingProviderType
  98133. * @param {?} dep
  98134. * @param {?=} eager
  98135. * @return {?}
  98136. */
  98137. function (requestingProviderType, dep, eager) {
  98138. if (eager === void 0) { eager = false; }
  98139. if (dep.isAttribute) {
  98140. var /** @type {?} */ attrValue = this._attrs[/** @type {?} */ ((dep.token)).value];
  98141. return { isValue: true, value: attrValue == null ? null : attrValue };
  98142. }
  98143. if (dep.token != null) {
  98144. // access builtints
  98145. if ((requestingProviderType === ProviderAstType.Directive ||
  98146. requestingProviderType === ProviderAstType.Component)) {
  98147. if (tokenReference(dep.token) ===
  98148. this.viewContext.reflector.resolveExternalReference(Identifiers.Renderer) ||
  98149. tokenReference(dep.token) ===
  98150. this.viewContext.reflector.resolveExternalReference(Identifiers.ElementRef) ||
  98151. tokenReference(dep.token) ===
  98152. this.viewContext.reflector.resolveExternalReference(Identifiers.ChangeDetectorRef) ||
  98153. tokenReference(dep.token) ===
  98154. this.viewContext.reflector.resolveExternalReference(Identifiers.TemplateRef)) {
  98155. return dep;
  98156. }
  98157. if (tokenReference(dep.token) ===
  98158. this.viewContext.reflector.resolveExternalReference(Identifiers.ViewContainerRef)) {
  98159. (/** @type {?} */ (this)).transformedHasViewContainer = true;
  98160. }
  98161. }
  98162. // access the injector
  98163. if (tokenReference(dep.token) ===
  98164. this.viewContext.reflector.resolveExternalReference(Identifiers.Injector)) {
  98165. return dep;
  98166. }
  98167. // access providers
  98168. if (this._getOrCreateLocalProvider(requestingProviderType, dep.token, eager) != null) {
  98169. return dep;
  98170. }
  98171. }
  98172. return null;
  98173. };
  98174. /**
  98175. * @param {?} requestingProviderType
  98176. * @param {?} dep
  98177. * @param {?=} eager
  98178. * @return {?}
  98179. */
  98180. ProviderElementContext.prototype._getDependency = /**
  98181. * @param {?} requestingProviderType
  98182. * @param {?} dep
  98183. * @param {?=} eager
  98184. * @return {?}
  98185. */
  98186. function (requestingProviderType, dep, eager) {
  98187. if (eager === void 0) { eager = false; }
  98188. var /** @type {?} */ currElement = this;
  98189. var /** @type {?} */ currEager = eager;
  98190. var /** @type {?} */ result = null;
  98191. if (!dep.isSkipSelf) {
  98192. result = this._getLocalDependency(requestingProviderType, dep, eager);
  98193. }
  98194. if (dep.isSelf) {
  98195. if (!result && dep.isOptional) {
  98196. result = { isValue: true, value: null };
  98197. }
  98198. }
  98199. else {
  98200. // check parent elements
  98201. while (!result && currElement._parent) {
  98202. var /** @type {?} */ prevElement = currElement;
  98203. currElement = currElement._parent;
  98204. if (prevElement._isViewRoot) {
  98205. currEager = false;
  98206. }
  98207. result = currElement._getLocalDependency(ProviderAstType.PublicService, dep, currEager);
  98208. }
  98209. // check @Host restriction
  98210. if (!result) {
  98211. if (!dep.isHost || this.viewContext.component.isHost ||
  98212. this.viewContext.component.type.reference === tokenReference(/** @type {?} */ ((dep.token))) ||
  98213. this.viewContext.viewProviders.get(tokenReference(/** @type {?} */ ((dep.token)))) != null) {
  98214. result = dep;
  98215. }
  98216. else {
  98217. result = dep.isOptional ? result = { isValue: true, value: null } : null;
  98218. }
  98219. }
  98220. }
  98221. if (!result) {
  98222. this.viewContext.errors.push(new ProviderError("No provider for " + tokenName((/** @type {?} */ ((dep.token)))), this._sourceSpan));
  98223. }
  98224. return result;
  98225. };
  98226. return ProviderElementContext;
  98227. }());
  98228. var NgModuleProviderAnalyzer = /** @class */ (function () {
  98229. function NgModuleProviderAnalyzer(reflector, ngModule, extraProviders, sourceSpan) {
  98230. var _this = this;
  98231. this.reflector = reflector;
  98232. this._transformedProviders = new Map();
  98233. this._seenProviders = new Map();
  98234. this._errors = [];
  98235. this._allProviders = new Map();
  98236. ngModule.transitiveModule.modules.forEach(function (ngModuleType) {
  98237. var /** @type {?} */ ngModuleProvider = { token: { identifier: ngModuleType }, useClass: ngModuleType };
  98238. _resolveProviders([ngModuleProvider], ProviderAstType.PublicService, true, sourceSpan, _this._errors, _this._allProviders);
  98239. });
  98240. _resolveProviders(ngModule.transitiveModule.providers.map(function (entry) { return entry.provider; }).concat(extraProviders), ProviderAstType.PublicService, false, sourceSpan, this._errors, this._allProviders);
  98241. }
  98242. /**
  98243. * @return {?}
  98244. */
  98245. NgModuleProviderAnalyzer.prototype.parse = /**
  98246. * @return {?}
  98247. */
  98248. function () {
  98249. var _this = this;
  98250. Array.from(this._allProviders.values()).forEach(function (provider) {
  98251. _this._getOrCreateLocalProvider(provider.token, provider.eager);
  98252. });
  98253. if (this._errors.length > 0) {
  98254. var /** @type {?} */ errorString = this._errors.join('\n');
  98255. throw new Error("Provider parse errors:\n" + errorString);
  98256. }
  98257. // Note: Maps keep their insertion order.
  98258. var /** @type {?} */ lazyProviders = [];
  98259. var /** @type {?} */ eagerProviders = [];
  98260. this._transformedProviders.forEach(function (provider) {
  98261. if (provider.eager) {
  98262. eagerProviders.push(provider);
  98263. }
  98264. else {
  98265. lazyProviders.push(provider);
  98266. }
  98267. });
  98268. return lazyProviders.concat(eagerProviders);
  98269. };
  98270. /**
  98271. * @param {?} token
  98272. * @param {?} eager
  98273. * @return {?}
  98274. */
  98275. NgModuleProviderAnalyzer.prototype._getOrCreateLocalProvider = /**
  98276. * @param {?} token
  98277. * @param {?} eager
  98278. * @return {?}
  98279. */
  98280. function (token, eager) {
  98281. var _this = this;
  98282. var /** @type {?} */ resolvedProvider = this._allProviders.get(tokenReference(token));
  98283. if (!resolvedProvider) {
  98284. return null;
  98285. }
  98286. var /** @type {?} */ transformedProviderAst = this._transformedProviders.get(tokenReference(token));
  98287. if (transformedProviderAst) {
  98288. return transformedProviderAst;
  98289. }
  98290. if (this._seenProviders.get(tokenReference(token)) != null) {
  98291. this._errors.push(new ProviderError("Cannot instantiate cyclic dependency! " + tokenName(token), resolvedProvider.sourceSpan));
  98292. return null;
  98293. }
  98294. this._seenProviders.set(tokenReference(token), true);
  98295. var /** @type {?} */ transformedProviders = resolvedProvider.providers.map(function (provider) {
  98296. var /** @type {?} */ transformedUseValue = provider.useValue;
  98297. var /** @type {?} */ transformedUseExisting = /** @type {?} */ ((provider.useExisting));
  98298. var /** @type {?} */ transformedDeps = /** @type {?} */ ((undefined));
  98299. if (provider.useExisting != null) {
  98300. var /** @type {?} */ existingDiDep = _this._getDependency({ token: provider.useExisting }, eager, resolvedProvider.sourceSpan);
  98301. if (existingDiDep.token != null) {
  98302. transformedUseExisting = existingDiDep.token;
  98303. }
  98304. else {
  98305. transformedUseExisting = /** @type {?} */ ((null));
  98306. transformedUseValue = existingDiDep.value;
  98307. }
  98308. }
  98309. else if (provider.useFactory) {
  98310. var /** @type {?} */ deps = provider.deps || provider.useFactory.diDeps;
  98311. transformedDeps =
  98312. deps.map(function (dep) { return _this._getDependency(dep, eager, resolvedProvider.sourceSpan); });
  98313. }
  98314. else if (provider.useClass) {
  98315. var /** @type {?} */ deps = provider.deps || provider.useClass.diDeps;
  98316. transformedDeps =
  98317. deps.map(function (dep) { return _this._getDependency(dep, eager, resolvedProvider.sourceSpan); });
  98318. }
  98319. return _transformProvider(provider, {
  98320. useExisting: transformedUseExisting,
  98321. useValue: transformedUseValue,
  98322. deps: transformedDeps
  98323. });
  98324. });
  98325. transformedProviderAst =
  98326. _transformProviderAst(resolvedProvider, { eager: eager, providers: transformedProviders });
  98327. this._transformedProviders.set(tokenReference(token), transformedProviderAst);
  98328. return transformedProviderAst;
  98329. };
  98330. /**
  98331. * @param {?} dep
  98332. * @param {?=} eager
  98333. * @param {?=} requestorSourceSpan
  98334. * @return {?}
  98335. */
  98336. NgModuleProviderAnalyzer.prototype._getDependency = /**
  98337. * @param {?} dep
  98338. * @param {?=} eager
  98339. * @param {?=} requestorSourceSpan
  98340. * @return {?}
  98341. */
  98342. function (dep, eager, requestorSourceSpan) {
  98343. if (eager === void 0) { eager = false; }
  98344. var /** @type {?} */ foundLocal = false;
  98345. if (!dep.isSkipSelf && dep.token != null) {
  98346. // access the injector
  98347. if (tokenReference(dep.token) ===
  98348. this.reflector.resolveExternalReference(Identifiers.Injector) ||
  98349. tokenReference(dep.token) ===
  98350. this.reflector.resolveExternalReference(Identifiers.ComponentFactoryResolver)) {
  98351. foundLocal = true;
  98352. // access providers
  98353. }
  98354. else if (this._getOrCreateLocalProvider(dep.token, eager) != null) {
  98355. foundLocal = true;
  98356. }
  98357. }
  98358. var /** @type {?} */ result = dep;
  98359. if (dep.isSelf && !foundLocal) {
  98360. if (dep.isOptional) {
  98361. result = { isValue: true, value: null };
  98362. }
  98363. else {
  98364. this._errors.push(new ProviderError("No provider for " + tokenName((/** @type {?} */ ((dep.token)))), requestorSourceSpan));
  98365. }
  98366. }
  98367. return result;
  98368. };
  98369. return NgModuleProviderAnalyzer;
  98370. }());
  98371. /**
  98372. * @param {?} provider
  98373. * @param {?} __1
  98374. * @return {?}
  98375. */
  98376. function _transformProvider(provider, _a) {
  98377. var useExisting = _a.useExisting, useValue = _a.useValue, deps = _a.deps;
  98378. return {
  98379. token: provider.token,
  98380. useClass: provider.useClass,
  98381. useExisting: useExisting,
  98382. useFactory: provider.useFactory,
  98383. useValue: useValue,
  98384. deps: deps,
  98385. multi: provider.multi
  98386. };
  98387. }
  98388. /**
  98389. * @param {?} provider
  98390. * @param {?} __1
  98391. * @return {?}
  98392. */
  98393. function _transformProviderAst(provider, _a) {
  98394. var eager = _a.eager, providers = _a.providers;
  98395. return new ProviderAst(provider.token, provider.multiProvider, provider.eager || eager, providers, provider.providerType, provider.lifecycleHooks, provider.sourceSpan);
  98396. }
  98397. /**
  98398. * @param {?} directives
  98399. * @param {?} sourceSpan
  98400. * @param {?} targetErrors
  98401. * @return {?}
  98402. */
  98403. function _resolveProvidersFromDirectives(directives, sourceSpan, targetErrors) {
  98404. var /** @type {?} */ providersByToken = new Map();
  98405. directives.forEach(function (directive) {
  98406. var /** @type {?} */ dirProvider = { token: { identifier: directive.type }, useClass: directive.type };
  98407. _resolveProviders([dirProvider], directive.isComponent ? ProviderAstType.Component : ProviderAstType.Directive, true, sourceSpan, targetErrors, providersByToken);
  98408. });
  98409. // Note: directives need to be able to overwrite providers of a component!
  98410. var /** @type {?} */ directivesWithComponentFirst = directives.filter(function (dir) { return dir.isComponent; }).concat(directives.filter(function (dir) { return !dir.isComponent; }));
  98411. directivesWithComponentFirst.forEach(function (directive) {
  98412. _resolveProviders(directive.providers, ProviderAstType.PublicService, false, sourceSpan, targetErrors, providersByToken);
  98413. _resolveProviders(directive.viewProviders, ProviderAstType.PrivateService, false, sourceSpan, targetErrors, providersByToken);
  98414. });
  98415. return providersByToken;
  98416. }
  98417. /**
  98418. * @param {?} providers
  98419. * @param {?} providerType
  98420. * @param {?} eager
  98421. * @param {?} sourceSpan
  98422. * @param {?} targetErrors
  98423. * @param {?} targetProvidersByToken
  98424. * @return {?}
  98425. */
  98426. function _resolveProviders(providers, providerType, eager, sourceSpan, targetErrors, targetProvidersByToken) {
  98427. providers.forEach(function (provider) {
  98428. var /** @type {?} */ resolvedProvider = targetProvidersByToken.get(tokenReference(provider.token));
  98429. if (resolvedProvider != null && !!resolvedProvider.multiProvider !== !!provider.multi) {
  98430. targetErrors.push(new ProviderError("Mixing multi and non multi provider is not possible for token " + tokenName(resolvedProvider.token), sourceSpan));
  98431. }
  98432. if (!resolvedProvider) {
  98433. var /** @type {?} */ lifecycleHooks = provider.token.identifier &&
  98434. (/** @type {?} */ (provider.token.identifier)).lifecycleHooks ?
  98435. (/** @type {?} */ (provider.token.identifier)).lifecycleHooks :
  98436. [];
  98437. var /** @type {?} */ isUseValue = !(provider.useClass || provider.useExisting || provider.useFactory);
  98438. resolvedProvider = new ProviderAst(provider.token, !!provider.multi, eager || isUseValue, [provider], providerType, lifecycleHooks, sourceSpan);
  98439. targetProvidersByToken.set(tokenReference(provider.token), resolvedProvider);
  98440. }
  98441. else {
  98442. if (!provider.multi) {
  98443. resolvedProvider.providers.length = 0;
  98444. }
  98445. resolvedProvider.providers.push(provider);
  98446. }
  98447. });
  98448. }
  98449. /**
  98450. * @param {?} component
  98451. * @return {?}
  98452. */
  98453. function _getViewQueries(component) {
  98454. // Note: queries start with id 1 so we can use the number in a Bloom filter!
  98455. var /** @type {?} */ viewQueryId = 1;
  98456. var /** @type {?} */ viewQueries = new Map();
  98457. if (component.viewQueries) {
  98458. component.viewQueries.forEach(function (query) { return _addQueryToTokenMap(viewQueries, { meta: query, queryId: viewQueryId++ }); });
  98459. }
  98460. return viewQueries;
  98461. }
  98462. /**
  98463. * @param {?} contentQueryStartId
  98464. * @param {?} directives
  98465. * @return {?}
  98466. */
  98467. function _getContentQueries(contentQueryStartId, directives) {
  98468. var /** @type {?} */ contentQueryId = contentQueryStartId;
  98469. var /** @type {?} */ contentQueries = new Map();
  98470. directives.forEach(function (directive, directiveIndex) {
  98471. if (directive.queries) {
  98472. directive.queries.forEach(function (query) { return _addQueryToTokenMap(contentQueries, { meta: query, queryId: contentQueryId++ }); });
  98473. }
  98474. });
  98475. return contentQueries;
  98476. }
  98477. /**
  98478. * @param {?} map
  98479. * @param {?} query
  98480. * @return {?}
  98481. */
  98482. function _addQueryToTokenMap(map, query) {
  98483. query.meta.selectors.forEach(function (token) {
  98484. var /** @type {?} */ entry = map.get(tokenReference(token));
  98485. if (!entry) {
  98486. entry = [];
  98487. map.set(tokenReference(token), entry);
  98488. }
  98489. entry.push(query);
  98490. });
  98491. }
  98492. /**
  98493. * @fileoverview added by tsickle
  98494. * @suppress {checkTypes} checked by tsc
  98495. */
  98496. /**
  98497. * @license
  98498. * Copyright Google Inc. All Rights Reserved.
  98499. *
  98500. * Use of this source code is governed by an MIT-style license that can be
  98501. * found in the LICENSE file at https://angular.io/license
  98502. */
  98503. var QUOTED_KEYS = '$quoted$';
  98504. /**
  98505. * @param {?} ctx
  98506. * @param {?} value
  98507. * @param {?=} type
  98508. * @return {?}
  98509. */
  98510. function convertValueToOutputAst(ctx, value, type) {
  98511. if (type === void 0) { type = null; }
  98512. return visitValue(value, new _ValueOutputAstTransformer(ctx), type);
  98513. }
  98514. var _ValueOutputAstTransformer = /** @class */ (function () {
  98515. function _ValueOutputAstTransformer(ctx) {
  98516. this.ctx = ctx;
  98517. }
  98518. /**
  98519. * @param {?} arr
  98520. * @param {?} type
  98521. * @return {?}
  98522. */
  98523. _ValueOutputAstTransformer.prototype.visitArray = /**
  98524. * @param {?} arr
  98525. * @param {?} type
  98526. * @return {?}
  98527. */
  98528. function (arr, type) {
  98529. var _this = this;
  98530. return literalArr(arr.map(function (value) { return visitValue(value, _this, null); }), type);
  98531. };
  98532. /**
  98533. * @param {?} map
  98534. * @param {?} type
  98535. * @return {?}
  98536. */
  98537. _ValueOutputAstTransformer.prototype.visitStringMap = /**
  98538. * @param {?} map
  98539. * @param {?} type
  98540. * @return {?}
  98541. */
  98542. function (map, type) {
  98543. var _this = this;
  98544. var /** @type {?} */ entries = [];
  98545. var /** @type {?} */ quotedSet = new Set(map && map[QUOTED_KEYS]);
  98546. Object.keys(map).forEach(function (key) {
  98547. entries.push(new LiteralMapEntry(key, visitValue(map[key], _this, null), quotedSet.has(key)));
  98548. });
  98549. return new LiteralMapExpr(entries, type);
  98550. };
  98551. /**
  98552. * @param {?} value
  98553. * @param {?} type
  98554. * @return {?}
  98555. */
  98556. _ValueOutputAstTransformer.prototype.visitPrimitive = /**
  98557. * @param {?} value
  98558. * @param {?} type
  98559. * @return {?}
  98560. */
  98561. function (value, type) { return literal(value, type); };
  98562. /**
  98563. * @param {?} value
  98564. * @param {?} type
  98565. * @return {?}
  98566. */
  98567. _ValueOutputAstTransformer.prototype.visitOther = /**
  98568. * @param {?} value
  98569. * @param {?} type
  98570. * @return {?}
  98571. */
  98572. function (value, type) {
  98573. if (value instanceof Expression) {
  98574. return value;
  98575. }
  98576. else {
  98577. return this.ctx.importExpr(value);
  98578. }
  98579. };
  98580. return _ValueOutputAstTransformer;
  98581. }());
  98582. /**
  98583. * @fileoverview added by tsickle
  98584. * @suppress {checkTypes} checked by tsc
  98585. */
  98586. /**
  98587. * @license
  98588. * Copyright Google Inc. All Rights Reserved.
  98589. *
  98590. * Use of this source code is governed by an MIT-style license that can be
  98591. * found in the LICENSE file at https://angular.io/license
  98592. */
  98593. /**
  98594. * @param {?} ctx
  98595. * @param {?} providerAst
  98596. * @return {?}
  98597. */
  98598. function providerDef(ctx, providerAst) {
  98599. var /** @type {?} */ flags = 0;
  98600. if (!providerAst.eager) {
  98601. flags |= 4096 /* LazyProvider */;
  98602. }
  98603. if (providerAst.providerType === ProviderAstType.PrivateService) {
  98604. flags |= 8192 /* PrivateProvider */;
  98605. }
  98606. providerAst.lifecycleHooks.forEach(function (lifecycleHook) {
  98607. // for regular providers, we only support ngOnDestroy
  98608. if (lifecycleHook === LifecycleHooks.OnDestroy ||
  98609. providerAst.providerType === ProviderAstType.Directive ||
  98610. providerAst.providerType === ProviderAstType.Component) {
  98611. flags |= lifecycleHookToNodeFlag(lifecycleHook);
  98612. }
  98613. });
  98614. var _a = providerAst.multiProvider ?
  98615. multiProviderDef(ctx, flags, providerAst.providers) :
  98616. singleProviderDef(ctx, flags, providerAst.providerType, providerAst.providers[0]), providerExpr = _a.providerExpr, providerFlags = _a.flags, depsExpr = _a.depsExpr;
  98617. return {
  98618. providerExpr: providerExpr,
  98619. flags: providerFlags, depsExpr: depsExpr,
  98620. tokenExpr: tokenExpr(ctx, providerAst.token),
  98621. };
  98622. }
  98623. /**
  98624. * @param {?} ctx
  98625. * @param {?} flags
  98626. * @param {?} providers
  98627. * @return {?}
  98628. */
  98629. function multiProviderDef(ctx, flags, providers) {
  98630. var /** @type {?} */ allDepDefs = [];
  98631. var /** @type {?} */ allParams = [];
  98632. var /** @type {?} */ exprs = providers.map(function (provider, providerIndex) {
  98633. var /** @type {?} */ expr;
  98634. if (provider.useClass) {
  98635. var /** @type {?} */ depExprs = convertDeps(providerIndex, provider.deps || provider.useClass.diDeps);
  98636. expr = ctx.importExpr(provider.useClass.reference).instantiate(depExprs);
  98637. }
  98638. else if (provider.useFactory) {
  98639. var /** @type {?} */ depExprs = convertDeps(providerIndex, provider.deps || provider.useFactory.diDeps);
  98640. expr = ctx.importExpr(provider.useFactory.reference).callFn(depExprs);
  98641. }
  98642. else if (provider.useExisting) {
  98643. var /** @type {?} */ depExprs = convertDeps(providerIndex, [{ token: provider.useExisting }]);
  98644. expr = depExprs[0];
  98645. }
  98646. else {
  98647. expr = convertValueToOutputAst(ctx, provider.useValue);
  98648. }
  98649. return expr;
  98650. });
  98651. var /** @type {?} */ providerExpr = fn(allParams, [new ReturnStatement(literalArr(exprs))], INFERRED_TYPE);
  98652. return {
  98653. providerExpr: providerExpr,
  98654. flags: flags | 1024 /* TypeFactoryProvider */,
  98655. depsExpr: literalArr(allDepDefs)
  98656. };
  98657. /**
  98658. * @param {?} providerIndex
  98659. * @param {?} deps
  98660. * @return {?}
  98661. */
  98662. function convertDeps(providerIndex, deps) {
  98663. return deps.map(function (dep, depIndex) {
  98664. var /** @type {?} */ paramName = "p" + providerIndex + "_" + depIndex;
  98665. allParams.push(new FnParam(paramName, DYNAMIC_TYPE));
  98666. allDepDefs.push(depDef(ctx, dep));
  98667. return variable(paramName);
  98668. });
  98669. }
  98670. }
  98671. /**
  98672. * @param {?} ctx
  98673. * @param {?} flags
  98674. * @param {?} providerType
  98675. * @param {?} providerMeta
  98676. * @return {?}
  98677. */
  98678. function singleProviderDef(ctx, flags, providerType, providerMeta) {
  98679. var /** @type {?} */ providerExpr;
  98680. var /** @type {?} */ deps;
  98681. if (providerType === ProviderAstType.Directive || providerType === ProviderAstType.Component) {
  98682. providerExpr = ctx.importExpr(/** @type {?} */ ((providerMeta.useClass)).reference);
  98683. flags |= 16384 /* TypeDirective */;
  98684. deps = providerMeta.deps || /** @type {?} */ ((providerMeta.useClass)).diDeps;
  98685. }
  98686. else {
  98687. if (providerMeta.useClass) {
  98688. providerExpr = ctx.importExpr(providerMeta.useClass.reference);
  98689. flags |= 512 /* TypeClassProvider */;
  98690. deps = providerMeta.deps || providerMeta.useClass.diDeps;
  98691. }
  98692. else if (providerMeta.useFactory) {
  98693. providerExpr = ctx.importExpr(providerMeta.useFactory.reference);
  98694. flags |= 1024 /* TypeFactoryProvider */;
  98695. deps = providerMeta.deps || providerMeta.useFactory.diDeps;
  98696. }
  98697. else if (providerMeta.useExisting) {
  98698. providerExpr = NULL_EXPR;
  98699. flags |= 2048 /* TypeUseExistingProvider */;
  98700. deps = [{ token: providerMeta.useExisting }];
  98701. }
  98702. else {
  98703. providerExpr = convertValueToOutputAst(ctx, providerMeta.useValue);
  98704. flags |= 256 /* TypeValueProvider */;
  98705. deps = [];
  98706. }
  98707. }
  98708. var /** @type {?} */ depsExpr = literalArr(deps.map(function (dep) { return depDef(ctx, dep); }));
  98709. return { providerExpr: providerExpr, flags: flags, depsExpr: depsExpr };
  98710. }
  98711. /**
  98712. * @param {?} ctx
  98713. * @param {?} tokenMeta
  98714. * @return {?}
  98715. */
  98716. function tokenExpr(ctx, tokenMeta) {
  98717. return tokenMeta.identifier ? ctx.importExpr(tokenMeta.identifier.reference) :
  98718. literal(tokenMeta.value);
  98719. }
  98720. /**
  98721. * @param {?} ctx
  98722. * @param {?} dep
  98723. * @return {?}
  98724. */
  98725. function depDef(ctx, dep) {
  98726. // Note: the following fields have already been normalized out by provider_analyzer:
  98727. // - isAttribute, isSelf, isHost
  98728. var /** @type {?} */ expr = dep.isValue ? convertValueToOutputAst(ctx, dep.value) : tokenExpr(ctx, /** @type {?} */ ((dep.token)));
  98729. var /** @type {?} */ flags = 0;
  98730. if (dep.isSkipSelf) {
  98731. flags |= 1 /* SkipSelf */;
  98732. }
  98733. if (dep.isOptional) {
  98734. flags |= 2 /* Optional */;
  98735. }
  98736. if (dep.isValue) {
  98737. flags |= 8 /* Value */;
  98738. }
  98739. return flags === 0 /* None */ ? expr : literalArr([literal(flags), expr]);
  98740. }
  98741. /**
  98742. * @param {?} lifecycleHook
  98743. * @return {?}
  98744. */
  98745. function lifecycleHookToNodeFlag(lifecycleHook) {
  98746. var /** @type {?} */ nodeFlag = 0;
  98747. switch (lifecycleHook) {
  98748. case LifecycleHooks.AfterContentChecked:
  98749. nodeFlag = 2097152 /* AfterContentChecked */;
  98750. break;
  98751. case LifecycleHooks.AfterContentInit:
  98752. nodeFlag = 1048576 /* AfterContentInit */;
  98753. break;
  98754. case LifecycleHooks.AfterViewChecked:
  98755. nodeFlag = 8388608 /* AfterViewChecked */;
  98756. break;
  98757. case LifecycleHooks.AfterViewInit:
  98758. nodeFlag = 4194304 /* AfterViewInit */;
  98759. break;
  98760. case LifecycleHooks.DoCheck:
  98761. nodeFlag = 262144 /* DoCheck */;
  98762. break;
  98763. case LifecycleHooks.OnChanges:
  98764. nodeFlag = 524288 /* OnChanges */;
  98765. break;
  98766. case LifecycleHooks.OnDestroy:
  98767. nodeFlag = 131072 /* OnDestroy */;
  98768. break;
  98769. case LifecycleHooks.OnInit:
  98770. nodeFlag = 65536 /* OnInit */;
  98771. break;
  98772. }
  98773. return nodeFlag;
  98774. }
  98775. /**
  98776. * @param {?} reflector
  98777. * @param {?} ctx
  98778. * @param {?} flags
  98779. * @param {?} entryComponents
  98780. * @return {?}
  98781. */
  98782. function componentFactoryResolverProviderDef(reflector, ctx, flags, entryComponents) {
  98783. var /** @type {?} */ entryComponentFactories = entryComponents.map(function (entryComponent) { return ctx.importExpr(entryComponent.componentFactory); });
  98784. var /** @type {?} */ token = createTokenForExternalReference(reflector, Identifiers.ComponentFactoryResolver);
  98785. var /** @type {?} */ classMeta = {
  98786. diDeps: [
  98787. { isValue: true, value: literalArr(entryComponentFactories) },
  98788. { token: token, isSkipSelf: true, isOptional: true },
  98789. { token: createTokenForExternalReference(reflector, Identifiers.NgModuleRef) },
  98790. ],
  98791. lifecycleHooks: [],
  98792. reference: reflector.resolveExternalReference(Identifiers.CodegenComponentFactoryResolver)
  98793. };
  98794. var _a = singleProviderDef(ctx, flags, ProviderAstType.PrivateService, {
  98795. token: token,
  98796. multi: false,
  98797. useClass: classMeta,
  98798. }), providerExpr = _a.providerExpr, providerFlags = _a.flags, depsExpr = _a.depsExpr;
  98799. return { providerExpr: providerExpr, flags: providerFlags, depsExpr: depsExpr, tokenExpr: tokenExpr(ctx, token) };
  98800. }
  98801. /**
  98802. * @fileoverview added by tsickle
  98803. * @suppress {checkTypes} checked by tsc
  98804. */
  98805. /**
  98806. * @license
  98807. * Copyright Google Inc. All Rights Reserved.
  98808. *
  98809. * Use of this source code is governed by an MIT-style license that can be
  98810. * found in the LICENSE file at https://angular.io/license
  98811. */
  98812. var NgModuleCompileResult = /** @class */ (function () {
  98813. function NgModuleCompileResult(ngModuleFactoryVar) {
  98814. this.ngModuleFactoryVar = ngModuleFactoryVar;
  98815. }
  98816. return NgModuleCompileResult;
  98817. }());
  98818. var LOG_VAR = variable('_l');
  98819. var NgModuleCompiler = /** @class */ (function () {
  98820. function NgModuleCompiler(reflector) {
  98821. this.reflector = reflector;
  98822. }
  98823. /**
  98824. * @param {?} ctx
  98825. * @param {?} ngModuleMeta
  98826. * @param {?} extraProviders
  98827. * @return {?}
  98828. */
  98829. NgModuleCompiler.prototype.compile = /**
  98830. * @param {?} ctx
  98831. * @param {?} ngModuleMeta
  98832. * @param {?} extraProviders
  98833. * @return {?}
  98834. */
  98835. function (ctx, ngModuleMeta, extraProviders) {
  98836. var /** @type {?} */ sourceSpan = typeSourceSpan('NgModule', ngModuleMeta.type);
  98837. var /** @type {?} */ entryComponentFactories = ngModuleMeta.transitiveModule.entryComponents;
  98838. var /** @type {?} */ bootstrapComponents = ngModuleMeta.bootstrapComponents;
  98839. var /** @type {?} */ providerParser = new NgModuleProviderAnalyzer(this.reflector, ngModuleMeta, extraProviders, sourceSpan);
  98840. var /** @type {?} */ providerDefs = [componentFactoryResolverProviderDef(this.reflector, ctx, 0 /* None */, entryComponentFactories)]
  98841. .concat(providerParser.parse().map(function (provider) { return providerDef(ctx, provider); }))
  98842. .map(function (_a) {
  98843. var providerExpr = _a.providerExpr, depsExpr = _a.depsExpr, flags = _a.flags, tokenExpr = _a.tokenExpr;
  98844. return importExpr(Identifiers.moduleProviderDef).callFn([
  98845. literal(flags), tokenExpr, providerExpr, depsExpr
  98846. ]);
  98847. });
  98848. var /** @type {?} */ ngModuleDef = importExpr(Identifiers.moduleDef).callFn([literalArr(providerDefs)]);
  98849. var /** @type {?} */ ngModuleDefFactory = fn([new FnParam(/** @type {?} */ ((LOG_VAR.name)))], [new ReturnStatement(ngModuleDef)], INFERRED_TYPE);
  98850. var /** @type {?} */ ngModuleFactoryVar = identifierName(ngModuleMeta.type) + "NgFactory";
  98851. this._createNgModuleFactory(ctx, ngModuleMeta.type.reference, importExpr(Identifiers.createModuleFactory).callFn([
  98852. ctx.importExpr(ngModuleMeta.type.reference),
  98853. literalArr(bootstrapComponents.map(function (id) { return ctx.importExpr(id.reference); })),
  98854. ngModuleDefFactory
  98855. ]));
  98856. if (ngModuleMeta.id) {
  98857. var /** @type {?} */ registerFactoryStmt = importExpr(Identifiers.RegisterModuleFactoryFn)
  98858. .callFn([literal(ngModuleMeta.id), variable(ngModuleFactoryVar)])
  98859. .toStmt();
  98860. ctx.statements.push(registerFactoryStmt);
  98861. }
  98862. return new NgModuleCompileResult(ngModuleFactoryVar);
  98863. };
  98864. /**
  98865. * @param {?} ctx
  98866. * @param {?} ngModuleReference
  98867. * @return {?}
  98868. */
  98869. NgModuleCompiler.prototype.createStub = /**
  98870. * @param {?} ctx
  98871. * @param {?} ngModuleReference
  98872. * @return {?}
  98873. */
  98874. function (ctx, ngModuleReference) {
  98875. this._createNgModuleFactory(ctx, ngModuleReference, NULL_EXPR);
  98876. };
  98877. /**
  98878. * @param {?} ctx
  98879. * @param {?} reference
  98880. * @param {?} value
  98881. * @return {?}
  98882. */
  98883. NgModuleCompiler.prototype._createNgModuleFactory = /**
  98884. * @param {?} ctx
  98885. * @param {?} reference
  98886. * @param {?} value
  98887. * @return {?}
  98888. */
  98889. function (ctx, reference, value) {
  98890. var /** @type {?} */ ngModuleFactoryVar = identifierName({ reference: reference }) + "NgFactory";
  98891. var /** @type {?} */ ngModuleFactoryStmt = variable(ngModuleFactoryVar)
  98892. .set(value)
  98893. .toDeclStmt(importType(Identifiers.NgModuleFactory, [/** @type {?} */ ((expressionType(ctx.importExpr(reference))))], [TypeModifier.Const]), [StmtModifier.Final, StmtModifier.Exported]);
  98894. ctx.statements.push(ngModuleFactoryStmt);
  98895. };
  98896. return NgModuleCompiler;
  98897. }());
  98898. /**
  98899. * @fileoverview added by tsickle
  98900. * @suppress {checkTypes} checked by tsc
  98901. */
  98902. /**
  98903. * @license
  98904. * Copyright Google Inc. All Rights Reserved.
  98905. *
  98906. * Use of this source code is governed by an MIT-style license that can be
  98907. * found in the LICENSE file at https://angular.io/license
  98908. */
  98909. /**
  98910. * Resolves types to {\@link NgModule}.
  98911. */
  98912. var NgModuleResolver = /** @class */ (function () {
  98913. function NgModuleResolver(_reflector) {
  98914. this._reflector = _reflector;
  98915. }
  98916. /**
  98917. * @param {?} type
  98918. * @return {?}
  98919. */
  98920. NgModuleResolver.prototype.isNgModule = /**
  98921. * @param {?} type
  98922. * @return {?}
  98923. */
  98924. function (type) { return this._reflector.annotations(type).some(createNgModule.isTypeOf); };
  98925. /**
  98926. * @param {?} type
  98927. * @param {?=} throwIfNotFound
  98928. * @return {?}
  98929. */
  98930. NgModuleResolver.prototype.resolve = /**
  98931. * @param {?} type
  98932. * @param {?=} throwIfNotFound
  98933. * @return {?}
  98934. */
  98935. function (type, throwIfNotFound) {
  98936. if (throwIfNotFound === void 0) { throwIfNotFound = true; }
  98937. var /** @type {?} */ ngModuleMeta = findLast(this._reflector.annotations(type), createNgModule.isTypeOf);
  98938. if (ngModuleMeta) {
  98939. return ngModuleMeta;
  98940. }
  98941. else {
  98942. if (throwIfNotFound) {
  98943. throw new Error("No NgModule metadata found for '" + stringify(type) + "'.");
  98944. }
  98945. return null;
  98946. }
  98947. };
  98948. return NgModuleResolver;
  98949. }());
  98950. /**
  98951. * @fileoverview added by tsickle
  98952. * @suppress {checkTypes} checked by tsc
  98953. */
  98954. /**
  98955. * @license
  98956. * Copyright Google Inc. All Rights Reserved.
  98957. *
  98958. * Use of this source code is governed by an MIT-style license that can be
  98959. * found in the LICENSE file at https://angular.io/license
  98960. */
  98961. // https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit
  98962. var VERSION$1 = 3;
  98963. var JS_B64_PREFIX = '# sourceMappingURL=data:application/json;base64,';
  98964. var SourceMapGenerator = /** @class */ (function () {
  98965. function SourceMapGenerator(file) {
  98966. if (file === void 0) { file = null; }
  98967. this.file = file;
  98968. this.sourcesContent = new Map();
  98969. this.lines = [];
  98970. this.lastCol0 = 0;
  98971. this.hasMappings = false;
  98972. }
  98973. // The content is `null` when the content is expected to be loaded using the URL
  98974. /**
  98975. * @param {?} url
  98976. * @param {?=} content
  98977. * @return {?}
  98978. */
  98979. SourceMapGenerator.prototype.addSource = /**
  98980. * @param {?} url
  98981. * @param {?=} content
  98982. * @return {?}
  98983. */
  98984. function (url, content) {
  98985. if (content === void 0) { content = null; }
  98986. if (!this.sourcesContent.has(url)) {
  98987. this.sourcesContent.set(url, content);
  98988. }
  98989. return this;
  98990. };
  98991. /**
  98992. * @return {?}
  98993. */
  98994. SourceMapGenerator.prototype.addLine = /**
  98995. * @return {?}
  98996. */
  98997. function () {
  98998. this.lines.push([]);
  98999. this.lastCol0 = 0;
  99000. return this;
  99001. };
  99002. /**
  99003. * @param {?} col0
  99004. * @param {?=} sourceUrl
  99005. * @param {?=} sourceLine0
  99006. * @param {?=} sourceCol0
  99007. * @return {?}
  99008. */
  99009. SourceMapGenerator.prototype.addMapping = /**
  99010. * @param {?} col0
  99011. * @param {?=} sourceUrl
  99012. * @param {?=} sourceLine0
  99013. * @param {?=} sourceCol0
  99014. * @return {?}
  99015. */
  99016. function (col0, sourceUrl, sourceLine0, sourceCol0) {
  99017. if (!this.currentLine) {
  99018. throw new Error("A line must be added before mappings can be added");
  99019. }
  99020. if (sourceUrl != null && !this.sourcesContent.has(sourceUrl)) {
  99021. throw new Error("Unknown source file \"" + sourceUrl + "\"");
  99022. }
  99023. if (col0 == null) {
  99024. throw new Error("The column in the generated code must be provided");
  99025. }
  99026. if (col0 < this.lastCol0) {
  99027. throw new Error("Mapping should be added in output order");
  99028. }
  99029. if (sourceUrl && (sourceLine0 == null || sourceCol0 == null)) {
  99030. throw new Error("The source location must be provided when a source url is provided");
  99031. }
  99032. this.hasMappings = true;
  99033. this.lastCol0 = col0;
  99034. this.currentLine.push({ col0: col0, sourceUrl: sourceUrl, sourceLine0: sourceLine0, sourceCol0: sourceCol0 });
  99035. return this;
  99036. };
  99037. Object.defineProperty(SourceMapGenerator.prototype, "currentLine", {
  99038. get: /**
  99039. * @return {?}
  99040. */
  99041. function () { return this.lines.slice(-1)[0]; },
  99042. enumerable: true,
  99043. configurable: true
  99044. });
  99045. /**
  99046. * @return {?}
  99047. */
  99048. SourceMapGenerator.prototype.toJSON = /**
  99049. * @return {?}
  99050. */
  99051. function () {
  99052. var _this = this;
  99053. if (!this.hasMappings) {
  99054. return null;
  99055. }
  99056. var /** @type {?} */ sourcesIndex = new Map();
  99057. var /** @type {?} */ sources = [];
  99058. var /** @type {?} */ sourcesContent = [];
  99059. Array.from(this.sourcesContent.keys()).forEach(function (url, i) {
  99060. sourcesIndex.set(url, i);
  99061. sources.push(url);
  99062. sourcesContent.push(_this.sourcesContent.get(url) || null);
  99063. });
  99064. var /** @type {?} */ mappings = '';
  99065. var /** @type {?} */ lastCol0 = 0;
  99066. var /** @type {?} */ lastSourceIndex = 0;
  99067. var /** @type {?} */ lastSourceLine0 = 0;
  99068. var /** @type {?} */ lastSourceCol0 = 0;
  99069. this.lines.forEach(function (segments) {
  99070. lastCol0 = 0;
  99071. mappings += segments
  99072. .map(function (segment) {
  99073. // zero-based starting column of the line in the generated code
  99074. var /** @type {?} */ segAsStr = toBase64VLQ(segment.col0 - lastCol0);
  99075. lastCol0 = segment.col0;
  99076. if (segment.sourceUrl != null) {
  99077. // zero-based index into the “sources” list
  99078. segAsStr +=
  99079. toBase64VLQ(/** @type {?} */ ((sourcesIndex.get(segment.sourceUrl))) - lastSourceIndex);
  99080. lastSourceIndex = /** @type {?} */ ((sourcesIndex.get(segment.sourceUrl)));
  99081. // the zero-based starting line in the original source
  99082. segAsStr += toBase64VLQ(/** @type {?} */ ((segment.sourceLine0)) - lastSourceLine0);
  99083. lastSourceLine0 = /** @type {?} */ ((segment.sourceLine0));
  99084. // the zero-based starting column in the original source
  99085. segAsStr += toBase64VLQ(/** @type {?} */ ((segment.sourceCol0)) - lastSourceCol0);
  99086. lastSourceCol0 = /** @type {?} */ ((segment.sourceCol0));
  99087. }
  99088. return segAsStr;
  99089. })
  99090. .join(',');
  99091. mappings += ';';
  99092. });
  99093. mappings = mappings.slice(0, -1);
  99094. return {
  99095. 'file': this.file || '',
  99096. 'version': VERSION$1,
  99097. 'sourceRoot': '',
  99098. 'sources': sources,
  99099. 'sourcesContent': sourcesContent,
  99100. 'mappings': mappings,
  99101. };
  99102. };
  99103. /**
  99104. * @return {?}
  99105. */
  99106. SourceMapGenerator.prototype.toJsComment = /**
  99107. * @return {?}
  99108. */
  99109. function () {
  99110. return this.hasMappings ? '//' + JS_B64_PREFIX + toBase64String(JSON.stringify(this, null, 0)) :
  99111. '';
  99112. };
  99113. return SourceMapGenerator;
  99114. }());
  99115. /**
  99116. * @param {?} value
  99117. * @return {?}
  99118. */
  99119. function toBase64String(value) {
  99120. var /** @type {?} */ b64 = '';
  99121. value = utf8Encode(value);
  99122. for (var /** @type {?} */ i = 0; i < value.length;) {
  99123. var /** @type {?} */ i1 = value.charCodeAt(i++);
  99124. var /** @type {?} */ i2 = value.charCodeAt(i++);
  99125. var /** @type {?} */ i3 = value.charCodeAt(i++);
  99126. b64 += toBase64Digit(i1 >> 2);
  99127. b64 += toBase64Digit(((i1 & 3) << 4) | (isNaN(i2) ? 0 : i2 >> 4));
  99128. b64 += isNaN(i2) ? '=' : toBase64Digit(((i2 & 15) << 2) | (i3 >> 6));
  99129. b64 += isNaN(i2) || isNaN(i3) ? '=' : toBase64Digit(i3 & 63);
  99130. }
  99131. return b64;
  99132. }
  99133. /**
  99134. * @param {?} value
  99135. * @return {?}
  99136. */
  99137. function toBase64VLQ(value) {
  99138. value = value < 0 ? ((-value) << 1) + 1 : value << 1;
  99139. var /** @type {?} */ out = '';
  99140. do {
  99141. var /** @type {?} */ digit = value & 31;
  99142. value = value >> 5;
  99143. if (value > 0) {
  99144. digit = digit | 32;
  99145. }
  99146. out += toBase64Digit(digit);
  99147. } while (value > 0);
  99148. return out;
  99149. }
  99150. var B64_DIGITS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
  99151. /**
  99152. * @param {?} value
  99153. * @return {?}
  99154. */
  99155. function toBase64Digit(value) {
  99156. if (value < 0 || value >= 64) {
  99157. throw new Error("Can only encode value in the range [0, 63]");
  99158. }
  99159. return B64_DIGITS[value];
  99160. }
  99161. /**
  99162. * @fileoverview added by tsickle
  99163. * @suppress {checkTypes} checked by tsc
  99164. */
  99165. /**
  99166. * @license
  99167. * Copyright Google Inc. All Rights Reserved.
  99168. *
  99169. * Use of this source code is governed by an MIT-style license that can be
  99170. * found in the LICENSE file at https://angular.io/license
  99171. */
  99172. var _SINGLE_QUOTE_ESCAPE_STRING_RE = /'|\\|\n|\r|\$/g;
  99173. var _LEGAL_IDENTIFIER_RE = /^[$A-Z_][0-9A-Z_$]*$/i;
  99174. var _INDENT_WITH = ' ';
  99175. var CATCH_ERROR_VAR$1 = variable('error', null, null);
  99176. var CATCH_STACK_VAR$1 = variable('stack', null, null);
  99177. /**
  99178. * @record
  99179. */
  99180. var _EmittedLine = /** @class */ (function () {
  99181. function _EmittedLine(indent) {
  99182. this.indent = indent;
  99183. this.partsLength = 0;
  99184. this.parts = [];
  99185. this.srcSpans = [];
  99186. }
  99187. return _EmittedLine;
  99188. }());
  99189. var EmitterVisitorContext = /** @class */ (function () {
  99190. function EmitterVisitorContext(_indent) {
  99191. this._indent = _indent;
  99192. this._classes = [];
  99193. this._preambleLineCount = 0;
  99194. this._lines = [new _EmittedLine(_indent)];
  99195. }
  99196. /**
  99197. * @return {?}
  99198. */
  99199. EmitterVisitorContext.createRoot = /**
  99200. * @return {?}
  99201. */
  99202. function () { return new EmitterVisitorContext(0); };
  99203. Object.defineProperty(EmitterVisitorContext.prototype, "_currentLine", {
  99204. get: /**
  99205. * @return {?}
  99206. */
  99207. function () { return this._lines[this._lines.length - 1]; },
  99208. enumerable: true,
  99209. configurable: true
  99210. });
  99211. /**
  99212. * @param {?=} from
  99213. * @param {?=} lastPart
  99214. * @return {?}
  99215. */
  99216. EmitterVisitorContext.prototype.println = /**
  99217. * @param {?=} from
  99218. * @param {?=} lastPart
  99219. * @return {?}
  99220. */
  99221. function (from, lastPart) {
  99222. if (lastPart === void 0) { lastPart = ''; }
  99223. this.print(from || null, lastPart, true);
  99224. };
  99225. /**
  99226. * @return {?}
  99227. */
  99228. EmitterVisitorContext.prototype.lineIsEmpty = /**
  99229. * @return {?}
  99230. */
  99231. function () { return this._currentLine.parts.length === 0; };
  99232. /**
  99233. * @return {?}
  99234. */
  99235. EmitterVisitorContext.prototype.lineLength = /**
  99236. * @return {?}
  99237. */
  99238. function () {
  99239. return this._currentLine.indent * _INDENT_WITH.length + this._currentLine.partsLength;
  99240. };
  99241. /**
  99242. * @param {?} from
  99243. * @param {?} part
  99244. * @param {?=} newLine
  99245. * @return {?}
  99246. */
  99247. EmitterVisitorContext.prototype.print = /**
  99248. * @param {?} from
  99249. * @param {?} part
  99250. * @param {?=} newLine
  99251. * @return {?}
  99252. */
  99253. function (from, part, newLine) {
  99254. if (newLine === void 0) { newLine = false; }
  99255. if (part.length > 0) {
  99256. this._currentLine.parts.push(part);
  99257. this._currentLine.partsLength += part.length;
  99258. this._currentLine.srcSpans.push(from && from.sourceSpan || null);
  99259. }
  99260. if (newLine) {
  99261. this._lines.push(new _EmittedLine(this._indent));
  99262. }
  99263. };
  99264. /**
  99265. * @return {?}
  99266. */
  99267. EmitterVisitorContext.prototype.removeEmptyLastLine = /**
  99268. * @return {?}
  99269. */
  99270. function () {
  99271. if (this.lineIsEmpty()) {
  99272. this._lines.pop();
  99273. }
  99274. };
  99275. /**
  99276. * @return {?}
  99277. */
  99278. EmitterVisitorContext.prototype.incIndent = /**
  99279. * @return {?}
  99280. */
  99281. function () {
  99282. this._indent++;
  99283. if (this.lineIsEmpty()) {
  99284. this._currentLine.indent = this._indent;
  99285. }
  99286. };
  99287. /**
  99288. * @return {?}
  99289. */
  99290. EmitterVisitorContext.prototype.decIndent = /**
  99291. * @return {?}
  99292. */
  99293. function () {
  99294. this._indent--;
  99295. if (this.lineIsEmpty()) {
  99296. this._currentLine.indent = this._indent;
  99297. }
  99298. };
  99299. /**
  99300. * @param {?} clazz
  99301. * @return {?}
  99302. */
  99303. EmitterVisitorContext.prototype.pushClass = /**
  99304. * @param {?} clazz
  99305. * @return {?}
  99306. */
  99307. function (clazz) { this._classes.push(clazz); };
  99308. /**
  99309. * @return {?}
  99310. */
  99311. EmitterVisitorContext.prototype.popClass = /**
  99312. * @return {?}
  99313. */
  99314. function () { return /** @type {?} */ ((this._classes.pop())); };
  99315. Object.defineProperty(EmitterVisitorContext.prototype, "currentClass", {
  99316. get: /**
  99317. * @return {?}
  99318. */
  99319. function () {
  99320. return this._classes.length > 0 ? this._classes[this._classes.length - 1] : null;
  99321. },
  99322. enumerable: true,
  99323. configurable: true
  99324. });
  99325. /**
  99326. * @return {?}
  99327. */
  99328. EmitterVisitorContext.prototype.toSource = /**
  99329. * @return {?}
  99330. */
  99331. function () {
  99332. return this.sourceLines
  99333. .map(function (l) { return l.parts.length > 0 ? _createIndent(l.indent) + l.parts.join('') : ''; })
  99334. .join('\n');
  99335. };
  99336. /**
  99337. * @param {?} genFilePath
  99338. * @param {?=} startsAtLine
  99339. * @return {?}
  99340. */
  99341. EmitterVisitorContext.prototype.toSourceMapGenerator = /**
  99342. * @param {?} genFilePath
  99343. * @param {?=} startsAtLine
  99344. * @return {?}
  99345. */
  99346. function (genFilePath, startsAtLine) {
  99347. if (startsAtLine === void 0) { startsAtLine = 0; }
  99348. var /** @type {?} */ map = new SourceMapGenerator(genFilePath);
  99349. var /** @type {?} */ firstOffsetMapped = false;
  99350. var /** @type {?} */ mapFirstOffsetIfNeeded = function () {
  99351. if (!firstOffsetMapped) {
  99352. // Add a single space so that tools won't try to load the file from disk.
  99353. // Note: We are using virtual urls like `ng:///`, so we have to
  99354. // provide a content here.
  99355. map.addSource(genFilePath, ' ').addMapping(0, genFilePath, 0, 0);
  99356. firstOffsetMapped = true;
  99357. }
  99358. };
  99359. for (var /** @type {?} */ i = 0; i < startsAtLine; i++) {
  99360. map.addLine();
  99361. mapFirstOffsetIfNeeded();
  99362. }
  99363. this.sourceLines.forEach(function (line, lineIdx) {
  99364. map.addLine();
  99365. var /** @type {?} */ spans = line.srcSpans;
  99366. var /** @type {?} */ parts = line.parts;
  99367. var /** @type {?} */ col0 = line.indent * _INDENT_WITH.length;
  99368. var /** @type {?} */ spanIdx = 0;
  99369. // skip leading parts without source spans
  99370. while (spanIdx < spans.length && !spans[spanIdx]) {
  99371. col0 += parts[spanIdx].length;
  99372. spanIdx++;
  99373. }
  99374. if (spanIdx < spans.length && lineIdx === 0 && col0 === 0) {
  99375. firstOffsetMapped = true;
  99376. }
  99377. else {
  99378. mapFirstOffsetIfNeeded();
  99379. }
  99380. while (spanIdx < spans.length) {
  99381. var /** @type {?} */ span = /** @type {?} */ ((spans[spanIdx]));
  99382. var /** @type {?} */ source = span.start.file;
  99383. var /** @type {?} */ sourceLine = span.start.line;
  99384. var /** @type {?} */ sourceCol = span.start.col;
  99385. map.addSource(source.url, source.content)
  99386. .addMapping(col0, source.url, sourceLine, sourceCol);
  99387. col0 += parts[spanIdx].length;
  99388. spanIdx++;
  99389. // assign parts without span or the same span to the previous segment
  99390. while (spanIdx < spans.length && (span === spans[spanIdx] || !spans[spanIdx])) {
  99391. col0 += parts[spanIdx].length;
  99392. spanIdx++;
  99393. }
  99394. }
  99395. });
  99396. return map;
  99397. };
  99398. /**
  99399. * @param {?} count
  99400. * @return {?}
  99401. */
  99402. EmitterVisitorContext.prototype.setPreambleLineCount = /**
  99403. * @param {?} count
  99404. * @return {?}
  99405. */
  99406. function (count) { return this._preambleLineCount = count; };
  99407. /**
  99408. * @param {?} line
  99409. * @param {?} column
  99410. * @return {?}
  99411. */
  99412. EmitterVisitorContext.prototype.spanOf = /**
  99413. * @param {?} line
  99414. * @param {?} column
  99415. * @return {?}
  99416. */
  99417. function (line, column) {
  99418. var /** @type {?} */ emittedLine = this._lines[line - this._preambleLineCount];
  99419. if (emittedLine) {
  99420. var /** @type {?} */ columnsLeft = column - _createIndent(emittedLine.indent).length;
  99421. for (var /** @type {?} */ partIndex = 0; partIndex < emittedLine.parts.length; partIndex++) {
  99422. var /** @type {?} */ part = emittedLine.parts[partIndex];
  99423. if (part.length > columnsLeft) {
  99424. return emittedLine.srcSpans[partIndex];
  99425. }
  99426. columnsLeft -= part.length;
  99427. }
  99428. }
  99429. return null;
  99430. };
  99431. Object.defineProperty(EmitterVisitorContext.prototype, "sourceLines", {
  99432. get: /**
  99433. * @return {?}
  99434. */
  99435. function () {
  99436. if (this._lines.length && this._lines[this._lines.length - 1].parts.length === 0) {
  99437. return this._lines.slice(0, -1);
  99438. }
  99439. return this._lines;
  99440. },
  99441. enumerable: true,
  99442. configurable: true
  99443. });
  99444. return EmitterVisitorContext;
  99445. }());
  99446. /**
  99447. * @abstract
  99448. */
  99449. var AbstractEmitterVisitor = /** @class */ (function () {
  99450. function AbstractEmitterVisitor(_escapeDollarInStrings) {
  99451. this._escapeDollarInStrings = _escapeDollarInStrings;
  99452. }
  99453. /**
  99454. * @param {?} stmt
  99455. * @param {?} ctx
  99456. * @return {?}
  99457. */
  99458. AbstractEmitterVisitor.prototype.visitExpressionStmt = /**
  99459. * @param {?} stmt
  99460. * @param {?} ctx
  99461. * @return {?}
  99462. */
  99463. function (stmt, ctx) {
  99464. stmt.expr.visitExpression(this, ctx);
  99465. ctx.println(stmt, ';');
  99466. return null;
  99467. };
  99468. /**
  99469. * @param {?} stmt
  99470. * @param {?} ctx
  99471. * @return {?}
  99472. */
  99473. AbstractEmitterVisitor.prototype.visitReturnStmt = /**
  99474. * @param {?} stmt
  99475. * @param {?} ctx
  99476. * @return {?}
  99477. */
  99478. function (stmt, ctx) {
  99479. ctx.print(stmt, "return ");
  99480. stmt.value.visitExpression(this, ctx);
  99481. ctx.println(stmt, ';');
  99482. return null;
  99483. };
  99484. /**
  99485. * @param {?} stmt
  99486. * @param {?} ctx
  99487. * @return {?}
  99488. */
  99489. AbstractEmitterVisitor.prototype.visitIfStmt = /**
  99490. * @param {?} stmt
  99491. * @param {?} ctx
  99492. * @return {?}
  99493. */
  99494. function (stmt, ctx) {
  99495. ctx.print(stmt, "if (");
  99496. stmt.condition.visitExpression(this, ctx);
  99497. ctx.print(stmt, ") {");
  99498. var /** @type {?} */ hasElseCase = stmt.falseCase != null && stmt.falseCase.length > 0;
  99499. if (stmt.trueCase.length <= 1 && !hasElseCase) {
  99500. ctx.print(stmt, " ");
  99501. this.visitAllStatements(stmt.trueCase, ctx);
  99502. ctx.removeEmptyLastLine();
  99503. ctx.print(stmt, " ");
  99504. }
  99505. else {
  99506. ctx.println();
  99507. ctx.incIndent();
  99508. this.visitAllStatements(stmt.trueCase, ctx);
  99509. ctx.decIndent();
  99510. if (hasElseCase) {
  99511. ctx.println(stmt, "} else {");
  99512. ctx.incIndent();
  99513. this.visitAllStatements(stmt.falseCase, ctx);
  99514. ctx.decIndent();
  99515. }
  99516. }
  99517. ctx.println(stmt, "}");
  99518. return null;
  99519. };
  99520. /**
  99521. * @param {?} stmt
  99522. * @param {?} ctx
  99523. * @return {?}
  99524. */
  99525. AbstractEmitterVisitor.prototype.visitThrowStmt = /**
  99526. * @param {?} stmt
  99527. * @param {?} ctx
  99528. * @return {?}
  99529. */
  99530. function (stmt, ctx) {
  99531. ctx.print(stmt, "throw ");
  99532. stmt.error.visitExpression(this, ctx);
  99533. ctx.println(stmt, ";");
  99534. return null;
  99535. };
  99536. /**
  99537. * @param {?} stmt
  99538. * @param {?} ctx
  99539. * @return {?}
  99540. */
  99541. AbstractEmitterVisitor.prototype.visitCommentStmt = /**
  99542. * @param {?} stmt
  99543. * @param {?} ctx
  99544. * @return {?}
  99545. */
  99546. function (stmt, ctx) {
  99547. var /** @type {?} */ lines = stmt.comment.split('\n');
  99548. lines.forEach(function (line) { ctx.println(stmt, "// " + line); });
  99549. return null;
  99550. };
  99551. /**
  99552. * @param {?} expr
  99553. * @param {?} ctx
  99554. * @return {?}
  99555. */
  99556. AbstractEmitterVisitor.prototype.visitWriteVarExpr = /**
  99557. * @param {?} expr
  99558. * @param {?} ctx
  99559. * @return {?}
  99560. */
  99561. function (expr, ctx) {
  99562. var /** @type {?} */ lineWasEmpty = ctx.lineIsEmpty();
  99563. if (!lineWasEmpty) {
  99564. ctx.print(expr, '(');
  99565. }
  99566. ctx.print(expr, expr.name + " = ");
  99567. expr.value.visitExpression(this, ctx);
  99568. if (!lineWasEmpty) {
  99569. ctx.print(expr, ')');
  99570. }
  99571. return null;
  99572. };
  99573. /**
  99574. * @param {?} expr
  99575. * @param {?} ctx
  99576. * @return {?}
  99577. */
  99578. AbstractEmitterVisitor.prototype.visitWriteKeyExpr = /**
  99579. * @param {?} expr
  99580. * @param {?} ctx
  99581. * @return {?}
  99582. */
  99583. function (expr, ctx) {
  99584. var /** @type {?} */ lineWasEmpty = ctx.lineIsEmpty();
  99585. if (!lineWasEmpty) {
  99586. ctx.print(expr, '(');
  99587. }
  99588. expr.receiver.visitExpression(this, ctx);
  99589. ctx.print(expr, "[");
  99590. expr.index.visitExpression(this, ctx);
  99591. ctx.print(expr, "] = ");
  99592. expr.value.visitExpression(this, ctx);
  99593. if (!lineWasEmpty) {
  99594. ctx.print(expr, ')');
  99595. }
  99596. return null;
  99597. };
  99598. /**
  99599. * @param {?} expr
  99600. * @param {?} ctx
  99601. * @return {?}
  99602. */
  99603. AbstractEmitterVisitor.prototype.visitWritePropExpr = /**
  99604. * @param {?} expr
  99605. * @param {?} ctx
  99606. * @return {?}
  99607. */
  99608. function (expr, ctx) {
  99609. var /** @type {?} */ lineWasEmpty = ctx.lineIsEmpty();
  99610. if (!lineWasEmpty) {
  99611. ctx.print(expr, '(');
  99612. }
  99613. expr.receiver.visitExpression(this, ctx);
  99614. ctx.print(expr, "." + expr.name + " = ");
  99615. expr.value.visitExpression(this, ctx);
  99616. if (!lineWasEmpty) {
  99617. ctx.print(expr, ')');
  99618. }
  99619. return null;
  99620. };
  99621. /**
  99622. * @param {?} expr
  99623. * @param {?} ctx
  99624. * @return {?}
  99625. */
  99626. AbstractEmitterVisitor.prototype.visitInvokeMethodExpr = /**
  99627. * @param {?} expr
  99628. * @param {?} ctx
  99629. * @return {?}
  99630. */
  99631. function (expr, ctx) {
  99632. expr.receiver.visitExpression(this, ctx);
  99633. var /** @type {?} */ name = expr.name;
  99634. if (expr.builtin != null) {
  99635. name = this.getBuiltinMethodName(expr.builtin);
  99636. if (name == null) {
  99637. // some builtins just mean to skip the call.
  99638. return null;
  99639. }
  99640. }
  99641. ctx.print(expr, "." + name + "(");
  99642. this.visitAllExpressions(expr.args, ctx, ",");
  99643. ctx.print(expr, ")");
  99644. return null;
  99645. };
  99646. /**
  99647. * @param {?} expr
  99648. * @param {?} ctx
  99649. * @return {?}
  99650. */
  99651. AbstractEmitterVisitor.prototype.visitInvokeFunctionExpr = /**
  99652. * @param {?} expr
  99653. * @param {?} ctx
  99654. * @return {?}
  99655. */
  99656. function (expr, ctx) {
  99657. expr.fn.visitExpression(this, ctx);
  99658. ctx.print(expr, "(");
  99659. this.visitAllExpressions(expr.args, ctx, ',');
  99660. ctx.print(expr, ")");
  99661. return null;
  99662. };
  99663. /**
  99664. * @param {?} ast
  99665. * @param {?} ctx
  99666. * @return {?}
  99667. */
  99668. AbstractEmitterVisitor.prototype.visitReadVarExpr = /**
  99669. * @param {?} ast
  99670. * @param {?} ctx
  99671. * @return {?}
  99672. */
  99673. function (ast, ctx) {
  99674. var /** @type {?} */ varName = /** @type {?} */ ((ast.name));
  99675. if (ast.builtin != null) {
  99676. switch (ast.builtin) {
  99677. case BuiltinVar.Super:
  99678. varName = 'super';
  99679. break;
  99680. case BuiltinVar.This:
  99681. varName = 'this';
  99682. break;
  99683. case BuiltinVar.CatchError:
  99684. varName = /** @type {?} */ ((CATCH_ERROR_VAR$1.name));
  99685. break;
  99686. case BuiltinVar.CatchStack:
  99687. varName = /** @type {?} */ ((CATCH_STACK_VAR$1.name));
  99688. break;
  99689. default:
  99690. throw new Error("Unknown builtin variable " + ast.builtin);
  99691. }
  99692. }
  99693. ctx.print(ast, varName);
  99694. return null;
  99695. };
  99696. /**
  99697. * @param {?} ast
  99698. * @param {?} ctx
  99699. * @return {?}
  99700. */
  99701. AbstractEmitterVisitor.prototype.visitInstantiateExpr = /**
  99702. * @param {?} ast
  99703. * @param {?} ctx
  99704. * @return {?}
  99705. */
  99706. function (ast, ctx) {
  99707. ctx.print(ast, "new ");
  99708. ast.classExpr.visitExpression(this, ctx);
  99709. ctx.print(ast, "(");
  99710. this.visitAllExpressions(ast.args, ctx, ',');
  99711. ctx.print(ast, ")");
  99712. return null;
  99713. };
  99714. /**
  99715. * @param {?} ast
  99716. * @param {?} ctx
  99717. * @return {?}
  99718. */
  99719. AbstractEmitterVisitor.prototype.visitLiteralExpr = /**
  99720. * @param {?} ast
  99721. * @param {?} ctx
  99722. * @return {?}
  99723. */
  99724. function (ast, ctx) {
  99725. var /** @type {?} */ value = ast.value;
  99726. if (typeof value === 'string') {
  99727. ctx.print(ast, escapeIdentifier(value, this._escapeDollarInStrings));
  99728. }
  99729. else {
  99730. ctx.print(ast, "" + value);
  99731. }
  99732. return null;
  99733. };
  99734. /**
  99735. * @param {?} ast
  99736. * @param {?} ctx
  99737. * @return {?}
  99738. */
  99739. AbstractEmitterVisitor.prototype.visitConditionalExpr = /**
  99740. * @param {?} ast
  99741. * @param {?} ctx
  99742. * @return {?}
  99743. */
  99744. function (ast, ctx) {
  99745. ctx.print(ast, "(");
  99746. ast.condition.visitExpression(this, ctx);
  99747. ctx.print(ast, '? ');
  99748. ast.trueCase.visitExpression(this, ctx);
  99749. ctx.print(ast, ': '); /** @type {?} */
  99750. ((ast.falseCase)).visitExpression(this, ctx);
  99751. ctx.print(ast, ")");
  99752. return null;
  99753. };
  99754. /**
  99755. * @param {?} ast
  99756. * @param {?} ctx
  99757. * @return {?}
  99758. */
  99759. AbstractEmitterVisitor.prototype.visitNotExpr = /**
  99760. * @param {?} ast
  99761. * @param {?} ctx
  99762. * @return {?}
  99763. */
  99764. function (ast, ctx) {
  99765. ctx.print(ast, '!');
  99766. ast.condition.visitExpression(this, ctx);
  99767. return null;
  99768. };
  99769. /**
  99770. * @param {?} ast
  99771. * @param {?} ctx
  99772. * @return {?}
  99773. */
  99774. AbstractEmitterVisitor.prototype.visitAssertNotNullExpr = /**
  99775. * @param {?} ast
  99776. * @param {?} ctx
  99777. * @return {?}
  99778. */
  99779. function (ast, ctx) {
  99780. ast.condition.visitExpression(this, ctx);
  99781. return null;
  99782. };
  99783. /**
  99784. * @param {?} ast
  99785. * @param {?} ctx
  99786. * @return {?}
  99787. */
  99788. AbstractEmitterVisitor.prototype.visitBinaryOperatorExpr = /**
  99789. * @param {?} ast
  99790. * @param {?} ctx
  99791. * @return {?}
  99792. */
  99793. function (ast, ctx) {
  99794. var /** @type {?} */ opStr;
  99795. switch (ast.operator) {
  99796. case BinaryOperator.Equals:
  99797. opStr = '==';
  99798. break;
  99799. case BinaryOperator.Identical:
  99800. opStr = '===';
  99801. break;
  99802. case BinaryOperator.NotEquals:
  99803. opStr = '!=';
  99804. break;
  99805. case BinaryOperator.NotIdentical:
  99806. opStr = '!==';
  99807. break;
  99808. case BinaryOperator.And:
  99809. opStr = '&&';
  99810. break;
  99811. case BinaryOperator.Or:
  99812. opStr = '||';
  99813. break;
  99814. case BinaryOperator.Plus:
  99815. opStr = '+';
  99816. break;
  99817. case BinaryOperator.Minus:
  99818. opStr = '-';
  99819. break;
  99820. case BinaryOperator.Divide:
  99821. opStr = '/';
  99822. break;
  99823. case BinaryOperator.Multiply:
  99824. opStr = '*';
  99825. break;
  99826. case BinaryOperator.Modulo:
  99827. opStr = '%';
  99828. break;
  99829. case BinaryOperator.Lower:
  99830. opStr = '<';
  99831. break;
  99832. case BinaryOperator.LowerEquals:
  99833. opStr = '<=';
  99834. break;
  99835. case BinaryOperator.Bigger:
  99836. opStr = '>';
  99837. break;
  99838. case BinaryOperator.BiggerEquals:
  99839. opStr = '>=';
  99840. break;
  99841. default:
  99842. throw new Error("Unknown operator " + ast.operator);
  99843. }
  99844. ctx.print(ast, "(");
  99845. ast.lhs.visitExpression(this, ctx);
  99846. ctx.print(ast, " " + opStr + " ");
  99847. ast.rhs.visitExpression(this, ctx);
  99848. ctx.print(ast, ")");
  99849. return null;
  99850. };
  99851. /**
  99852. * @param {?} ast
  99853. * @param {?} ctx
  99854. * @return {?}
  99855. */
  99856. AbstractEmitterVisitor.prototype.visitReadPropExpr = /**
  99857. * @param {?} ast
  99858. * @param {?} ctx
  99859. * @return {?}
  99860. */
  99861. function (ast, ctx) {
  99862. ast.receiver.visitExpression(this, ctx);
  99863. ctx.print(ast, ".");
  99864. ctx.print(ast, ast.name);
  99865. return null;
  99866. };
  99867. /**
  99868. * @param {?} ast
  99869. * @param {?} ctx
  99870. * @return {?}
  99871. */
  99872. AbstractEmitterVisitor.prototype.visitReadKeyExpr = /**
  99873. * @param {?} ast
  99874. * @param {?} ctx
  99875. * @return {?}
  99876. */
  99877. function (ast, ctx) {
  99878. ast.receiver.visitExpression(this, ctx);
  99879. ctx.print(ast, "[");
  99880. ast.index.visitExpression(this, ctx);
  99881. ctx.print(ast, "]");
  99882. return null;
  99883. };
  99884. /**
  99885. * @param {?} ast
  99886. * @param {?} ctx
  99887. * @return {?}
  99888. */
  99889. AbstractEmitterVisitor.prototype.visitLiteralArrayExpr = /**
  99890. * @param {?} ast
  99891. * @param {?} ctx
  99892. * @return {?}
  99893. */
  99894. function (ast, ctx) {
  99895. ctx.print(ast, "[");
  99896. this.visitAllExpressions(ast.entries, ctx, ',');
  99897. ctx.print(ast, "]");
  99898. return null;
  99899. };
  99900. /**
  99901. * @param {?} ast
  99902. * @param {?} ctx
  99903. * @return {?}
  99904. */
  99905. AbstractEmitterVisitor.prototype.visitLiteralMapExpr = /**
  99906. * @param {?} ast
  99907. * @param {?} ctx
  99908. * @return {?}
  99909. */
  99910. function (ast, ctx) {
  99911. var _this = this;
  99912. ctx.print(ast, "{");
  99913. this.visitAllObjects(function (entry) {
  99914. ctx.print(ast, escapeIdentifier(entry.key, _this._escapeDollarInStrings, entry.quoted) + ":");
  99915. entry.value.visitExpression(_this, ctx);
  99916. }, ast.entries, ctx, ',');
  99917. ctx.print(ast, "}");
  99918. return null;
  99919. };
  99920. /**
  99921. * @param {?} ast
  99922. * @param {?} ctx
  99923. * @return {?}
  99924. */
  99925. AbstractEmitterVisitor.prototype.visitCommaExpr = /**
  99926. * @param {?} ast
  99927. * @param {?} ctx
  99928. * @return {?}
  99929. */
  99930. function (ast, ctx) {
  99931. ctx.print(ast, '(');
  99932. this.visitAllExpressions(ast.parts, ctx, ',');
  99933. ctx.print(ast, ')');
  99934. return null;
  99935. };
  99936. /**
  99937. * @param {?} expressions
  99938. * @param {?} ctx
  99939. * @param {?} separator
  99940. * @return {?}
  99941. */
  99942. AbstractEmitterVisitor.prototype.visitAllExpressions = /**
  99943. * @param {?} expressions
  99944. * @param {?} ctx
  99945. * @param {?} separator
  99946. * @return {?}
  99947. */
  99948. function (expressions, ctx, separator) {
  99949. var _this = this;
  99950. this.visitAllObjects(function (expr) { return expr.visitExpression(_this, ctx); }, expressions, ctx, separator);
  99951. };
  99952. /**
  99953. * @template T
  99954. * @param {?} handler
  99955. * @param {?} expressions
  99956. * @param {?} ctx
  99957. * @param {?} separator
  99958. * @return {?}
  99959. */
  99960. AbstractEmitterVisitor.prototype.visitAllObjects = /**
  99961. * @template T
  99962. * @param {?} handler
  99963. * @param {?} expressions
  99964. * @param {?} ctx
  99965. * @param {?} separator
  99966. * @return {?}
  99967. */
  99968. function (handler, expressions, ctx, separator) {
  99969. var /** @type {?} */ incrementedIndent = false;
  99970. for (var /** @type {?} */ i = 0; i < expressions.length; i++) {
  99971. if (i > 0) {
  99972. if (ctx.lineLength() > 80) {
  99973. ctx.print(null, separator, true);
  99974. if (!incrementedIndent) {
  99975. // continuation are marked with double indent.
  99976. ctx.incIndent();
  99977. ctx.incIndent();
  99978. incrementedIndent = true;
  99979. }
  99980. }
  99981. else {
  99982. ctx.print(null, separator, false);
  99983. }
  99984. }
  99985. handler(expressions[i]);
  99986. }
  99987. if (incrementedIndent) {
  99988. // continuation are marked with double indent.
  99989. ctx.decIndent();
  99990. ctx.decIndent();
  99991. }
  99992. };
  99993. /**
  99994. * @param {?} statements
  99995. * @param {?} ctx
  99996. * @return {?}
  99997. */
  99998. AbstractEmitterVisitor.prototype.visitAllStatements = /**
  99999. * @param {?} statements
  100000. * @param {?} ctx
  100001. * @return {?}
  100002. */
  100003. function (statements, ctx) {
  100004. var _this = this;
  100005. statements.forEach(function (stmt) { return stmt.visitStatement(_this, ctx); });
  100006. };
  100007. return AbstractEmitterVisitor;
  100008. }());
  100009. /**
  100010. * @param {?} input
  100011. * @param {?} escapeDollar
  100012. * @param {?=} alwaysQuote
  100013. * @return {?}
  100014. */
  100015. function escapeIdentifier(input, escapeDollar, alwaysQuote) {
  100016. if (alwaysQuote === void 0) { alwaysQuote = true; }
  100017. if (input == null) {
  100018. return null;
  100019. }
  100020. var /** @type {?} */ body = input.replace(_SINGLE_QUOTE_ESCAPE_STRING_RE, function () {
  100021. var match = [];
  100022. for (var _i = 0; _i < arguments.length; _i++) {
  100023. match[_i] = arguments[_i];
  100024. }
  100025. if (match[0] == '$') {
  100026. return escapeDollar ? '\\$' : '$';
  100027. }
  100028. else if (match[0] == '\n') {
  100029. return '\\n';
  100030. }
  100031. else if (match[0] == '\r') {
  100032. return '\\r';
  100033. }
  100034. else {
  100035. return "\\" + match[0];
  100036. }
  100037. });
  100038. var /** @type {?} */ requiresQuotes = alwaysQuote || !_LEGAL_IDENTIFIER_RE.test(body);
  100039. return requiresQuotes ? "'" + body + "'" : body;
  100040. }
  100041. /**
  100042. * @param {?} count
  100043. * @return {?}
  100044. */
  100045. function _createIndent(count) {
  100046. var /** @type {?} */ res = '';
  100047. for (var /** @type {?} */ i = 0; i < count; i++) {
  100048. res += _INDENT_WITH;
  100049. }
  100050. return res;
  100051. }
  100052. /**
  100053. * @fileoverview added by tsickle
  100054. * @suppress {checkTypes} checked by tsc
  100055. */
  100056. /**
  100057. * @license
  100058. * Copyright Google Inc. All Rights Reserved.
  100059. *
  100060. * Use of this source code is governed by an MIT-style license that can be
  100061. * found in the LICENSE file at https://angular.io/license
  100062. */
  100063. /**
  100064. * @param {?} ast
  100065. * @return {?}
  100066. */
  100067. function debugOutputAstAsTypeScript(ast) {
  100068. var /** @type {?} */ converter = new _TsEmitterVisitor();
  100069. var /** @type {?} */ ctx = EmitterVisitorContext.createRoot();
  100070. var /** @type {?} */ asts = Array.isArray(ast) ? ast : [ast];
  100071. asts.forEach(function (ast) {
  100072. if (ast instanceof Statement) {
  100073. ast.visitStatement(converter, ctx);
  100074. }
  100075. else if (ast instanceof Expression) {
  100076. ast.visitExpression(converter, ctx);
  100077. }
  100078. else if (ast instanceof Type$1) {
  100079. ast.visitType(converter, ctx);
  100080. }
  100081. else {
  100082. throw new Error("Don't know how to print debug info for " + ast);
  100083. }
  100084. });
  100085. return ctx.toSource();
  100086. }
  100087. var TypeScriptEmitter = /** @class */ (function () {
  100088. function TypeScriptEmitter() {
  100089. }
  100090. /**
  100091. * @param {?} genFilePath
  100092. * @param {?} stmts
  100093. * @param {?=} preamble
  100094. * @param {?=} emitSourceMaps
  100095. * @param {?=} referenceFilter
  100096. * @return {?}
  100097. */
  100098. TypeScriptEmitter.prototype.emitStatementsAndContext = /**
  100099. * @param {?} genFilePath
  100100. * @param {?} stmts
  100101. * @param {?=} preamble
  100102. * @param {?=} emitSourceMaps
  100103. * @param {?=} referenceFilter
  100104. * @return {?}
  100105. */
  100106. function (genFilePath, stmts, preamble, emitSourceMaps, referenceFilter) {
  100107. if (preamble === void 0) { preamble = ''; }
  100108. if (emitSourceMaps === void 0) { emitSourceMaps = true; }
  100109. var /** @type {?} */ converter = new _TsEmitterVisitor(referenceFilter);
  100110. var /** @type {?} */ ctx = EmitterVisitorContext.createRoot();
  100111. converter.visitAllStatements(stmts, ctx);
  100112. var /** @type {?} */ preambleLines = preamble ? preamble.split('\n') : [];
  100113. converter.reexports.forEach(function (reexports, exportedModuleName) {
  100114. var /** @type {?} */ reexportsCode = reexports.map(function (reexport) { return reexport.name + " as " + reexport.as; }).join(',');
  100115. preambleLines.push("export {" + reexportsCode + "} from '" + exportedModuleName + "';");
  100116. });
  100117. converter.importsWithPrefixes.forEach(function (prefix, importedModuleName) {
  100118. // Note: can't write the real word for import as it screws up system.js auto detection...
  100119. preambleLines.push("imp" +
  100120. ("ort * as " + prefix + " from '" + importedModuleName + "';"));
  100121. });
  100122. var /** @type {?} */ sm = emitSourceMaps ?
  100123. ctx.toSourceMapGenerator(genFilePath, preambleLines.length).toJsComment() :
  100124. '';
  100125. var /** @type {?} */ lines = preambleLines.concat([ctx.toSource(), sm]);
  100126. if (sm) {
  100127. // always add a newline at the end, as some tools have bugs without it.
  100128. lines.push('');
  100129. }
  100130. ctx.setPreambleLineCount(preambleLines.length);
  100131. return { sourceText: lines.join('\n'), context: ctx };
  100132. };
  100133. /**
  100134. * @param {?} genFilePath
  100135. * @param {?} stmts
  100136. * @param {?=} preamble
  100137. * @return {?}
  100138. */
  100139. TypeScriptEmitter.prototype.emitStatements = /**
  100140. * @param {?} genFilePath
  100141. * @param {?} stmts
  100142. * @param {?=} preamble
  100143. * @return {?}
  100144. */
  100145. function (genFilePath, stmts, preamble) {
  100146. if (preamble === void 0) { preamble = ''; }
  100147. return this.emitStatementsAndContext(genFilePath, stmts, preamble).sourceText;
  100148. };
  100149. return TypeScriptEmitter;
  100150. }());
  100151. var _TsEmitterVisitor = /** @class */ (function (_super) {
  100152. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(_TsEmitterVisitor, _super);
  100153. function _TsEmitterVisitor(referenceFilter) {
  100154. var _this = _super.call(this, false) || this;
  100155. _this.referenceFilter = referenceFilter;
  100156. _this.typeExpression = 0;
  100157. _this.importsWithPrefixes = new Map();
  100158. _this.reexports = new Map();
  100159. return _this;
  100160. }
  100161. /**
  100162. * @param {?} t
  100163. * @param {?} ctx
  100164. * @param {?=} defaultType
  100165. * @return {?}
  100166. */
  100167. _TsEmitterVisitor.prototype.visitType = /**
  100168. * @param {?} t
  100169. * @param {?} ctx
  100170. * @param {?=} defaultType
  100171. * @return {?}
  100172. */
  100173. function (t, ctx, defaultType) {
  100174. if (defaultType === void 0) { defaultType = 'any'; }
  100175. if (t) {
  100176. this.typeExpression++;
  100177. t.visitType(this, ctx);
  100178. this.typeExpression--;
  100179. }
  100180. else {
  100181. ctx.print(null, defaultType);
  100182. }
  100183. };
  100184. /**
  100185. * @param {?} ast
  100186. * @param {?} ctx
  100187. * @return {?}
  100188. */
  100189. _TsEmitterVisitor.prototype.visitLiteralExpr = /**
  100190. * @param {?} ast
  100191. * @param {?} ctx
  100192. * @return {?}
  100193. */
  100194. function (ast, ctx) {
  100195. var /** @type {?} */ value = ast.value;
  100196. if (value == null && ast.type != INFERRED_TYPE) {
  100197. ctx.print(ast, "(" + value + " as any)");
  100198. return null;
  100199. }
  100200. return _super.prototype.visitLiteralExpr.call(this, ast, ctx);
  100201. };
  100202. // Temporary workaround to support strictNullCheck enabled consumers of ngc emit.
  100203. // In SNC mode, [] have the type never[], so we cast here to any[].
  100204. // TODO: narrow the cast to a more explicit type, or use a pattern that does not
  100205. // start with [].concat. see https://github.com/angular/angular/pull/11846
  100206. /**
  100207. * @param {?} ast
  100208. * @param {?} ctx
  100209. * @return {?}
  100210. */
  100211. _TsEmitterVisitor.prototype.visitLiteralArrayExpr = /**
  100212. * @param {?} ast
  100213. * @param {?} ctx
  100214. * @return {?}
  100215. */
  100216. function (ast, ctx) {
  100217. if (ast.entries.length === 0) {
  100218. ctx.print(ast, '(');
  100219. }
  100220. var /** @type {?} */ result = _super.prototype.visitLiteralArrayExpr.call(this, ast, ctx);
  100221. if (ast.entries.length === 0) {
  100222. ctx.print(ast, ' as any[])');
  100223. }
  100224. return result;
  100225. };
  100226. /**
  100227. * @param {?} ast
  100228. * @param {?} ctx
  100229. * @return {?}
  100230. */
  100231. _TsEmitterVisitor.prototype.visitExternalExpr = /**
  100232. * @param {?} ast
  100233. * @param {?} ctx
  100234. * @return {?}
  100235. */
  100236. function (ast, ctx) {
  100237. this._visitIdentifier(ast.value, ast.typeParams, ctx);
  100238. return null;
  100239. };
  100240. /**
  100241. * @param {?} ast
  100242. * @param {?} ctx
  100243. * @return {?}
  100244. */
  100245. _TsEmitterVisitor.prototype.visitAssertNotNullExpr = /**
  100246. * @param {?} ast
  100247. * @param {?} ctx
  100248. * @return {?}
  100249. */
  100250. function (ast, ctx) {
  100251. var /** @type {?} */ result = _super.prototype.visitAssertNotNullExpr.call(this, ast, ctx);
  100252. ctx.print(ast, '!');
  100253. return result;
  100254. };
  100255. /**
  100256. * @param {?} stmt
  100257. * @param {?} ctx
  100258. * @return {?}
  100259. */
  100260. _TsEmitterVisitor.prototype.visitDeclareVarStmt = /**
  100261. * @param {?} stmt
  100262. * @param {?} ctx
  100263. * @return {?}
  100264. */
  100265. function (stmt, ctx) {
  100266. if (stmt.hasModifier(StmtModifier.Exported) && stmt.value instanceof ExternalExpr &&
  100267. !stmt.type) {
  100268. // check for a reexport
  100269. var _a = stmt.value.value, name_1 = _a.name, moduleName = _a.moduleName;
  100270. if (moduleName) {
  100271. var /** @type {?} */ reexports = this.reexports.get(moduleName);
  100272. if (!reexports) {
  100273. reexports = [];
  100274. this.reexports.set(moduleName, reexports);
  100275. }
  100276. reexports.push({ name: /** @type {?} */ ((name_1)), as: stmt.name });
  100277. return null;
  100278. }
  100279. }
  100280. if (stmt.hasModifier(StmtModifier.Exported)) {
  100281. ctx.print(stmt, "export ");
  100282. }
  100283. if (stmt.hasModifier(StmtModifier.Final)) {
  100284. ctx.print(stmt, "const");
  100285. }
  100286. else {
  100287. ctx.print(stmt, "var");
  100288. }
  100289. ctx.print(stmt, " " + stmt.name);
  100290. this._printColonType(stmt.type, ctx);
  100291. ctx.print(stmt, " = ");
  100292. stmt.value.visitExpression(this, ctx);
  100293. ctx.println(stmt, ";");
  100294. return null;
  100295. };
  100296. /**
  100297. * @param {?} ast
  100298. * @param {?} ctx
  100299. * @return {?}
  100300. */
  100301. _TsEmitterVisitor.prototype.visitCastExpr = /**
  100302. * @param {?} ast
  100303. * @param {?} ctx
  100304. * @return {?}
  100305. */
  100306. function (ast, ctx) {
  100307. ctx.print(ast, "(<"); /** @type {?} */
  100308. ((ast.type)).visitType(this, ctx);
  100309. ctx.print(ast, ">");
  100310. ast.value.visitExpression(this, ctx);
  100311. ctx.print(ast, ")");
  100312. return null;
  100313. };
  100314. /**
  100315. * @param {?} ast
  100316. * @param {?} ctx
  100317. * @return {?}
  100318. */
  100319. _TsEmitterVisitor.prototype.visitInstantiateExpr = /**
  100320. * @param {?} ast
  100321. * @param {?} ctx
  100322. * @return {?}
  100323. */
  100324. function (ast, ctx) {
  100325. ctx.print(ast, "new ");
  100326. this.typeExpression++;
  100327. ast.classExpr.visitExpression(this, ctx);
  100328. this.typeExpression--;
  100329. ctx.print(ast, "(");
  100330. this.visitAllExpressions(ast.args, ctx, ',');
  100331. ctx.print(ast, ")");
  100332. return null;
  100333. };
  100334. /**
  100335. * @param {?} stmt
  100336. * @param {?} ctx
  100337. * @return {?}
  100338. */
  100339. _TsEmitterVisitor.prototype.visitDeclareClassStmt = /**
  100340. * @param {?} stmt
  100341. * @param {?} ctx
  100342. * @return {?}
  100343. */
  100344. function (stmt, ctx) {
  100345. var _this = this;
  100346. ctx.pushClass(stmt);
  100347. if (stmt.hasModifier(StmtModifier.Exported)) {
  100348. ctx.print(stmt, "export ");
  100349. }
  100350. ctx.print(stmt, "class " + stmt.name);
  100351. if (stmt.parent != null) {
  100352. ctx.print(stmt, " extends ");
  100353. this.typeExpression++;
  100354. stmt.parent.visitExpression(this, ctx);
  100355. this.typeExpression--;
  100356. }
  100357. ctx.println(stmt, " {");
  100358. ctx.incIndent();
  100359. stmt.fields.forEach(function (field) { return _this._visitClassField(field, ctx); });
  100360. if (stmt.constructorMethod != null) {
  100361. this._visitClassConstructor(stmt, ctx);
  100362. }
  100363. stmt.getters.forEach(function (getter) { return _this._visitClassGetter(getter, ctx); });
  100364. stmt.methods.forEach(function (method) { return _this._visitClassMethod(method, ctx); });
  100365. ctx.decIndent();
  100366. ctx.println(stmt, "}");
  100367. ctx.popClass();
  100368. return null;
  100369. };
  100370. /**
  100371. * @param {?} field
  100372. * @param {?} ctx
  100373. * @return {?}
  100374. */
  100375. _TsEmitterVisitor.prototype._visitClassField = /**
  100376. * @param {?} field
  100377. * @param {?} ctx
  100378. * @return {?}
  100379. */
  100380. function (field, ctx) {
  100381. if (field.hasModifier(StmtModifier.Private)) {
  100382. // comment out as a workaround for #10967
  100383. ctx.print(null, "/*private*/ ");
  100384. }
  100385. ctx.print(null, field.name);
  100386. this._printColonType(field.type, ctx);
  100387. ctx.println(null, ";");
  100388. };
  100389. /**
  100390. * @param {?} getter
  100391. * @param {?} ctx
  100392. * @return {?}
  100393. */
  100394. _TsEmitterVisitor.prototype._visitClassGetter = /**
  100395. * @param {?} getter
  100396. * @param {?} ctx
  100397. * @return {?}
  100398. */
  100399. function (getter, ctx) {
  100400. if (getter.hasModifier(StmtModifier.Private)) {
  100401. ctx.print(null, "private ");
  100402. }
  100403. ctx.print(null, "get " + getter.name + "()");
  100404. this._printColonType(getter.type, ctx);
  100405. ctx.println(null, " {");
  100406. ctx.incIndent();
  100407. this.visitAllStatements(getter.body, ctx);
  100408. ctx.decIndent();
  100409. ctx.println(null, "}");
  100410. };
  100411. /**
  100412. * @param {?} stmt
  100413. * @param {?} ctx
  100414. * @return {?}
  100415. */
  100416. _TsEmitterVisitor.prototype._visitClassConstructor = /**
  100417. * @param {?} stmt
  100418. * @param {?} ctx
  100419. * @return {?}
  100420. */
  100421. function (stmt, ctx) {
  100422. ctx.print(stmt, "constructor(");
  100423. this._visitParams(stmt.constructorMethod.params, ctx);
  100424. ctx.println(stmt, ") {");
  100425. ctx.incIndent();
  100426. this.visitAllStatements(stmt.constructorMethod.body, ctx);
  100427. ctx.decIndent();
  100428. ctx.println(stmt, "}");
  100429. };
  100430. /**
  100431. * @param {?} method
  100432. * @param {?} ctx
  100433. * @return {?}
  100434. */
  100435. _TsEmitterVisitor.prototype._visitClassMethod = /**
  100436. * @param {?} method
  100437. * @param {?} ctx
  100438. * @return {?}
  100439. */
  100440. function (method, ctx) {
  100441. if (method.hasModifier(StmtModifier.Private)) {
  100442. ctx.print(null, "private ");
  100443. }
  100444. ctx.print(null, method.name + "(");
  100445. this._visitParams(method.params, ctx);
  100446. ctx.print(null, ")");
  100447. this._printColonType(method.type, ctx, 'void');
  100448. ctx.println(null, " {");
  100449. ctx.incIndent();
  100450. this.visitAllStatements(method.body, ctx);
  100451. ctx.decIndent();
  100452. ctx.println(null, "}");
  100453. };
  100454. /**
  100455. * @param {?} ast
  100456. * @param {?} ctx
  100457. * @return {?}
  100458. */
  100459. _TsEmitterVisitor.prototype.visitFunctionExpr = /**
  100460. * @param {?} ast
  100461. * @param {?} ctx
  100462. * @return {?}
  100463. */
  100464. function (ast, ctx) {
  100465. ctx.print(ast, "(");
  100466. this._visitParams(ast.params, ctx);
  100467. ctx.print(ast, ")");
  100468. this._printColonType(ast.type, ctx, 'void');
  100469. ctx.println(ast, " => {");
  100470. ctx.incIndent();
  100471. this.visitAllStatements(ast.statements, ctx);
  100472. ctx.decIndent();
  100473. ctx.print(ast, "}");
  100474. return null;
  100475. };
  100476. /**
  100477. * @param {?} stmt
  100478. * @param {?} ctx
  100479. * @return {?}
  100480. */
  100481. _TsEmitterVisitor.prototype.visitDeclareFunctionStmt = /**
  100482. * @param {?} stmt
  100483. * @param {?} ctx
  100484. * @return {?}
  100485. */
  100486. function (stmt, ctx) {
  100487. if (stmt.hasModifier(StmtModifier.Exported)) {
  100488. ctx.print(stmt, "export ");
  100489. }
  100490. ctx.print(stmt, "function " + stmt.name + "(");
  100491. this._visitParams(stmt.params, ctx);
  100492. ctx.print(stmt, ")");
  100493. this._printColonType(stmt.type, ctx, 'void');
  100494. ctx.println(stmt, " {");
  100495. ctx.incIndent();
  100496. this.visitAllStatements(stmt.statements, ctx);
  100497. ctx.decIndent();
  100498. ctx.println(stmt, "}");
  100499. return null;
  100500. };
  100501. /**
  100502. * @param {?} stmt
  100503. * @param {?} ctx
  100504. * @return {?}
  100505. */
  100506. _TsEmitterVisitor.prototype.visitTryCatchStmt = /**
  100507. * @param {?} stmt
  100508. * @param {?} ctx
  100509. * @return {?}
  100510. */
  100511. function (stmt, ctx) {
  100512. ctx.println(stmt, "try {");
  100513. ctx.incIndent();
  100514. this.visitAllStatements(stmt.bodyStmts, ctx);
  100515. ctx.decIndent();
  100516. ctx.println(stmt, "} catch (" + CATCH_ERROR_VAR$1.name + ") {");
  100517. ctx.incIndent();
  100518. var /** @type {?} */ catchStmts = [/** @type {?} */ (CATCH_STACK_VAR$1.set(CATCH_ERROR_VAR$1.prop('stack', null)).toDeclStmt(null, [
  100519. StmtModifier.Final
  100520. ]))].concat(stmt.catchStmts);
  100521. this.visitAllStatements(catchStmts, ctx);
  100522. ctx.decIndent();
  100523. ctx.println(stmt, "}");
  100524. return null;
  100525. };
  100526. /**
  100527. * @param {?} type
  100528. * @param {?} ctx
  100529. * @return {?}
  100530. */
  100531. _TsEmitterVisitor.prototype.visitBuiltintType = /**
  100532. * @param {?} type
  100533. * @param {?} ctx
  100534. * @return {?}
  100535. */
  100536. function (type, ctx) {
  100537. var /** @type {?} */ typeStr;
  100538. switch (type.name) {
  100539. case BuiltinTypeName.Bool:
  100540. typeStr = 'boolean';
  100541. break;
  100542. case BuiltinTypeName.Dynamic:
  100543. typeStr = 'any';
  100544. break;
  100545. case BuiltinTypeName.Function:
  100546. typeStr = 'Function';
  100547. break;
  100548. case BuiltinTypeName.Number:
  100549. typeStr = 'number';
  100550. break;
  100551. case BuiltinTypeName.Int:
  100552. typeStr = 'number';
  100553. break;
  100554. case BuiltinTypeName.String:
  100555. typeStr = 'string';
  100556. break;
  100557. default:
  100558. throw new Error("Unsupported builtin type " + type.name);
  100559. }
  100560. ctx.print(null, typeStr);
  100561. return null;
  100562. };
  100563. /**
  100564. * @param {?} ast
  100565. * @param {?} ctx
  100566. * @return {?}
  100567. */
  100568. _TsEmitterVisitor.prototype.visitExpressionType = /**
  100569. * @param {?} ast
  100570. * @param {?} ctx
  100571. * @return {?}
  100572. */
  100573. function (ast, ctx) {
  100574. ast.value.visitExpression(this, ctx);
  100575. return null;
  100576. };
  100577. /**
  100578. * @param {?} type
  100579. * @param {?} ctx
  100580. * @return {?}
  100581. */
  100582. _TsEmitterVisitor.prototype.visitArrayType = /**
  100583. * @param {?} type
  100584. * @param {?} ctx
  100585. * @return {?}
  100586. */
  100587. function (type, ctx) {
  100588. this.visitType(type.of, ctx);
  100589. ctx.print(null, "[]");
  100590. return null;
  100591. };
  100592. /**
  100593. * @param {?} type
  100594. * @param {?} ctx
  100595. * @return {?}
  100596. */
  100597. _TsEmitterVisitor.prototype.visitMapType = /**
  100598. * @param {?} type
  100599. * @param {?} ctx
  100600. * @return {?}
  100601. */
  100602. function (type, ctx) {
  100603. ctx.print(null, "{[key: string]:");
  100604. this.visitType(type.valueType, ctx);
  100605. ctx.print(null, "}");
  100606. return null;
  100607. };
  100608. /**
  100609. * @param {?} method
  100610. * @return {?}
  100611. */
  100612. _TsEmitterVisitor.prototype.getBuiltinMethodName = /**
  100613. * @param {?} method
  100614. * @return {?}
  100615. */
  100616. function (method) {
  100617. var /** @type {?} */ name;
  100618. switch (method) {
  100619. case BuiltinMethod.ConcatArray:
  100620. name = 'concat';
  100621. break;
  100622. case BuiltinMethod.SubscribeObservable:
  100623. name = 'subscribe';
  100624. break;
  100625. case BuiltinMethod.Bind:
  100626. name = 'bind';
  100627. break;
  100628. default:
  100629. throw new Error("Unknown builtin method: " + method);
  100630. }
  100631. return name;
  100632. };
  100633. /**
  100634. * @param {?} params
  100635. * @param {?} ctx
  100636. * @return {?}
  100637. */
  100638. _TsEmitterVisitor.prototype._visitParams = /**
  100639. * @param {?} params
  100640. * @param {?} ctx
  100641. * @return {?}
  100642. */
  100643. function (params, ctx) {
  100644. var _this = this;
  100645. this.visitAllObjects(function (param) {
  100646. ctx.print(null, param.name);
  100647. _this._printColonType(param.type, ctx);
  100648. }, params, ctx, ',');
  100649. };
  100650. /**
  100651. * @param {?} value
  100652. * @param {?} typeParams
  100653. * @param {?} ctx
  100654. * @return {?}
  100655. */
  100656. _TsEmitterVisitor.prototype._visitIdentifier = /**
  100657. * @param {?} value
  100658. * @param {?} typeParams
  100659. * @param {?} ctx
  100660. * @return {?}
  100661. */
  100662. function (value, typeParams, ctx) {
  100663. var _this = this;
  100664. var name = value.name, moduleName = value.moduleName;
  100665. if (this.referenceFilter && this.referenceFilter(value)) {
  100666. ctx.print(null, '(null as any)');
  100667. return;
  100668. }
  100669. if (moduleName) {
  100670. var /** @type {?} */ prefix = this.importsWithPrefixes.get(moduleName);
  100671. if (prefix == null) {
  100672. prefix = "i" + this.importsWithPrefixes.size;
  100673. this.importsWithPrefixes.set(moduleName, prefix);
  100674. }
  100675. ctx.print(null, prefix + ".");
  100676. }
  100677. ctx.print(null, /** @type {?} */ ((name)));
  100678. if (this.typeExpression > 0) {
  100679. // If we are in a type expression that refers to a generic type then supply
  100680. // the required type parameters. If there were not enough type parameters
  100681. // supplied, supply any as the type. Outside a type expression the reference
  100682. // should not supply type parameters and be treated as a simple value reference
  100683. // to the constructor function itself.
  100684. var /** @type {?} */ suppliedParameters = typeParams || [];
  100685. if (suppliedParameters.length > 0) {
  100686. ctx.print(null, "<");
  100687. this.visitAllObjects(function (type) { return type.visitType(_this, ctx); }, /** @type {?} */ ((typeParams)), ctx, ',');
  100688. ctx.print(null, ">");
  100689. }
  100690. }
  100691. };
  100692. /**
  100693. * @param {?} type
  100694. * @param {?} ctx
  100695. * @param {?=} defaultType
  100696. * @return {?}
  100697. */
  100698. _TsEmitterVisitor.prototype._printColonType = /**
  100699. * @param {?} type
  100700. * @param {?} ctx
  100701. * @param {?=} defaultType
  100702. * @return {?}
  100703. */
  100704. function (type, ctx, defaultType) {
  100705. if (type !== INFERRED_TYPE) {
  100706. ctx.print(null, ':');
  100707. this.visitType(type, ctx, defaultType);
  100708. }
  100709. };
  100710. return _TsEmitterVisitor;
  100711. }(AbstractEmitterVisitor));
  100712. /**
  100713. * @fileoverview added by tsickle
  100714. * @suppress {checkTypes} checked by tsc
  100715. */
  100716. /**
  100717. * @license
  100718. * Copyright Google Inc. All Rights Reserved.
  100719. *
  100720. * Use of this source code is governed by an MIT-style license that can be
  100721. * found in the LICENSE file at https://angular.io/license
  100722. */
  100723. /**
  100724. * Resolve a `Type` for {\@link Pipe}.
  100725. *
  100726. * This interface can be overridden by the application developer to create custom behavior.
  100727. *
  100728. * See {\@link Compiler}
  100729. */
  100730. var PipeResolver = /** @class */ (function () {
  100731. function PipeResolver(_reflector) {
  100732. this._reflector = _reflector;
  100733. }
  100734. /**
  100735. * @param {?} type
  100736. * @return {?}
  100737. */
  100738. PipeResolver.prototype.isPipe = /**
  100739. * @param {?} type
  100740. * @return {?}
  100741. */
  100742. function (type) {
  100743. var /** @type {?} */ typeMetadata = this._reflector.annotations(resolveForwardRef(type));
  100744. return typeMetadata && typeMetadata.some(createPipe.isTypeOf);
  100745. };
  100746. /**
  100747. * Return {@link Pipe} for a given `Type`.
  100748. */
  100749. /**
  100750. * Return {\@link Pipe} for a given `Type`.
  100751. * @param {?} type
  100752. * @param {?=} throwIfNotFound
  100753. * @return {?}
  100754. */
  100755. PipeResolver.prototype.resolve = /**
  100756. * Return {\@link Pipe} for a given `Type`.
  100757. * @param {?} type
  100758. * @param {?=} throwIfNotFound
  100759. * @return {?}
  100760. */
  100761. function (type, throwIfNotFound) {
  100762. if (throwIfNotFound === void 0) { throwIfNotFound = true; }
  100763. var /** @type {?} */ metas = this._reflector.annotations(resolveForwardRef(type));
  100764. if (metas) {
  100765. var /** @type {?} */ annotation = findLast(metas, createPipe.isTypeOf);
  100766. if (annotation) {
  100767. return annotation;
  100768. }
  100769. }
  100770. if (throwIfNotFound) {
  100771. throw new Error("No Pipe decorator found on " + stringify(type));
  100772. }
  100773. return null;
  100774. };
  100775. return PipeResolver;
  100776. }());
  100777. /**
  100778. * @fileoverview added by tsickle
  100779. * @suppress {checkTypes} checked by tsc
  100780. */
  100781. /**
  100782. * @license
  100783. * Copyright Google Inc. All Rights Reserved.
  100784. *
  100785. * Use of this source code is governed by an MIT-style license that can be
  100786. * found in the LICENSE file at https://angular.io/license
  100787. */
  100788. /**
  100789. * Map from tagName|propertyName SecurityContext. Properties applying to all tags use '*'.
  100790. */
  100791. var SECURITY_SCHEMA = {};
  100792. /**
  100793. * @param {?} ctx
  100794. * @param {?} specs
  100795. * @return {?}
  100796. */
  100797. function registerContext(ctx, specs) {
  100798. for (var _i = 0, specs_1 = specs; _i < specs_1.length; _i++) {
  100799. var spec = specs_1[_i];
  100800. SECURITY_SCHEMA[spec.toLowerCase()] = ctx;
  100801. }
  100802. }
  100803. // Case is insignificant below, all element and attribute names are lower-cased for lookup.
  100804. registerContext(SecurityContext.HTML, [
  100805. 'iframe|srcdoc',
  100806. '*|innerHTML',
  100807. '*|outerHTML',
  100808. ]);
  100809. registerContext(SecurityContext.STYLE, ['*|style']);
  100810. // NB: no SCRIPT contexts here, they are never allowed due to the parser stripping them.
  100811. registerContext(SecurityContext.URL, [
  100812. '*|formAction', 'area|href', 'area|ping', 'audio|src', 'a|href',
  100813. 'a|ping', 'blockquote|cite', 'body|background', 'del|cite', 'form|action',
  100814. 'img|src', 'img|srcset', 'input|src', 'ins|cite', 'q|cite',
  100815. 'source|src', 'source|srcset', 'track|src', 'video|poster', 'video|src',
  100816. ]);
  100817. registerContext(SecurityContext.RESOURCE_URL, [
  100818. 'applet|code',
  100819. 'applet|codebase',
  100820. 'base|href',
  100821. 'embed|src',
  100822. 'frame|src',
  100823. 'head|profile',
  100824. 'html|manifest',
  100825. 'iframe|src',
  100826. 'link|href',
  100827. 'media|src',
  100828. 'object|codebase',
  100829. 'object|data',
  100830. 'script|src',
  100831. ]);
  100832. /**
  100833. * @fileoverview added by tsickle
  100834. * @suppress {checkTypes} checked by tsc
  100835. */
  100836. /**
  100837. * @license
  100838. * Copyright Google Inc. All Rights Reserved.
  100839. *
  100840. * Use of this source code is governed by an MIT-style license that can be
  100841. * found in the LICENSE file at https://angular.io/license
  100842. */
  100843. /**
  100844. * @abstract
  100845. */
  100846. var ElementSchemaRegistry = /** @class */ (function () {
  100847. function ElementSchemaRegistry() {
  100848. }
  100849. return ElementSchemaRegistry;
  100850. }());
  100851. /**
  100852. * @fileoverview added by tsickle
  100853. * @suppress {checkTypes} checked by tsc
  100854. */
  100855. /**
  100856. * @license
  100857. * Copyright Google Inc. All Rights Reserved.
  100858. *
  100859. * Use of this source code is governed by an MIT-style license that can be
  100860. * found in the LICENSE file at https://angular.io/license
  100861. */
  100862. var BOOLEAN = 'boolean';
  100863. var NUMBER = 'number';
  100864. var STRING = 'string';
  100865. var OBJECT = 'object';
  100866. /**
  100867. * This array represents the DOM schema. It encodes inheritance, properties, and events.
  100868. *
  100869. * ## Overview
  100870. *
  100871. * Each line represents one kind of element. The `element_inheritance` and properties are joined
  100872. * using `element_inheritance|properties` syntax.
  100873. *
  100874. * ## Element Inheritance
  100875. *
  100876. * The `element_inheritance` can be further subdivided as `element1,element2,...^parentElement`.
  100877. * Here the individual elements are separated by `,` (commas). Every element in the list
  100878. * has identical properties.
  100879. *
  100880. * An `element` may inherit additional properties from `parentElement` If no `^parentElement` is
  100881. * specified then `""` (blank) element is assumed.
  100882. *
  100883. * NOTE: The blank element inherits from root `[Element]` element, the super element of all
  100884. * elements.
  100885. *
  100886. * NOTE an element prefix such as `:svg:` has no special meaning to the schema.
  100887. *
  100888. * ## Properties
  100889. *
  100890. * Each element has a set of properties separated by `,` (commas). Each property can be prefixed
  100891. * by a special character designating its type:
  100892. *
  100893. * - (no prefix): property is a string.
  100894. * - `*`: property represents an event.
  100895. * - `!`: property is a boolean.
  100896. * - `#`: property is a number.
  100897. * - `%`: property is an object.
  100898. *
  100899. * ## Query
  100900. *
  100901. * The class creates an internal squas representation which allows to easily answer the query of
  100902. * if a given property exist on a given element.
  100903. *
  100904. * NOTE: We don't yet support querying for types or events.
  100905. * NOTE: This schema is auto extracted from `schema_extractor.ts` located in the test folder,
  100906. * see dom_element_schema_registry_spec.ts
  100907. */
  100908. var SCHEMA = [
  100909. '[Element]|textContent,%classList,className,id,innerHTML,*beforecopy,*beforecut,*beforepaste,*copy,*cut,*paste,*search,*selectstart,*webkitfullscreenchange,*webkitfullscreenerror,*wheel,outerHTML,#scrollLeft,#scrollTop,slot' +
  100910. ',*message,*mozfullscreenchange,*mozfullscreenerror,*mozpointerlockchange,*mozpointerlockerror,*webglcontextcreationerror,*webglcontextlost,*webglcontextrestored',
  100911. '[HTMLElement]^[Element]|accessKey,contentEditable,dir,!draggable,!hidden,innerText,lang,*abort,*auxclick,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*cuechange,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*seeked,*seeking,*select,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,outerText,!spellcheck,%style,#tabIndex,title,!translate',
  100912. 'abbr,address,article,aside,b,bdi,bdo,cite,code,dd,dfn,dt,em,figcaption,figure,footer,header,i,kbd,main,mark,nav,noscript,rb,rp,rt,rtc,ruby,s,samp,section,small,strong,sub,sup,u,var,wbr^[HTMLElement]|accessKey,contentEditable,dir,!draggable,!hidden,innerText,lang,*abort,*auxclick,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*cuechange,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*seeked,*seeking,*select,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,outerText,!spellcheck,%style,#tabIndex,title,!translate',
  100913. 'media^[HTMLElement]|!autoplay,!controls,%controlsList,%crossOrigin,#currentTime,!defaultMuted,#defaultPlaybackRate,!disableRemotePlayback,!loop,!muted,*encrypted,*waitingforkey,#playbackRate,preload,src,%srcObject,#volume',
  100914. ':svg:^[HTMLElement]|*abort,*auxclick,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*cuechange,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*seeked,*seeking,*select,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,%style,#tabIndex',
  100915. ':svg:graphics^:svg:|',
  100916. ':svg:animation^:svg:|*begin,*end,*repeat',
  100917. ':svg:geometry^:svg:|',
  100918. ':svg:componentTransferFunction^:svg:|',
  100919. ':svg:gradient^:svg:|',
  100920. ':svg:textContent^:svg:graphics|',
  100921. ':svg:textPositioning^:svg:textContent|',
  100922. 'a^[HTMLElement]|charset,coords,download,hash,host,hostname,href,hreflang,name,password,pathname,ping,port,protocol,referrerPolicy,rel,rev,search,shape,target,text,type,username',
  100923. 'area^[HTMLElement]|alt,coords,download,hash,host,hostname,href,!noHref,password,pathname,ping,port,protocol,referrerPolicy,rel,search,shape,target,username',
  100924. 'audio^media|',
  100925. 'br^[HTMLElement]|clear',
  100926. 'base^[HTMLElement]|href,target',
  100927. 'body^[HTMLElement]|aLink,background,bgColor,link,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,text,vLink',
  100928. 'button^[HTMLElement]|!autofocus,!disabled,formAction,formEnctype,formMethod,!formNoValidate,formTarget,name,type,value',
  100929. 'canvas^[HTMLElement]|#height,#width',
  100930. 'content^[HTMLElement]|select',
  100931. 'dl^[HTMLElement]|!compact',
  100932. 'datalist^[HTMLElement]|',
  100933. 'details^[HTMLElement]|!open',
  100934. 'dialog^[HTMLElement]|!open,returnValue',
  100935. 'dir^[HTMLElement]|!compact',
  100936. 'div^[HTMLElement]|align',
  100937. 'embed^[HTMLElement]|align,height,name,src,type,width',
  100938. 'fieldset^[HTMLElement]|!disabled,name',
  100939. 'font^[HTMLElement]|color,face,size',
  100940. 'form^[HTMLElement]|acceptCharset,action,autocomplete,encoding,enctype,method,name,!noValidate,target',
  100941. 'frame^[HTMLElement]|frameBorder,longDesc,marginHeight,marginWidth,name,!noResize,scrolling,src',
  100942. 'frameset^[HTMLElement]|cols,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,rows',
  100943. 'hr^[HTMLElement]|align,color,!noShade,size,width',
  100944. 'head^[HTMLElement]|',
  100945. 'h1,h2,h3,h4,h5,h6^[HTMLElement]|align',
  100946. 'html^[HTMLElement]|version',
  100947. 'iframe^[HTMLElement]|align,!allowFullscreen,frameBorder,height,longDesc,marginHeight,marginWidth,name,referrerPolicy,%sandbox,scrolling,src,srcdoc,width',
  100948. 'img^[HTMLElement]|align,alt,border,%crossOrigin,#height,#hspace,!isMap,longDesc,lowsrc,name,referrerPolicy,sizes,src,srcset,useMap,#vspace,#width',
  100949. 'input^[HTMLElement]|accept,align,alt,autocapitalize,autocomplete,!autofocus,!checked,!defaultChecked,defaultValue,dirName,!disabled,%files,formAction,formEnctype,formMethod,!formNoValidate,formTarget,#height,!incremental,!indeterminate,max,#maxLength,min,#minLength,!multiple,name,pattern,placeholder,!readOnly,!required,selectionDirection,#selectionEnd,#selectionStart,#size,src,step,type,useMap,value,%valueAsDate,#valueAsNumber,#width',
  100950. 'li^[HTMLElement]|type,#value',
  100951. 'label^[HTMLElement]|htmlFor',
  100952. 'legend^[HTMLElement]|align',
  100953. 'link^[HTMLElement]|as,charset,%crossOrigin,!disabled,href,hreflang,integrity,media,referrerPolicy,rel,%relList,rev,%sizes,target,type',
  100954. 'map^[HTMLElement]|name',
  100955. 'marquee^[HTMLElement]|behavior,bgColor,direction,height,#hspace,#loop,#scrollAmount,#scrollDelay,!trueSpeed,#vspace,width',
  100956. 'menu^[HTMLElement]|!compact',
  100957. 'meta^[HTMLElement]|content,httpEquiv,name,scheme',
  100958. 'meter^[HTMLElement]|#high,#low,#max,#min,#optimum,#value',
  100959. 'ins,del^[HTMLElement]|cite,dateTime',
  100960. 'ol^[HTMLElement]|!compact,!reversed,#start,type',
  100961. 'object^[HTMLElement]|align,archive,border,code,codeBase,codeType,data,!declare,height,#hspace,name,standby,type,useMap,#vspace,width',
  100962. 'optgroup^[HTMLElement]|!disabled,label',
  100963. 'option^[HTMLElement]|!defaultSelected,!disabled,label,!selected,text,value',
  100964. 'output^[HTMLElement]|defaultValue,%htmlFor,name,value',
  100965. 'p^[HTMLElement]|align',
  100966. 'param^[HTMLElement]|name,type,value,valueType',
  100967. 'picture^[HTMLElement]|',
  100968. 'pre^[HTMLElement]|#width',
  100969. 'progress^[HTMLElement]|#max,#value',
  100970. 'q,blockquote,cite^[HTMLElement]|',
  100971. 'script^[HTMLElement]|!async,charset,%crossOrigin,!defer,event,htmlFor,integrity,src,text,type',
  100972. 'select^[HTMLElement]|!autofocus,!disabled,#length,!multiple,name,!required,#selectedIndex,#size,value',
  100973. 'shadow^[HTMLElement]|',
  100974. 'slot^[HTMLElement]|name',
  100975. 'source^[HTMLElement]|media,sizes,src,srcset,type',
  100976. 'span^[HTMLElement]|',
  100977. 'style^[HTMLElement]|!disabled,media,type',
  100978. 'caption^[HTMLElement]|align',
  100979. 'th,td^[HTMLElement]|abbr,align,axis,bgColor,ch,chOff,#colSpan,headers,height,!noWrap,#rowSpan,scope,vAlign,width',
  100980. 'col,colgroup^[HTMLElement]|align,ch,chOff,#span,vAlign,width',
  100981. 'table^[HTMLElement]|align,bgColor,border,%caption,cellPadding,cellSpacing,frame,rules,summary,%tFoot,%tHead,width',
  100982. 'tr^[HTMLElement]|align,bgColor,ch,chOff,vAlign',
  100983. 'tfoot,thead,tbody^[HTMLElement]|align,ch,chOff,vAlign',
  100984. 'template^[HTMLElement]|',
  100985. 'textarea^[HTMLElement]|autocapitalize,!autofocus,#cols,defaultValue,dirName,!disabled,#maxLength,#minLength,name,placeholder,!readOnly,!required,#rows,selectionDirection,#selectionEnd,#selectionStart,value,wrap',
  100986. 'title^[HTMLElement]|text',
  100987. 'track^[HTMLElement]|!default,kind,label,src,srclang',
  100988. 'ul^[HTMLElement]|!compact,type',
  100989. 'unknown^[HTMLElement]|',
  100990. 'video^media|#height,poster,#width',
  100991. ':svg:a^:svg:graphics|',
  100992. ':svg:animate^:svg:animation|',
  100993. ':svg:animateMotion^:svg:animation|',
  100994. ':svg:animateTransform^:svg:animation|',
  100995. ':svg:circle^:svg:geometry|',
  100996. ':svg:clipPath^:svg:graphics|',
  100997. ':svg:defs^:svg:graphics|',
  100998. ':svg:desc^:svg:|',
  100999. ':svg:discard^:svg:|',
  101000. ':svg:ellipse^:svg:geometry|',
  101001. ':svg:feBlend^:svg:|',
  101002. ':svg:feColorMatrix^:svg:|',
  101003. ':svg:feComponentTransfer^:svg:|',
  101004. ':svg:feComposite^:svg:|',
  101005. ':svg:feConvolveMatrix^:svg:|',
  101006. ':svg:feDiffuseLighting^:svg:|',
  101007. ':svg:feDisplacementMap^:svg:|',
  101008. ':svg:feDistantLight^:svg:|',
  101009. ':svg:feDropShadow^:svg:|',
  101010. ':svg:feFlood^:svg:|',
  101011. ':svg:feFuncA^:svg:componentTransferFunction|',
  101012. ':svg:feFuncB^:svg:componentTransferFunction|',
  101013. ':svg:feFuncG^:svg:componentTransferFunction|',
  101014. ':svg:feFuncR^:svg:componentTransferFunction|',
  101015. ':svg:feGaussianBlur^:svg:|',
  101016. ':svg:feImage^:svg:|',
  101017. ':svg:feMerge^:svg:|',
  101018. ':svg:feMergeNode^:svg:|',
  101019. ':svg:feMorphology^:svg:|',
  101020. ':svg:feOffset^:svg:|',
  101021. ':svg:fePointLight^:svg:|',
  101022. ':svg:feSpecularLighting^:svg:|',
  101023. ':svg:feSpotLight^:svg:|',
  101024. ':svg:feTile^:svg:|',
  101025. ':svg:feTurbulence^:svg:|',
  101026. ':svg:filter^:svg:|',
  101027. ':svg:foreignObject^:svg:graphics|',
  101028. ':svg:g^:svg:graphics|',
  101029. ':svg:image^:svg:graphics|',
  101030. ':svg:line^:svg:geometry|',
  101031. ':svg:linearGradient^:svg:gradient|',
  101032. ':svg:mpath^:svg:|',
  101033. ':svg:marker^:svg:|',
  101034. ':svg:mask^:svg:|',
  101035. ':svg:metadata^:svg:|',
  101036. ':svg:path^:svg:geometry|',
  101037. ':svg:pattern^:svg:|',
  101038. ':svg:polygon^:svg:geometry|',
  101039. ':svg:polyline^:svg:geometry|',
  101040. ':svg:radialGradient^:svg:gradient|',
  101041. ':svg:rect^:svg:geometry|',
  101042. ':svg:svg^:svg:graphics|#currentScale,#zoomAndPan',
  101043. ':svg:script^:svg:|type',
  101044. ':svg:set^:svg:animation|',
  101045. ':svg:stop^:svg:|',
  101046. ':svg:style^:svg:|!disabled,media,title,type',
  101047. ':svg:switch^:svg:graphics|',
  101048. ':svg:symbol^:svg:|',
  101049. ':svg:tspan^:svg:textPositioning|',
  101050. ':svg:text^:svg:textPositioning|',
  101051. ':svg:textPath^:svg:textContent|',
  101052. ':svg:title^:svg:|',
  101053. ':svg:use^:svg:graphics|',
  101054. ':svg:view^:svg:|#zoomAndPan',
  101055. 'data^[HTMLElement]|value',
  101056. 'keygen^[HTMLElement]|!autofocus,challenge,!disabled,form,keytype,name',
  101057. 'menuitem^[HTMLElement]|type,label,icon,!disabled,!checked,radiogroup,!default',
  101058. 'summary^[HTMLElement]|',
  101059. 'time^[HTMLElement]|dateTime',
  101060. ':svg:cursor^:svg:|',
  101061. ];
  101062. var _ATTR_TO_PROP = {
  101063. 'class': 'className',
  101064. 'for': 'htmlFor',
  101065. 'formaction': 'formAction',
  101066. 'innerHtml': 'innerHTML',
  101067. 'readonly': 'readOnly',
  101068. 'tabindex': 'tabIndex',
  101069. };
  101070. var DomElementSchemaRegistry = /** @class */ (function (_super) {
  101071. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(DomElementSchemaRegistry, _super);
  101072. function DomElementSchemaRegistry() {
  101073. var _this = _super.call(this) || this;
  101074. _this._schema = {};
  101075. SCHEMA.forEach(function (encodedType) {
  101076. var /** @type {?} */ type = {};
  101077. var _a = encodedType.split('|'), strType = _a[0], strProperties = _a[1];
  101078. var /** @type {?} */ properties = strProperties.split(',');
  101079. var _b = strType.split('^'), typeNames = _b[0], superName = _b[1];
  101080. typeNames.split(',').forEach(function (tag) { return _this._schema[tag.toLowerCase()] = type; });
  101081. var /** @type {?} */ superType = superName && _this._schema[superName.toLowerCase()];
  101082. if (superType) {
  101083. Object.keys(superType).forEach(function (prop) { type[prop] = superType[prop]; });
  101084. }
  101085. properties.forEach(function (property) {
  101086. if (property.length > 0) {
  101087. switch (property[0]) {
  101088. case '*':
  101089. // We don't yet support events.
  101090. // If ever allowing to bind to events, GO THROUGH A SECURITY REVIEW, allowing events
  101091. // will
  101092. // almost certainly introduce bad XSS vulnerabilities.
  101093. // type[property.substring(1)] = EVENT;
  101094. break;
  101095. case '!':
  101096. type[property.substring(1)] = BOOLEAN;
  101097. break;
  101098. case '#':
  101099. type[property.substring(1)] = NUMBER;
  101100. break;
  101101. case '%':
  101102. type[property.substring(1)] = OBJECT;
  101103. break;
  101104. default:
  101105. type[property] = STRING;
  101106. }
  101107. }
  101108. });
  101109. });
  101110. return _this;
  101111. }
  101112. /**
  101113. * @param {?} tagName
  101114. * @param {?} propName
  101115. * @param {?} schemaMetas
  101116. * @return {?}
  101117. */
  101118. DomElementSchemaRegistry.prototype.hasProperty = /**
  101119. * @param {?} tagName
  101120. * @param {?} propName
  101121. * @param {?} schemaMetas
  101122. * @return {?}
  101123. */
  101124. function (tagName, propName, schemaMetas) {
  101125. if (schemaMetas.some(function (schema) { return schema.name === NO_ERRORS_SCHEMA.name; })) {
  101126. return true;
  101127. }
  101128. if (tagName.indexOf('-') > -1) {
  101129. if (isNgContainer(tagName) || isNgContent(tagName)) {
  101130. return false;
  101131. }
  101132. if (schemaMetas.some(function (schema) { return schema.name === CUSTOM_ELEMENTS_SCHEMA.name; })) {
  101133. // Can't tell now as we don't know which properties a custom element will get
  101134. // once it is instantiated
  101135. return true;
  101136. }
  101137. }
  101138. var /** @type {?} */ elementProperties = this._schema[tagName.toLowerCase()] || this._schema['unknown'];
  101139. return !!elementProperties[propName];
  101140. };
  101141. /**
  101142. * @param {?} tagName
  101143. * @param {?} schemaMetas
  101144. * @return {?}
  101145. */
  101146. DomElementSchemaRegistry.prototype.hasElement = /**
  101147. * @param {?} tagName
  101148. * @param {?} schemaMetas
  101149. * @return {?}
  101150. */
  101151. function (tagName, schemaMetas) {
  101152. if (schemaMetas.some(function (schema) { return schema.name === NO_ERRORS_SCHEMA.name; })) {
  101153. return true;
  101154. }
  101155. if (tagName.indexOf('-') > -1) {
  101156. if (isNgContainer(tagName) || isNgContent(tagName)) {
  101157. return true;
  101158. }
  101159. if (schemaMetas.some(function (schema) { return schema.name === CUSTOM_ELEMENTS_SCHEMA.name; })) {
  101160. // Allow any custom elements
  101161. return true;
  101162. }
  101163. }
  101164. return !!this._schema[tagName.toLowerCase()];
  101165. };
  101166. /**
  101167. * securityContext returns the security context for the given property on the given DOM tag.
  101168. *
  101169. * Tag and property name are statically known and cannot change at runtime, i.e. it is not
  101170. * possible to bind a value into a changing attribute or tag name.
  101171. *
  101172. * The filtering is white list based. All attributes in the schema above are assumed to have the
  101173. * 'NONE' security context, i.e. that they are safe inert string values. Only specific well known
  101174. * attack vectors are assigned their appropriate context.
  101175. */
  101176. /**
  101177. * securityContext returns the security context for the given property on the given DOM tag.
  101178. *
  101179. * Tag and property name are statically known and cannot change at runtime, i.e. it is not
  101180. * possible to bind a value into a changing attribute or tag name.
  101181. *
  101182. * The filtering is white list based. All attributes in the schema above are assumed to have the
  101183. * 'NONE' security context, i.e. that they are safe inert string values. Only specific well known
  101184. * attack vectors are assigned their appropriate context.
  101185. * @param {?} tagName
  101186. * @param {?} propName
  101187. * @param {?} isAttribute
  101188. * @return {?}
  101189. */
  101190. DomElementSchemaRegistry.prototype.securityContext = /**
  101191. * securityContext returns the security context for the given property on the given DOM tag.
  101192. *
  101193. * Tag and property name are statically known and cannot change at runtime, i.e. it is not
  101194. * possible to bind a value into a changing attribute or tag name.
  101195. *
  101196. * The filtering is white list based. All attributes in the schema above are assumed to have the
  101197. * 'NONE' security context, i.e. that they are safe inert string values. Only specific well known
  101198. * attack vectors are assigned their appropriate context.
  101199. * @param {?} tagName
  101200. * @param {?} propName
  101201. * @param {?} isAttribute
  101202. * @return {?}
  101203. */
  101204. function (tagName, propName, isAttribute) {
  101205. if (isAttribute) {
  101206. // NB: For security purposes, use the mapped property name, not the attribute name.
  101207. propName = this.getMappedPropName(propName);
  101208. }
  101209. // Make sure comparisons are case insensitive, so that case differences between attribute and
  101210. // property names do not have a security impact.
  101211. tagName = tagName.toLowerCase();
  101212. propName = propName.toLowerCase();
  101213. var /** @type {?} */ ctx = SECURITY_SCHEMA[tagName + '|' + propName];
  101214. if (ctx) {
  101215. return ctx;
  101216. }
  101217. ctx = SECURITY_SCHEMA['*|' + propName];
  101218. return ctx ? ctx : SecurityContext.NONE;
  101219. };
  101220. /**
  101221. * @param {?} propName
  101222. * @return {?}
  101223. */
  101224. DomElementSchemaRegistry.prototype.getMappedPropName = /**
  101225. * @param {?} propName
  101226. * @return {?}
  101227. */
  101228. function (propName) { return _ATTR_TO_PROP[propName] || propName; };
  101229. /**
  101230. * @return {?}
  101231. */
  101232. DomElementSchemaRegistry.prototype.getDefaultComponentElementName = /**
  101233. * @return {?}
  101234. */
  101235. function () { return 'ng-component'; };
  101236. /**
  101237. * @param {?} name
  101238. * @return {?}
  101239. */
  101240. DomElementSchemaRegistry.prototype.validateProperty = /**
  101241. * @param {?} name
  101242. * @return {?}
  101243. */
  101244. function (name) {
  101245. if (name.toLowerCase().startsWith('on')) {
  101246. var /** @type {?} */ msg = "Binding to event property '" + name + "' is disallowed for security reasons, " +
  101247. ("please use (" + name.slice(2) + ")=...") +
  101248. ("\nIf '" + name + "' is a directive input, make sure the directive is imported by the") +
  101249. " current module.";
  101250. return { error: true, msg: msg };
  101251. }
  101252. else {
  101253. return { error: false };
  101254. }
  101255. };
  101256. /**
  101257. * @param {?} name
  101258. * @return {?}
  101259. */
  101260. DomElementSchemaRegistry.prototype.validateAttribute = /**
  101261. * @param {?} name
  101262. * @return {?}
  101263. */
  101264. function (name) {
  101265. if (name.toLowerCase().startsWith('on')) {
  101266. var /** @type {?} */ msg = "Binding to event attribute '" + name + "' is disallowed for security reasons, " +
  101267. ("please use (" + name.slice(2) + ")=...");
  101268. return { error: true, msg: msg };
  101269. }
  101270. else {
  101271. return { error: false };
  101272. }
  101273. };
  101274. /**
  101275. * @return {?}
  101276. */
  101277. DomElementSchemaRegistry.prototype.allKnownElementNames = /**
  101278. * @return {?}
  101279. */
  101280. function () { return Object.keys(this._schema); };
  101281. /**
  101282. * @param {?} propName
  101283. * @return {?}
  101284. */
  101285. DomElementSchemaRegistry.prototype.normalizeAnimationStyleProperty = /**
  101286. * @param {?} propName
  101287. * @return {?}
  101288. */
  101289. function (propName) {
  101290. return dashCaseToCamelCase(propName);
  101291. };
  101292. /**
  101293. * @param {?} camelCaseProp
  101294. * @param {?} userProvidedProp
  101295. * @param {?} val
  101296. * @return {?}
  101297. */
  101298. DomElementSchemaRegistry.prototype.normalizeAnimationStyleValue = /**
  101299. * @param {?} camelCaseProp
  101300. * @param {?} userProvidedProp
  101301. * @param {?} val
  101302. * @return {?}
  101303. */
  101304. function (camelCaseProp, userProvidedProp, val) {
  101305. var /** @type {?} */ unit = '';
  101306. var /** @type {?} */ strVal = val.toString().trim();
  101307. var /** @type {?} */ errorMsg = /** @type {?} */ ((null));
  101308. if (_isPixelDimensionStyle(camelCaseProp) && val !== 0 && val !== '0') {
  101309. if (typeof val === 'number') {
  101310. unit = 'px';
  101311. }
  101312. else {
  101313. var /** @type {?} */ valAndSuffixMatch = val.match(/^[+-]?[\d\.]+([a-z]*)$/);
  101314. if (valAndSuffixMatch && valAndSuffixMatch[1].length == 0) {
  101315. errorMsg = "Please provide a CSS unit value for " + userProvidedProp + ":" + val;
  101316. }
  101317. }
  101318. }
  101319. return { error: errorMsg, value: strVal + unit };
  101320. };
  101321. return DomElementSchemaRegistry;
  101322. }(ElementSchemaRegistry));
  101323. /**
  101324. * @param {?} prop
  101325. * @return {?}
  101326. */
  101327. function _isPixelDimensionStyle(prop) {
  101328. switch (prop) {
  101329. case 'width':
  101330. case 'height':
  101331. case 'minWidth':
  101332. case 'minHeight':
  101333. case 'maxWidth':
  101334. case 'maxHeight':
  101335. case 'left':
  101336. case 'top':
  101337. case 'bottom':
  101338. case 'right':
  101339. case 'fontSize':
  101340. case 'outlineWidth':
  101341. case 'outlineOffset':
  101342. case 'paddingTop':
  101343. case 'paddingLeft':
  101344. case 'paddingBottom':
  101345. case 'paddingRight':
  101346. case 'marginTop':
  101347. case 'marginLeft':
  101348. case 'marginBottom':
  101349. case 'marginRight':
  101350. case 'borderRadius':
  101351. case 'borderWidth':
  101352. case 'borderTopWidth':
  101353. case 'borderLeftWidth':
  101354. case 'borderRightWidth':
  101355. case 'borderBottomWidth':
  101356. case 'textIndent':
  101357. return true;
  101358. default:
  101359. return false;
  101360. }
  101361. }
  101362. /**
  101363. * @fileoverview added by tsickle
  101364. * @suppress {checkTypes} checked by tsc
  101365. */
  101366. /**
  101367. * @license
  101368. * Copyright Google Inc. All Rights Reserved.
  101369. *
  101370. * Use of this source code is governed by an MIT-style license that can be
  101371. * found in the LICENSE file at https://angular.io/license
  101372. */
  101373. /**
  101374. * This file is a port of shadowCSS from webcomponents.js to TypeScript.
  101375. *
  101376. * Please make sure to keep to edits in sync with the source file.
  101377. *
  101378. * Source:
  101379. * https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js
  101380. *
  101381. * The original file level comment is reproduced below
  101382. */
  101383. /*
  101384. This is a limited shim for ShadowDOM css styling.
  101385. https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#styles
  101386. The intention here is to support only the styling features which can be
  101387. relatively simply implemented. The goal is to allow users to avoid the
  101388. most obvious pitfalls and do so without compromising performance significantly.
  101389. For ShadowDOM styling that's not covered here, a set of best practices
  101390. can be provided that should allow users to accomplish more complex styling.
  101391. The following is a list of specific ShadowDOM styling features and a brief
  101392. discussion of the approach used to shim.
  101393. Shimmed features:
  101394. * :host, :host-context: ShadowDOM allows styling of the shadowRoot's host
  101395. element using the :host rule. To shim this feature, the :host styles are
  101396. reformatted and prefixed with a given scope name and promoted to a
  101397. document level stylesheet.
  101398. For example, given a scope name of .foo, a rule like this:
  101399. :host {
  101400. background: red;
  101401. }
  101402. }
  101403. becomes:
  101404. .foo {
  101405. background: red;
  101406. }
  101407. * encapsulation: Styles defined within ShadowDOM, apply only to
  101408. dom inside the ShadowDOM. Polymer uses one of two techniques to implement
  101409. this feature.
  101410. By default, rules are prefixed with the host element tag name
  101411. as a descendant selector. This ensures styling does not leak out of the 'top'
  101412. of the element's ShadowDOM. For example,
  101413. div {
  101414. font-weight: bold;
  101415. }
  101416. becomes:
  101417. x-foo div {
  101418. font-weight: bold;
  101419. }
  101420. becomes:
  101421. Alternatively, if WebComponents.ShadowCSS.strictStyling is set to true then
  101422. selectors are scoped by adding an attribute selector suffix to each
  101423. simple selector that contains the host element tag name. Each element
  101424. in the element's ShadowDOM template is also given the scope attribute.
  101425. Thus, these rules match only elements that have the scope attribute.
  101426. For example, given a scope name of x-foo, a rule like this:
  101427. div {
  101428. font-weight: bold;
  101429. }
  101430. becomes:
  101431. div[x-foo] {
  101432. font-weight: bold;
  101433. }
  101434. Note that elements that are dynamically added to a scope must have the scope
  101435. selector added to them manually.
  101436. * upper/lower bound encapsulation: Styles which are defined outside a
  101437. shadowRoot should not cross the ShadowDOM boundary and should not apply
  101438. inside a shadowRoot.
  101439. This styling behavior is not emulated. Some possible ways to do this that
  101440. were rejected due to complexity and/or performance concerns include: (1) reset
  101441. every possible property for every possible selector for a given scope name;
  101442. (2) re-implement css in javascript.
  101443. As an alternative, users should make sure to use selectors
  101444. specific to the scope in which they are working.
  101445. * ::distributed: This behavior is not emulated. It's often not necessary
  101446. to style the contents of a specific insertion point and instead, descendants
  101447. of the host element can be styled selectively. Users can also create an
  101448. extra node around an insertion point and style that node's contents
  101449. via descendent selectors. For example, with a shadowRoot like this:
  101450. <style>
  101451. ::content(div) {
  101452. background: red;
  101453. }
  101454. </style>
  101455. <content></content>
  101456. could become:
  101457. <style>
  101458. / *@polyfill .content-container div * /
  101459. ::content(div) {
  101460. background: red;
  101461. }
  101462. </style>
  101463. <div class="content-container">
  101464. <content></content>
  101465. </div>
  101466. Note the use of @polyfill in the comment above a ShadowDOM specific style
  101467. declaration. This is a directive to the styling shim to use the selector
  101468. in comments in lieu of the next selector when running under polyfill.
  101469. */
  101470. var ShadowCss = /** @class */ (function () {
  101471. function ShadowCss() {
  101472. this.strictStyling = true;
  101473. }
  101474. /*
  101475. * Shim some cssText with the given selector. Returns cssText that can
  101476. * be included in the document via WebComponents.ShadowCSS.addCssToDocument(css).
  101477. *
  101478. * When strictStyling is true:
  101479. * - selector is the attribute added to all elements inside the host,
  101480. * - hostSelector is the attribute added to the host itself.
  101481. */
  101482. /**
  101483. * @param {?} cssText
  101484. * @param {?} selector
  101485. * @param {?=} hostSelector
  101486. * @return {?}
  101487. */
  101488. ShadowCss.prototype.shimCssText = /**
  101489. * @param {?} cssText
  101490. * @param {?} selector
  101491. * @param {?=} hostSelector
  101492. * @return {?}
  101493. */
  101494. function (cssText, selector, hostSelector) {
  101495. if (hostSelector === void 0) { hostSelector = ''; }
  101496. var /** @type {?} */ commentsWithHash = extractCommentsWithHash(cssText);
  101497. cssText = stripComments(cssText);
  101498. cssText = this._insertDirectives(cssText);
  101499. var /** @type {?} */ scopedCssText = this._scopeCssText(cssText, selector, hostSelector);
  101500. return [scopedCssText].concat(commentsWithHash).join('\n');
  101501. };
  101502. /**
  101503. * @param {?} cssText
  101504. * @return {?}
  101505. */
  101506. ShadowCss.prototype._insertDirectives = /**
  101507. * @param {?} cssText
  101508. * @return {?}
  101509. */
  101510. function (cssText) {
  101511. cssText = this._insertPolyfillDirectivesInCssText(cssText);
  101512. return this._insertPolyfillRulesInCssText(cssText);
  101513. };
  101514. /**
  101515. * @param {?} cssText
  101516. * @return {?}
  101517. */
  101518. ShadowCss.prototype._insertPolyfillDirectivesInCssText = /**
  101519. * @param {?} cssText
  101520. * @return {?}
  101521. */
  101522. function (cssText) {
  101523. // Difference with webcomponents.js: does not handle comments
  101524. return cssText.replace(_cssContentNextSelectorRe, function () {
  101525. var m = [];
  101526. for (var _i = 0; _i < arguments.length; _i++) {
  101527. m[_i] = arguments[_i];
  101528. }
  101529. return m[2] + '{';
  101530. });
  101531. };
  101532. /**
  101533. * @param {?} cssText
  101534. * @return {?}
  101535. */
  101536. ShadowCss.prototype._insertPolyfillRulesInCssText = /**
  101537. * @param {?} cssText
  101538. * @return {?}
  101539. */
  101540. function (cssText) {
  101541. // Difference with webcomponents.js: does not handle comments
  101542. return cssText.replace(_cssContentRuleRe, function () {
  101543. var m = [];
  101544. for (var _i = 0; _i < arguments.length; _i++) {
  101545. m[_i] = arguments[_i];
  101546. }
  101547. var /** @type {?} */ rule = m[0].replace(m[1], '').replace(m[2], '');
  101548. return m[4] + rule;
  101549. });
  101550. };
  101551. /**
  101552. * @param {?} cssText
  101553. * @param {?} scopeSelector
  101554. * @param {?} hostSelector
  101555. * @return {?}
  101556. */
  101557. ShadowCss.prototype._scopeCssText = /**
  101558. * @param {?} cssText
  101559. * @param {?} scopeSelector
  101560. * @param {?} hostSelector
  101561. * @return {?}
  101562. */
  101563. function (cssText, scopeSelector, hostSelector) {
  101564. var /** @type {?} */ unscopedRules = this._extractUnscopedRulesFromCssText(cssText);
  101565. // replace :host and :host-context -shadowcsshost and -shadowcsshost respectively
  101566. cssText = this._insertPolyfillHostInCssText(cssText);
  101567. cssText = this._convertColonHost(cssText);
  101568. cssText = this._convertColonHostContext(cssText);
  101569. cssText = this._convertShadowDOMSelectors(cssText);
  101570. if (scopeSelector) {
  101571. cssText = this._scopeSelectors(cssText, scopeSelector, hostSelector);
  101572. }
  101573. cssText = cssText + '\n' + unscopedRules;
  101574. return cssText.trim();
  101575. };
  101576. /**
  101577. * @param {?} cssText
  101578. * @return {?}
  101579. */
  101580. ShadowCss.prototype._extractUnscopedRulesFromCssText = /**
  101581. * @param {?} cssText
  101582. * @return {?}
  101583. */
  101584. function (cssText) {
  101585. // Difference with webcomponents.js: does not handle comments
  101586. var /** @type {?} */ r = '';
  101587. var /** @type {?} */ m;
  101588. _cssContentUnscopedRuleRe.lastIndex = 0;
  101589. while ((m = _cssContentUnscopedRuleRe.exec(cssText)) !== null) {
  101590. var /** @type {?} */ rule = m[0].replace(m[2], '').replace(m[1], m[4]);
  101591. r += rule + '\n\n';
  101592. }
  101593. return r;
  101594. };
  101595. /**
  101596. * @param {?} cssText
  101597. * @return {?}
  101598. */
  101599. ShadowCss.prototype._convertColonHost = /**
  101600. * @param {?} cssText
  101601. * @return {?}
  101602. */
  101603. function (cssText) {
  101604. return this._convertColonRule(cssText, _cssColonHostRe, this._colonHostPartReplacer);
  101605. };
  101606. /**
  101607. * @param {?} cssText
  101608. * @return {?}
  101609. */
  101610. ShadowCss.prototype._convertColonHostContext = /**
  101611. * @param {?} cssText
  101612. * @return {?}
  101613. */
  101614. function (cssText) {
  101615. return this._convertColonRule(cssText, _cssColonHostContextRe, this._colonHostContextPartReplacer);
  101616. };
  101617. /**
  101618. * @param {?} cssText
  101619. * @param {?} regExp
  101620. * @param {?} partReplacer
  101621. * @return {?}
  101622. */
  101623. ShadowCss.prototype._convertColonRule = /**
  101624. * @param {?} cssText
  101625. * @param {?} regExp
  101626. * @param {?} partReplacer
  101627. * @return {?}
  101628. */
  101629. function (cssText, regExp, partReplacer) {
  101630. // m[1] = :host(-context), m[2] = contents of (), m[3] rest of rule
  101631. return cssText.replace(regExp, function () {
  101632. var m = [];
  101633. for (var _i = 0; _i < arguments.length; _i++) {
  101634. m[_i] = arguments[_i];
  101635. }
  101636. if (m[2]) {
  101637. var /** @type {?} */ parts = m[2].split(',');
  101638. var /** @type {?} */ r = [];
  101639. for (var /** @type {?} */ i = 0; i < parts.length; i++) {
  101640. var /** @type {?} */ p = parts[i].trim();
  101641. if (!p)
  101642. break;
  101643. r.push(partReplacer(_polyfillHostNoCombinator, p, m[3]));
  101644. }
  101645. return r.join(',');
  101646. }
  101647. else {
  101648. return _polyfillHostNoCombinator + m[3];
  101649. }
  101650. });
  101651. };
  101652. /**
  101653. * @param {?} host
  101654. * @param {?} part
  101655. * @param {?} suffix
  101656. * @return {?}
  101657. */
  101658. ShadowCss.prototype._colonHostContextPartReplacer = /**
  101659. * @param {?} host
  101660. * @param {?} part
  101661. * @param {?} suffix
  101662. * @return {?}
  101663. */
  101664. function (host, part, suffix) {
  101665. if (part.indexOf(_polyfillHost) > -1) {
  101666. return this._colonHostPartReplacer(host, part, suffix);
  101667. }
  101668. else {
  101669. return host + part + suffix + ', ' + part + ' ' + host + suffix;
  101670. }
  101671. };
  101672. /**
  101673. * @param {?} host
  101674. * @param {?} part
  101675. * @param {?} suffix
  101676. * @return {?}
  101677. */
  101678. ShadowCss.prototype._colonHostPartReplacer = /**
  101679. * @param {?} host
  101680. * @param {?} part
  101681. * @param {?} suffix
  101682. * @return {?}
  101683. */
  101684. function (host, part, suffix) {
  101685. return host + part.replace(_polyfillHost, '') + suffix;
  101686. };
  101687. /**
  101688. * @param {?} cssText
  101689. * @return {?}
  101690. */
  101691. ShadowCss.prototype._convertShadowDOMSelectors = /**
  101692. * @param {?} cssText
  101693. * @return {?}
  101694. */
  101695. function (cssText) {
  101696. return _shadowDOMSelectorsRe.reduce(function (result, pattern) { return result.replace(pattern, ' '); }, cssText);
  101697. };
  101698. /**
  101699. * @param {?} cssText
  101700. * @param {?} scopeSelector
  101701. * @param {?} hostSelector
  101702. * @return {?}
  101703. */
  101704. ShadowCss.prototype._scopeSelectors = /**
  101705. * @param {?} cssText
  101706. * @param {?} scopeSelector
  101707. * @param {?} hostSelector
  101708. * @return {?}
  101709. */
  101710. function (cssText, scopeSelector, hostSelector) {
  101711. var _this = this;
  101712. return processRules(cssText, function (rule) {
  101713. var /** @type {?} */ selector = rule.selector;
  101714. var /** @type {?} */ content = rule.content;
  101715. if (rule.selector[0] != '@') {
  101716. selector =
  101717. _this._scopeSelector(rule.selector, scopeSelector, hostSelector, _this.strictStyling);
  101718. }
  101719. else if (rule.selector.startsWith('@media') || rule.selector.startsWith('@supports') ||
  101720. rule.selector.startsWith('@page') || rule.selector.startsWith('@document')) {
  101721. content = _this._scopeSelectors(rule.content, scopeSelector, hostSelector);
  101722. }
  101723. return new CssRule(selector, content);
  101724. });
  101725. };
  101726. /**
  101727. * @param {?} selector
  101728. * @param {?} scopeSelector
  101729. * @param {?} hostSelector
  101730. * @param {?} strict
  101731. * @return {?}
  101732. */
  101733. ShadowCss.prototype._scopeSelector = /**
  101734. * @param {?} selector
  101735. * @param {?} scopeSelector
  101736. * @param {?} hostSelector
  101737. * @param {?} strict
  101738. * @return {?}
  101739. */
  101740. function (selector, scopeSelector, hostSelector, strict) {
  101741. var _this = this;
  101742. return selector.split(',')
  101743. .map(function (part) { return part.trim().split(_shadowDeepSelectors); })
  101744. .map(function (deepParts) {
  101745. var shallowPart = deepParts[0], otherParts = deepParts.slice(1);
  101746. var /** @type {?} */ applyScope = function (shallowPart) {
  101747. if (_this._selectorNeedsScoping(shallowPart, scopeSelector)) {
  101748. return strict ?
  101749. _this._applyStrictSelectorScope(shallowPart, scopeSelector, hostSelector) :
  101750. _this._applySelectorScope(shallowPart, scopeSelector, hostSelector);
  101751. }
  101752. else {
  101753. return shallowPart;
  101754. }
  101755. };
  101756. return [applyScope(shallowPart)].concat(otherParts).join(' ');
  101757. })
  101758. .join(', ');
  101759. };
  101760. /**
  101761. * @param {?} selector
  101762. * @param {?} scopeSelector
  101763. * @return {?}
  101764. */
  101765. ShadowCss.prototype._selectorNeedsScoping = /**
  101766. * @param {?} selector
  101767. * @param {?} scopeSelector
  101768. * @return {?}
  101769. */
  101770. function (selector, scopeSelector) {
  101771. var /** @type {?} */ re = this._makeScopeMatcher(scopeSelector);
  101772. return !re.test(selector);
  101773. };
  101774. /**
  101775. * @param {?} scopeSelector
  101776. * @return {?}
  101777. */
  101778. ShadowCss.prototype._makeScopeMatcher = /**
  101779. * @param {?} scopeSelector
  101780. * @return {?}
  101781. */
  101782. function (scopeSelector) {
  101783. var /** @type {?} */ lre = /\[/g;
  101784. var /** @type {?} */ rre = /\]/g;
  101785. scopeSelector = scopeSelector.replace(lre, '\\[').replace(rre, '\\]');
  101786. return new RegExp('^(' + scopeSelector + ')' + _selectorReSuffix, 'm');
  101787. };
  101788. /**
  101789. * @param {?} selector
  101790. * @param {?} scopeSelector
  101791. * @param {?} hostSelector
  101792. * @return {?}
  101793. */
  101794. ShadowCss.prototype._applySelectorScope = /**
  101795. * @param {?} selector
  101796. * @param {?} scopeSelector
  101797. * @param {?} hostSelector
  101798. * @return {?}
  101799. */
  101800. function (selector, scopeSelector, hostSelector) {
  101801. // Difference from webcomponents.js: scopeSelector could not be an array
  101802. return this._applySimpleSelectorScope(selector, scopeSelector, hostSelector);
  101803. };
  101804. /**
  101805. * @param {?} selector
  101806. * @param {?} scopeSelector
  101807. * @param {?} hostSelector
  101808. * @return {?}
  101809. */
  101810. ShadowCss.prototype._applySimpleSelectorScope = /**
  101811. * @param {?} selector
  101812. * @param {?} scopeSelector
  101813. * @param {?} hostSelector
  101814. * @return {?}
  101815. */
  101816. function (selector, scopeSelector, hostSelector) {
  101817. // In Android browser, the lastIndex is not reset when the regex is used in String.replace()
  101818. _polyfillHostRe.lastIndex = 0;
  101819. if (_polyfillHostRe.test(selector)) {
  101820. var /** @type {?} */ replaceBy_1 = this.strictStyling ? "[" + hostSelector + "]" : scopeSelector;
  101821. return selector
  101822. .replace(_polyfillHostNoCombinatorRe, function (hnc, selector) {
  101823. return selector.replace(/([^:]*)(:*)(.*)/, function (_, before, colon, after) {
  101824. return before + replaceBy_1 + colon + after;
  101825. });
  101826. })
  101827. .replace(_polyfillHostRe, replaceBy_1 + ' ');
  101828. }
  101829. return scopeSelector + ' ' + selector;
  101830. };
  101831. /**
  101832. * @param {?} selector
  101833. * @param {?} scopeSelector
  101834. * @param {?} hostSelector
  101835. * @return {?}
  101836. */
  101837. ShadowCss.prototype._applyStrictSelectorScope = /**
  101838. * @param {?} selector
  101839. * @param {?} scopeSelector
  101840. * @param {?} hostSelector
  101841. * @return {?}
  101842. */
  101843. function (selector, scopeSelector, hostSelector) {
  101844. var _this = this;
  101845. var /** @type {?} */ isRe = /\[is=([^\]]*)\]/g;
  101846. scopeSelector = scopeSelector.replace(isRe, function (_) {
  101847. var parts = [];
  101848. for (var _i = 1; _i < arguments.length; _i++) {
  101849. parts[_i - 1] = arguments[_i];
  101850. }
  101851. return parts[0];
  101852. });
  101853. var /** @type {?} */ attrName = '[' + scopeSelector + ']';
  101854. var /** @type {?} */ _scopeSelectorPart = function (p) {
  101855. var /** @type {?} */ scopedP = p.trim();
  101856. if (!scopedP) {
  101857. return '';
  101858. }
  101859. if (p.indexOf(_polyfillHostNoCombinator) > -1) {
  101860. scopedP = _this._applySimpleSelectorScope(p, scopeSelector, hostSelector);
  101861. }
  101862. else {
  101863. // remove :host since it should be unnecessary
  101864. var /** @type {?} */ t = p.replace(_polyfillHostRe, '');
  101865. if (t.length > 0) {
  101866. var /** @type {?} */ matches = t.match(/([^:]*)(:*)(.*)/);
  101867. if (matches) {
  101868. scopedP = matches[1] + attrName + matches[2] + matches[3];
  101869. }
  101870. }
  101871. }
  101872. return scopedP;
  101873. };
  101874. var /** @type {?} */ safeContent = new SafeSelector(selector);
  101875. selector = safeContent.content();
  101876. var /** @type {?} */ scopedSelector = '';
  101877. var /** @type {?} */ startIndex = 0;
  101878. var /** @type {?} */ res;
  101879. var /** @type {?} */ sep = /( |>|\+|~(?!=))\s*/g;
  101880. // If a selector appears before :host it should not be shimmed as it
  101881. // matches on ancestor elements and not on elements in the host's shadow
  101882. // `:host-context(div)` is transformed to
  101883. // `-shadowcsshost-no-combinatordiv, div -shadowcsshost-no-combinator`
  101884. // the `div` is not part of the component in the 2nd selectors and should not be scoped.
  101885. // Historically `component-tag:host` was matching the component so we also want to preserve
  101886. // this behavior to avoid breaking legacy apps (it should not match).
  101887. // The behavior should be:
  101888. // - `tag:host` -> `tag[h]` (this is to avoid breaking legacy apps, should not match anything)
  101889. // - `tag :host` -> `tag [h]` (`tag` is not scoped because it's considered part of a
  101890. // `:host-context(tag)`)
  101891. var /** @type {?} */ hasHost = selector.indexOf(_polyfillHostNoCombinator) > -1;
  101892. // Only scope parts after the first `-shadowcsshost-no-combinator` when it is present
  101893. var /** @type {?} */ shouldScope = !hasHost;
  101894. while ((res = sep.exec(selector)) !== null) {
  101895. var /** @type {?} */ separator = res[1];
  101896. var /** @type {?} */ part_1 = selector.slice(startIndex, res.index).trim();
  101897. shouldScope = shouldScope || part_1.indexOf(_polyfillHostNoCombinator) > -1;
  101898. var /** @type {?} */ scopedPart = shouldScope ? _scopeSelectorPart(part_1) : part_1;
  101899. scopedSelector += scopedPart + " " + separator + " ";
  101900. startIndex = sep.lastIndex;
  101901. }
  101902. var /** @type {?} */ part = selector.substring(startIndex);
  101903. shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1;
  101904. scopedSelector += shouldScope ? _scopeSelectorPart(part) : part;
  101905. // replace the placeholders with their original values
  101906. return safeContent.restore(scopedSelector);
  101907. };
  101908. /**
  101909. * @param {?} selector
  101910. * @return {?}
  101911. */
  101912. ShadowCss.prototype._insertPolyfillHostInCssText = /**
  101913. * @param {?} selector
  101914. * @return {?}
  101915. */
  101916. function (selector) {
  101917. return selector.replace(_colonHostContextRe, _polyfillHostContext)
  101918. .replace(_colonHostRe, _polyfillHost);
  101919. };
  101920. return ShadowCss;
  101921. }());
  101922. var SafeSelector = /** @class */ (function () {
  101923. function SafeSelector(selector) {
  101924. var _this = this;
  101925. this.placeholders = [];
  101926. this.index = 0;
  101927. // Replaces attribute selectors with placeholders.
  101928. // The WS in [attr="va lue"] would otherwise be interpreted as a selector separator.
  101929. selector = selector.replace(/(\[[^\]]*\])/g, function (_, keep) {
  101930. var /** @type {?} */ replaceBy = "__ph-" + _this.index + "__";
  101931. _this.placeholders.push(keep);
  101932. _this.index++;
  101933. return replaceBy;
  101934. });
  101935. // Replaces the expression in `:nth-child(2n + 1)` with a placeholder.
  101936. // WS and "+" would otherwise be interpreted as selector separators.
  101937. this._content = selector.replace(/(:nth-[-\w]+)(\([^)]+\))/g, function (_, pseudo, exp) {
  101938. var /** @type {?} */ replaceBy = "__ph-" + _this.index + "__";
  101939. _this.placeholders.push(exp);
  101940. _this.index++;
  101941. return pseudo + replaceBy;
  101942. });
  101943. }
  101944. /**
  101945. * @param {?} content
  101946. * @return {?}
  101947. */
  101948. SafeSelector.prototype.restore = /**
  101949. * @param {?} content
  101950. * @return {?}
  101951. */
  101952. function (content) {
  101953. var _this = this;
  101954. return content.replace(/__ph-(\d+)__/g, function (ph, index) { return _this.placeholders[+index]; });
  101955. };
  101956. /**
  101957. * @return {?}
  101958. */
  101959. SafeSelector.prototype.content = /**
  101960. * @return {?}
  101961. */
  101962. function () { return this._content; };
  101963. return SafeSelector;
  101964. }());
  101965. var _cssContentNextSelectorRe = /polyfill-next-selector[^}]*content:[\s]*?(['"])(.*?)\1[;\s]*}([^{]*?){/gim;
  101966. var _cssContentRuleRe = /(polyfill-rule)[^}]*(content:[\s]*(['"])(.*?)\3)[;\s]*[^}]*}/gim;
  101967. var _cssContentUnscopedRuleRe = /(polyfill-unscoped-rule)[^}]*(content:[\s]*(['"])(.*?)\3)[;\s]*[^}]*}/gim;
  101968. var _polyfillHost = '-shadowcsshost';
  101969. // note: :host-context pre-processed to -shadowcsshostcontext.
  101970. var _polyfillHostContext = '-shadowcsscontext';
  101971. var _parenSuffix = ')(?:\\((' +
  101972. '(?:\\([^)(]*\\)|[^)(]*)+?' +
  101973. ')\\))?([^,{]*)';
  101974. var _cssColonHostRe = new RegExp('(' + _polyfillHost + _parenSuffix, 'gim');
  101975. var _cssColonHostContextRe = new RegExp('(' + _polyfillHostContext + _parenSuffix, 'gim');
  101976. var _polyfillHostNoCombinator = _polyfillHost + '-no-combinator';
  101977. var _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s]*)/;
  101978. var _shadowDOMSelectorsRe = [
  101979. /::shadow/g,
  101980. /::content/g,
  101981. /\/shadow-deep\//g,
  101982. /\/shadow\//g,
  101983. ];
  101984. // The deep combinator is deprecated in the CSS spec
  101985. // Support for `>>>`, `deep`, `::ng-deep` is then also deprecated and will be removed in the future.
  101986. // see https://github.com/angular/angular/pull/17677
  101987. var _shadowDeepSelectors = /(?:>>>)|(?:\/deep\/)|(?:::ng-deep)/g;
  101988. var _selectorReSuffix = '([>\\s~+\[.,{:][\\s\\S]*)?$';
  101989. var _polyfillHostRe = /-shadowcsshost/gim;
  101990. var _colonHostRe = /:host/gim;
  101991. var _colonHostContextRe = /:host-context/gim;
  101992. var _commentRe = /\/\*\s*[\s\S]*?\*\//g;
  101993. /**
  101994. * @param {?} input
  101995. * @return {?}
  101996. */
  101997. function stripComments(input) {
  101998. return input.replace(_commentRe, '');
  101999. }
  102000. var _commentWithHashRe = /\/\*\s*#\s*source(Mapping)?URL=[\s\S]+?\*\//g;
  102001. /**
  102002. * @param {?} input
  102003. * @return {?}
  102004. */
  102005. function extractCommentsWithHash(input) {
  102006. return input.match(_commentWithHashRe) || [];
  102007. }
  102008. var _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g;
  102009. var _curlyRe = /([{}])/g;
  102010. var OPEN_CURLY = '{';
  102011. var CLOSE_CURLY = '}';
  102012. var BLOCK_PLACEHOLDER = '%BLOCK%';
  102013. var CssRule = /** @class */ (function () {
  102014. function CssRule(selector, content) {
  102015. this.selector = selector;
  102016. this.content = content;
  102017. }
  102018. return CssRule;
  102019. }());
  102020. /**
  102021. * @param {?} input
  102022. * @param {?} ruleCallback
  102023. * @return {?}
  102024. */
  102025. function processRules(input, ruleCallback) {
  102026. var /** @type {?} */ inputWithEscapedBlocks = escapeBlocks(input);
  102027. var /** @type {?} */ nextBlockIndex = 0;
  102028. return inputWithEscapedBlocks.escapedString.replace(_ruleRe, function () {
  102029. var m = [];
  102030. for (var _i = 0; _i < arguments.length; _i++) {
  102031. m[_i] = arguments[_i];
  102032. }
  102033. var /** @type {?} */ selector = m[2];
  102034. var /** @type {?} */ content = '';
  102035. var /** @type {?} */ suffix = m[4];
  102036. var /** @type {?} */ contentPrefix = '';
  102037. if (suffix && suffix.startsWith('{' + BLOCK_PLACEHOLDER)) {
  102038. content = inputWithEscapedBlocks.blocks[nextBlockIndex++];
  102039. suffix = suffix.substring(BLOCK_PLACEHOLDER.length + 1);
  102040. contentPrefix = '{';
  102041. }
  102042. var /** @type {?} */ rule = ruleCallback(new CssRule(selector, content));
  102043. return "" + m[1] + rule.selector + m[3] + contentPrefix + rule.content + suffix;
  102044. });
  102045. }
  102046. var StringWithEscapedBlocks = /** @class */ (function () {
  102047. function StringWithEscapedBlocks(escapedString, blocks) {
  102048. this.escapedString = escapedString;
  102049. this.blocks = blocks;
  102050. }
  102051. return StringWithEscapedBlocks;
  102052. }());
  102053. /**
  102054. * @param {?} input
  102055. * @return {?}
  102056. */
  102057. function escapeBlocks(input) {
  102058. var /** @type {?} */ inputParts = input.split(_curlyRe);
  102059. var /** @type {?} */ resultParts = [];
  102060. var /** @type {?} */ escapedBlocks = [];
  102061. var /** @type {?} */ bracketCount = 0;
  102062. var /** @type {?} */ currentBlockParts = [];
  102063. for (var /** @type {?} */ partIndex = 0; partIndex < inputParts.length; partIndex++) {
  102064. var /** @type {?} */ part = inputParts[partIndex];
  102065. if (part == CLOSE_CURLY) {
  102066. bracketCount--;
  102067. }
  102068. if (bracketCount > 0) {
  102069. currentBlockParts.push(part);
  102070. }
  102071. else {
  102072. if (currentBlockParts.length > 0) {
  102073. escapedBlocks.push(currentBlockParts.join(''));
  102074. resultParts.push(BLOCK_PLACEHOLDER);
  102075. currentBlockParts = [];
  102076. }
  102077. resultParts.push(part);
  102078. }
  102079. if (part == OPEN_CURLY) {
  102080. bracketCount++;
  102081. }
  102082. }
  102083. if (currentBlockParts.length > 0) {
  102084. escapedBlocks.push(currentBlockParts.join(''));
  102085. resultParts.push(BLOCK_PLACEHOLDER);
  102086. }
  102087. return new StringWithEscapedBlocks(resultParts.join(''), escapedBlocks);
  102088. }
  102089. /**
  102090. * @fileoverview added by tsickle
  102091. * @suppress {checkTypes} checked by tsc
  102092. */
  102093. /**
  102094. * @license
  102095. * Copyright Google Inc. All Rights Reserved.
  102096. *
  102097. * Use of this source code is governed by an MIT-style license that can be
  102098. * found in the LICENSE file at https://angular.io/license
  102099. */
  102100. var COMPONENT_VARIABLE = '%COMP%';
  102101. var HOST_ATTR = "_nghost-" + COMPONENT_VARIABLE;
  102102. var CONTENT_ATTR = "_ngcontent-" + COMPONENT_VARIABLE;
  102103. var StylesCompileDependency = /** @class */ (function () {
  102104. function StylesCompileDependency(name, moduleUrl, setValue) {
  102105. this.name = name;
  102106. this.moduleUrl = moduleUrl;
  102107. this.setValue = setValue;
  102108. }
  102109. return StylesCompileDependency;
  102110. }());
  102111. var CompiledStylesheet = /** @class */ (function () {
  102112. function CompiledStylesheet(outputCtx, stylesVar, dependencies, isShimmed, meta) {
  102113. this.outputCtx = outputCtx;
  102114. this.stylesVar = stylesVar;
  102115. this.dependencies = dependencies;
  102116. this.isShimmed = isShimmed;
  102117. this.meta = meta;
  102118. }
  102119. return CompiledStylesheet;
  102120. }());
  102121. var StyleCompiler = /** @class */ (function () {
  102122. function StyleCompiler(_urlResolver) {
  102123. this._urlResolver = _urlResolver;
  102124. this._shadowCss = new ShadowCss();
  102125. }
  102126. /**
  102127. * @param {?} outputCtx
  102128. * @param {?} comp
  102129. * @return {?}
  102130. */
  102131. StyleCompiler.prototype.compileComponent = /**
  102132. * @param {?} outputCtx
  102133. * @param {?} comp
  102134. * @return {?}
  102135. */
  102136. function (outputCtx, comp) {
  102137. var /** @type {?} */ template = /** @type {?} */ ((comp.template));
  102138. return this._compileStyles(outputCtx, comp, new CompileStylesheetMetadata({
  102139. styles: template.styles,
  102140. styleUrls: template.styleUrls,
  102141. moduleUrl: identifierModuleUrl(comp.type)
  102142. }), this.needsStyleShim(comp), true);
  102143. };
  102144. /**
  102145. * @param {?} outputCtx
  102146. * @param {?} comp
  102147. * @param {?} stylesheet
  102148. * @param {?=} shim
  102149. * @return {?}
  102150. */
  102151. StyleCompiler.prototype.compileStyles = /**
  102152. * @param {?} outputCtx
  102153. * @param {?} comp
  102154. * @param {?} stylesheet
  102155. * @param {?=} shim
  102156. * @return {?}
  102157. */
  102158. function (outputCtx, comp, stylesheet, shim) {
  102159. if (shim === void 0) { shim = this.needsStyleShim(comp); }
  102160. return this._compileStyles(outputCtx, comp, stylesheet, shim, false);
  102161. };
  102162. /**
  102163. * @param {?} comp
  102164. * @return {?}
  102165. */
  102166. StyleCompiler.prototype.needsStyleShim = /**
  102167. * @param {?} comp
  102168. * @return {?}
  102169. */
  102170. function (comp) {
  102171. return /** @type {?} */ ((comp.template)).encapsulation === ViewEncapsulation.Emulated;
  102172. };
  102173. /**
  102174. * @param {?} outputCtx
  102175. * @param {?} comp
  102176. * @param {?} stylesheet
  102177. * @param {?} shim
  102178. * @param {?} isComponentStylesheet
  102179. * @return {?}
  102180. */
  102181. StyleCompiler.prototype._compileStyles = /**
  102182. * @param {?} outputCtx
  102183. * @param {?} comp
  102184. * @param {?} stylesheet
  102185. * @param {?} shim
  102186. * @param {?} isComponentStylesheet
  102187. * @return {?}
  102188. */
  102189. function (outputCtx, comp, stylesheet, shim, isComponentStylesheet) {
  102190. var _this = this;
  102191. var /** @type {?} */ styleExpressions = stylesheet.styles.map(function (plainStyle) { return literal(_this._shimIfNeeded(plainStyle, shim)); });
  102192. var /** @type {?} */ dependencies = [];
  102193. stylesheet.styleUrls.forEach(function (styleUrl) {
  102194. var /** @type {?} */ exprIndex = styleExpressions.length;
  102195. // Note: This placeholder will be filled later.
  102196. styleExpressions.push(/** @type {?} */ ((null)));
  102197. dependencies.push(new StylesCompileDependency(getStylesVarName(null), styleUrl, function (value) { return styleExpressions[exprIndex] = outputCtx.importExpr(value); }));
  102198. });
  102199. // styles variable contains plain strings and arrays of other styles arrays (recursive),
  102200. // so we set its type to dynamic.
  102201. var /** @type {?} */ stylesVar = getStylesVarName(isComponentStylesheet ? comp : null);
  102202. var /** @type {?} */ stmt = variable(stylesVar)
  102203. .set(literalArr(styleExpressions, new ArrayType(DYNAMIC_TYPE, [TypeModifier.Const])))
  102204. .toDeclStmt(null, isComponentStylesheet ? [StmtModifier.Final] : [
  102205. StmtModifier.Final, StmtModifier.Exported
  102206. ]);
  102207. outputCtx.statements.push(stmt);
  102208. return new CompiledStylesheet(outputCtx, stylesVar, dependencies, shim, stylesheet);
  102209. };
  102210. /**
  102211. * @param {?} style
  102212. * @param {?} shim
  102213. * @return {?}
  102214. */
  102215. StyleCompiler.prototype._shimIfNeeded = /**
  102216. * @param {?} style
  102217. * @param {?} shim
  102218. * @return {?}
  102219. */
  102220. function (style, shim) {
  102221. return shim ? this._shadowCss.shimCssText(style, CONTENT_ATTR, HOST_ATTR) : style;
  102222. };
  102223. return StyleCompiler;
  102224. }());
  102225. /**
  102226. * @param {?} component
  102227. * @return {?}
  102228. */
  102229. function getStylesVarName(component) {
  102230. var /** @type {?} */ result = "styles";
  102231. if (component) {
  102232. result += "_" + identifierName(component.type);
  102233. }
  102234. return result;
  102235. }
  102236. /**
  102237. * @fileoverview added by tsickle
  102238. * @suppress {checkTypes} checked by tsc
  102239. */
  102240. /**
  102241. * @license
  102242. * Copyright Google Inc. All Rights Reserved.
  102243. *
  102244. * Use of this source code is governed by an MIT-style license that can be
  102245. * found in the LICENSE file at https://angular.io/license
  102246. */
  102247. var PRESERVE_WS_ATTR_NAME = 'ngPreserveWhitespaces';
  102248. var SKIP_WS_TRIM_TAGS = new Set(['pre', 'template', 'textarea', 'script', 'style']);
  102249. // Equivalent to \s with \u00a0 (non-breaking space) excluded.
  102250. // Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp
  102251. var WS_CHARS = ' \f\n\r\t\v\u1680\u180e\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff';
  102252. var NO_WS_REGEXP = new RegExp("[^" + WS_CHARS + "]");
  102253. var WS_REPLACE_REGEXP = new RegExp("[" + WS_CHARS + "]{2,}", 'g');
  102254. /**
  102255. * @param {?} attrs
  102256. * @return {?}
  102257. */
  102258. function hasPreserveWhitespacesAttr(attrs) {
  102259. return attrs.some(function (attr) { return attr.name === PRESERVE_WS_ATTR_NAME; });
  102260. }
  102261. /**
  102262. * Angular Dart introduced &ngsp; as a placeholder for non-removable space, see:
  102263. * https://github.com/dart-lang/angular/blob/0bb611387d29d65b5af7f9d2515ab571fd3fbee4/_tests/test/compiler/preserve_whitespace_test.dart#L25-L32
  102264. * In Angular Dart &ngsp; is converted to the 0xE500 PUA (Private Use Areas) unicode character
  102265. * and later on replaced by a space. We are re-implementing the same idea here.
  102266. * @param {?} value
  102267. * @return {?}
  102268. */
  102269. function replaceNgsp(value) {
  102270. // lexer is replacing the &ngsp; pseudo-entity with NGSP_UNICODE
  102271. return value.replace(new RegExp(NGSP_UNICODE, 'g'), ' ');
  102272. }
  102273. /**
  102274. * This visitor can walk HTML parse tree and remove / trim text nodes using the following rules:
  102275. * - consider spaces, tabs and new lines as whitespace characters;
  102276. * - drop text nodes consisting of whitespace characters only;
  102277. * - for all other text nodes replace consecutive whitespace characters with one space;
  102278. * - convert &ngsp; pseudo-entity to a single space;
  102279. *
  102280. * Removal and trimming of whitespaces have positive performance impact (less code to generate
  102281. * while compiling templates, faster view creation). At the same time it can be "destructive"
  102282. * in some cases (whitespaces can influence layout). Because of the potential of breaking layout
  102283. * this visitor is not activated by default in Angular 5 and people need to explicitly opt-in for
  102284. * whitespace removal. The default option for whitespace removal will be revisited in Angular 6
  102285. * and might be changed to "on" by default.
  102286. */
  102287. var WhitespaceVisitor = /** @class */ (function () {
  102288. function WhitespaceVisitor() {
  102289. }
  102290. /**
  102291. * @param {?} element
  102292. * @param {?} context
  102293. * @return {?}
  102294. */
  102295. WhitespaceVisitor.prototype.visitElement = /**
  102296. * @param {?} element
  102297. * @param {?} context
  102298. * @return {?}
  102299. */
  102300. function (element, context) {
  102301. if (SKIP_WS_TRIM_TAGS.has(element.name) || hasPreserveWhitespacesAttr(element.attrs)) {
  102302. // don't descent into elements where we need to preserve whitespaces
  102303. // but still visit all attributes to eliminate one used as a market to preserve WS
  102304. return new Element(element.name, visitAll(this, element.attrs), element.children, element.sourceSpan, element.startSourceSpan, element.endSourceSpan);
  102305. }
  102306. return new Element(element.name, element.attrs, visitAll(this, element.children), element.sourceSpan, element.startSourceSpan, element.endSourceSpan);
  102307. };
  102308. /**
  102309. * @param {?} attribute
  102310. * @param {?} context
  102311. * @return {?}
  102312. */
  102313. WhitespaceVisitor.prototype.visitAttribute = /**
  102314. * @param {?} attribute
  102315. * @param {?} context
  102316. * @return {?}
  102317. */
  102318. function (attribute, context) {
  102319. return attribute.name !== PRESERVE_WS_ATTR_NAME ? attribute : null;
  102320. };
  102321. /**
  102322. * @param {?} text
  102323. * @param {?} context
  102324. * @return {?}
  102325. */
  102326. WhitespaceVisitor.prototype.visitText = /**
  102327. * @param {?} text
  102328. * @param {?} context
  102329. * @return {?}
  102330. */
  102331. function (text, context) {
  102332. var /** @type {?} */ isNotBlank = text.value.match(NO_WS_REGEXP);
  102333. if (isNotBlank) {
  102334. return new Text(replaceNgsp(text.value).replace(WS_REPLACE_REGEXP, ' '), text.sourceSpan);
  102335. }
  102336. return null;
  102337. };
  102338. /**
  102339. * @param {?} comment
  102340. * @param {?} context
  102341. * @return {?}
  102342. */
  102343. WhitespaceVisitor.prototype.visitComment = /**
  102344. * @param {?} comment
  102345. * @param {?} context
  102346. * @return {?}
  102347. */
  102348. function (comment, context) { return comment; };
  102349. /**
  102350. * @param {?} expansion
  102351. * @param {?} context
  102352. * @return {?}
  102353. */
  102354. WhitespaceVisitor.prototype.visitExpansion = /**
  102355. * @param {?} expansion
  102356. * @param {?} context
  102357. * @return {?}
  102358. */
  102359. function (expansion, context) { return expansion; };
  102360. /**
  102361. * @param {?} expansionCase
  102362. * @param {?} context
  102363. * @return {?}
  102364. */
  102365. WhitespaceVisitor.prototype.visitExpansionCase = /**
  102366. * @param {?} expansionCase
  102367. * @param {?} context
  102368. * @return {?}
  102369. */
  102370. function (expansionCase, context) { return expansionCase; };
  102371. return WhitespaceVisitor;
  102372. }());
  102373. /**
  102374. * @param {?} htmlAstWithErrors
  102375. * @return {?}
  102376. */
  102377. function removeWhitespaces(htmlAstWithErrors) {
  102378. return new ParseTreeResult(visitAll(new WhitespaceVisitor(), htmlAstWithErrors.rootNodes), htmlAstWithErrors.errors);
  102379. }
  102380. /**
  102381. * @fileoverview added by tsickle
  102382. * @suppress {checkTypes} checked by tsc
  102383. */
  102384. /**
  102385. * @license
  102386. * Copyright Google Inc. All Rights Reserved.
  102387. *
  102388. * Use of this source code is governed by an MIT-style license that can be
  102389. * found in the LICENSE file at https://angular.io/license
  102390. */
  102391. // http://cldr.unicode.org/index/cldr-spec/plural-rules
  102392. var PLURAL_CASES = ['zero', 'one', 'two', 'few', 'many', 'other'];
  102393. /**
  102394. * Expands special forms into elements.
  102395. *
  102396. * For example,
  102397. *
  102398. * ```
  102399. * { messages.length, plural,
  102400. * =0 {zero}
  102401. * =1 {one}
  102402. * other {more than one}
  102403. * }
  102404. * ```
  102405. *
  102406. * will be expanded into
  102407. *
  102408. * ```
  102409. * <ng-container [ngPlural]="messages.length">
  102410. * <ng-template ngPluralCase="=0">zero</ng-template>
  102411. * <ng-template ngPluralCase="=1">one</ng-template>
  102412. * <ng-template ngPluralCase="other">more than one</ng-template>
  102413. * </ng-container>
  102414. * ```
  102415. * @param {?} nodes
  102416. * @return {?}
  102417. */
  102418. function expandNodes(nodes) {
  102419. var /** @type {?} */ expander = new _Expander();
  102420. return new ExpansionResult(visitAll(expander, nodes), expander.isExpanded, expander.errors);
  102421. }
  102422. var ExpansionResult = /** @class */ (function () {
  102423. function ExpansionResult(nodes, expanded, errors) {
  102424. this.nodes = nodes;
  102425. this.expanded = expanded;
  102426. this.errors = errors;
  102427. }
  102428. return ExpansionResult;
  102429. }());
  102430. var ExpansionError = /** @class */ (function (_super) {
  102431. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(ExpansionError, _super);
  102432. function ExpansionError(span, errorMsg) {
  102433. return _super.call(this, span, errorMsg) || this;
  102434. }
  102435. return ExpansionError;
  102436. }(ParseError));
  102437. /**
  102438. * Expand expansion forms (plural, select) to directives
  102439. *
  102440. * \@internal
  102441. */
  102442. var _Expander = /** @class */ (function () {
  102443. function _Expander() {
  102444. this.isExpanded = false;
  102445. this.errors = [];
  102446. }
  102447. /**
  102448. * @param {?} element
  102449. * @param {?} context
  102450. * @return {?}
  102451. */
  102452. _Expander.prototype.visitElement = /**
  102453. * @param {?} element
  102454. * @param {?} context
  102455. * @return {?}
  102456. */
  102457. function (element, context) {
  102458. return new Element(element.name, element.attrs, visitAll(this, element.children), element.sourceSpan, element.startSourceSpan, element.endSourceSpan);
  102459. };
  102460. /**
  102461. * @param {?} attribute
  102462. * @param {?} context
  102463. * @return {?}
  102464. */
  102465. _Expander.prototype.visitAttribute = /**
  102466. * @param {?} attribute
  102467. * @param {?} context
  102468. * @return {?}
  102469. */
  102470. function (attribute, context) { return attribute; };
  102471. /**
  102472. * @param {?} text
  102473. * @param {?} context
  102474. * @return {?}
  102475. */
  102476. _Expander.prototype.visitText = /**
  102477. * @param {?} text
  102478. * @param {?} context
  102479. * @return {?}
  102480. */
  102481. function (text, context) { return text; };
  102482. /**
  102483. * @param {?} comment
  102484. * @param {?} context
  102485. * @return {?}
  102486. */
  102487. _Expander.prototype.visitComment = /**
  102488. * @param {?} comment
  102489. * @param {?} context
  102490. * @return {?}
  102491. */
  102492. function (comment, context) { return comment; };
  102493. /**
  102494. * @param {?} icu
  102495. * @param {?} context
  102496. * @return {?}
  102497. */
  102498. _Expander.prototype.visitExpansion = /**
  102499. * @param {?} icu
  102500. * @param {?} context
  102501. * @return {?}
  102502. */
  102503. function (icu, context) {
  102504. this.isExpanded = true;
  102505. return icu.type == 'plural' ? _expandPluralForm(icu, this.errors) :
  102506. _expandDefaultForm(icu, this.errors);
  102507. };
  102508. /**
  102509. * @param {?} icuCase
  102510. * @param {?} context
  102511. * @return {?}
  102512. */
  102513. _Expander.prototype.visitExpansionCase = /**
  102514. * @param {?} icuCase
  102515. * @param {?} context
  102516. * @return {?}
  102517. */
  102518. function (icuCase, context) {
  102519. throw new Error('Should not be reached');
  102520. };
  102521. return _Expander;
  102522. }());
  102523. /**
  102524. * @param {?} ast
  102525. * @param {?} errors
  102526. * @return {?}
  102527. */
  102528. function _expandPluralForm(ast, errors) {
  102529. var /** @type {?} */ children = ast.cases.map(function (c) {
  102530. if (PLURAL_CASES.indexOf(c.value) == -1 && !c.value.match(/^=\d+$/)) {
  102531. errors.push(new ExpansionError(c.valueSourceSpan, "Plural cases should be \"=<number>\" or one of " + PLURAL_CASES.join(", ")));
  102532. }
  102533. var /** @type {?} */ expansionResult = expandNodes(c.expression);
  102534. errors.push.apply(errors, expansionResult.errors);
  102535. return new Element("ng-template", [new Attribute$1('ngPluralCase', "" + c.value, c.valueSourceSpan)], expansionResult.nodes, c.sourceSpan, c.sourceSpan, c.sourceSpan);
  102536. });
  102537. var /** @type {?} */ switchAttr = new Attribute$1('[ngPlural]', ast.switchValue, ast.switchValueSourceSpan);
  102538. return new Element('ng-container', [switchAttr], children, ast.sourceSpan, ast.sourceSpan, ast.sourceSpan);
  102539. }
  102540. /**
  102541. * @param {?} ast
  102542. * @param {?} errors
  102543. * @return {?}
  102544. */
  102545. function _expandDefaultForm(ast, errors) {
  102546. var /** @type {?} */ children = ast.cases.map(function (c) {
  102547. var /** @type {?} */ expansionResult = expandNodes(c.expression);
  102548. errors.push.apply(errors, expansionResult.errors);
  102549. if (c.value === 'other') {
  102550. // other is the default case when no values match
  102551. return new Element("ng-template", [new Attribute$1('ngSwitchDefault', '', c.valueSourceSpan)], expansionResult.nodes, c.sourceSpan, c.sourceSpan, c.sourceSpan);
  102552. }
  102553. return new Element("ng-template", [new Attribute$1('ngSwitchCase', "" + c.value, c.valueSourceSpan)], expansionResult.nodes, c.sourceSpan, c.sourceSpan, c.sourceSpan);
  102554. });
  102555. var /** @type {?} */ switchAttr = new Attribute$1('[ngSwitch]', ast.switchValue, ast.switchValueSourceSpan);
  102556. return new Element('ng-container', [switchAttr], children, ast.sourceSpan, ast.sourceSpan, ast.sourceSpan);
  102557. }
  102558. /**
  102559. * @fileoverview added by tsickle
  102560. * @suppress {checkTypes} checked by tsc
  102561. */
  102562. /**
  102563. * @license
  102564. * Copyright Google Inc. All Rights Reserved.
  102565. *
  102566. * Use of this source code is governed by an MIT-style license that can be
  102567. * found in the LICENSE file at https://angular.io/license
  102568. */
  102569. var PROPERTY_PARTS_SEPARATOR = '.';
  102570. var ATTRIBUTE_PREFIX = 'attr';
  102571. var CLASS_PREFIX = 'class';
  102572. var STYLE_PREFIX = 'style';
  102573. var ANIMATE_PROP_PREFIX = 'animate-';
  102574. /** @enum {number} */
  102575. var BoundPropertyType = {
  102576. DEFAULT: 0,
  102577. LITERAL_ATTR: 1,
  102578. ANIMATION: 2,
  102579. };
  102580. BoundPropertyType[BoundPropertyType.DEFAULT] = "DEFAULT";
  102581. BoundPropertyType[BoundPropertyType.LITERAL_ATTR] = "LITERAL_ATTR";
  102582. BoundPropertyType[BoundPropertyType.ANIMATION] = "ANIMATION";
  102583. /**
  102584. * Represents a parsed property.
  102585. */
  102586. var BoundProperty = /** @class */ (function () {
  102587. function BoundProperty(name, expression, type, sourceSpan) {
  102588. this.name = name;
  102589. this.expression = expression;
  102590. this.type = type;
  102591. this.sourceSpan = sourceSpan;
  102592. this.isLiteral = this.type === BoundPropertyType.LITERAL_ATTR;
  102593. this.isAnimation = this.type === BoundPropertyType.ANIMATION;
  102594. }
  102595. return BoundProperty;
  102596. }());
  102597. /**
  102598. * Parses bindings in templates and in the directive host area.
  102599. */
  102600. var BindingParser = /** @class */ (function () {
  102601. function BindingParser(_exprParser, _interpolationConfig, _schemaRegistry, pipes, _targetErrors) {
  102602. var _this = this;
  102603. this._exprParser = _exprParser;
  102604. this._interpolationConfig = _interpolationConfig;
  102605. this._schemaRegistry = _schemaRegistry;
  102606. this._targetErrors = _targetErrors;
  102607. this.pipesByName = new Map();
  102608. this._usedPipes = new Map();
  102609. pipes.forEach(function (pipe) { return _this.pipesByName.set(pipe.name, pipe); });
  102610. }
  102611. /**
  102612. * @return {?}
  102613. */
  102614. BindingParser.prototype.getUsedPipes = /**
  102615. * @return {?}
  102616. */
  102617. function () { return Array.from(this._usedPipes.values()); };
  102618. /**
  102619. * @param {?} dirMeta
  102620. * @param {?} elementSelector
  102621. * @param {?} sourceSpan
  102622. * @return {?}
  102623. */
  102624. BindingParser.prototype.createDirectiveHostPropertyAsts = /**
  102625. * @param {?} dirMeta
  102626. * @param {?} elementSelector
  102627. * @param {?} sourceSpan
  102628. * @return {?}
  102629. */
  102630. function (dirMeta, elementSelector, sourceSpan) {
  102631. var _this = this;
  102632. if (dirMeta.hostProperties) {
  102633. var /** @type {?} */ boundProps_1 = [];
  102634. Object.keys(dirMeta.hostProperties).forEach(function (propName) {
  102635. var /** @type {?} */ expression = dirMeta.hostProperties[propName];
  102636. if (typeof expression === 'string') {
  102637. _this.parsePropertyBinding(propName, expression, true, sourceSpan, [], boundProps_1);
  102638. }
  102639. else {
  102640. _this._reportError("Value of the host property binding \"" + propName + "\" needs to be a string representing an expression but got \"" + expression + "\" (" + typeof expression + ")", sourceSpan);
  102641. }
  102642. });
  102643. return boundProps_1.map(function (prop) { return _this.createElementPropertyAst(elementSelector, prop); });
  102644. }
  102645. return null;
  102646. };
  102647. /**
  102648. * @param {?} dirMeta
  102649. * @param {?} sourceSpan
  102650. * @return {?}
  102651. */
  102652. BindingParser.prototype.createDirectiveHostEventAsts = /**
  102653. * @param {?} dirMeta
  102654. * @param {?} sourceSpan
  102655. * @return {?}
  102656. */
  102657. function (dirMeta, sourceSpan) {
  102658. var _this = this;
  102659. if (dirMeta.hostListeners) {
  102660. var /** @type {?} */ targetEventAsts_1 = [];
  102661. Object.keys(dirMeta.hostListeners).forEach(function (propName) {
  102662. var /** @type {?} */ expression = dirMeta.hostListeners[propName];
  102663. if (typeof expression === 'string') {
  102664. _this.parseEvent(propName, expression, sourceSpan, [], targetEventAsts_1);
  102665. }
  102666. else {
  102667. _this._reportError("Value of the host listener \"" + propName + "\" needs to be a string representing an expression but got \"" + expression + "\" (" + typeof expression + ")", sourceSpan);
  102668. }
  102669. });
  102670. return targetEventAsts_1;
  102671. }
  102672. return null;
  102673. };
  102674. /**
  102675. * @param {?} value
  102676. * @param {?} sourceSpan
  102677. * @return {?}
  102678. */
  102679. BindingParser.prototype.parseInterpolation = /**
  102680. * @param {?} value
  102681. * @param {?} sourceSpan
  102682. * @return {?}
  102683. */
  102684. function (value, sourceSpan) {
  102685. var /** @type {?} */ sourceInfo = sourceSpan.start.toString();
  102686. try {
  102687. var /** @type {?} */ ast = /** @type {?} */ ((this._exprParser.parseInterpolation(value, sourceInfo, this._interpolationConfig)));
  102688. if (ast)
  102689. this._reportExpressionParserErrors(ast.errors, sourceSpan);
  102690. this._checkPipes(ast, sourceSpan);
  102691. return ast;
  102692. }
  102693. catch (/** @type {?} */ e) {
  102694. this._reportError("" + e, sourceSpan);
  102695. return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo);
  102696. }
  102697. };
  102698. /**
  102699. * @param {?} prefixToken
  102700. * @param {?} value
  102701. * @param {?} sourceSpan
  102702. * @param {?} targetMatchableAttrs
  102703. * @param {?} targetProps
  102704. * @param {?} targetVars
  102705. * @return {?}
  102706. */
  102707. BindingParser.prototype.parseInlineTemplateBinding = /**
  102708. * @param {?} prefixToken
  102709. * @param {?} value
  102710. * @param {?} sourceSpan
  102711. * @param {?} targetMatchableAttrs
  102712. * @param {?} targetProps
  102713. * @param {?} targetVars
  102714. * @return {?}
  102715. */
  102716. function (prefixToken, value, sourceSpan, targetMatchableAttrs, targetProps, targetVars) {
  102717. var /** @type {?} */ bindings = this._parseTemplateBindings(prefixToken, value, sourceSpan);
  102718. for (var /** @type {?} */ i = 0; i < bindings.length; i++) {
  102719. var /** @type {?} */ binding = bindings[i];
  102720. if (binding.keyIsVar) {
  102721. targetVars.push(new VariableAst(binding.key, binding.name, sourceSpan));
  102722. }
  102723. else if (binding.expression) {
  102724. this._parsePropertyAst(binding.key, binding.expression, sourceSpan, targetMatchableAttrs, targetProps);
  102725. }
  102726. else {
  102727. targetMatchableAttrs.push([binding.key, '']);
  102728. this.parseLiteralAttr(binding.key, null, sourceSpan, targetMatchableAttrs, targetProps);
  102729. }
  102730. }
  102731. };
  102732. /**
  102733. * @param {?} prefixToken
  102734. * @param {?} value
  102735. * @param {?} sourceSpan
  102736. * @return {?}
  102737. */
  102738. BindingParser.prototype._parseTemplateBindings = /**
  102739. * @param {?} prefixToken
  102740. * @param {?} value
  102741. * @param {?} sourceSpan
  102742. * @return {?}
  102743. */
  102744. function (prefixToken, value, sourceSpan) {
  102745. var _this = this;
  102746. var /** @type {?} */ sourceInfo = sourceSpan.start.toString();
  102747. try {
  102748. var /** @type {?} */ bindingsResult = this._exprParser.parseTemplateBindings(prefixToken, value, sourceInfo);
  102749. this._reportExpressionParserErrors(bindingsResult.errors, sourceSpan);
  102750. bindingsResult.templateBindings.forEach(function (binding) {
  102751. if (binding.expression) {
  102752. _this._checkPipes(binding.expression, sourceSpan);
  102753. }
  102754. });
  102755. bindingsResult.warnings.forEach(function (warning) { _this._reportError(warning, sourceSpan, ParseErrorLevel.WARNING); });
  102756. return bindingsResult.templateBindings;
  102757. }
  102758. catch (/** @type {?} */ e) {
  102759. this._reportError("" + e, sourceSpan);
  102760. return [];
  102761. }
  102762. };
  102763. /**
  102764. * @param {?} name
  102765. * @param {?} value
  102766. * @param {?} sourceSpan
  102767. * @param {?} targetMatchableAttrs
  102768. * @param {?} targetProps
  102769. * @return {?}
  102770. */
  102771. BindingParser.prototype.parseLiteralAttr = /**
  102772. * @param {?} name
  102773. * @param {?} value
  102774. * @param {?} sourceSpan
  102775. * @param {?} targetMatchableAttrs
  102776. * @param {?} targetProps
  102777. * @return {?}
  102778. */
  102779. function (name, value, sourceSpan, targetMatchableAttrs, targetProps) {
  102780. if (_isAnimationLabel(name)) {
  102781. name = name.substring(1);
  102782. if (value) {
  102783. this._reportError("Assigning animation triggers via @prop=\"exp\" attributes with an expression is invalid." +
  102784. " Use property bindings (e.g. [@prop]=\"exp\") or use an attribute without a value (e.g. @prop) instead.", sourceSpan, ParseErrorLevel.ERROR);
  102785. }
  102786. this._parseAnimation(name, value, sourceSpan, targetMatchableAttrs, targetProps);
  102787. }
  102788. else {
  102789. targetProps.push(new BoundProperty(name, this._exprParser.wrapLiteralPrimitive(value, ''), BoundPropertyType.LITERAL_ATTR, sourceSpan));
  102790. }
  102791. };
  102792. /**
  102793. * @param {?} name
  102794. * @param {?} expression
  102795. * @param {?} isHost
  102796. * @param {?} sourceSpan
  102797. * @param {?} targetMatchableAttrs
  102798. * @param {?} targetProps
  102799. * @return {?}
  102800. */
  102801. BindingParser.prototype.parsePropertyBinding = /**
  102802. * @param {?} name
  102803. * @param {?} expression
  102804. * @param {?} isHost
  102805. * @param {?} sourceSpan
  102806. * @param {?} targetMatchableAttrs
  102807. * @param {?} targetProps
  102808. * @return {?}
  102809. */
  102810. function (name, expression, isHost, sourceSpan, targetMatchableAttrs, targetProps) {
  102811. var /** @type {?} */ isAnimationProp = false;
  102812. if (name.startsWith(ANIMATE_PROP_PREFIX)) {
  102813. isAnimationProp = true;
  102814. name = name.substring(ANIMATE_PROP_PREFIX.length);
  102815. }
  102816. else if (_isAnimationLabel(name)) {
  102817. isAnimationProp = true;
  102818. name = name.substring(1);
  102819. }
  102820. if (isAnimationProp) {
  102821. this._parseAnimation(name, expression, sourceSpan, targetMatchableAttrs, targetProps);
  102822. }
  102823. else {
  102824. this._parsePropertyAst(name, this._parseBinding(expression, isHost, sourceSpan), sourceSpan, targetMatchableAttrs, targetProps);
  102825. }
  102826. };
  102827. /**
  102828. * @param {?} name
  102829. * @param {?} value
  102830. * @param {?} sourceSpan
  102831. * @param {?} targetMatchableAttrs
  102832. * @param {?} targetProps
  102833. * @return {?}
  102834. */
  102835. BindingParser.prototype.parsePropertyInterpolation = /**
  102836. * @param {?} name
  102837. * @param {?} value
  102838. * @param {?} sourceSpan
  102839. * @param {?} targetMatchableAttrs
  102840. * @param {?} targetProps
  102841. * @return {?}
  102842. */
  102843. function (name, value, sourceSpan, targetMatchableAttrs, targetProps) {
  102844. var /** @type {?} */ expr = this.parseInterpolation(value, sourceSpan);
  102845. if (expr) {
  102846. this._parsePropertyAst(name, expr, sourceSpan, targetMatchableAttrs, targetProps);
  102847. return true;
  102848. }
  102849. return false;
  102850. };
  102851. /**
  102852. * @param {?} name
  102853. * @param {?} ast
  102854. * @param {?} sourceSpan
  102855. * @param {?} targetMatchableAttrs
  102856. * @param {?} targetProps
  102857. * @return {?}
  102858. */
  102859. BindingParser.prototype._parsePropertyAst = /**
  102860. * @param {?} name
  102861. * @param {?} ast
  102862. * @param {?} sourceSpan
  102863. * @param {?} targetMatchableAttrs
  102864. * @param {?} targetProps
  102865. * @return {?}
  102866. */
  102867. function (name, ast, sourceSpan, targetMatchableAttrs, targetProps) {
  102868. targetMatchableAttrs.push([name, /** @type {?} */ ((ast.source))]);
  102869. targetProps.push(new BoundProperty(name, ast, BoundPropertyType.DEFAULT, sourceSpan));
  102870. };
  102871. /**
  102872. * @param {?} name
  102873. * @param {?} expression
  102874. * @param {?} sourceSpan
  102875. * @param {?} targetMatchableAttrs
  102876. * @param {?} targetProps
  102877. * @return {?}
  102878. */
  102879. BindingParser.prototype._parseAnimation = /**
  102880. * @param {?} name
  102881. * @param {?} expression
  102882. * @param {?} sourceSpan
  102883. * @param {?} targetMatchableAttrs
  102884. * @param {?} targetProps
  102885. * @return {?}
  102886. */
  102887. function (name, expression, sourceSpan, targetMatchableAttrs, targetProps) {
  102888. // This will occur when a @trigger is not paired with an expression.
  102889. // For animations it is valid to not have an expression since */void
  102890. // states will be applied by angular when the element is attached/detached
  102891. var /** @type {?} */ ast = this._parseBinding(expression || 'undefined', false, sourceSpan);
  102892. targetMatchableAttrs.push([name, /** @type {?} */ ((ast.source))]);
  102893. targetProps.push(new BoundProperty(name, ast, BoundPropertyType.ANIMATION, sourceSpan));
  102894. };
  102895. /**
  102896. * @param {?} value
  102897. * @param {?} isHostBinding
  102898. * @param {?} sourceSpan
  102899. * @return {?}
  102900. */
  102901. BindingParser.prototype._parseBinding = /**
  102902. * @param {?} value
  102903. * @param {?} isHostBinding
  102904. * @param {?} sourceSpan
  102905. * @return {?}
  102906. */
  102907. function (value, isHostBinding, sourceSpan) {
  102908. var /** @type {?} */ sourceInfo = sourceSpan.start.toString();
  102909. try {
  102910. var /** @type {?} */ ast = isHostBinding ?
  102911. this._exprParser.parseSimpleBinding(value, sourceInfo, this._interpolationConfig) :
  102912. this._exprParser.parseBinding(value, sourceInfo, this._interpolationConfig);
  102913. if (ast)
  102914. this._reportExpressionParserErrors(ast.errors, sourceSpan);
  102915. this._checkPipes(ast, sourceSpan);
  102916. return ast;
  102917. }
  102918. catch (/** @type {?} */ e) {
  102919. this._reportError("" + e, sourceSpan);
  102920. return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo);
  102921. }
  102922. };
  102923. /**
  102924. * @param {?} elementSelector
  102925. * @param {?} boundProp
  102926. * @return {?}
  102927. */
  102928. BindingParser.prototype.createElementPropertyAst = /**
  102929. * @param {?} elementSelector
  102930. * @param {?} boundProp
  102931. * @return {?}
  102932. */
  102933. function (elementSelector, boundProp) {
  102934. if (boundProp.isAnimation) {
  102935. return new BoundElementPropertyAst(boundProp.name, PropertyBindingType.Animation, SecurityContext.NONE, boundProp.expression, null, boundProp.sourceSpan);
  102936. }
  102937. var /** @type {?} */ unit = null;
  102938. var /** @type {?} */ bindingType = /** @type {?} */ ((undefined));
  102939. var /** @type {?} */ boundPropertyName = null;
  102940. var /** @type {?} */ parts = boundProp.name.split(PROPERTY_PARTS_SEPARATOR);
  102941. var /** @type {?} */ securityContexts = /** @type {?} */ ((undefined));
  102942. // Check check for special cases (prefix style, attr, class)
  102943. if (parts.length > 1) {
  102944. if (parts[0] == ATTRIBUTE_PREFIX) {
  102945. boundPropertyName = parts[1];
  102946. this._validatePropertyOrAttributeName(boundPropertyName, boundProp.sourceSpan, true);
  102947. securityContexts = calcPossibleSecurityContexts(this._schemaRegistry, elementSelector, boundPropertyName, true);
  102948. var /** @type {?} */ nsSeparatorIdx = boundPropertyName.indexOf(':');
  102949. if (nsSeparatorIdx > -1) {
  102950. var /** @type {?} */ ns = boundPropertyName.substring(0, nsSeparatorIdx);
  102951. var /** @type {?} */ name_1 = boundPropertyName.substring(nsSeparatorIdx + 1);
  102952. boundPropertyName = mergeNsAndName(ns, name_1);
  102953. }
  102954. bindingType = PropertyBindingType.Attribute;
  102955. }
  102956. else if (parts[0] == CLASS_PREFIX) {
  102957. boundPropertyName = parts[1];
  102958. bindingType = PropertyBindingType.Class;
  102959. securityContexts = [SecurityContext.NONE];
  102960. }
  102961. else if (parts[0] == STYLE_PREFIX) {
  102962. unit = parts.length > 2 ? parts[2] : null;
  102963. boundPropertyName = parts[1];
  102964. bindingType = PropertyBindingType.Style;
  102965. securityContexts = [SecurityContext.STYLE];
  102966. }
  102967. }
  102968. // If not a special case, use the full property name
  102969. if (boundPropertyName === null) {
  102970. boundPropertyName = this._schemaRegistry.getMappedPropName(boundProp.name);
  102971. securityContexts = calcPossibleSecurityContexts(this._schemaRegistry, elementSelector, boundPropertyName, false);
  102972. bindingType = PropertyBindingType.Property;
  102973. this._validatePropertyOrAttributeName(boundPropertyName, boundProp.sourceSpan, false);
  102974. }
  102975. return new BoundElementPropertyAst(boundPropertyName, bindingType, securityContexts[0], boundProp.expression, unit, boundProp.sourceSpan);
  102976. };
  102977. /**
  102978. * @param {?} name
  102979. * @param {?} expression
  102980. * @param {?} sourceSpan
  102981. * @param {?} targetMatchableAttrs
  102982. * @param {?} targetEvents
  102983. * @return {?}
  102984. */
  102985. BindingParser.prototype.parseEvent = /**
  102986. * @param {?} name
  102987. * @param {?} expression
  102988. * @param {?} sourceSpan
  102989. * @param {?} targetMatchableAttrs
  102990. * @param {?} targetEvents
  102991. * @return {?}
  102992. */
  102993. function (name, expression, sourceSpan, targetMatchableAttrs, targetEvents) {
  102994. if (_isAnimationLabel(name)) {
  102995. name = name.substr(1);
  102996. this._parseAnimationEvent(name, expression, sourceSpan, targetEvents);
  102997. }
  102998. else {
  102999. this._parseEvent(name, expression, sourceSpan, targetMatchableAttrs, targetEvents);
  103000. }
  103001. };
  103002. /**
  103003. * @param {?} name
  103004. * @param {?} expression
  103005. * @param {?} sourceSpan
  103006. * @param {?} targetEvents
  103007. * @return {?}
  103008. */
  103009. BindingParser.prototype._parseAnimationEvent = /**
  103010. * @param {?} name
  103011. * @param {?} expression
  103012. * @param {?} sourceSpan
  103013. * @param {?} targetEvents
  103014. * @return {?}
  103015. */
  103016. function (name, expression, sourceSpan, targetEvents) {
  103017. var /** @type {?} */ matches = splitAtPeriod(name, [name, '']);
  103018. var /** @type {?} */ eventName = matches[0];
  103019. var /** @type {?} */ phase = matches[1].toLowerCase();
  103020. if (phase) {
  103021. switch (phase) {
  103022. case 'start':
  103023. case 'done':
  103024. var /** @type {?} */ ast = this._parseAction(expression, sourceSpan);
  103025. targetEvents.push(new BoundEventAst(eventName, null, phase, ast, sourceSpan));
  103026. break;
  103027. default:
  103028. this._reportError("The provided animation output phase value \"" + phase + "\" for \"@" + eventName + "\" is not supported (use start or done)", sourceSpan);
  103029. break;
  103030. }
  103031. }
  103032. else {
  103033. this._reportError("The animation trigger output event (@" + eventName + ") is missing its phase value name (start or done are currently supported)", sourceSpan);
  103034. }
  103035. };
  103036. /**
  103037. * @param {?} name
  103038. * @param {?} expression
  103039. * @param {?} sourceSpan
  103040. * @param {?} targetMatchableAttrs
  103041. * @param {?} targetEvents
  103042. * @return {?}
  103043. */
  103044. BindingParser.prototype._parseEvent = /**
  103045. * @param {?} name
  103046. * @param {?} expression
  103047. * @param {?} sourceSpan
  103048. * @param {?} targetMatchableAttrs
  103049. * @param {?} targetEvents
  103050. * @return {?}
  103051. */
  103052. function (name, expression, sourceSpan, targetMatchableAttrs, targetEvents) {
  103053. // long format: 'target: eventName'
  103054. var _a = splitAtColon(name, [/** @type {?} */ ((null)), name]), target = _a[0], eventName = _a[1];
  103055. var /** @type {?} */ ast = this._parseAction(expression, sourceSpan);
  103056. targetMatchableAttrs.push([/** @type {?} */ ((name)), /** @type {?} */ ((ast.source))]);
  103057. targetEvents.push(new BoundEventAst(eventName, target, null, ast, sourceSpan));
  103058. // Don't detect directives for event names for now,
  103059. // so don't add the event name to the matchableAttrs
  103060. };
  103061. /**
  103062. * @param {?} value
  103063. * @param {?} sourceSpan
  103064. * @return {?}
  103065. */
  103066. BindingParser.prototype._parseAction = /**
  103067. * @param {?} value
  103068. * @param {?} sourceSpan
  103069. * @return {?}
  103070. */
  103071. function (value, sourceSpan) {
  103072. var /** @type {?} */ sourceInfo = sourceSpan.start.toString();
  103073. try {
  103074. var /** @type {?} */ ast = this._exprParser.parseAction(value, sourceInfo, this._interpolationConfig);
  103075. if (ast) {
  103076. this._reportExpressionParserErrors(ast.errors, sourceSpan);
  103077. }
  103078. if (!ast || ast.ast instanceof EmptyExpr) {
  103079. this._reportError("Empty expressions are not allowed", sourceSpan);
  103080. return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo);
  103081. }
  103082. this._checkPipes(ast, sourceSpan);
  103083. return ast;
  103084. }
  103085. catch (/** @type {?} */ e) {
  103086. this._reportError("" + e, sourceSpan);
  103087. return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo);
  103088. }
  103089. };
  103090. /**
  103091. * @param {?} message
  103092. * @param {?} sourceSpan
  103093. * @param {?=} level
  103094. * @return {?}
  103095. */
  103096. BindingParser.prototype._reportError = /**
  103097. * @param {?} message
  103098. * @param {?} sourceSpan
  103099. * @param {?=} level
  103100. * @return {?}
  103101. */
  103102. function (message, sourceSpan, level) {
  103103. if (level === void 0) { level = ParseErrorLevel.ERROR; }
  103104. this._targetErrors.push(new ParseError(sourceSpan, message, level));
  103105. };
  103106. /**
  103107. * @param {?} errors
  103108. * @param {?} sourceSpan
  103109. * @return {?}
  103110. */
  103111. BindingParser.prototype._reportExpressionParserErrors = /**
  103112. * @param {?} errors
  103113. * @param {?} sourceSpan
  103114. * @return {?}
  103115. */
  103116. function (errors, sourceSpan) {
  103117. for (var _i = 0, errors_1 = errors; _i < errors_1.length; _i++) {
  103118. var error = errors_1[_i];
  103119. this._reportError(error.message, sourceSpan);
  103120. }
  103121. };
  103122. /**
  103123. * @param {?} ast
  103124. * @param {?} sourceSpan
  103125. * @return {?}
  103126. */
  103127. BindingParser.prototype._checkPipes = /**
  103128. * @param {?} ast
  103129. * @param {?} sourceSpan
  103130. * @return {?}
  103131. */
  103132. function (ast, sourceSpan) {
  103133. var _this = this;
  103134. if (ast) {
  103135. var /** @type {?} */ collector = new PipeCollector();
  103136. ast.visit(collector);
  103137. collector.pipes.forEach(function (ast, pipeName) {
  103138. var /** @type {?} */ pipeMeta = _this.pipesByName.get(pipeName);
  103139. if (!pipeMeta) {
  103140. _this._reportError("The pipe '" + pipeName + "' could not be found", new ParseSourceSpan(sourceSpan.start.moveBy(ast.span.start), sourceSpan.start.moveBy(ast.span.end)));
  103141. }
  103142. else {
  103143. _this._usedPipes.set(pipeName, pipeMeta);
  103144. }
  103145. });
  103146. }
  103147. };
  103148. /**
  103149. * @param {?} propName the name of the property / attribute
  103150. * @param {?} sourceSpan
  103151. * @param {?} isAttr true when binding to an attribute
  103152. * @return {?}
  103153. */
  103154. BindingParser.prototype._validatePropertyOrAttributeName = /**
  103155. * @param {?} propName the name of the property / attribute
  103156. * @param {?} sourceSpan
  103157. * @param {?} isAttr true when binding to an attribute
  103158. * @return {?}
  103159. */
  103160. function (propName, sourceSpan, isAttr) {
  103161. var /** @type {?} */ report = isAttr ? this._schemaRegistry.validateAttribute(propName) :
  103162. this._schemaRegistry.validateProperty(propName);
  103163. if (report.error) {
  103164. this._reportError(/** @type {?} */ ((report.msg)), sourceSpan, ParseErrorLevel.ERROR);
  103165. }
  103166. };
  103167. return BindingParser;
  103168. }());
  103169. var PipeCollector = /** @class */ (function (_super) {
  103170. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(PipeCollector, _super);
  103171. function PipeCollector() {
  103172. var _this = _super !== null && _super.apply(this, arguments) || this;
  103173. _this.pipes = new Map();
  103174. return _this;
  103175. }
  103176. /**
  103177. * @param {?} ast
  103178. * @param {?} context
  103179. * @return {?}
  103180. */
  103181. PipeCollector.prototype.visitPipe = /**
  103182. * @param {?} ast
  103183. * @param {?} context
  103184. * @return {?}
  103185. */
  103186. function (ast, context) {
  103187. this.pipes.set(ast.name, ast);
  103188. ast.exp.visit(this);
  103189. this.visitAll(ast.args, context);
  103190. return null;
  103191. };
  103192. return PipeCollector;
  103193. }(RecursiveAstVisitor));
  103194. /**
  103195. * @param {?} name
  103196. * @return {?}
  103197. */
  103198. function _isAnimationLabel(name) {
  103199. return name[0] == '@';
  103200. }
  103201. /**
  103202. * @param {?} registry
  103203. * @param {?} selector
  103204. * @param {?} propName
  103205. * @param {?} isAttribute
  103206. * @return {?}
  103207. */
  103208. function calcPossibleSecurityContexts(registry, selector, propName, isAttribute) {
  103209. var /** @type {?} */ ctxs = [];
  103210. CssSelector.parse(selector).forEach(function (selector) {
  103211. var /** @type {?} */ elementNames = selector.element ? [selector.element] : registry.allKnownElementNames();
  103212. var /** @type {?} */ notElementNames = new Set(selector.notSelectors.filter(function (selector) { return selector.isElementSelector(); })
  103213. .map(function (selector) { return selector.element; }));
  103214. var /** @type {?} */ possibleElementNames = elementNames.filter(function (elementName) { return !notElementNames.has(elementName); });
  103215. ctxs.push.apply(ctxs, possibleElementNames.map(function (elementName) { return registry.securityContext(elementName, propName, isAttribute); }));
  103216. });
  103217. return ctxs.length === 0 ? [SecurityContext.NONE] : Array.from(new Set(ctxs)).sort();
  103218. }
  103219. /**
  103220. * @fileoverview added by tsickle
  103221. * @suppress {checkTypes} checked by tsc
  103222. */
  103223. /**
  103224. * @license
  103225. * Copyright Google Inc. All Rights Reserved.
  103226. *
  103227. * Use of this source code is governed by an MIT-style license that can be
  103228. * found in the LICENSE file at https://angular.io/license
  103229. */
  103230. var BIND_NAME_REGEXP = /^(?:(?:(?:(bind-)|(let-)|(ref-|#)|(on-)|(bindon-)|(@))(.+))|\[\(([^\)]+)\)\]|\[([^\]]+)\]|\(([^\)]+)\))$/;
  103231. // Group 1 = "bind-"
  103232. var KW_BIND_IDX = 1;
  103233. // Group 2 = "let-"
  103234. var KW_LET_IDX = 2;
  103235. // Group 3 = "ref-/#"
  103236. var KW_REF_IDX = 3;
  103237. // Group 4 = "on-"
  103238. var KW_ON_IDX = 4;
  103239. // Group 5 = "bindon-"
  103240. var KW_BINDON_IDX = 5;
  103241. // Group 6 = "@"
  103242. var KW_AT_IDX = 6;
  103243. // Group 7 = the identifier after "bind-", "let-", "ref-/#", "on-", "bindon-" or "@"
  103244. var IDENT_KW_IDX = 7;
  103245. // Group 8 = identifier inside [()]
  103246. var IDENT_BANANA_BOX_IDX = 8;
  103247. // Group 9 = identifier inside []
  103248. var IDENT_PROPERTY_IDX = 9;
  103249. // Group 10 = identifier inside ()
  103250. var IDENT_EVENT_IDX = 10;
  103251. // deprecated in 4.x
  103252. var TEMPLATE_ELEMENT = 'template';
  103253. // deprecated in 4.x
  103254. var TEMPLATE_ATTR = 'template';
  103255. var TEMPLATE_ATTR_PREFIX = '*';
  103256. var CLASS_ATTR = 'class';
  103257. var TEXT_CSS_SELECTOR = CssSelector.parse('*')[0];
  103258. var TEMPLATE_ELEMENT_DEPRECATION_WARNING = 'The <template> element is deprecated. Use <ng-template> instead';
  103259. var TEMPLATE_ATTR_DEPRECATION_WARNING = 'The template attribute is deprecated. Use an ng-template element instead.';
  103260. var warningCounts = {};
  103261. /**
  103262. * @param {?} warnings
  103263. * @return {?}
  103264. */
  103265. function warnOnlyOnce(warnings) {
  103266. return function (error) {
  103267. if (warnings.indexOf(error.msg) !== -1) {
  103268. warningCounts[error.msg] = (warningCounts[error.msg] || 0) + 1;
  103269. return warningCounts[error.msg] <= 1;
  103270. }
  103271. return true;
  103272. };
  103273. }
  103274. var TemplateParseError = /** @class */ (function (_super) {
  103275. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(TemplateParseError, _super);
  103276. function TemplateParseError(message, span, level) {
  103277. return _super.call(this, span, message, level) || this;
  103278. }
  103279. return TemplateParseError;
  103280. }(ParseError));
  103281. var TemplateParseResult = /** @class */ (function () {
  103282. function TemplateParseResult(templateAst, usedPipes, errors) {
  103283. this.templateAst = templateAst;
  103284. this.usedPipes = usedPipes;
  103285. this.errors = errors;
  103286. }
  103287. return TemplateParseResult;
  103288. }());
  103289. var TemplateParser = /** @class */ (function () {
  103290. function TemplateParser(_config, _reflector, _exprParser, _schemaRegistry, _htmlParser, _console, transforms) {
  103291. this._config = _config;
  103292. this._reflector = _reflector;
  103293. this._exprParser = _exprParser;
  103294. this._schemaRegistry = _schemaRegistry;
  103295. this._htmlParser = _htmlParser;
  103296. this._console = _console;
  103297. this.transforms = transforms;
  103298. }
  103299. /**
  103300. * @param {?} component
  103301. * @param {?} template
  103302. * @param {?} directives
  103303. * @param {?} pipes
  103304. * @param {?} schemas
  103305. * @param {?} templateUrl
  103306. * @param {?} preserveWhitespaces
  103307. * @return {?}
  103308. */
  103309. TemplateParser.prototype.parse = /**
  103310. * @param {?} component
  103311. * @param {?} template
  103312. * @param {?} directives
  103313. * @param {?} pipes
  103314. * @param {?} schemas
  103315. * @param {?} templateUrl
  103316. * @param {?} preserveWhitespaces
  103317. * @return {?}
  103318. */
  103319. function (component, template, directives, pipes, schemas, templateUrl, preserveWhitespaces) {
  103320. var /** @type {?} */ result = this.tryParse(component, template, directives, pipes, schemas, templateUrl, preserveWhitespaces);
  103321. var /** @type {?} */ warnings = /** @type {?} */ ((result.errors)).filter(function (error) { return error.level === ParseErrorLevel.WARNING; }).filter(warnOnlyOnce([TEMPLATE_ATTR_DEPRECATION_WARNING, TEMPLATE_ELEMENT_DEPRECATION_WARNING]));
  103322. var /** @type {?} */ errors = /** @type {?} */ ((result.errors)).filter(function (error) { return error.level === ParseErrorLevel.ERROR; });
  103323. if (warnings.length > 0) {
  103324. this._console.warn("Template parse warnings:\n" + warnings.join('\n'));
  103325. }
  103326. if (errors.length > 0) {
  103327. var /** @type {?} */ errorString = errors.join('\n');
  103328. throw syntaxError("Template parse errors:\n" + errorString, errors);
  103329. }
  103330. return { template: /** @type {?} */ ((result.templateAst)), pipes: /** @type {?} */ ((result.usedPipes)) };
  103331. };
  103332. /**
  103333. * @param {?} component
  103334. * @param {?} template
  103335. * @param {?} directives
  103336. * @param {?} pipes
  103337. * @param {?} schemas
  103338. * @param {?} templateUrl
  103339. * @param {?} preserveWhitespaces
  103340. * @return {?}
  103341. */
  103342. TemplateParser.prototype.tryParse = /**
  103343. * @param {?} component
  103344. * @param {?} template
  103345. * @param {?} directives
  103346. * @param {?} pipes
  103347. * @param {?} schemas
  103348. * @param {?} templateUrl
  103349. * @param {?} preserveWhitespaces
  103350. * @return {?}
  103351. */
  103352. function (component, template, directives, pipes, schemas, templateUrl, preserveWhitespaces) {
  103353. var /** @type {?} */ htmlParseResult = typeof template === 'string' ? /** @type {?} */ ((this._htmlParser)).parse(template, templateUrl, true, this.getInterpolationConfig(component)) :
  103354. template;
  103355. if (!preserveWhitespaces) {
  103356. htmlParseResult = removeWhitespaces(htmlParseResult);
  103357. }
  103358. return this.tryParseHtml(this.expandHtml(htmlParseResult), component, directives, pipes, schemas);
  103359. };
  103360. /**
  103361. * @param {?} htmlAstWithErrors
  103362. * @param {?} component
  103363. * @param {?} directives
  103364. * @param {?} pipes
  103365. * @param {?} schemas
  103366. * @return {?}
  103367. */
  103368. TemplateParser.prototype.tryParseHtml = /**
  103369. * @param {?} htmlAstWithErrors
  103370. * @param {?} component
  103371. * @param {?} directives
  103372. * @param {?} pipes
  103373. * @param {?} schemas
  103374. * @return {?}
  103375. */
  103376. function (htmlAstWithErrors, component, directives, pipes, schemas) {
  103377. var /** @type {?} */ result;
  103378. var /** @type {?} */ errors = htmlAstWithErrors.errors;
  103379. var /** @type {?} */ usedPipes = [];
  103380. if (htmlAstWithErrors.rootNodes.length > 0) {
  103381. var /** @type {?} */ uniqDirectives = removeSummaryDuplicates(directives);
  103382. var /** @type {?} */ uniqPipes = removeSummaryDuplicates(pipes);
  103383. var /** @type {?} */ providerViewContext = new ProviderViewContext(this._reflector, component);
  103384. var /** @type {?} */ interpolationConfig = /** @type {?} */ ((undefined));
  103385. if (component.template && component.template.interpolation) {
  103386. interpolationConfig = {
  103387. start: component.template.interpolation[0],
  103388. end: component.template.interpolation[1]
  103389. };
  103390. }
  103391. var /** @type {?} */ bindingParser = new BindingParser(this._exprParser, /** @type {?} */ ((interpolationConfig)), this._schemaRegistry, uniqPipes, errors);
  103392. var /** @type {?} */ parseVisitor = new TemplateParseVisitor(this._reflector, this._config, providerViewContext, uniqDirectives, bindingParser, this._schemaRegistry, schemas, errors);
  103393. result = visitAll(parseVisitor, htmlAstWithErrors.rootNodes, EMPTY_ELEMENT_CONTEXT);
  103394. errors.push.apply(errors, providerViewContext.errors);
  103395. usedPipes.push.apply(usedPipes, bindingParser.getUsedPipes());
  103396. }
  103397. else {
  103398. result = [];
  103399. }
  103400. this._assertNoReferenceDuplicationOnTemplate(result, errors);
  103401. if (errors.length > 0) {
  103402. return new TemplateParseResult(result, usedPipes, errors);
  103403. }
  103404. if (this.transforms) {
  103405. this.transforms.forEach(function (transform) { result = templateVisitAll(transform, result); });
  103406. }
  103407. return new TemplateParseResult(result, usedPipes, errors);
  103408. };
  103409. /**
  103410. * @param {?} htmlAstWithErrors
  103411. * @param {?=} forced
  103412. * @return {?}
  103413. */
  103414. TemplateParser.prototype.expandHtml = /**
  103415. * @param {?} htmlAstWithErrors
  103416. * @param {?=} forced
  103417. * @return {?}
  103418. */
  103419. function (htmlAstWithErrors, forced) {
  103420. if (forced === void 0) { forced = false; }
  103421. var /** @type {?} */ errors = htmlAstWithErrors.errors;
  103422. if (errors.length == 0 || forced) {
  103423. // Transform ICU messages to angular directives
  103424. var /** @type {?} */ expandedHtmlAst = expandNodes(htmlAstWithErrors.rootNodes);
  103425. errors.push.apply(errors, expandedHtmlAst.errors);
  103426. htmlAstWithErrors = new ParseTreeResult(expandedHtmlAst.nodes, errors);
  103427. }
  103428. return htmlAstWithErrors;
  103429. };
  103430. /**
  103431. * @param {?} component
  103432. * @return {?}
  103433. */
  103434. TemplateParser.prototype.getInterpolationConfig = /**
  103435. * @param {?} component
  103436. * @return {?}
  103437. */
  103438. function (component) {
  103439. if (component.template) {
  103440. return InterpolationConfig.fromArray(component.template.interpolation);
  103441. }
  103442. return undefined;
  103443. };
  103444. /** @internal */
  103445. /**
  103446. * \@internal
  103447. * @param {?} result
  103448. * @param {?} errors
  103449. * @return {?}
  103450. */
  103451. TemplateParser.prototype._assertNoReferenceDuplicationOnTemplate = /**
  103452. * \@internal
  103453. * @param {?} result
  103454. * @param {?} errors
  103455. * @return {?}
  103456. */
  103457. function (result, errors) {
  103458. var /** @type {?} */ existingReferences = [];
  103459. result.filter(function (element) { return !!(/** @type {?} */ (element)).references; })
  103460. .forEach(function (element) {
  103461. return (/** @type {?} */ (element)).references.forEach(function (reference) {
  103462. var /** @type {?} */ name = reference.name;
  103463. if (existingReferences.indexOf(name) < 0) {
  103464. existingReferences.push(name);
  103465. }
  103466. else {
  103467. var /** @type {?} */ error = new TemplateParseError("Reference \"#" + name + "\" is defined several times", reference.sourceSpan, ParseErrorLevel.ERROR);
  103468. errors.push(error);
  103469. }
  103470. });
  103471. });
  103472. };
  103473. return TemplateParser;
  103474. }());
  103475. var TemplateParseVisitor = /** @class */ (function () {
  103476. function TemplateParseVisitor(reflector, config, providerViewContext, directives, _bindingParser, _schemaRegistry, _schemas, _targetErrors) {
  103477. var _this = this;
  103478. this.reflector = reflector;
  103479. this.config = config;
  103480. this.providerViewContext = providerViewContext;
  103481. this._bindingParser = _bindingParser;
  103482. this._schemaRegistry = _schemaRegistry;
  103483. this._schemas = _schemas;
  103484. this._targetErrors = _targetErrors;
  103485. this.selectorMatcher = new SelectorMatcher();
  103486. this.directivesIndex = new Map();
  103487. this.ngContentCount = 0;
  103488. // Note: queries start with id 1 so we can use the number in a Bloom filter!
  103489. this.contentQueryStartId = providerViewContext.component.viewQueries.length + 1;
  103490. directives.forEach(function (directive, index) {
  103491. var /** @type {?} */ selector = CssSelector.parse(/** @type {?} */ ((directive.selector)));
  103492. _this.selectorMatcher.addSelectables(selector, directive);
  103493. _this.directivesIndex.set(directive, index);
  103494. });
  103495. }
  103496. /**
  103497. * @param {?} expansion
  103498. * @param {?} context
  103499. * @return {?}
  103500. */
  103501. TemplateParseVisitor.prototype.visitExpansion = /**
  103502. * @param {?} expansion
  103503. * @param {?} context
  103504. * @return {?}
  103505. */
  103506. function (expansion, context) { return null; };
  103507. /**
  103508. * @param {?} expansionCase
  103509. * @param {?} context
  103510. * @return {?}
  103511. */
  103512. TemplateParseVisitor.prototype.visitExpansionCase = /**
  103513. * @param {?} expansionCase
  103514. * @param {?} context
  103515. * @return {?}
  103516. */
  103517. function (expansionCase, context) { return null; };
  103518. /**
  103519. * @param {?} text
  103520. * @param {?} parent
  103521. * @return {?}
  103522. */
  103523. TemplateParseVisitor.prototype.visitText = /**
  103524. * @param {?} text
  103525. * @param {?} parent
  103526. * @return {?}
  103527. */
  103528. function (text, parent) {
  103529. var /** @type {?} */ ngContentIndex = /** @type {?} */ ((parent.findNgContentIndex(TEXT_CSS_SELECTOR)));
  103530. var /** @type {?} */ valueNoNgsp = replaceNgsp(text.value);
  103531. var /** @type {?} */ expr = this._bindingParser.parseInterpolation(valueNoNgsp, /** @type {?} */ ((text.sourceSpan)));
  103532. return expr ? new BoundTextAst(expr, ngContentIndex, /** @type {?} */ ((text.sourceSpan))) :
  103533. new TextAst(valueNoNgsp, ngContentIndex, /** @type {?} */ ((text.sourceSpan)));
  103534. };
  103535. /**
  103536. * @param {?} attribute
  103537. * @param {?} context
  103538. * @return {?}
  103539. */
  103540. TemplateParseVisitor.prototype.visitAttribute = /**
  103541. * @param {?} attribute
  103542. * @param {?} context
  103543. * @return {?}
  103544. */
  103545. function (attribute, context) {
  103546. return new AttrAst(attribute.name, attribute.value, attribute.sourceSpan);
  103547. };
  103548. /**
  103549. * @param {?} comment
  103550. * @param {?} context
  103551. * @return {?}
  103552. */
  103553. TemplateParseVisitor.prototype.visitComment = /**
  103554. * @param {?} comment
  103555. * @param {?} context
  103556. * @return {?}
  103557. */
  103558. function (comment, context) { return null; };
  103559. /**
  103560. * @param {?} element
  103561. * @param {?} parent
  103562. * @return {?}
  103563. */
  103564. TemplateParseVisitor.prototype.visitElement = /**
  103565. * @param {?} element
  103566. * @param {?} parent
  103567. * @return {?}
  103568. */
  103569. function (element, parent) {
  103570. var _this = this;
  103571. var /** @type {?} */ queryStartIndex = this.contentQueryStartId;
  103572. var /** @type {?} */ nodeName = element.name;
  103573. var /** @type {?} */ preparsedElement = preparseElement(element);
  103574. if (preparsedElement.type === PreparsedElementType.SCRIPT ||
  103575. preparsedElement.type === PreparsedElementType.STYLE) {
  103576. // Skipping <script> for security reasons
  103577. // Skipping <style> as we already processed them
  103578. // in the StyleCompiler
  103579. return null;
  103580. }
  103581. if (preparsedElement.type === PreparsedElementType.STYLESHEET &&
  103582. isStyleUrlResolvable(preparsedElement.hrefAttr)) {
  103583. // Skipping stylesheets with either relative urls or package scheme as we already processed
  103584. // them in the StyleCompiler
  103585. return null;
  103586. }
  103587. var /** @type {?} */ matchableAttrs = [];
  103588. var /** @type {?} */ elementOrDirectiveProps = [];
  103589. var /** @type {?} */ elementOrDirectiveRefs = [];
  103590. var /** @type {?} */ elementVars = [];
  103591. var /** @type {?} */ events = [];
  103592. var /** @type {?} */ templateElementOrDirectiveProps = [];
  103593. var /** @type {?} */ templateMatchableAttrs = [];
  103594. var /** @type {?} */ templateElementVars = [];
  103595. var /** @type {?} */ hasInlineTemplates = false;
  103596. var /** @type {?} */ attrs = [];
  103597. var /** @type {?} */ isTemplateElement = isTemplate(element, this.config.enableLegacyTemplate, function (m, span) { return _this._reportError(m, span, ParseErrorLevel.WARNING); });
  103598. element.attrs.forEach(function (attr) {
  103599. var /** @type {?} */ hasBinding = _this._parseAttr(isTemplateElement, attr, matchableAttrs, elementOrDirectiveProps, events, elementOrDirectiveRefs, elementVars);
  103600. var /** @type {?} */ templateBindingsSource;
  103601. var /** @type {?} */ prefixToken;
  103602. var /** @type {?} */ normalizedName = _this._normalizeAttributeName(attr.name);
  103603. if (_this.config.enableLegacyTemplate && normalizedName == TEMPLATE_ATTR) {
  103604. _this._reportError(TEMPLATE_ATTR_DEPRECATION_WARNING, attr.sourceSpan, ParseErrorLevel.WARNING);
  103605. templateBindingsSource = attr.value;
  103606. }
  103607. else if (normalizedName.startsWith(TEMPLATE_ATTR_PREFIX)) {
  103608. templateBindingsSource = attr.value;
  103609. prefixToken = normalizedName.substring(TEMPLATE_ATTR_PREFIX.length) + ':';
  103610. }
  103611. var /** @type {?} */ hasTemplateBinding = templateBindingsSource != null;
  103612. if (hasTemplateBinding) {
  103613. if (hasInlineTemplates) {
  103614. _this._reportError("Can't have multiple template bindings on one element. Use only one attribute named 'template' or prefixed with *", attr.sourceSpan);
  103615. }
  103616. hasInlineTemplates = true;
  103617. _this._bindingParser.parseInlineTemplateBinding(/** @type {?} */ ((prefixToken)), /** @type {?} */ ((templateBindingsSource)), attr.sourceSpan, templateMatchableAttrs, templateElementOrDirectiveProps, templateElementVars);
  103618. }
  103619. if (!hasBinding && !hasTemplateBinding) {
  103620. // don't include the bindings as attributes as well in the AST
  103621. attrs.push(_this.visitAttribute(attr, null));
  103622. matchableAttrs.push([attr.name, attr.value]);
  103623. }
  103624. });
  103625. var /** @type {?} */ elementCssSelector = createElementCssSelector(nodeName, matchableAttrs);
  103626. var _a = this._parseDirectives(this.selectorMatcher, elementCssSelector), directiveMetas = _a.directives, matchElement = _a.matchElement;
  103627. var /** @type {?} */ references = [];
  103628. var /** @type {?} */ boundDirectivePropNames = new Set();
  103629. var /** @type {?} */ directiveAsts = this._createDirectiveAsts(isTemplateElement, element.name, directiveMetas, elementOrDirectiveProps, elementOrDirectiveRefs, /** @type {?} */ ((element.sourceSpan)), references, boundDirectivePropNames);
  103630. var /** @type {?} */ elementProps = this._createElementPropertyAsts(element.name, elementOrDirectiveProps, boundDirectivePropNames);
  103631. var /** @type {?} */ isViewRoot = parent.isTemplateElement || hasInlineTemplates;
  103632. var /** @type {?} */ providerContext = new ProviderElementContext(this.providerViewContext, /** @type {?} */ ((parent.providerContext)), isViewRoot, directiveAsts, attrs, references, isTemplateElement, queryStartIndex, /** @type {?} */ ((element.sourceSpan)));
  103633. var /** @type {?} */ children = visitAll(preparsedElement.nonBindable ? NON_BINDABLE_VISITOR : this, element.children, ElementContext.create(isTemplateElement, directiveAsts, isTemplateElement ? /** @type {?} */ ((parent.providerContext)) : providerContext));
  103634. providerContext.afterElement();
  103635. // Override the actual selector when the `ngProjectAs` attribute is provided
  103636. var /** @type {?} */ projectionSelector = preparsedElement.projectAs != null ?
  103637. CssSelector.parse(preparsedElement.projectAs)[0] :
  103638. elementCssSelector;
  103639. var /** @type {?} */ ngContentIndex = /** @type {?} */ ((parent.findNgContentIndex(projectionSelector)));
  103640. var /** @type {?} */ parsedElement;
  103641. if (preparsedElement.type === PreparsedElementType.NG_CONTENT) {
  103642. if (element.children && !element.children.every(_isEmptyTextNode)) {
  103643. this._reportError("<ng-content> element cannot have content.", /** @type {?} */ ((element.sourceSpan)));
  103644. }
  103645. parsedElement = new NgContentAst(this.ngContentCount++, hasInlineTemplates ? /** @type {?} */ ((null)) : ngContentIndex, /** @type {?} */ ((element.sourceSpan)));
  103646. }
  103647. else if (isTemplateElement) {
  103648. this._assertAllEventsPublishedByDirectives(directiveAsts, events);
  103649. this._assertNoComponentsNorElementBindingsOnTemplate(directiveAsts, elementProps, /** @type {?} */ ((element.sourceSpan)));
  103650. parsedElement = new EmbeddedTemplateAst(attrs, events, references, elementVars, providerContext.transformedDirectiveAsts, providerContext.transformProviders, providerContext.transformedHasViewContainer, providerContext.queryMatches, children, hasInlineTemplates ? /** @type {?} */ ((null)) : ngContentIndex, /** @type {?} */ ((element.sourceSpan)));
  103651. }
  103652. else {
  103653. this._assertElementExists(matchElement, element);
  103654. this._assertOnlyOneComponent(directiveAsts, /** @type {?} */ ((element.sourceSpan)));
  103655. var /** @type {?} */ ngContentIndex_1 = hasInlineTemplates ? null : parent.findNgContentIndex(projectionSelector);
  103656. parsedElement = new ElementAst(nodeName, attrs, elementProps, events, references, providerContext.transformedDirectiveAsts, providerContext.transformProviders, providerContext.transformedHasViewContainer, providerContext.queryMatches, children, hasInlineTemplates ? null : ngContentIndex_1, element.sourceSpan, element.endSourceSpan || null);
  103657. }
  103658. if (hasInlineTemplates) {
  103659. var /** @type {?} */ templateQueryStartIndex = this.contentQueryStartId;
  103660. var /** @type {?} */ templateSelector = createElementCssSelector(TEMPLATE_ELEMENT, templateMatchableAttrs);
  103661. var templateDirectiveMetas = this._parseDirectives(this.selectorMatcher, templateSelector).directives;
  103662. var /** @type {?} */ templateBoundDirectivePropNames = new Set();
  103663. var /** @type {?} */ templateDirectiveAsts = this._createDirectiveAsts(true, element.name, templateDirectiveMetas, templateElementOrDirectiveProps, [], /** @type {?} */ ((element.sourceSpan)), [], templateBoundDirectivePropNames);
  103664. var /** @type {?} */ templateElementProps = this._createElementPropertyAsts(element.name, templateElementOrDirectiveProps, templateBoundDirectivePropNames);
  103665. this._assertNoComponentsNorElementBindingsOnTemplate(templateDirectiveAsts, templateElementProps, /** @type {?} */ ((element.sourceSpan)));
  103666. var /** @type {?} */ templateProviderContext = new ProviderElementContext(this.providerViewContext, /** @type {?} */ ((parent.providerContext)), parent.isTemplateElement, templateDirectiveAsts, [], [], true, templateQueryStartIndex, /** @type {?} */ ((element.sourceSpan)));
  103667. templateProviderContext.afterElement();
  103668. parsedElement = new EmbeddedTemplateAst([], [], [], templateElementVars, templateProviderContext.transformedDirectiveAsts, templateProviderContext.transformProviders, templateProviderContext.transformedHasViewContainer, templateProviderContext.queryMatches, [parsedElement], ngContentIndex, /** @type {?} */ ((element.sourceSpan)));
  103669. }
  103670. return parsedElement;
  103671. };
  103672. /**
  103673. * @param {?} isTemplateElement
  103674. * @param {?} attr
  103675. * @param {?} targetMatchableAttrs
  103676. * @param {?} targetProps
  103677. * @param {?} targetEvents
  103678. * @param {?} targetRefs
  103679. * @param {?} targetVars
  103680. * @return {?}
  103681. */
  103682. TemplateParseVisitor.prototype._parseAttr = /**
  103683. * @param {?} isTemplateElement
  103684. * @param {?} attr
  103685. * @param {?} targetMatchableAttrs
  103686. * @param {?} targetProps
  103687. * @param {?} targetEvents
  103688. * @param {?} targetRefs
  103689. * @param {?} targetVars
  103690. * @return {?}
  103691. */
  103692. function (isTemplateElement, attr, targetMatchableAttrs, targetProps, targetEvents, targetRefs, targetVars) {
  103693. var /** @type {?} */ name = this._normalizeAttributeName(attr.name);
  103694. var /** @type {?} */ value = attr.value;
  103695. var /** @type {?} */ srcSpan = attr.sourceSpan;
  103696. var /** @type {?} */ bindParts = name.match(BIND_NAME_REGEXP);
  103697. var /** @type {?} */ hasBinding = false;
  103698. if (bindParts !== null) {
  103699. hasBinding = true;
  103700. if (bindParts[KW_BIND_IDX] != null) {
  103701. this._bindingParser.parsePropertyBinding(bindParts[IDENT_KW_IDX], value, false, srcSpan, targetMatchableAttrs, targetProps);
  103702. }
  103703. else if (bindParts[KW_LET_IDX]) {
  103704. if (isTemplateElement) {
  103705. var /** @type {?} */ identifier = bindParts[IDENT_KW_IDX];
  103706. this._parseVariable(identifier, value, srcSpan, targetVars);
  103707. }
  103708. else {
  103709. this._reportError("\"let-\" is only supported on ng-template elements.", srcSpan);
  103710. }
  103711. }
  103712. else if (bindParts[KW_REF_IDX]) {
  103713. var /** @type {?} */ identifier = bindParts[IDENT_KW_IDX];
  103714. this._parseReference(identifier, value, srcSpan, targetRefs);
  103715. }
  103716. else if (bindParts[KW_ON_IDX]) {
  103717. this._bindingParser.parseEvent(bindParts[IDENT_KW_IDX], value, srcSpan, targetMatchableAttrs, targetEvents);
  103718. }
  103719. else if (bindParts[KW_BINDON_IDX]) {
  103720. this._bindingParser.parsePropertyBinding(bindParts[IDENT_KW_IDX], value, false, srcSpan, targetMatchableAttrs, targetProps);
  103721. this._parseAssignmentEvent(bindParts[IDENT_KW_IDX], value, srcSpan, targetMatchableAttrs, targetEvents);
  103722. }
  103723. else if (bindParts[KW_AT_IDX]) {
  103724. this._bindingParser.parseLiteralAttr(name, value, srcSpan, targetMatchableAttrs, targetProps);
  103725. }
  103726. else if (bindParts[IDENT_BANANA_BOX_IDX]) {
  103727. this._bindingParser.parsePropertyBinding(bindParts[IDENT_BANANA_BOX_IDX], value, false, srcSpan, targetMatchableAttrs, targetProps);
  103728. this._parseAssignmentEvent(bindParts[IDENT_BANANA_BOX_IDX], value, srcSpan, targetMatchableAttrs, targetEvents);
  103729. }
  103730. else if (bindParts[IDENT_PROPERTY_IDX]) {
  103731. this._bindingParser.parsePropertyBinding(bindParts[IDENT_PROPERTY_IDX], value, false, srcSpan, targetMatchableAttrs, targetProps);
  103732. }
  103733. else if (bindParts[IDENT_EVENT_IDX]) {
  103734. this._bindingParser.parseEvent(bindParts[IDENT_EVENT_IDX], value, srcSpan, targetMatchableAttrs, targetEvents);
  103735. }
  103736. }
  103737. else {
  103738. hasBinding = this._bindingParser.parsePropertyInterpolation(name, value, srcSpan, targetMatchableAttrs, targetProps);
  103739. }
  103740. if (!hasBinding) {
  103741. this._bindingParser.parseLiteralAttr(name, value, srcSpan, targetMatchableAttrs, targetProps);
  103742. }
  103743. return hasBinding;
  103744. };
  103745. /**
  103746. * @param {?} attrName
  103747. * @return {?}
  103748. */
  103749. TemplateParseVisitor.prototype._normalizeAttributeName = /**
  103750. * @param {?} attrName
  103751. * @return {?}
  103752. */
  103753. function (attrName) {
  103754. return /^data-/i.test(attrName) ? attrName.substring(5) : attrName;
  103755. };
  103756. /**
  103757. * @param {?} identifier
  103758. * @param {?} value
  103759. * @param {?} sourceSpan
  103760. * @param {?} targetVars
  103761. * @return {?}
  103762. */
  103763. TemplateParseVisitor.prototype._parseVariable = /**
  103764. * @param {?} identifier
  103765. * @param {?} value
  103766. * @param {?} sourceSpan
  103767. * @param {?} targetVars
  103768. * @return {?}
  103769. */
  103770. function (identifier, value, sourceSpan, targetVars) {
  103771. if (identifier.indexOf('-') > -1) {
  103772. this._reportError("\"-\" is not allowed in variable names", sourceSpan);
  103773. }
  103774. targetVars.push(new VariableAst(identifier, value, sourceSpan));
  103775. };
  103776. /**
  103777. * @param {?} identifier
  103778. * @param {?} value
  103779. * @param {?} sourceSpan
  103780. * @param {?} targetRefs
  103781. * @return {?}
  103782. */
  103783. TemplateParseVisitor.prototype._parseReference = /**
  103784. * @param {?} identifier
  103785. * @param {?} value
  103786. * @param {?} sourceSpan
  103787. * @param {?} targetRefs
  103788. * @return {?}
  103789. */
  103790. function (identifier, value, sourceSpan, targetRefs) {
  103791. if (identifier.indexOf('-') > -1) {
  103792. this._reportError("\"-\" is not allowed in reference names", sourceSpan);
  103793. }
  103794. targetRefs.push(new ElementOrDirectiveRef(identifier, value, sourceSpan));
  103795. };
  103796. /**
  103797. * @param {?} name
  103798. * @param {?} expression
  103799. * @param {?} sourceSpan
  103800. * @param {?} targetMatchableAttrs
  103801. * @param {?} targetEvents
  103802. * @return {?}
  103803. */
  103804. TemplateParseVisitor.prototype._parseAssignmentEvent = /**
  103805. * @param {?} name
  103806. * @param {?} expression
  103807. * @param {?} sourceSpan
  103808. * @param {?} targetMatchableAttrs
  103809. * @param {?} targetEvents
  103810. * @return {?}
  103811. */
  103812. function (name, expression, sourceSpan, targetMatchableAttrs, targetEvents) {
  103813. this._bindingParser.parseEvent(name + "Change", expression + "=$event", sourceSpan, targetMatchableAttrs, targetEvents);
  103814. };
  103815. /**
  103816. * @param {?} selectorMatcher
  103817. * @param {?} elementCssSelector
  103818. * @return {?}
  103819. */
  103820. TemplateParseVisitor.prototype._parseDirectives = /**
  103821. * @param {?} selectorMatcher
  103822. * @param {?} elementCssSelector
  103823. * @return {?}
  103824. */
  103825. function (selectorMatcher, elementCssSelector) {
  103826. var _this = this;
  103827. // Need to sort the directives so that we get consistent results throughout,
  103828. // as selectorMatcher uses Maps inside.
  103829. // Also deduplicate directives as they might match more than one time!
  103830. var /** @type {?} */ directives = new Array(this.directivesIndex.size);
  103831. // Whether any directive selector matches on the element name
  103832. var /** @type {?} */ matchElement = false;
  103833. selectorMatcher.match(elementCssSelector, function (selector, directive) {
  103834. directives[/** @type {?} */ ((_this.directivesIndex.get(directive)))] = directive;
  103835. matchElement = matchElement || selector.hasElementSelector();
  103836. });
  103837. return {
  103838. directives: directives.filter(function (dir) { return !!dir; }),
  103839. matchElement: matchElement,
  103840. };
  103841. };
  103842. /**
  103843. * @param {?} isTemplateElement
  103844. * @param {?} elementName
  103845. * @param {?} directives
  103846. * @param {?} props
  103847. * @param {?} elementOrDirectiveRefs
  103848. * @param {?} elementSourceSpan
  103849. * @param {?} targetReferences
  103850. * @param {?} targetBoundDirectivePropNames
  103851. * @return {?}
  103852. */
  103853. TemplateParseVisitor.prototype._createDirectiveAsts = /**
  103854. * @param {?} isTemplateElement
  103855. * @param {?} elementName
  103856. * @param {?} directives
  103857. * @param {?} props
  103858. * @param {?} elementOrDirectiveRefs
  103859. * @param {?} elementSourceSpan
  103860. * @param {?} targetReferences
  103861. * @param {?} targetBoundDirectivePropNames
  103862. * @return {?}
  103863. */
  103864. function (isTemplateElement, elementName, directives, props, elementOrDirectiveRefs, elementSourceSpan, targetReferences, targetBoundDirectivePropNames) {
  103865. var _this = this;
  103866. var /** @type {?} */ matchedReferences = new Set();
  103867. var /** @type {?} */ component = /** @type {?} */ ((null));
  103868. var /** @type {?} */ directiveAsts = directives.map(function (directive) {
  103869. var /** @type {?} */ sourceSpan = new ParseSourceSpan(elementSourceSpan.start, elementSourceSpan.end, "Directive " + identifierName(directive.type));
  103870. if (directive.isComponent) {
  103871. component = directive;
  103872. }
  103873. var /** @type {?} */ directiveProperties = [];
  103874. var /** @type {?} */ hostProperties = /** @type {?} */ ((_this._bindingParser.createDirectiveHostPropertyAsts(directive, elementName, sourceSpan)));
  103875. // Note: We need to check the host properties here as well,
  103876. // as we don't know the element name in the DirectiveWrapperCompiler yet.
  103877. hostProperties = _this._checkPropertiesInSchema(elementName, hostProperties);
  103878. var /** @type {?} */ hostEvents = /** @type {?} */ ((_this._bindingParser.createDirectiveHostEventAsts(directive, sourceSpan)));
  103879. _this._createDirectivePropertyAsts(directive.inputs, props, directiveProperties, targetBoundDirectivePropNames);
  103880. elementOrDirectiveRefs.forEach(function (elOrDirRef) {
  103881. if ((elOrDirRef.value.length === 0 && directive.isComponent) ||
  103882. (elOrDirRef.isReferenceToDirective(directive))) {
  103883. targetReferences.push(new ReferenceAst(elOrDirRef.name, createTokenForReference(directive.type.reference), elOrDirRef.sourceSpan));
  103884. matchedReferences.add(elOrDirRef.name);
  103885. }
  103886. });
  103887. var /** @type {?} */ contentQueryStartId = _this.contentQueryStartId;
  103888. _this.contentQueryStartId += directive.queries.length;
  103889. return new DirectiveAst(directive, directiveProperties, hostProperties, hostEvents, contentQueryStartId, sourceSpan);
  103890. });
  103891. elementOrDirectiveRefs.forEach(function (elOrDirRef) {
  103892. if (elOrDirRef.value.length > 0) {
  103893. if (!matchedReferences.has(elOrDirRef.name)) {
  103894. _this._reportError("There is no directive with \"exportAs\" set to \"" + elOrDirRef.value + "\"", elOrDirRef.sourceSpan);
  103895. }
  103896. }
  103897. else if (!component) {
  103898. var /** @type {?} */ refToken = /** @type {?} */ ((null));
  103899. if (isTemplateElement) {
  103900. refToken = createTokenForExternalReference(_this.reflector, Identifiers.TemplateRef);
  103901. }
  103902. targetReferences.push(new ReferenceAst(elOrDirRef.name, refToken, elOrDirRef.sourceSpan));
  103903. }
  103904. });
  103905. return directiveAsts;
  103906. };
  103907. /**
  103908. * @param {?} directiveProperties
  103909. * @param {?} boundProps
  103910. * @param {?} targetBoundDirectiveProps
  103911. * @param {?} targetBoundDirectivePropNames
  103912. * @return {?}
  103913. */
  103914. TemplateParseVisitor.prototype._createDirectivePropertyAsts = /**
  103915. * @param {?} directiveProperties
  103916. * @param {?} boundProps
  103917. * @param {?} targetBoundDirectiveProps
  103918. * @param {?} targetBoundDirectivePropNames
  103919. * @return {?}
  103920. */
  103921. function (directiveProperties, boundProps, targetBoundDirectiveProps, targetBoundDirectivePropNames) {
  103922. if (directiveProperties) {
  103923. var /** @type {?} */ boundPropsByName_1 = new Map();
  103924. boundProps.forEach(function (boundProp) {
  103925. var /** @type {?} */ prevValue = boundPropsByName_1.get(boundProp.name);
  103926. if (!prevValue || prevValue.isLiteral) {
  103927. // give [a]="b" a higher precedence than a="b" on the same element
  103928. // give [a]="b" a higher precedence than a="b" on the same element
  103929. boundPropsByName_1.set(boundProp.name, boundProp);
  103930. }
  103931. });
  103932. Object.keys(directiveProperties).forEach(function (dirProp) {
  103933. var /** @type {?} */ elProp = directiveProperties[dirProp];
  103934. var /** @type {?} */ boundProp = boundPropsByName_1.get(elProp);
  103935. // Bindings are optional, so this binding only needs to be set up if an expression is given.
  103936. if (boundProp) {
  103937. targetBoundDirectivePropNames.add(boundProp.name);
  103938. if (!isEmptyExpression(boundProp.expression)) {
  103939. targetBoundDirectiveProps.push(new BoundDirectivePropertyAst(dirProp, boundProp.name, boundProp.expression, boundProp.sourceSpan));
  103940. }
  103941. }
  103942. });
  103943. }
  103944. };
  103945. /**
  103946. * @param {?} elementName
  103947. * @param {?} props
  103948. * @param {?} boundDirectivePropNames
  103949. * @return {?}
  103950. */
  103951. TemplateParseVisitor.prototype._createElementPropertyAsts = /**
  103952. * @param {?} elementName
  103953. * @param {?} props
  103954. * @param {?} boundDirectivePropNames
  103955. * @return {?}
  103956. */
  103957. function (elementName, props, boundDirectivePropNames) {
  103958. var _this = this;
  103959. var /** @type {?} */ boundElementProps = [];
  103960. props.forEach(function (prop) {
  103961. if (!prop.isLiteral && !boundDirectivePropNames.has(prop.name)) {
  103962. boundElementProps.push(_this._bindingParser.createElementPropertyAst(elementName, prop));
  103963. }
  103964. });
  103965. return this._checkPropertiesInSchema(elementName, boundElementProps);
  103966. };
  103967. /**
  103968. * @param {?} directives
  103969. * @return {?}
  103970. */
  103971. TemplateParseVisitor.prototype._findComponentDirectives = /**
  103972. * @param {?} directives
  103973. * @return {?}
  103974. */
  103975. function (directives) {
  103976. return directives.filter(function (directive) { return directive.directive.isComponent; });
  103977. };
  103978. /**
  103979. * @param {?} directives
  103980. * @return {?}
  103981. */
  103982. TemplateParseVisitor.prototype._findComponentDirectiveNames = /**
  103983. * @param {?} directives
  103984. * @return {?}
  103985. */
  103986. function (directives) {
  103987. return this._findComponentDirectives(directives)
  103988. .map(function (directive) { return ((identifierName(directive.directive.type))); });
  103989. };
  103990. /**
  103991. * @param {?} directives
  103992. * @param {?} sourceSpan
  103993. * @return {?}
  103994. */
  103995. TemplateParseVisitor.prototype._assertOnlyOneComponent = /**
  103996. * @param {?} directives
  103997. * @param {?} sourceSpan
  103998. * @return {?}
  103999. */
  104000. function (directives, sourceSpan) {
  104001. var /** @type {?} */ componentTypeNames = this._findComponentDirectiveNames(directives);
  104002. if (componentTypeNames.length > 1) {
  104003. this._reportError("More than one component matched on this element.\n" +
  104004. "Make sure that only one component's selector can match a given element.\n" +
  104005. ("Conflicting components: " + componentTypeNames.join(',')), sourceSpan);
  104006. }
  104007. };
  104008. /**
  104009. * Make sure that non-angular tags conform to the schemas.
  104010. *
  104011. * Note: An element is considered an angular tag when at least one directive selector matches the
  104012. * tag name.
  104013. *
  104014. * @param {?} matchElement Whether any directive has matched on the tag name
  104015. * @param {?} element the html element
  104016. * @return {?}
  104017. */
  104018. TemplateParseVisitor.prototype._assertElementExists = /**
  104019. * Make sure that non-angular tags conform to the schemas.
  104020. *
  104021. * Note: An element is considered an angular tag when at least one directive selector matches the
  104022. * tag name.
  104023. *
  104024. * @param {?} matchElement Whether any directive has matched on the tag name
  104025. * @param {?} element the html element
  104026. * @return {?}
  104027. */
  104028. function (matchElement, element) {
  104029. var /** @type {?} */ elName = element.name.replace(/^:xhtml:/, '');
  104030. if (!matchElement && !this._schemaRegistry.hasElement(elName, this._schemas)) {
  104031. var /** @type {?} */ errorMsg = "'" + elName + "' is not a known element:\n";
  104032. errorMsg +=
  104033. "1. If '" + elName + "' is an Angular component, then verify that it is part of this module.\n";
  104034. if (elName.indexOf('-') > -1) {
  104035. errorMsg +=
  104036. "2. If '" + elName + "' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.";
  104037. }
  104038. else {
  104039. errorMsg +=
  104040. "2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.";
  104041. }
  104042. this._reportError(errorMsg, /** @type {?} */ ((element.sourceSpan)));
  104043. }
  104044. };
  104045. /**
  104046. * @param {?} directives
  104047. * @param {?} elementProps
  104048. * @param {?} sourceSpan
  104049. * @return {?}
  104050. */
  104051. TemplateParseVisitor.prototype._assertNoComponentsNorElementBindingsOnTemplate = /**
  104052. * @param {?} directives
  104053. * @param {?} elementProps
  104054. * @param {?} sourceSpan
  104055. * @return {?}
  104056. */
  104057. function (directives, elementProps, sourceSpan) {
  104058. var _this = this;
  104059. var /** @type {?} */ componentTypeNames = this._findComponentDirectiveNames(directives);
  104060. if (componentTypeNames.length > 0) {
  104061. this._reportError("Components on an embedded template: " + componentTypeNames.join(','), sourceSpan);
  104062. }
  104063. elementProps.forEach(function (prop) {
  104064. _this._reportError("Property binding " + prop.name + " not used by any directive on an embedded template. Make sure that the property name is spelled correctly and all directives are listed in the \"@NgModule.declarations\".", sourceSpan);
  104065. });
  104066. };
  104067. /**
  104068. * @param {?} directives
  104069. * @param {?} events
  104070. * @return {?}
  104071. */
  104072. TemplateParseVisitor.prototype._assertAllEventsPublishedByDirectives = /**
  104073. * @param {?} directives
  104074. * @param {?} events
  104075. * @return {?}
  104076. */
  104077. function (directives, events) {
  104078. var _this = this;
  104079. var /** @type {?} */ allDirectiveEvents = new Set();
  104080. directives.forEach(function (directive) {
  104081. Object.keys(directive.directive.outputs).forEach(function (k) {
  104082. var /** @type {?} */ eventName = directive.directive.outputs[k];
  104083. allDirectiveEvents.add(eventName);
  104084. });
  104085. });
  104086. events.forEach(function (event) {
  104087. if (event.target != null || !allDirectiveEvents.has(event.name)) {
  104088. _this._reportError("Event binding " + event.fullName + " not emitted by any directive on an embedded template. Make sure that the event name is spelled correctly and all directives are listed in the \"@NgModule.declarations\".", event.sourceSpan);
  104089. }
  104090. });
  104091. };
  104092. /**
  104093. * @param {?} elementName
  104094. * @param {?} boundProps
  104095. * @return {?}
  104096. */
  104097. TemplateParseVisitor.prototype._checkPropertiesInSchema = /**
  104098. * @param {?} elementName
  104099. * @param {?} boundProps
  104100. * @return {?}
  104101. */
  104102. function (elementName, boundProps) {
  104103. var _this = this;
  104104. // Note: We can't filter out empty expressions before this method,
  104105. // as we still want to validate them!
  104106. return boundProps.filter(function (boundProp) {
  104107. if (boundProp.type === PropertyBindingType.Property &&
  104108. !_this._schemaRegistry.hasProperty(elementName, boundProp.name, _this._schemas)) {
  104109. var /** @type {?} */ errorMsg = "Can't bind to '" + boundProp.name + "' since it isn't a known property of '" + elementName + "'.";
  104110. if (elementName.startsWith('ng-')) {
  104111. errorMsg +=
  104112. "\n1. If '" + boundProp.name + "' is an Angular directive, then add 'CommonModule' to the '@NgModule.imports' of this component." +
  104113. "\n2. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.";
  104114. }
  104115. else if (elementName.indexOf('-') > -1) {
  104116. errorMsg +=
  104117. "\n1. If '" + elementName + "' is an Angular component and it has '" + boundProp.name + "' input, then verify that it is part of this module." +
  104118. ("\n2. If '" + elementName + "' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.") +
  104119. "\n3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.";
  104120. }
  104121. _this._reportError(errorMsg, boundProp.sourceSpan);
  104122. }
  104123. return !isEmptyExpression(boundProp.value);
  104124. });
  104125. };
  104126. /**
  104127. * @param {?} message
  104128. * @param {?} sourceSpan
  104129. * @param {?=} level
  104130. * @return {?}
  104131. */
  104132. TemplateParseVisitor.prototype._reportError = /**
  104133. * @param {?} message
  104134. * @param {?} sourceSpan
  104135. * @param {?=} level
  104136. * @return {?}
  104137. */
  104138. function (message, sourceSpan, level) {
  104139. if (level === void 0) { level = ParseErrorLevel.ERROR; }
  104140. this._targetErrors.push(new ParseError(sourceSpan, message, level));
  104141. };
  104142. return TemplateParseVisitor;
  104143. }());
  104144. var NonBindableVisitor = /** @class */ (function () {
  104145. function NonBindableVisitor() {
  104146. }
  104147. /**
  104148. * @param {?} ast
  104149. * @param {?} parent
  104150. * @return {?}
  104151. */
  104152. NonBindableVisitor.prototype.visitElement = /**
  104153. * @param {?} ast
  104154. * @param {?} parent
  104155. * @return {?}
  104156. */
  104157. function (ast, parent) {
  104158. var /** @type {?} */ preparsedElement = preparseElement(ast);
  104159. if (preparsedElement.type === PreparsedElementType.SCRIPT ||
  104160. preparsedElement.type === PreparsedElementType.STYLE ||
  104161. preparsedElement.type === PreparsedElementType.STYLESHEET) {
  104162. // Skipping <script> for security reasons
  104163. // Skipping <style> and stylesheets as we already processed them
  104164. // in the StyleCompiler
  104165. return null;
  104166. }
  104167. var /** @type {?} */ attrNameAndValues = ast.attrs.map(function (attr) { return [attr.name, attr.value]; });
  104168. var /** @type {?} */ selector = createElementCssSelector(ast.name, attrNameAndValues);
  104169. var /** @type {?} */ ngContentIndex = parent.findNgContentIndex(selector);
  104170. var /** @type {?} */ children = visitAll(this, ast.children, EMPTY_ELEMENT_CONTEXT);
  104171. return new ElementAst(ast.name, visitAll(this, ast.attrs), [], [], [], [], [], false, [], children, ngContentIndex, ast.sourceSpan, ast.endSourceSpan);
  104172. };
  104173. /**
  104174. * @param {?} comment
  104175. * @param {?} context
  104176. * @return {?}
  104177. */
  104178. NonBindableVisitor.prototype.visitComment = /**
  104179. * @param {?} comment
  104180. * @param {?} context
  104181. * @return {?}
  104182. */
  104183. function (comment, context) { return null; };
  104184. /**
  104185. * @param {?} attribute
  104186. * @param {?} context
  104187. * @return {?}
  104188. */
  104189. NonBindableVisitor.prototype.visitAttribute = /**
  104190. * @param {?} attribute
  104191. * @param {?} context
  104192. * @return {?}
  104193. */
  104194. function (attribute, context) {
  104195. return new AttrAst(attribute.name, attribute.value, attribute.sourceSpan);
  104196. };
  104197. /**
  104198. * @param {?} text
  104199. * @param {?} parent
  104200. * @return {?}
  104201. */
  104202. NonBindableVisitor.prototype.visitText = /**
  104203. * @param {?} text
  104204. * @param {?} parent
  104205. * @return {?}
  104206. */
  104207. function (text, parent) {
  104208. var /** @type {?} */ ngContentIndex = /** @type {?} */ ((parent.findNgContentIndex(TEXT_CSS_SELECTOR)));
  104209. return new TextAst(text.value, ngContentIndex, /** @type {?} */ ((text.sourceSpan)));
  104210. };
  104211. /**
  104212. * @param {?} expansion
  104213. * @param {?} context
  104214. * @return {?}
  104215. */
  104216. NonBindableVisitor.prototype.visitExpansion = /**
  104217. * @param {?} expansion
  104218. * @param {?} context
  104219. * @return {?}
  104220. */
  104221. function (expansion, context) { return expansion; };
  104222. /**
  104223. * @param {?} expansionCase
  104224. * @param {?} context
  104225. * @return {?}
  104226. */
  104227. NonBindableVisitor.prototype.visitExpansionCase = /**
  104228. * @param {?} expansionCase
  104229. * @param {?} context
  104230. * @return {?}
  104231. */
  104232. function (expansionCase, context) { return expansionCase; };
  104233. return NonBindableVisitor;
  104234. }());
  104235. /**
  104236. * A reference to an element or directive in a template. E.g., the reference in this template:
  104237. *
  104238. * <div #myMenu="coolMenu">
  104239. *
  104240. * would be {name: 'myMenu', value: 'coolMenu', sourceSpan: ...}
  104241. */
  104242. var ElementOrDirectiveRef = /** @class */ (function () {
  104243. function ElementOrDirectiveRef(name, value, sourceSpan) {
  104244. this.name = name;
  104245. this.value = value;
  104246. this.sourceSpan = sourceSpan;
  104247. }
  104248. /** Gets whether this is a reference to the given directive. */
  104249. /**
  104250. * Gets whether this is a reference to the given directive.
  104251. * @param {?} directive
  104252. * @return {?}
  104253. */
  104254. ElementOrDirectiveRef.prototype.isReferenceToDirective = /**
  104255. * Gets whether this is a reference to the given directive.
  104256. * @param {?} directive
  104257. * @return {?}
  104258. */
  104259. function (directive) {
  104260. return splitExportAs(directive.exportAs).indexOf(this.value) !== -1;
  104261. };
  104262. return ElementOrDirectiveRef;
  104263. }());
  104264. /**
  104265. * Splits a raw, potentially comma-delimted `exportAs` value into an array of names.
  104266. * @param {?} exportAs
  104267. * @return {?}
  104268. */
  104269. function splitExportAs(exportAs) {
  104270. return exportAs ? exportAs.split(',').map(function (e) { return e.trim(); }) : [];
  104271. }
  104272. /**
  104273. * @param {?} classAttrValue
  104274. * @return {?}
  104275. */
  104276. function splitClasses(classAttrValue) {
  104277. return classAttrValue.trim().split(/\s+/g);
  104278. }
  104279. var ElementContext = /** @class */ (function () {
  104280. function ElementContext(isTemplateElement, _ngContentIndexMatcher, _wildcardNgContentIndex, providerContext) {
  104281. this.isTemplateElement = isTemplateElement;
  104282. this._ngContentIndexMatcher = _ngContentIndexMatcher;
  104283. this._wildcardNgContentIndex = _wildcardNgContentIndex;
  104284. this.providerContext = providerContext;
  104285. }
  104286. /**
  104287. * @param {?} isTemplateElement
  104288. * @param {?} directives
  104289. * @param {?} providerContext
  104290. * @return {?}
  104291. */
  104292. ElementContext.create = /**
  104293. * @param {?} isTemplateElement
  104294. * @param {?} directives
  104295. * @param {?} providerContext
  104296. * @return {?}
  104297. */
  104298. function (isTemplateElement, directives, providerContext) {
  104299. var /** @type {?} */ matcher = new SelectorMatcher();
  104300. var /** @type {?} */ wildcardNgContentIndex = /** @type {?} */ ((null));
  104301. var /** @type {?} */ component = directives.find(function (directive) { return directive.directive.isComponent; });
  104302. if (component) {
  104303. var /** @type {?} */ ngContentSelectors = /** @type {?} */ ((component.directive.template)).ngContentSelectors;
  104304. for (var /** @type {?} */ i = 0; i < ngContentSelectors.length; i++) {
  104305. var /** @type {?} */ selector = ngContentSelectors[i];
  104306. if (selector === '*') {
  104307. wildcardNgContentIndex = i;
  104308. }
  104309. else {
  104310. matcher.addSelectables(CssSelector.parse(ngContentSelectors[i]), i);
  104311. }
  104312. }
  104313. }
  104314. return new ElementContext(isTemplateElement, matcher, wildcardNgContentIndex, providerContext);
  104315. };
  104316. /**
  104317. * @param {?} selector
  104318. * @return {?}
  104319. */
  104320. ElementContext.prototype.findNgContentIndex = /**
  104321. * @param {?} selector
  104322. * @return {?}
  104323. */
  104324. function (selector) {
  104325. var /** @type {?} */ ngContentIndices = [];
  104326. this._ngContentIndexMatcher.match(selector, function (selector, ngContentIndex) { ngContentIndices.push(ngContentIndex); });
  104327. ngContentIndices.sort();
  104328. if (this._wildcardNgContentIndex != null) {
  104329. ngContentIndices.push(this._wildcardNgContentIndex);
  104330. }
  104331. return ngContentIndices.length > 0 ? ngContentIndices[0] : null;
  104332. };
  104333. return ElementContext;
  104334. }());
  104335. /**
  104336. * @param {?} elementName
  104337. * @param {?} attributes
  104338. * @return {?}
  104339. */
  104340. function createElementCssSelector(elementName, attributes) {
  104341. var /** @type {?} */ cssSelector = new CssSelector();
  104342. var /** @type {?} */ elNameNoNs = splitNsName(elementName)[1];
  104343. cssSelector.setElement(elNameNoNs);
  104344. for (var /** @type {?} */ i = 0; i < attributes.length; i++) {
  104345. var /** @type {?} */ attrName = attributes[i][0];
  104346. var /** @type {?} */ attrNameNoNs = splitNsName(attrName)[1];
  104347. var /** @type {?} */ attrValue = attributes[i][1];
  104348. cssSelector.addAttribute(attrNameNoNs, attrValue);
  104349. if (attrName.toLowerCase() == CLASS_ATTR) {
  104350. var /** @type {?} */ classes = splitClasses(attrValue);
  104351. classes.forEach(function (className) { return cssSelector.addClassName(className); });
  104352. }
  104353. }
  104354. return cssSelector;
  104355. }
  104356. var EMPTY_ELEMENT_CONTEXT = new ElementContext(true, new SelectorMatcher(), null, null);
  104357. var NON_BINDABLE_VISITOR = new NonBindableVisitor();
  104358. /**
  104359. * @param {?} node
  104360. * @return {?}
  104361. */
  104362. function _isEmptyTextNode(node) {
  104363. return node instanceof Text && node.value.trim().length == 0;
  104364. }
  104365. /**
  104366. * @template T
  104367. * @param {?} items
  104368. * @return {?}
  104369. */
  104370. function removeSummaryDuplicates(items) {
  104371. var /** @type {?} */ map = new Map();
  104372. items.forEach(function (item) {
  104373. if (!map.get(item.type.reference)) {
  104374. map.set(item.type.reference, item);
  104375. }
  104376. });
  104377. return Array.from(map.values());
  104378. }
  104379. /**
  104380. * @param {?} ast
  104381. * @return {?}
  104382. */
  104383. function isEmptyExpression(ast) {
  104384. if (ast instanceof ASTWithSource) {
  104385. ast = ast.ast;
  104386. }
  104387. return ast instanceof EmptyExpr;
  104388. }
  104389. /**
  104390. * @param {?} el
  104391. * @param {?} enableLegacyTemplate
  104392. * @param {?} reportDeprecation
  104393. * @return {?}
  104394. */
  104395. function isTemplate(el, enableLegacyTemplate, reportDeprecation) {
  104396. if (isNgTemplate(el.name))
  104397. return true;
  104398. var /** @type {?} */ tagNoNs = splitNsName(el.name)[1];
  104399. // `<template>` is HTML and case insensitive
  104400. if (tagNoNs.toLowerCase() === TEMPLATE_ELEMENT) {
  104401. if (enableLegacyTemplate && tagNoNs.toLowerCase() === TEMPLATE_ELEMENT) {
  104402. reportDeprecation(TEMPLATE_ELEMENT_DEPRECATION_WARNING, /** @type {?} */ ((el.sourceSpan)));
  104403. return true;
  104404. }
  104405. }
  104406. return false;
  104407. }
  104408. /**
  104409. * @fileoverview added by tsickle
  104410. * @suppress {checkTypes} checked by tsc
  104411. */
  104412. /**
  104413. * @license
  104414. * Copyright Google Inc. All Rights Reserved.
  104415. *
  104416. * Use of this source code is governed by an MIT-style license that can be
  104417. * found in the LICENSE file at https://angular.io/license
  104418. */
  104419. var EventHandlerVars = /** @class */ (function () {
  104420. function EventHandlerVars() {
  104421. }
  104422. EventHandlerVars.event = variable('$event');
  104423. return EventHandlerVars;
  104424. }());
  104425. /**
  104426. * @record
  104427. */
  104428. var ConvertActionBindingResult = /** @class */ (function () {
  104429. function ConvertActionBindingResult(stmts, allowDefault) {
  104430. this.stmts = stmts;
  104431. this.allowDefault = allowDefault;
  104432. }
  104433. return ConvertActionBindingResult;
  104434. }());
  104435. /**
  104436. * Converts the given expression AST into an executable output AST, assuming the expression is
  104437. * used in an action binding (e.g. an event handler).
  104438. * @param {?} localResolver
  104439. * @param {?} implicitReceiver
  104440. * @param {?} action
  104441. * @param {?} bindingId
  104442. * @return {?}
  104443. */
  104444. function convertActionBinding(localResolver, implicitReceiver, action, bindingId) {
  104445. if (!localResolver) {
  104446. localResolver = new DefaultLocalResolver();
  104447. }
  104448. var /** @type {?} */ actionWithoutBuiltins = convertPropertyBindingBuiltins({
  104449. createLiteralArrayConverter: function (argCount) {
  104450. // Note: no caching for literal arrays in actions.
  104451. return function (args) { return literalArr(args); };
  104452. },
  104453. createLiteralMapConverter: function (keys) {
  104454. // Note: no caching for literal maps in actions.
  104455. return function (values) {
  104456. var /** @type {?} */ entries = keys.map(function (k, i) {
  104457. return ({
  104458. key: k.key,
  104459. value: values[i],
  104460. quoted: k.quoted,
  104461. });
  104462. });
  104463. return literalMap(entries);
  104464. };
  104465. },
  104466. createPipeConverter: function (name) {
  104467. throw new Error("Illegal State: Actions are not allowed to contain pipes. Pipe: " + name);
  104468. }
  104469. }, action);
  104470. var /** @type {?} */ visitor = new _AstToIrVisitor(localResolver, implicitReceiver, bindingId);
  104471. var /** @type {?} */ actionStmts = [];
  104472. flattenStatements(actionWithoutBuiltins.visit(visitor, _Mode.Statement), actionStmts);
  104473. prependTemporaryDecls(visitor.temporaryCount, bindingId, actionStmts);
  104474. var /** @type {?} */ lastIndex = actionStmts.length - 1;
  104475. var /** @type {?} */ preventDefaultVar = /** @type {?} */ ((null));
  104476. if (lastIndex >= 0) {
  104477. var /** @type {?} */ lastStatement = actionStmts[lastIndex];
  104478. var /** @type {?} */ returnExpr = convertStmtIntoExpression(lastStatement);
  104479. if (returnExpr) {
  104480. // Note: We need to cast the result of the method call to dynamic,
  104481. // as it might be a void method!
  104482. preventDefaultVar = createPreventDefaultVar(bindingId);
  104483. actionStmts[lastIndex] =
  104484. preventDefaultVar.set(returnExpr.cast(DYNAMIC_TYPE).notIdentical(literal(false)))
  104485. .toDeclStmt(null, [StmtModifier.Final]);
  104486. }
  104487. }
  104488. return new ConvertActionBindingResult(actionStmts, preventDefaultVar);
  104489. }
  104490. /**
  104491. * @record
  104492. */
  104493. /**
  104494. * @record
  104495. */
  104496. /**
  104497. * @param {?} converterFactory
  104498. * @param {?} ast
  104499. * @return {?}
  104500. */
  104501. function convertPropertyBindingBuiltins(converterFactory, ast) {
  104502. return convertBuiltins(converterFactory, ast);
  104503. }
  104504. var ConvertPropertyBindingResult = /** @class */ (function () {
  104505. function ConvertPropertyBindingResult(stmts, currValExpr) {
  104506. this.stmts = stmts;
  104507. this.currValExpr = currValExpr;
  104508. }
  104509. return ConvertPropertyBindingResult;
  104510. }());
  104511. /** @enum {number} */
  104512. var BindingForm = {
  104513. // The general form of binding expression, supports all expressions.
  104514. General: 0,
  104515. // Try to generate a simple binding (no temporaries or statements)
  104516. // otherise generate a general binding
  104517. TrySimple: 1,
  104518. };
  104519. BindingForm[BindingForm.General] = "General";
  104520. BindingForm[BindingForm.TrySimple] = "TrySimple";
  104521. /**
  104522. * Converts the given expression AST into an executable output AST, assuming the expression
  104523. * is used in property binding. The expression has to be preprocessed via
  104524. * `convertPropertyBindingBuiltins`.
  104525. * @param {?} localResolver
  104526. * @param {?} implicitReceiver
  104527. * @param {?} expressionWithoutBuiltins
  104528. * @param {?} bindingId
  104529. * @param {?} form
  104530. * @return {?}
  104531. */
  104532. function convertPropertyBinding(localResolver, implicitReceiver, expressionWithoutBuiltins, bindingId, form) {
  104533. if (!localResolver) {
  104534. localResolver = new DefaultLocalResolver();
  104535. }
  104536. var /** @type {?} */ currValExpr = createCurrValueExpr(bindingId);
  104537. var /** @type {?} */ stmts = [];
  104538. var /** @type {?} */ visitor = new _AstToIrVisitor(localResolver, implicitReceiver, bindingId);
  104539. var /** @type {?} */ outputExpr = expressionWithoutBuiltins.visit(visitor, _Mode.Expression);
  104540. if (visitor.temporaryCount) {
  104541. for (var /** @type {?} */ i = 0; i < visitor.temporaryCount; i++) {
  104542. stmts.push(temporaryDeclaration(bindingId, i));
  104543. }
  104544. }
  104545. else if (form == BindingForm.TrySimple) {
  104546. return new ConvertPropertyBindingResult([], outputExpr);
  104547. }
  104548. stmts.push(currValExpr.set(outputExpr).toDeclStmt(DYNAMIC_TYPE, [StmtModifier.Final]));
  104549. return new ConvertPropertyBindingResult(stmts, currValExpr);
  104550. }
  104551. /**
  104552. * @param {?} converterFactory
  104553. * @param {?} ast
  104554. * @return {?}
  104555. */
  104556. function convertBuiltins(converterFactory, ast) {
  104557. var /** @type {?} */ visitor = new _BuiltinAstConverter(converterFactory);
  104558. return ast.visit(visitor);
  104559. }
  104560. /**
  104561. * @param {?} bindingId
  104562. * @param {?} temporaryNumber
  104563. * @return {?}
  104564. */
  104565. function temporaryName(bindingId, temporaryNumber) {
  104566. return "tmp_" + bindingId + "_" + temporaryNumber;
  104567. }
  104568. /**
  104569. * @param {?} bindingId
  104570. * @param {?} temporaryNumber
  104571. * @return {?}
  104572. */
  104573. function temporaryDeclaration(bindingId, temporaryNumber) {
  104574. return new DeclareVarStmt(temporaryName(bindingId, temporaryNumber), NULL_EXPR);
  104575. }
  104576. /**
  104577. * @param {?} temporaryCount
  104578. * @param {?} bindingId
  104579. * @param {?} statements
  104580. * @return {?}
  104581. */
  104582. function prependTemporaryDecls(temporaryCount, bindingId, statements) {
  104583. for (var /** @type {?} */ i = temporaryCount - 1; i >= 0; i--) {
  104584. statements.unshift(temporaryDeclaration(bindingId, i));
  104585. }
  104586. }
  104587. /** @enum {number} */
  104588. var _Mode = {
  104589. Statement: 0,
  104590. Expression: 1,
  104591. };
  104592. _Mode[_Mode.Statement] = "Statement";
  104593. _Mode[_Mode.Expression] = "Expression";
  104594. /**
  104595. * @param {?} mode
  104596. * @param {?} ast
  104597. * @return {?}
  104598. */
  104599. function ensureStatementMode(mode, ast) {
  104600. if (mode !== _Mode.Statement) {
  104601. throw new Error("Expected a statement, but saw " + ast);
  104602. }
  104603. }
  104604. /**
  104605. * @param {?} mode
  104606. * @param {?} ast
  104607. * @return {?}
  104608. */
  104609. function ensureExpressionMode(mode, ast) {
  104610. if (mode !== _Mode.Expression) {
  104611. throw new Error("Expected an expression, but saw " + ast);
  104612. }
  104613. }
  104614. /**
  104615. * @param {?} mode
  104616. * @param {?} expr
  104617. * @return {?}
  104618. */
  104619. function convertToStatementIfNeeded(mode, expr) {
  104620. if (mode === _Mode.Statement) {
  104621. return expr.toStmt();
  104622. }
  104623. else {
  104624. return expr;
  104625. }
  104626. }
  104627. var _BuiltinAstConverter = /** @class */ (function (_super) {
  104628. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(_BuiltinAstConverter, _super);
  104629. function _BuiltinAstConverter(_converterFactory) {
  104630. var _this = _super.call(this) || this;
  104631. _this._converterFactory = _converterFactory;
  104632. return _this;
  104633. }
  104634. /**
  104635. * @param {?} ast
  104636. * @param {?} context
  104637. * @return {?}
  104638. */
  104639. _BuiltinAstConverter.prototype.visitPipe = /**
  104640. * @param {?} ast
  104641. * @param {?} context
  104642. * @return {?}
  104643. */
  104644. function (ast, context) {
  104645. var _this = this;
  104646. var /** @type {?} */ args = [ast.exp].concat(ast.args).map(function (ast) { return ast.visit(_this, context); });
  104647. return new BuiltinFunctionCall(ast.span, args, this._converterFactory.createPipeConverter(ast.name, args.length));
  104648. };
  104649. /**
  104650. * @param {?} ast
  104651. * @param {?} context
  104652. * @return {?}
  104653. */
  104654. _BuiltinAstConverter.prototype.visitLiteralArray = /**
  104655. * @param {?} ast
  104656. * @param {?} context
  104657. * @return {?}
  104658. */
  104659. function (ast, context) {
  104660. var _this = this;
  104661. var /** @type {?} */ args = ast.expressions.map(function (ast) { return ast.visit(_this, context); });
  104662. return new BuiltinFunctionCall(ast.span, args, this._converterFactory.createLiteralArrayConverter(ast.expressions.length));
  104663. };
  104664. /**
  104665. * @param {?} ast
  104666. * @param {?} context
  104667. * @return {?}
  104668. */
  104669. _BuiltinAstConverter.prototype.visitLiteralMap = /**
  104670. * @param {?} ast
  104671. * @param {?} context
  104672. * @return {?}
  104673. */
  104674. function (ast, context) {
  104675. var _this = this;
  104676. var /** @type {?} */ args = ast.values.map(function (ast) { return ast.visit(_this, context); });
  104677. return new BuiltinFunctionCall(ast.span, args, this._converterFactory.createLiteralMapConverter(ast.keys));
  104678. };
  104679. return _BuiltinAstConverter;
  104680. }(AstTransformer));
  104681. var _AstToIrVisitor = /** @class */ (function () {
  104682. function _AstToIrVisitor(_localResolver, _implicitReceiver, bindingId) {
  104683. this._localResolver = _localResolver;
  104684. this._implicitReceiver = _implicitReceiver;
  104685. this.bindingId = bindingId;
  104686. this._nodeMap = new Map();
  104687. this._resultMap = new Map();
  104688. this._currentTemporary = 0;
  104689. this.temporaryCount = 0;
  104690. }
  104691. /**
  104692. * @param {?} ast
  104693. * @param {?} mode
  104694. * @return {?}
  104695. */
  104696. _AstToIrVisitor.prototype.visitBinary = /**
  104697. * @param {?} ast
  104698. * @param {?} mode
  104699. * @return {?}
  104700. */
  104701. function (ast, mode) {
  104702. var /** @type {?} */ op;
  104703. switch (ast.operation) {
  104704. case '+':
  104705. op = BinaryOperator.Plus;
  104706. break;
  104707. case '-':
  104708. op = BinaryOperator.Minus;
  104709. break;
  104710. case '*':
  104711. op = BinaryOperator.Multiply;
  104712. break;
  104713. case '/':
  104714. op = BinaryOperator.Divide;
  104715. break;
  104716. case '%':
  104717. op = BinaryOperator.Modulo;
  104718. break;
  104719. case '&&':
  104720. op = BinaryOperator.And;
  104721. break;
  104722. case '||':
  104723. op = BinaryOperator.Or;
  104724. break;
  104725. case '==':
  104726. op = BinaryOperator.Equals;
  104727. break;
  104728. case '!=':
  104729. op = BinaryOperator.NotEquals;
  104730. break;
  104731. case '===':
  104732. op = BinaryOperator.Identical;
  104733. break;
  104734. case '!==':
  104735. op = BinaryOperator.NotIdentical;
  104736. break;
  104737. case '<':
  104738. op = BinaryOperator.Lower;
  104739. break;
  104740. case '>':
  104741. op = BinaryOperator.Bigger;
  104742. break;
  104743. case '<=':
  104744. op = BinaryOperator.LowerEquals;
  104745. break;
  104746. case '>=':
  104747. op = BinaryOperator.BiggerEquals;
  104748. break;
  104749. default:
  104750. throw new Error("Unsupported operation " + ast.operation);
  104751. }
  104752. return convertToStatementIfNeeded(mode, new BinaryOperatorExpr(op, this._visit(ast.left, _Mode.Expression), this._visit(ast.right, _Mode.Expression)));
  104753. };
  104754. /**
  104755. * @param {?} ast
  104756. * @param {?} mode
  104757. * @return {?}
  104758. */
  104759. _AstToIrVisitor.prototype.visitChain = /**
  104760. * @param {?} ast
  104761. * @param {?} mode
  104762. * @return {?}
  104763. */
  104764. function (ast, mode) {
  104765. ensureStatementMode(mode, ast);
  104766. return this.visitAll(ast.expressions, mode);
  104767. };
  104768. /**
  104769. * @param {?} ast
  104770. * @param {?} mode
  104771. * @return {?}
  104772. */
  104773. _AstToIrVisitor.prototype.visitConditional = /**
  104774. * @param {?} ast
  104775. * @param {?} mode
  104776. * @return {?}
  104777. */
  104778. function (ast, mode) {
  104779. var /** @type {?} */ value = this._visit(ast.condition, _Mode.Expression);
  104780. return convertToStatementIfNeeded(mode, value.conditional(this._visit(ast.trueExp, _Mode.Expression), this._visit(ast.falseExp, _Mode.Expression)));
  104781. };
  104782. /**
  104783. * @param {?} ast
  104784. * @param {?} mode
  104785. * @return {?}
  104786. */
  104787. _AstToIrVisitor.prototype.visitPipe = /**
  104788. * @param {?} ast
  104789. * @param {?} mode
  104790. * @return {?}
  104791. */
  104792. function (ast, mode) {
  104793. throw new Error("Illegal state: Pipes should have been converted into functions. Pipe: " + ast.name);
  104794. };
  104795. /**
  104796. * @param {?} ast
  104797. * @param {?} mode
  104798. * @return {?}
  104799. */
  104800. _AstToIrVisitor.prototype.visitFunctionCall = /**
  104801. * @param {?} ast
  104802. * @param {?} mode
  104803. * @return {?}
  104804. */
  104805. function (ast, mode) {
  104806. var /** @type {?} */ convertedArgs = this.visitAll(ast.args, _Mode.Expression);
  104807. var /** @type {?} */ fnResult;
  104808. if (ast instanceof BuiltinFunctionCall) {
  104809. fnResult = ast.converter(convertedArgs);
  104810. }
  104811. else {
  104812. fnResult = this._visit(/** @type {?} */ ((ast.target)), _Mode.Expression).callFn(convertedArgs);
  104813. }
  104814. return convertToStatementIfNeeded(mode, fnResult);
  104815. };
  104816. /**
  104817. * @param {?} ast
  104818. * @param {?} mode
  104819. * @return {?}
  104820. */
  104821. _AstToIrVisitor.prototype.visitImplicitReceiver = /**
  104822. * @param {?} ast
  104823. * @param {?} mode
  104824. * @return {?}
  104825. */
  104826. function (ast, mode) {
  104827. ensureExpressionMode(mode, ast);
  104828. return this._implicitReceiver;
  104829. };
  104830. /**
  104831. * @param {?} ast
  104832. * @param {?} mode
  104833. * @return {?}
  104834. */
  104835. _AstToIrVisitor.prototype.visitInterpolation = /**
  104836. * @param {?} ast
  104837. * @param {?} mode
  104838. * @return {?}
  104839. */
  104840. function (ast, mode) {
  104841. ensureExpressionMode(mode, ast);
  104842. var /** @type {?} */ args = [literal(ast.expressions.length)];
  104843. for (var /** @type {?} */ i = 0; i < ast.strings.length - 1; i++) {
  104844. args.push(literal(ast.strings[i]));
  104845. args.push(this._visit(ast.expressions[i], _Mode.Expression));
  104846. }
  104847. args.push(literal(ast.strings[ast.strings.length - 1]));
  104848. return ast.expressions.length <= 9 ?
  104849. importExpr(Identifiers.inlineInterpolate).callFn(args) :
  104850. importExpr(Identifiers.interpolate).callFn([args[0], literalArr(args.slice(1))]);
  104851. };
  104852. /**
  104853. * @param {?} ast
  104854. * @param {?} mode
  104855. * @return {?}
  104856. */
  104857. _AstToIrVisitor.prototype.visitKeyedRead = /**
  104858. * @param {?} ast
  104859. * @param {?} mode
  104860. * @return {?}
  104861. */
  104862. function (ast, mode) {
  104863. var /** @type {?} */ leftMostSafe = this.leftMostSafeNode(ast);
  104864. if (leftMostSafe) {
  104865. return this.convertSafeAccess(ast, leftMostSafe, mode);
  104866. }
  104867. else {
  104868. return convertToStatementIfNeeded(mode, this._visit(ast.obj, _Mode.Expression).key(this._visit(ast.key, _Mode.Expression)));
  104869. }
  104870. };
  104871. /**
  104872. * @param {?} ast
  104873. * @param {?} mode
  104874. * @return {?}
  104875. */
  104876. _AstToIrVisitor.prototype.visitKeyedWrite = /**
  104877. * @param {?} ast
  104878. * @param {?} mode
  104879. * @return {?}
  104880. */
  104881. function (ast, mode) {
  104882. var /** @type {?} */ obj = this._visit(ast.obj, _Mode.Expression);
  104883. var /** @type {?} */ key = this._visit(ast.key, _Mode.Expression);
  104884. var /** @type {?} */ value = this._visit(ast.value, _Mode.Expression);
  104885. return convertToStatementIfNeeded(mode, obj.key(key).set(value));
  104886. };
  104887. /**
  104888. * @param {?} ast
  104889. * @param {?} mode
  104890. * @return {?}
  104891. */
  104892. _AstToIrVisitor.prototype.visitLiteralArray = /**
  104893. * @param {?} ast
  104894. * @param {?} mode
  104895. * @return {?}
  104896. */
  104897. function (ast, mode) {
  104898. throw new Error("Illegal State: literal arrays should have been converted into functions");
  104899. };
  104900. /**
  104901. * @param {?} ast
  104902. * @param {?} mode
  104903. * @return {?}
  104904. */
  104905. _AstToIrVisitor.prototype.visitLiteralMap = /**
  104906. * @param {?} ast
  104907. * @param {?} mode
  104908. * @return {?}
  104909. */
  104910. function (ast, mode) {
  104911. throw new Error("Illegal State: literal maps should have been converted into functions");
  104912. };
  104913. /**
  104914. * @param {?} ast
  104915. * @param {?} mode
  104916. * @return {?}
  104917. */
  104918. _AstToIrVisitor.prototype.visitLiteralPrimitive = /**
  104919. * @param {?} ast
  104920. * @param {?} mode
  104921. * @return {?}
  104922. */
  104923. function (ast, mode) {
  104924. // For literal values of null, undefined, true, or false allow type inteference
  104925. // to infer the type.
  104926. var /** @type {?} */ type = ast.value === null || ast.value === undefined || ast.value === true || ast.value === true ?
  104927. INFERRED_TYPE :
  104928. undefined;
  104929. return convertToStatementIfNeeded(mode, literal(ast.value, type));
  104930. };
  104931. /**
  104932. * @param {?} name
  104933. * @return {?}
  104934. */
  104935. _AstToIrVisitor.prototype._getLocal = /**
  104936. * @param {?} name
  104937. * @return {?}
  104938. */
  104939. function (name) { return this._localResolver.getLocal(name); };
  104940. /**
  104941. * @param {?} ast
  104942. * @param {?} mode
  104943. * @return {?}
  104944. */
  104945. _AstToIrVisitor.prototype.visitMethodCall = /**
  104946. * @param {?} ast
  104947. * @param {?} mode
  104948. * @return {?}
  104949. */
  104950. function (ast, mode) {
  104951. if (ast.receiver instanceof ImplicitReceiver && ast.name == '$any') {
  104952. var /** @type {?} */ args = /** @type {?} */ (this.visitAll(ast.args, _Mode.Expression));
  104953. if (args.length != 1) {
  104954. throw new Error("Invalid call to $any, expected 1 argument but received " + (args.length || 'none'));
  104955. }
  104956. return (/** @type {?} */ (args[0])).cast(DYNAMIC_TYPE);
  104957. }
  104958. var /** @type {?} */ leftMostSafe = this.leftMostSafeNode(ast);
  104959. if (leftMostSafe) {
  104960. return this.convertSafeAccess(ast, leftMostSafe, mode);
  104961. }
  104962. else {
  104963. var /** @type {?} */ args = this.visitAll(ast.args, _Mode.Expression);
  104964. var /** @type {?} */ result = null;
  104965. var /** @type {?} */ receiver = this._visit(ast.receiver, _Mode.Expression);
  104966. if (receiver === this._implicitReceiver) {
  104967. var /** @type {?} */ varExpr = this._getLocal(ast.name);
  104968. if (varExpr) {
  104969. result = varExpr.callFn(args);
  104970. }
  104971. }
  104972. if (result == null) {
  104973. result = receiver.callMethod(ast.name, args);
  104974. }
  104975. return convertToStatementIfNeeded(mode, result);
  104976. }
  104977. };
  104978. /**
  104979. * @param {?} ast
  104980. * @param {?} mode
  104981. * @return {?}
  104982. */
  104983. _AstToIrVisitor.prototype.visitPrefixNot = /**
  104984. * @param {?} ast
  104985. * @param {?} mode
  104986. * @return {?}
  104987. */
  104988. function (ast, mode) {
  104989. return convertToStatementIfNeeded(mode, not(this._visit(ast.expression, _Mode.Expression)));
  104990. };
  104991. /**
  104992. * @param {?} ast
  104993. * @param {?} mode
  104994. * @return {?}
  104995. */
  104996. _AstToIrVisitor.prototype.visitNonNullAssert = /**
  104997. * @param {?} ast
  104998. * @param {?} mode
  104999. * @return {?}
  105000. */
  105001. function (ast, mode) {
  105002. return convertToStatementIfNeeded(mode, assertNotNull(this._visit(ast.expression, _Mode.Expression)));
  105003. };
  105004. /**
  105005. * @param {?} ast
  105006. * @param {?} mode
  105007. * @return {?}
  105008. */
  105009. _AstToIrVisitor.prototype.visitPropertyRead = /**
  105010. * @param {?} ast
  105011. * @param {?} mode
  105012. * @return {?}
  105013. */
  105014. function (ast, mode) {
  105015. var /** @type {?} */ leftMostSafe = this.leftMostSafeNode(ast);
  105016. if (leftMostSafe) {
  105017. return this.convertSafeAccess(ast, leftMostSafe, mode);
  105018. }
  105019. else {
  105020. var /** @type {?} */ result = null;
  105021. var /** @type {?} */ receiver = this._visit(ast.receiver, _Mode.Expression);
  105022. if (receiver === this._implicitReceiver) {
  105023. result = this._getLocal(ast.name);
  105024. }
  105025. if (result == null) {
  105026. result = receiver.prop(ast.name);
  105027. }
  105028. return convertToStatementIfNeeded(mode, result);
  105029. }
  105030. };
  105031. /**
  105032. * @param {?} ast
  105033. * @param {?} mode
  105034. * @return {?}
  105035. */
  105036. _AstToIrVisitor.prototype.visitPropertyWrite = /**
  105037. * @param {?} ast
  105038. * @param {?} mode
  105039. * @return {?}
  105040. */
  105041. function (ast, mode) {
  105042. var /** @type {?} */ receiver = this._visit(ast.receiver, _Mode.Expression);
  105043. if (receiver === this._implicitReceiver) {
  105044. var /** @type {?} */ varExpr = this._getLocal(ast.name);
  105045. if (varExpr) {
  105046. throw new Error('Cannot assign to a reference or variable!');
  105047. }
  105048. }
  105049. return convertToStatementIfNeeded(mode, receiver.prop(ast.name).set(this._visit(ast.value, _Mode.Expression)));
  105050. };
  105051. /**
  105052. * @param {?} ast
  105053. * @param {?} mode
  105054. * @return {?}
  105055. */
  105056. _AstToIrVisitor.prototype.visitSafePropertyRead = /**
  105057. * @param {?} ast
  105058. * @param {?} mode
  105059. * @return {?}
  105060. */
  105061. function (ast, mode) {
  105062. return this.convertSafeAccess(ast, this.leftMostSafeNode(ast), mode);
  105063. };
  105064. /**
  105065. * @param {?} ast
  105066. * @param {?} mode
  105067. * @return {?}
  105068. */
  105069. _AstToIrVisitor.prototype.visitSafeMethodCall = /**
  105070. * @param {?} ast
  105071. * @param {?} mode
  105072. * @return {?}
  105073. */
  105074. function (ast, mode) {
  105075. return this.convertSafeAccess(ast, this.leftMostSafeNode(ast), mode);
  105076. };
  105077. /**
  105078. * @param {?} asts
  105079. * @param {?} mode
  105080. * @return {?}
  105081. */
  105082. _AstToIrVisitor.prototype.visitAll = /**
  105083. * @param {?} asts
  105084. * @param {?} mode
  105085. * @return {?}
  105086. */
  105087. function (asts, mode) {
  105088. var _this = this;
  105089. return asts.map(function (ast) { return _this._visit(ast, mode); });
  105090. };
  105091. /**
  105092. * @param {?} ast
  105093. * @param {?} mode
  105094. * @return {?}
  105095. */
  105096. _AstToIrVisitor.prototype.visitQuote = /**
  105097. * @param {?} ast
  105098. * @param {?} mode
  105099. * @return {?}
  105100. */
  105101. function (ast, mode) {
  105102. throw new Error("Quotes are not supported for evaluation!\n Statement: " + ast.uninterpretedExpression + " located at " + ast.location);
  105103. };
  105104. /**
  105105. * @param {?} ast
  105106. * @param {?} mode
  105107. * @return {?}
  105108. */
  105109. _AstToIrVisitor.prototype._visit = /**
  105110. * @param {?} ast
  105111. * @param {?} mode
  105112. * @return {?}
  105113. */
  105114. function (ast, mode) {
  105115. var /** @type {?} */ result = this._resultMap.get(ast);
  105116. if (result)
  105117. return result;
  105118. return (this._nodeMap.get(ast) || ast).visit(this, mode);
  105119. };
  105120. /**
  105121. * @param {?} ast
  105122. * @param {?} leftMostSafe
  105123. * @param {?} mode
  105124. * @return {?}
  105125. */
  105126. _AstToIrVisitor.prototype.convertSafeAccess = /**
  105127. * @param {?} ast
  105128. * @param {?} leftMostSafe
  105129. * @param {?} mode
  105130. * @return {?}
  105131. */
  105132. function (ast, leftMostSafe, mode) {
  105133. // If the expression contains a safe access node on the left it needs to be converted to
  105134. // an expression that guards the access to the member by checking the receiver for blank. As
  105135. // execution proceeds from left to right, the left most part of the expression must be guarded
  105136. // first but, because member access is left associative, the right side of the expression is at
  105137. // the top of the AST. The desired result requires lifting a copy of the the left part of the
  105138. // expression up to test it for blank before generating the unguarded version.
  105139. // Consider, for example the following expression: a?.b.c?.d.e
  105140. // This results in the ast:
  105141. // .
  105142. // / \
  105143. // ?. e
  105144. // / \
  105145. // . d
  105146. // / \
  105147. // ?. c
  105148. // / \
  105149. // a b
  105150. // The following tree should be generated:
  105151. //
  105152. // /---- ? ----\
  105153. // / | \
  105154. // a /--- ? ---\ null
  105155. // / | \
  105156. // . . null
  105157. // / \ / \
  105158. // . c . e
  105159. // / \ / \
  105160. // a b , d
  105161. // / \
  105162. // . c
  105163. // / \
  105164. // a b
  105165. //
  105166. // Notice that the first guard condition is the left hand of the left most safe access node
  105167. // which comes in as leftMostSafe to this routine.
  105168. var /** @type {?} */ guardedExpression = this._visit(leftMostSafe.receiver, _Mode.Expression);
  105169. var /** @type {?} */ temporary = /** @type {?} */ ((undefined));
  105170. if (this.needsTemporary(leftMostSafe.receiver)) {
  105171. // If the expression has method calls or pipes then we need to save the result into a
  105172. // temporary variable to avoid calling stateful or impure code more than once.
  105173. temporary = this.allocateTemporary();
  105174. // Preserve the result in the temporary variable
  105175. guardedExpression = temporary.set(guardedExpression);
  105176. // Ensure all further references to the guarded expression refer to the temporary instead.
  105177. this._resultMap.set(leftMostSafe.receiver, temporary);
  105178. }
  105179. var /** @type {?} */ condition = guardedExpression.isBlank();
  105180. // Convert the ast to an unguarded access to the receiver's member. The map will substitute
  105181. // leftMostNode with its unguarded version in the call to `this.visit()`.
  105182. if (leftMostSafe instanceof SafeMethodCall) {
  105183. this._nodeMap.set(leftMostSafe, new MethodCall(leftMostSafe.span, leftMostSafe.receiver, leftMostSafe.name, leftMostSafe.args));
  105184. }
  105185. else {
  105186. this._nodeMap.set(leftMostSafe, new PropertyRead(leftMostSafe.span, leftMostSafe.receiver, leftMostSafe.name));
  105187. }
  105188. // Recursively convert the node now without the guarded member access.
  105189. var /** @type {?} */ access = this._visit(ast, _Mode.Expression);
  105190. // Remove the mapping. This is not strictly required as the converter only traverses each node
  105191. // once but is safer if the conversion is changed to traverse the nodes more than once.
  105192. this._nodeMap.delete(leftMostSafe);
  105193. // If we allocated a temporary, release it.
  105194. if (temporary) {
  105195. this.releaseTemporary(temporary);
  105196. }
  105197. // Produce the conditional
  105198. return convertToStatementIfNeeded(mode, condition.conditional(literal(null), access));
  105199. };
  105200. /**
  105201. * @param {?} ast
  105202. * @return {?}
  105203. */
  105204. _AstToIrVisitor.prototype.leftMostSafeNode = /**
  105205. * @param {?} ast
  105206. * @return {?}
  105207. */
  105208. function (ast) {
  105209. var _this = this;
  105210. var /** @type {?} */ visit = function (visitor, ast) {
  105211. return (_this._nodeMap.get(ast) || ast).visit(visitor);
  105212. };
  105213. return ast.visit({
  105214. visitBinary: /**
  105215. * @param {?} ast
  105216. * @return {?}
  105217. */
  105218. function (ast) { return null; },
  105219. visitChain: /**
  105220. * @param {?} ast
  105221. * @return {?}
  105222. */
  105223. function (ast) { return null; },
  105224. visitConditional: /**
  105225. * @param {?} ast
  105226. * @return {?}
  105227. */
  105228. function (ast) { return null; },
  105229. visitFunctionCall: /**
  105230. * @param {?} ast
  105231. * @return {?}
  105232. */
  105233. function (ast) { return null; },
  105234. visitImplicitReceiver: /**
  105235. * @param {?} ast
  105236. * @return {?}
  105237. */
  105238. function (ast) { return null; },
  105239. visitInterpolation: /**
  105240. * @param {?} ast
  105241. * @return {?}
  105242. */
  105243. function (ast) { return null; },
  105244. visitKeyedRead: /**
  105245. * @param {?} ast
  105246. * @return {?}
  105247. */
  105248. function (ast) { return visit(this, ast.obj); },
  105249. visitKeyedWrite: /**
  105250. * @param {?} ast
  105251. * @return {?}
  105252. */
  105253. function (ast) { return null; },
  105254. visitLiteralArray: /**
  105255. * @param {?} ast
  105256. * @return {?}
  105257. */
  105258. function (ast) { return null; },
  105259. visitLiteralMap: /**
  105260. * @param {?} ast
  105261. * @return {?}
  105262. */
  105263. function (ast) { return null; },
  105264. visitLiteralPrimitive: /**
  105265. * @param {?} ast
  105266. * @return {?}
  105267. */
  105268. function (ast) { return null; },
  105269. visitMethodCall: /**
  105270. * @param {?} ast
  105271. * @return {?}
  105272. */
  105273. function (ast) { return visit(this, ast.receiver); },
  105274. visitPipe: /**
  105275. * @param {?} ast
  105276. * @return {?}
  105277. */
  105278. function (ast) { return null; },
  105279. visitPrefixNot: /**
  105280. * @param {?} ast
  105281. * @return {?}
  105282. */
  105283. function (ast) { return null; },
  105284. visitNonNullAssert: /**
  105285. * @param {?} ast
  105286. * @return {?}
  105287. */
  105288. function (ast) { return null; },
  105289. visitPropertyRead: /**
  105290. * @param {?} ast
  105291. * @return {?}
  105292. */
  105293. function (ast) { return visit(this, ast.receiver); },
  105294. visitPropertyWrite: /**
  105295. * @param {?} ast
  105296. * @return {?}
  105297. */
  105298. function (ast) { return null; },
  105299. visitQuote: /**
  105300. * @param {?} ast
  105301. * @return {?}
  105302. */
  105303. function (ast) { return null; },
  105304. visitSafeMethodCall: /**
  105305. * @param {?} ast
  105306. * @return {?}
  105307. */
  105308. function (ast) { return visit(this, ast.receiver) || ast; },
  105309. visitSafePropertyRead: /**
  105310. * @param {?} ast
  105311. * @return {?}
  105312. */
  105313. function (ast) {
  105314. return visit(this, ast.receiver) || ast;
  105315. }
  105316. });
  105317. };
  105318. /**
  105319. * @param {?} ast
  105320. * @return {?}
  105321. */
  105322. _AstToIrVisitor.prototype.needsTemporary = /**
  105323. * @param {?} ast
  105324. * @return {?}
  105325. */
  105326. function (ast) {
  105327. var _this = this;
  105328. var /** @type {?} */ visit = function (visitor, ast) {
  105329. return ast && (_this._nodeMap.get(ast) || ast).visit(visitor);
  105330. };
  105331. var /** @type {?} */ visitSome = function (visitor, ast) {
  105332. return ast.some(function (ast) { return visit(visitor, ast); });
  105333. };
  105334. return ast.visit({
  105335. visitBinary: /**
  105336. * @param {?} ast
  105337. * @return {?}
  105338. */
  105339. function (ast) { return visit(this, ast.left) || visit(this, ast.right); },
  105340. visitChain: /**
  105341. * @param {?} ast
  105342. * @return {?}
  105343. */
  105344. function (ast) { return false; },
  105345. visitConditional: /**
  105346. * @param {?} ast
  105347. * @return {?}
  105348. */
  105349. function (ast) {
  105350. return visit(this, ast.condition) || visit(this, ast.trueExp) ||
  105351. visit(this, ast.falseExp);
  105352. },
  105353. visitFunctionCall: /**
  105354. * @param {?} ast
  105355. * @return {?}
  105356. */
  105357. function (ast) { return true; },
  105358. visitImplicitReceiver: /**
  105359. * @param {?} ast
  105360. * @return {?}
  105361. */
  105362. function (ast) { return false; },
  105363. visitInterpolation: /**
  105364. * @param {?} ast
  105365. * @return {?}
  105366. */
  105367. function (ast) { return visitSome(this, ast.expressions); },
  105368. visitKeyedRead: /**
  105369. * @param {?} ast
  105370. * @return {?}
  105371. */
  105372. function (ast) { return false; },
  105373. visitKeyedWrite: /**
  105374. * @param {?} ast
  105375. * @return {?}
  105376. */
  105377. function (ast) { return false; },
  105378. visitLiteralArray: /**
  105379. * @param {?} ast
  105380. * @return {?}
  105381. */
  105382. function (ast) { return true; },
  105383. visitLiteralMap: /**
  105384. * @param {?} ast
  105385. * @return {?}
  105386. */
  105387. function (ast) { return true; },
  105388. visitLiteralPrimitive: /**
  105389. * @param {?} ast
  105390. * @return {?}
  105391. */
  105392. function (ast) { return false; },
  105393. visitMethodCall: /**
  105394. * @param {?} ast
  105395. * @return {?}
  105396. */
  105397. function (ast) { return true; },
  105398. visitPipe: /**
  105399. * @param {?} ast
  105400. * @return {?}
  105401. */
  105402. function (ast) { return true; },
  105403. visitPrefixNot: /**
  105404. * @param {?} ast
  105405. * @return {?}
  105406. */
  105407. function (ast) { return visit(this, ast.expression); },
  105408. visitNonNullAssert: /**
  105409. * @param {?} ast
  105410. * @return {?}
  105411. */
  105412. function (ast) { return visit(this, ast.expression); },
  105413. visitPropertyRead: /**
  105414. * @param {?} ast
  105415. * @return {?}
  105416. */
  105417. function (ast) { return false; },
  105418. visitPropertyWrite: /**
  105419. * @param {?} ast
  105420. * @return {?}
  105421. */
  105422. function (ast) { return false; },
  105423. visitQuote: /**
  105424. * @param {?} ast
  105425. * @return {?}
  105426. */
  105427. function (ast) { return false; },
  105428. visitSafeMethodCall: /**
  105429. * @param {?} ast
  105430. * @return {?}
  105431. */
  105432. function (ast) { return true; },
  105433. visitSafePropertyRead: /**
  105434. * @param {?} ast
  105435. * @return {?}
  105436. */
  105437. function (ast) { return false; }
  105438. });
  105439. };
  105440. /**
  105441. * @return {?}
  105442. */
  105443. _AstToIrVisitor.prototype.allocateTemporary = /**
  105444. * @return {?}
  105445. */
  105446. function () {
  105447. var /** @type {?} */ tempNumber = this._currentTemporary++;
  105448. this.temporaryCount = Math.max(this._currentTemporary, this.temporaryCount);
  105449. return new ReadVarExpr(temporaryName(this.bindingId, tempNumber));
  105450. };
  105451. /**
  105452. * @param {?} temporary
  105453. * @return {?}
  105454. */
  105455. _AstToIrVisitor.prototype.releaseTemporary = /**
  105456. * @param {?} temporary
  105457. * @return {?}
  105458. */
  105459. function (temporary) {
  105460. this._currentTemporary--;
  105461. if (temporary.name != temporaryName(this.bindingId, this._currentTemporary)) {
  105462. throw new Error("Temporary " + temporary.name + " released out of order");
  105463. }
  105464. };
  105465. return _AstToIrVisitor;
  105466. }());
  105467. /**
  105468. * @param {?} arg
  105469. * @param {?} output
  105470. * @return {?}
  105471. */
  105472. function flattenStatements(arg, output) {
  105473. if (Array.isArray(arg)) {
  105474. (/** @type {?} */ (arg)).forEach(function (entry) { return flattenStatements(entry, output); });
  105475. }
  105476. else {
  105477. output.push(arg);
  105478. }
  105479. }
  105480. var DefaultLocalResolver = /** @class */ (function () {
  105481. function DefaultLocalResolver() {
  105482. }
  105483. /**
  105484. * @param {?} name
  105485. * @return {?}
  105486. */
  105487. DefaultLocalResolver.prototype.getLocal = /**
  105488. * @param {?} name
  105489. * @return {?}
  105490. */
  105491. function (name) {
  105492. if (name === EventHandlerVars.event.name) {
  105493. return EventHandlerVars.event;
  105494. }
  105495. return null;
  105496. };
  105497. return DefaultLocalResolver;
  105498. }());
  105499. /**
  105500. * @param {?} bindingId
  105501. * @return {?}
  105502. */
  105503. function createCurrValueExpr(bindingId) {
  105504. return variable("currVal_" + bindingId); // fix syntax highlighting: `
  105505. }
  105506. /**
  105507. * @param {?} bindingId
  105508. * @return {?}
  105509. */
  105510. function createPreventDefaultVar(bindingId) {
  105511. return variable("pd_" + bindingId);
  105512. }
  105513. /**
  105514. * @param {?} stmt
  105515. * @return {?}
  105516. */
  105517. function convertStmtIntoExpression(stmt) {
  105518. if (stmt instanceof ExpressionStatement) {
  105519. return stmt.expr;
  105520. }
  105521. else if (stmt instanceof ReturnStatement) {
  105522. return stmt.value;
  105523. }
  105524. return null;
  105525. }
  105526. var BuiltinFunctionCall = /** @class */ (function (_super) {
  105527. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(BuiltinFunctionCall, _super);
  105528. function BuiltinFunctionCall(span, args, converter) {
  105529. var _this = _super.call(this, span, null, args) || this;
  105530. _this.args = args;
  105531. _this.converter = converter;
  105532. return _this;
  105533. }
  105534. return BuiltinFunctionCall;
  105535. }(FunctionCall));
  105536. /**
  105537. * @fileoverview added by tsickle
  105538. * @suppress {checkTypes} checked by tsc
  105539. */
  105540. /**
  105541. * @license
  105542. * Copyright Google Inc. All Rights Reserved.
  105543. *
  105544. * Use of this source code is governed by an MIT-style license that can be
  105545. * found in the LICENSE file at https://angular.io/license
  105546. */
  105547. /**
  105548. * Generates code that is used to type check templates.
  105549. */
  105550. var TypeCheckCompiler = /** @class */ (function () {
  105551. function TypeCheckCompiler(options, reflector) {
  105552. this.options = options;
  105553. this.reflector = reflector;
  105554. }
  105555. /**
  105556. * Important notes:
  105557. * - This must not produce new `import` statements, but only refer to types outside
  105558. * of the file via the variables provided via externalReferenceVars.
  105559. * This allows Typescript to reuse the old program's structure as no imports have changed.
  105560. * - This must not produce any exports, as this would pollute the .d.ts file
  105561. * and also violate the point above.
  105562. */
  105563. /**
  105564. * Important notes:
  105565. * - This must not produce new `import` statements, but only refer to types outside
  105566. * of the file via the variables provided via externalReferenceVars.
  105567. * This allows Typescript to reuse the old program's structure as no imports have changed.
  105568. * - This must not produce any exports, as this would pollute the .d.ts file
  105569. * and also violate the point above.
  105570. * @param {?} componentId
  105571. * @param {?} component
  105572. * @param {?} template
  105573. * @param {?} usedPipes
  105574. * @param {?} externalReferenceVars
  105575. * @param {?} ctx
  105576. * @return {?}
  105577. */
  105578. TypeCheckCompiler.prototype.compileComponent = /**
  105579. * Important notes:
  105580. * - This must not produce new `import` statements, but only refer to types outside
  105581. * of the file via the variables provided via externalReferenceVars.
  105582. * This allows Typescript to reuse the old program's structure as no imports have changed.
  105583. * - This must not produce any exports, as this would pollute the .d.ts file
  105584. * and also violate the point above.
  105585. * @param {?} componentId
  105586. * @param {?} component
  105587. * @param {?} template
  105588. * @param {?} usedPipes
  105589. * @param {?} externalReferenceVars
  105590. * @param {?} ctx
  105591. * @return {?}
  105592. */
  105593. function (componentId, component, template, usedPipes, externalReferenceVars, ctx) {
  105594. var _this = this;
  105595. var /** @type {?} */ pipes = new Map();
  105596. usedPipes.forEach(function (p) { return pipes.set(p.name, p.type.reference); });
  105597. var /** @type {?} */ embeddedViewCount = 0;
  105598. var /** @type {?} */ viewBuilderFactory = function (parent, guards) {
  105599. var /** @type {?} */ embeddedViewIndex = embeddedViewCount++;
  105600. return new ViewBuilder(_this.options, _this.reflector, externalReferenceVars, parent, component.type.reference, component.isHost, embeddedViewIndex, pipes, guards, ctx, viewBuilderFactory);
  105601. };
  105602. var /** @type {?} */ visitor = viewBuilderFactory(null, []);
  105603. visitor.visitAll([], template);
  105604. return visitor.build(componentId);
  105605. };
  105606. return TypeCheckCompiler;
  105607. }());
  105608. var DYNAMIC_VAR_NAME = '_any';
  105609. var TypeCheckLocalResolver = /** @class */ (function () {
  105610. function TypeCheckLocalResolver() {
  105611. }
  105612. /**
  105613. * @param {?} name
  105614. * @return {?}
  105615. */
  105616. TypeCheckLocalResolver.prototype.getLocal = /**
  105617. * @param {?} name
  105618. * @return {?}
  105619. */
  105620. function (name) {
  105621. if (name === EventHandlerVars.event.name) {
  105622. // References to the event should not be type-checked.
  105623. // TODO(chuckj): determine a better type for the event.
  105624. return variable(DYNAMIC_VAR_NAME);
  105625. }
  105626. return null;
  105627. };
  105628. return TypeCheckLocalResolver;
  105629. }());
  105630. var defaultResolver = new TypeCheckLocalResolver();
  105631. var ViewBuilder = /** @class */ (function () {
  105632. function ViewBuilder(options, reflector, externalReferenceVars, parent, component, isHostComponent, embeddedViewIndex, pipes, guards, ctx, viewBuilderFactory) {
  105633. this.options = options;
  105634. this.reflector = reflector;
  105635. this.externalReferenceVars = externalReferenceVars;
  105636. this.parent = parent;
  105637. this.component = component;
  105638. this.isHostComponent = isHostComponent;
  105639. this.embeddedViewIndex = embeddedViewIndex;
  105640. this.pipes = pipes;
  105641. this.guards = guards;
  105642. this.ctx = ctx;
  105643. this.viewBuilderFactory = viewBuilderFactory;
  105644. this.refOutputVars = new Map();
  105645. this.variables = [];
  105646. this.children = [];
  105647. this.updates = [];
  105648. this.actions = [];
  105649. }
  105650. /**
  105651. * @param {?} type
  105652. * @return {?}
  105653. */
  105654. ViewBuilder.prototype.getOutputVar = /**
  105655. * @param {?} type
  105656. * @return {?}
  105657. */
  105658. function (type) {
  105659. var /** @type {?} */ varName;
  105660. if (type === this.component && this.isHostComponent) {
  105661. varName = DYNAMIC_VAR_NAME;
  105662. }
  105663. else if (type instanceof StaticSymbol) {
  105664. varName = this.externalReferenceVars.get(type);
  105665. }
  105666. else {
  105667. varName = DYNAMIC_VAR_NAME;
  105668. }
  105669. if (!varName) {
  105670. throw new Error("Illegal State: referring to a type without a variable " + JSON.stringify(type));
  105671. }
  105672. return varName;
  105673. };
  105674. /**
  105675. * @param {?} ast
  105676. * @return {?}
  105677. */
  105678. ViewBuilder.prototype.getTypeGuardExpressions = /**
  105679. * @param {?} ast
  105680. * @return {?}
  105681. */
  105682. function (ast) {
  105683. var /** @type {?} */ result = this.guards.slice();
  105684. for (var _i = 0, _a = ast.directives; _i < _a.length; _i++) {
  105685. var directive = _a[_i];
  105686. for (var _b = 0, _c = directive.inputs; _b < _c.length; _b++) {
  105687. var input = _c[_b];
  105688. var /** @type {?} */ guard = directive.directive.guards[input.directiveName];
  105689. if (guard) {
  105690. var /** @type {?} */ useIf = guard === 'UseIf';
  105691. result.push({
  105692. guard: guard,
  105693. useIf: useIf,
  105694. expression: /** @type {?} */ ({ context: this.component, value: input.value })
  105695. });
  105696. }
  105697. }
  105698. }
  105699. return result;
  105700. };
  105701. /**
  105702. * @param {?} variables
  105703. * @param {?} astNodes
  105704. * @return {?}
  105705. */
  105706. ViewBuilder.prototype.visitAll = /**
  105707. * @param {?} variables
  105708. * @param {?} astNodes
  105709. * @return {?}
  105710. */
  105711. function (variables, astNodes) {
  105712. this.variables = variables;
  105713. templateVisitAll(this, astNodes);
  105714. };
  105715. /**
  105716. * @param {?} componentId
  105717. * @param {?=} targetStatements
  105718. * @return {?}
  105719. */
  105720. ViewBuilder.prototype.build = /**
  105721. * @param {?} componentId
  105722. * @param {?=} targetStatements
  105723. * @return {?}
  105724. */
  105725. function (componentId, targetStatements) {
  105726. var _this = this;
  105727. if (targetStatements === void 0) { targetStatements = []; }
  105728. this.children.forEach(function (child) { return child.build(componentId, targetStatements); });
  105729. var /** @type {?} */ viewStmts = [variable(DYNAMIC_VAR_NAME).set(NULL_EXPR).toDeclStmt(DYNAMIC_TYPE)];
  105730. var /** @type {?} */ bindingCount = 0;
  105731. this.updates.forEach(function (expression) {
  105732. var _a = _this.preprocessUpdateExpression(expression), sourceSpan = _a.sourceSpan, context = _a.context, value = _a.value;
  105733. var /** @type {?} */ bindingId = "" + bindingCount++;
  105734. var /** @type {?} */ nameResolver = context === _this.component ? _this : defaultResolver;
  105735. var _b = convertPropertyBinding(nameResolver, variable(_this.getOutputVar(context)), value, bindingId, BindingForm.General), stmts = _b.stmts, currValExpr = _b.currValExpr;
  105736. stmts.push(new ExpressionStatement(currValExpr));
  105737. viewStmts.push.apply(viewStmts, stmts.map(function (stmt) { return applySourceSpanToStatementIfNeeded(stmt, sourceSpan); }));
  105738. });
  105739. this.actions.forEach(function (_a) {
  105740. var sourceSpan = _a.sourceSpan, context = _a.context, value = _a.value;
  105741. var /** @type {?} */ bindingId = "" + bindingCount++;
  105742. var /** @type {?} */ nameResolver = context === _this.component ? _this : defaultResolver;
  105743. var stmts = convertActionBinding(nameResolver, variable(_this.getOutputVar(context)), value, bindingId).stmts;
  105744. viewStmts.push.apply(viewStmts, stmts.map(function (stmt) { return applySourceSpanToStatementIfNeeded(stmt, sourceSpan); }));
  105745. });
  105746. if (this.guards.length) {
  105747. var /** @type {?} */ guardExpression = undefined;
  105748. for (var _i = 0, _a = this.guards; _i < _a.length; _i++) {
  105749. var guard = _a[_i];
  105750. var _b = this.preprocessUpdateExpression(guard.expression), context = _b.context, value = _b.value;
  105751. var /** @type {?} */ bindingId = "" + bindingCount++;
  105752. var /** @type {?} */ nameResolver = context === this.component ? this : defaultResolver;
  105753. // We only support support simple expressions and ignore others as they
  105754. // are unlikely to affect type narrowing.
  105755. var _c = convertPropertyBinding(nameResolver, variable(this.getOutputVar(context)), value, bindingId, BindingForm.TrySimple), stmts = _c.stmts, currValExpr = _c.currValExpr;
  105756. if (stmts.length == 0) {
  105757. var /** @type {?} */ guardClause = guard.useIf ? currValExpr : this.ctx.importExpr(guard.guard).callFn([currValExpr]);
  105758. guardExpression = guardExpression ? guardExpression.and(guardClause) : guardClause;
  105759. }
  105760. }
  105761. if (guardExpression) {
  105762. viewStmts = [new IfStmt(guardExpression, viewStmts)];
  105763. }
  105764. }
  105765. var /** @type {?} */ viewName = "_View_" + componentId + "_" + this.embeddedViewIndex;
  105766. var /** @type {?} */ viewFactory = new DeclareFunctionStmt(viewName, [], viewStmts);
  105767. targetStatements.push(viewFactory);
  105768. return targetStatements;
  105769. };
  105770. /**
  105771. * @param {?} ast
  105772. * @param {?} context
  105773. * @return {?}
  105774. */
  105775. ViewBuilder.prototype.visitBoundText = /**
  105776. * @param {?} ast
  105777. * @param {?} context
  105778. * @return {?}
  105779. */
  105780. function (ast, context) {
  105781. var _this = this;
  105782. var /** @type {?} */ astWithSource = /** @type {?} */ (ast.value);
  105783. var /** @type {?} */ inter = /** @type {?} */ (astWithSource.ast);
  105784. inter.expressions.forEach(function (expr) {
  105785. return _this.updates.push({ context: _this.component, value: expr, sourceSpan: ast.sourceSpan });
  105786. });
  105787. };
  105788. /**
  105789. * @param {?} ast
  105790. * @param {?} context
  105791. * @return {?}
  105792. */
  105793. ViewBuilder.prototype.visitEmbeddedTemplate = /**
  105794. * @param {?} ast
  105795. * @param {?} context
  105796. * @return {?}
  105797. */
  105798. function (ast, context) {
  105799. this.visitElementOrTemplate(ast);
  105800. // Note: The old view compiler used to use an `any` type
  105801. // for the context in any embedded view.
  105802. // We keep this behaivor behind a flag for now.
  105803. if (this.options.fullTemplateTypeCheck) {
  105804. // Find any applicable type guards. For example, NgIf has a type guard on ngIf
  105805. // (see NgIf.ngIfTypeGuard) that can be used to indicate that a template is only
  105806. // stamped out if ngIf is truthy so any bindings in the template can assume that,
  105807. // if a nullable type is used for ngIf, that expression is not null or undefined.
  105808. var /** @type {?} */ guards = this.getTypeGuardExpressions(ast);
  105809. var /** @type {?} */ childVisitor = this.viewBuilderFactory(this, guards);
  105810. this.children.push(childVisitor);
  105811. childVisitor.visitAll(ast.variables, ast.children);
  105812. }
  105813. };
  105814. /**
  105815. * @param {?} ast
  105816. * @param {?} context
  105817. * @return {?}
  105818. */
  105819. ViewBuilder.prototype.visitElement = /**
  105820. * @param {?} ast
  105821. * @param {?} context
  105822. * @return {?}
  105823. */
  105824. function (ast, context) {
  105825. var _this = this;
  105826. this.visitElementOrTemplate(ast);
  105827. var /** @type {?} */ inputDefs = [];
  105828. var /** @type {?} */ updateRendererExpressions = [];
  105829. var /** @type {?} */ outputDefs = [];
  105830. ast.inputs.forEach(function (inputAst) {
  105831. _this.updates.push({ context: _this.component, value: inputAst.value, sourceSpan: inputAst.sourceSpan });
  105832. });
  105833. templateVisitAll(this, ast.children);
  105834. };
  105835. /**
  105836. * @param {?} ast
  105837. * @return {?}
  105838. */
  105839. ViewBuilder.prototype.visitElementOrTemplate = /**
  105840. * @param {?} ast
  105841. * @return {?}
  105842. */
  105843. function (ast) {
  105844. var _this = this;
  105845. ast.directives.forEach(function (dirAst) { _this.visitDirective(dirAst); });
  105846. ast.references.forEach(function (ref) {
  105847. var /** @type {?} */ outputVarType = /** @type {?} */ ((null));
  105848. // Note: The old view compiler used to use an `any` type
  105849. // for directives exposed via `exportAs`.
  105850. // We keep this behaivor behind a flag for now.
  105851. if (ref.value && ref.value.identifier && _this.options.fullTemplateTypeCheck) {
  105852. outputVarType = ref.value.identifier.reference;
  105853. }
  105854. else {
  105855. outputVarType = BuiltinTypeName.Dynamic;
  105856. }
  105857. _this.refOutputVars.set(ref.name, outputVarType);
  105858. });
  105859. ast.outputs.forEach(function (outputAst) {
  105860. _this.actions.push({ context: _this.component, value: outputAst.handler, sourceSpan: outputAst.sourceSpan });
  105861. });
  105862. };
  105863. /**
  105864. * @param {?} dirAst
  105865. * @return {?}
  105866. */
  105867. ViewBuilder.prototype.visitDirective = /**
  105868. * @param {?} dirAst
  105869. * @return {?}
  105870. */
  105871. function (dirAst) {
  105872. var _this = this;
  105873. var /** @type {?} */ dirType = dirAst.directive.type.reference;
  105874. dirAst.inputs.forEach(function (input) {
  105875. return _this.updates.push({ context: _this.component, value: input.value, sourceSpan: input.sourceSpan });
  105876. });
  105877. // Note: The old view compiler used to use an `any` type
  105878. // for expressions in host properties / events.
  105879. // We keep this behaivor behind a flag for now.
  105880. if (this.options.fullTemplateTypeCheck) {
  105881. dirAst.hostProperties.forEach(function (inputAst) {
  105882. return _this.updates.push({ context: dirType, value: inputAst.value, sourceSpan: inputAst.sourceSpan });
  105883. });
  105884. dirAst.hostEvents.forEach(function (hostEventAst) {
  105885. return _this.actions.push({
  105886. context: dirType,
  105887. value: hostEventAst.handler,
  105888. sourceSpan: hostEventAst.sourceSpan
  105889. });
  105890. });
  105891. }
  105892. };
  105893. /**
  105894. * @param {?} name
  105895. * @return {?}
  105896. */
  105897. ViewBuilder.prototype.getLocal = /**
  105898. * @param {?} name
  105899. * @return {?}
  105900. */
  105901. function (name) {
  105902. if (name == EventHandlerVars.event.name) {
  105903. return variable(this.getOutputVar(BuiltinTypeName.Dynamic));
  105904. }
  105905. for (var /** @type {?} */ currBuilder = this; currBuilder; currBuilder = currBuilder.parent) {
  105906. var /** @type {?} */ outputVarType = void 0;
  105907. // check references
  105908. outputVarType = currBuilder.refOutputVars.get(name);
  105909. if (outputVarType == null) {
  105910. // check variables
  105911. var /** @type {?} */ varAst = currBuilder.variables.find(function (varAst) { return varAst.name === name; });
  105912. if (varAst) {
  105913. outputVarType = BuiltinTypeName.Dynamic;
  105914. }
  105915. }
  105916. if (outputVarType != null) {
  105917. return variable(this.getOutputVar(outputVarType));
  105918. }
  105919. }
  105920. return null;
  105921. };
  105922. /**
  105923. * @param {?} name
  105924. * @return {?}
  105925. */
  105926. ViewBuilder.prototype.pipeOutputVar = /**
  105927. * @param {?} name
  105928. * @return {?}
  105929. */
  105930. function (name) {
  105931. var /** @type {?} */ pipe = this.pipes.get(name);
  105932. if (!pipe) {
  105933. throw new Error("Illegal State: Could not find pipe " + name + " in template of " + this.component);
  105934. }
  105935. return this.getOutputVar(pipe);
  105936. };
  105937. /**
  105938. * @param {?} expression
  105939. * @return {?}
  105940. */
  105941. ViewBuilder.prototype.preprocessUpdateExpression = /**
  105942. * @param {?} expression
  105943. * @return {?}
  105944. */
  105945. function (expression) {
  105946. var _this = this;
  105947. return {
  105948. sourceSpan: expression.sourceSpan,
  105949. context: expression.context,
  105950. value: convertPropertyBindingBuiltins({
  105951. createLiteralArrayConverter: function (argCount) {
  105952. return function (args) {
  105953. var /** @type {?} */ arr = literalArr(args);
  105954. // Note: The old view compiler used to use an `any` type
  105955. // for arrays.
  105956. return _this.options.fullTemplateTypeCheck ? arr : arr.cast(DYNAMIC_TYPE);
  105957. };
  105958. },
  105959. createLiteralMapConverter: function (keys) {
  105960. return function (values) {
  105961. var /** @type {?} */ entries = keys.map(function (k, i) {
  105962. return ({
  105963. key: k.key,
  105964. value: values[i],
  105965. quoted: k.quoted,
  105966. });
  105967. });
  105968. var /** @type {?} */ map = literalMap(entries);
  105969. // Note: The old view compiler used to use an `any` type
  105970. // for maps.
  105971. return _this.options.fullTemplateTypeCheck ? map : map.cast(DYNAMIC_TYPE);
  105972. };
  105973. },
  105974. createPipeConverter: function (name, argCount) {
  105975. return function (args) {
  105976. // Note: The old view compiler used to use an `any` type
  105977. // for pipes.
  105978. var /** @type {?} */ pipeExpr = _this.options.fullTemplateTypeCheck ?
  105979. variable(_this.pipeOutputVar(name)) :
  105980. variable(_this.getOutputVar(BuiltinTypeName.Dynamic));
  105981. return pipeExpr.callMethod('transform', args);
  105982. };
  105983. },
  105984. }, expression.value)
  105985. };
  105986. };
  105987. /**
  105988. * @param {?} ast
  105989. * @param {?} context
  105990. * @return {?}
  105991. */
  105992. ViewBuilder.prototype.visitNgContent = /**
  105993. * @param {?} ast
  105994. * @param {?} context
  105995. * @return {?}
  105996. */
  105997. function (ast, context) { };
  105998. /**
  105999. * @param {?} ast
  106000. * @param {?} context
  106001. * @return {?}
  106002. */
  106003. ViewBuilder.prototype.visitText = /**
  106004. * @param {?} ast
  106005. * @param {?} context
  106006. * @return {?}
  106007. */
  106008. function (ast, context) { };
  106009. /**
  106010. * @param {?} ast
  106011. * @param {?} context
  106012. * @return {?}
  106013. */
  106014. ViewBuilder.prototype.visitDirectiveProperty = /**
  106015. * @param {?} ast
  106016. * @param {?} context
  106017. * @return {?}
  106018. */
  106019. function (ast, context) { };
  106020. /**
  106021. * @param {?} ast
  106022. * @param {?} context
  106023. * @return {?}
  106024. */
  106025. ViewBuilder.prototype.visitReference = /**
  106026. * @param {?} ast
  106027. * @param {?} context
  106028. * @return {?}
  106029. */
  106030. function (ast, context) { };
  106031. /**
  106032. * @param {?} ast
  106033. * @param {?} context
  106034. * @return {?}
  106035. */
  106036. ViewBuilder.prototype.visitVariable = /**
  106037. * @param {?} ast
  106038. * @param {?} context
  106039. * @return {?}
  106040. */
  106041. function (ast, context) { };
  106042. /**
  106043. * @param {?} ast
  106044. * @param {?} context
  106045. * @return {?}
  106046. */
  106047. ViewBuilder.prototype.visitEvent = /**
  106048. * @param {?} ast
  106049. * @param {?} context
  106050. * @return {?}
  106051. */
  106052. function (ast, context) { };
  106053. /**
  106054. * @param {?} ast
  106055. * @param {?} context
  106056. * @return {?}
  106057. */
  106058. ViewBuilder.prototype.visitElementProperty = /**
  106059. * @param {?} ast
  106060. * @param {?} context
  106061. * @return {?}
  106062. */
  106063. function (ast, context) { };
  106064. /**
  106065. * @param {?} ast
  106066. * @param {?} context
  106067. * @return {?}
  106068. */
  106069. ViewBuilder.prototype.visitAttr = /**
  106070. * @param {?} ast
  106071. * @param {?} context
  106072. * @return {?}
  106073. */
  106074. function (ast, context) { };
  106075. return ViewBuilder;
  106076. }());
  106077. /**
  106078. * @fileoverview added by tsickle
  106079. * @suppress {checkTypes} checked by tsc
  106080. */
  106081. /**
  106082. * @license
  106083. * Copyright Google Inc. All Rights Reserved.
  106084. *
  106085. * Use of this source code is governed by an MIT-style license that can be
  106086. * found in the LICENSE file at https://angular.io/license
  106087. */
  106088. var CLASS_ATTR$1 = 'class';
  106089. var STYLE_ATTR = 'style';
  106090. var IMPLICIT_TEMPLATE_VAR = '\$implicit';
  106091. var ViewCompileResult = /** @class */ (function () {
  106092. function ViewCompileResult(viewClassVar, rendererTypeVar) {
  106093. this.viewClassVar = viewClassVar;
  106094. this.rendererTypeVar = rendererTypeVar;
  106095. }
  106096. return ViewCompileResult;
  106097. }());
  106098. var ViewCompiler = /** @class */ (function () {
  106099. function ViewCompiler(_reflector) {
  106100. this._reflector = _reflector;
  106101. }
  106102. /**
  106103. * @param {?} outputCtx
  106104. * @param {?} component
  106105. * @param {?} template
  106106. * @param {?} styles
  106107. * @param {?} usedPipes
  106108. * @return {?}
  106109. */
  106110. ViewCompiler.prototype.compileComponent = /**
  106111. * @param {?} outputCtx
  106112. * @param {?} component
  106113. * @param {?} template
  106114. * @param {?} styles
  106115. * @param {?} usedPipes
  106116. * @return {?}
  106117. */
  106118. function (outputCtx, component, template, styles, usedPipes) {
  106119. var _this = this;
  106120. var /** @type {?} */ embeddedViewCount = 0;
  106121. var /** @type {?} */ staticQueryIds = findStaticQueryIds(template);
  106122. var /** @type {?} */ renderComponentVarName = /** @type {?} */ ((undefined));
  106123. if (!component.isHost) {
  106124. var /** @type {?} */ template_1 = /** @type {?} */ ((component.template));
  106125. var /** @type {?} */ customRenderData = [];
  106126. if (template_1.animations && template_1.animations.length) {
  106127. customRenderData.push(new LiteralMapEntry('animation', convertValueToOutputAst(outputCtx, template_1.animations), true));
  106128. }
  106129. var /** @type {?} */ renderComponentVar = variable(rendererTypeName(component.type.reference));
  106130. renderComponentVarName = /** @type {?} */ ((renderComponentVar.name));
  106131. outputCtx.statements.push(renderComponentVar
  106132. .set(importExpr(Identifiers.createRendererType2).callFn([new LiteralMapExpr([
  106133. new LiteralMapEntry('encapsulation', literal(template_1.encapsulation), false),
  106134. new LiteralMapEntry('styles', styles, false),
  106135. new LiteralMapEntry('data', new LiteralMapExpr(customRenderData), false)
  106136. ])]))
  106137. .toDeclStmt(importType(Identifiers.RendererType2), [StmtModifier.Final, StmtModifier.Exported]));
  106138. }
  106139. var /** @type {?} */ viewBuilderFactory = function (parent) {
  106140. var /** @type {?} */ embeddedViewIndex = embeddedViewCount++;
  106141. return new ViewBuilder$1(_this._reflector, outputCtx, parent, component, embeddedViewIndex, usedPipes, staticQueryIds, viewBuilderFactory);
  106142. };
  106143. var /** @type {?} */ visitor = viewBuilderFactory(null);
  106144. visitor.visitAll([], template);
  106145. (_a = outputCtx.statements).push.apply(_a, visitor.build());
  106146. return new ViewCompileResult(visitor.viewName, renderComponentVarName);
  106147. var _a;
  106148. };
  106149. return ViewCompiler;
  106150. }());
  106151. var LOG_VAR$1 = variable('_l');
  106152. var VIEW_VAR = variable('_v');
  106153. var CHECK_VAR = variable('_ck');
  106154. var COMP_VAR = variable('_co');
  106155. var EVENT_NAME_VAR = variable('en');
  106156. var ALLOW_DEFAULT_VAR = variable("ad");
  106157. var ViewBuilder$1 = /** @class */ (function () {
  106158. function ViewBuilder(reflector, outputCtx, parent, component, embeddedViewIndex, usedPipes, staticQueryIds, viewBuilderFactory) {
  106159. this.reflector = reflector;
  106160. this.outputCtx = outputCtx;
  106161. this.parent = parent;
  106162. this.component = component;
  106163. this.embeddedViewIndex = embeddedViewIndex;
  106164. this.usedPipes = usedPipes;
  106165. this.staticQueryIds = staticQueryIds;
  106166. this.viewBuilderFactory = viewBuilderFactory;
  106167. this.nodes = [];
  106168. this.purePipeNodeIndices = Object.create(null);
  106169. this.refNodeIndices = Object.create(null);
  106170. this.variables = [];
  106171. this.children = [];
  106172. // TODO(tbosch): The old view compiler used to use an `any` type
  106173. // for the context in any embedded view. We keep this behaivor for now
  106174. // to be able to introduce the new view compiler without too many errors.
  106175. this.compType = this.embeddedViewIndex > 0 ?
  106176. DYNAMIC_TYPE : /** @type {?} */
  106177. ((expressionType(outputCtx.importExpr(this.component.type.reference))));
  106178. this.viewName = viewClassName(this.component.type.reference, this.embeddedViewIndex);
  106179. }
  106180. /**
  106181. * @param {?} variables
  106182. * @param {?} astNodes
  106183. * @return {?}
  106184. */
  106185. ViewBuilder.prototype.visitAll = /**
  106186. * @param {?} variables
  106187. * @param {?} astNodes
  106188. * @return {?}
  106189. */
  106190. function (variables, astNodes) {
  106191. var _this = this;
  106192. this.variables = variables;
  106193. // create the pipes for the pure pipes immediately, so that we know their indices.
  106194. if (!this.parent) {
  106195. this.usedPipes.forEach(function (pipe) {
  106196. if (pipe.pure) {
  106197. _this.purePipeNodeIndices[pipe.name] = _this._createPipe(null, pipe);
  106198. }
  106199. });
  106200. }
  106201. if (!this.parent) {
  106202. var /** @type {?} */ queryIds_1 = staticViewQueryIds(this.staticQueryIds);
  106203. this.component.viewQueries.forEach(function (query, queryIndex) {
  106204. // Note: queries start with id 1 so we can use the number in a Bloom filter!
  106205. var /** @type {?} */ queryId = queryIndex + 1;
  106206. var /** @type {?} */ bindingType = query.first ? 0 /* First */ : 1;
  106207. var /** @type {?} */ flags = 134217728 /* TypeViewQuery */ | calcStaticDynamicQueryFlags(queryIds_1, queryId, query.first);
  106208. _this.nodes.push(function () {
  106209. return ({
  106210. sourceSpan: null,
  106211. nodeFlags: flags,
  106212. nodeDef: importExpr(Identifiers.queryDef).callFn([
  106213. literal(flags), literal(queryId),
  106214. new LiteralMapExpr([new LiteralMapEntry(query.propertyName, literal(bindingType), false)])
  106215. ])
  106216. });
  106217. });
  106218. });
  106219. }
  106220. templateVisitAll(this, astNodes);
  106221. if (this.parent && (astNodes.length === 0 || needsAdditionalRootNode(astNodes))) {
  106222. // if the view is an embedded view, then we need to add an additional root node in some cases
  106223. this.nodes.push(function () {
  106224. return ({
  106225. sourceSpan: null,
  106226. nodeFlags: 1 /* TypeElement */,
  106227. nodeDef: importExpr(Identifiers.anchorDef).callFn([
  106228. literal(0 /* None */), NULL_EXPR, NULL_EXPR, literal(0)
  106229. ])
  106230. });
  106231. });
  106232. }
  106233. };
  106234. /**
  106235. * @param {?=} targetStatements
  106236. * @return {?}
  106237. */
  106238. ViewBuilder.prototype.build = /**
  106239. * @param {?=} targetStatements
  106240. * @return {?}
  106241. */
  106242. function (targetStatements) {
  106243. if (targetStatements === void 0) { targetStatements = []; }
  106244. this.children.forEach(function (child) { return child.build(targetStatements); });
  106245. var _a = this._createNodeExpressions(), updateRendererStmts = _a.updateRendererStmts, updateDirectivesStmts = _a.updateDirectivesStmts, nodeDefExprs = _a.nodeDefExprs;
  106246. var /** @type {?} */ updateRendererFn = this._createUpdateFn(updateRendererStmts);
  106247. var /** @type {?} */ updateDirectivesFn = this._createUpdateFn(updateDirectivesStmts);
  106248. var /** @type {?} */ viewFlags = 0;
  106249. if (!this.parent && this.component.changeDetection === ChangeDetectionStrategy.OnPush) {
  106250. viewFlags |= 2 /* OnPush */;
  106251. }
  106252. var /** @type {?} */ viewFactory = new DeclareFunctionStmt(this.viewName, [new FnParam(/** @type {?} */ ((LOG_VAR$1.name)))], [new ReturnStatement(importExpr(Identifiers.viewDef).callFn([
  106253. literal(viewFlags),
  106254. literalArr(nodeDefExprs),
  106255. updateDirectivesFn,
  106256. updateRendererFn,
  106257. ]))], importType(Identifiers.ViewDefinition), this.embeddedViewIndex === 0 ? [StmtModifier.Exported] : []);
  106258. targetStatements.push(viewFactory);
  106259. return targetStatements;
  106260. };
  106261. /**
  106262. * @param {?} updateStmts
  106263. * @return {?}
  106264. */
  106265. ViewBuilder.prototype._createUpdateFn = /**
  106266. * @param {?} updateStmts
  106267. * @return {?}
  106268. */
  106269. function (updateStmts) {
  106270. var /** @type {?} */ updateFn;
  106271. if (updateStmts.length > 0) {
  106272. var /** @type {?} */ preStmts = [];
  106273. if (!this.component.isHost && findReadVarNames(updateStmts).has(/** @type {?} */ ((COMP_VAR.name)))) {
  106274. preStmts.push(COMP_VAR.set(VIEW_VAR.prop('component')).toDeclStmt(this.compType));
  106275. }
  106276. updateFn = fn([
  106277. new FnParam(/** @type {?} */ ((CHECK_VAR.name)), INFERRED_TYPE),
  106278. new FnParam(/** @type {?} */ ((VIEW_VAR.name)), INFERRED_TYPE)
  106279. ], preStmts.concat(updateStmts), INFERRED_TYPE);
  106280. }
  106281. else {
  106282. updateFn = NULL_EXPR;
  106283. }
  106284. return updateFn;
  106285. };
  106286. /**
  106287. * @param {?} ast
  106288. * @param {?} context
  106289. * @return {?}
  106290. */
  106291. ViewBuilder.prototype.visitNgContent = /**
  106292. * @param {?} ast
  106293. * @param {?} context
  106294. * @return {?}
  106295. */
  106296. function (ast, context) {
  106297. // ngContentDef(ngContentIndex: number, index: number): NodeDef;
  106298. this.nodes.push(function () {
  106299. return ({
  106300. sourceSpan: ast.sourceSpan,
  106301. nodeFlags: 8 /* TypeNgContent */,
  106302. nodeDef: importExpr(Identifiers.ngContentDef).callFn([
  106303. literal(ast.ngContentIndex), literal(ast.index)
  106304. ])
  106305. });
  106306. });
  106307. };
  106308. /**
  106309. * @param {?} ast
  106310. * @param {?} context
  106311. * @return {?}
  106312. */
  106313. ViewBuilder.prototype.visitText = /**
  106314. * @param {?} ast
  106315. * @param {?} context
  106316. * @return {?}
  106317. */
  106318. function (ast, context) {
  106319. // Static text nodes have no check function
  106320. var /** @type {?} */ checkIndex = -1;
  106321. this.nodes.push(function () {
  106322. return ({
  106323. sourceSpan: ast.sourceSpan,
  106324. nodeFlags: 2 /* TypeText */,
  106325. nodeDef: importExpr(Identifiers.textDef).callFn([
  106326. literal(checkIndex),
  106327. literal(ast.ngContentIndex),
  106328. literalArr([literal(ast.value)]),
  106329. ])
  106330. });
  106331. });
  106332. };
  106333. /**
  106334. * @param {?} ast
  106335. * @param {?} context
  106336. * @return {?}
  106337. */
  106338. ViewBuilder.prototype.visitBoundText = /**
  106339. * @param {?} ast
  106340. * @param {?} context
  106341. * @return {?}
  106342. */
  106343. function (ast, context) {
  106344. var _this = this;
  106345. var /** @type {?} */ nodeIndex = this.nodes.length;
  106346. // reserve the space in the nodeDefs array
  106347. this.nodes.push(/** @type {?} */ ((null)));
  106348. var /** @type {?} */ astWithSource = /** @type {?} */ (ast.value);
  106349. var /** @type {?} */ inter = /** @type {?} */ (astWithSource.ast);
  106350. var /** @type {?} */ updateRendererExpressions = inter.expressions.map(function (expr, bindingIndex) {
  106351. return _this._preprocessUpdateExpression({ nodeIndex: nodeIndex, bindingIndex: bindingIndex, sourceSpan: ast.sourceSpan, context: COMP_VAR, value: expr });
  106352. });
  106353. // Check index is the same as the node index during compilation
  106354. // They might only differ at runtime
  106355. var /** @type {?} */ checkIndex = nodeIndex;
  106356. this.nodes[nodeIndex] = function () {
  106357. return ({
  106358. sourceSpan: ast.sourceSpan,
  106359. nodeFlags: 2 /* TypeText */,
  106360. nodeDef: importExpr(Identifiers.textDef).callFn([
  106361. literal(checkIndex),
  106362. literal(ast.ngContentIndex),
  106363. literalArr(inter.strings.map(function (s) { return literal(s); })),
  106364. ]),
  106365. updateRenderer: updateRendererExpressions
  106366. });
  106367. };
  106368. };
  106369. /**
  106370. * @param {?} ast
  106371. * @param {?} context
  106372. * @return {?}
  106373. */
  106374. ViewBuilder.prototype.visitEmbeddedTemplate = /**
  106375. * @param {?} ast
  106376. * @param {?} context
  106377. * @return {?}
  106378. */
  106379. function (ast, context) {
  106380. var _this = this;
  106381. var /** @type {?} */ nodeIndex = this.nodes.length;
  106382. // reserve the space in the nodeDefs array
  106383. this.nodes.push(/** @type {?} */ ((null)));
  106384. var _a = this._visitElementOrTemplate(nodeIndex, ast), flags = _a.flags, queryMatchesExpr = _a.queryMatchesExpr, hostEvents = _a.hostEvents;
  106385. var /** @type {?} */ childVisitor = this.viewBuilderFactory(this);
  106386. this.children.push(childVisitor);
  106387. childVisitor.visitAll(ast.variables, ast.children);
  106388. var /** @type {?} */ childCount = this.nodes.length - nodeIndex - 1;
  106389. // anchorDef(
  106390. // flags: NodeFlags, matchedQueries: [string, QueryValueType][], ngContentIndex: number,
  106391. // childCount: number, handleEventFn?: ElementHandleEventFn, templateFactory?:
  106392. // ViewDefinitionFactory): NodeDef;
  106393. this.nodes[nodeIndex] = function () {
  106394. return ({
  106395. sourceSpan: ast.sourceSpan,
  106396. nodeFlags: 1 /* TypeElement */ | flags,
  106397. nodeDef: importExpr(Identifiers.anchorDef).callFn([
  106398. literal(flags),
  106399. queryMatchesExpr,
  106400. literal(ast.ngContentIndex),
  106401. literal(childCount),
  106402. _this._createElementHandleEventFn(nodeIndex, hostEvents),
  106403. variable(childVisitor.viewName),
  106404. ])
  106405. });
  106406. };
  106407. };
  106408. /**
  106409. * @param {?} ast
  106410. * @param {?} context
  106411. * @return {?}
  106412. */
  106413. ViewBuilder.prototype.visitElement = /**
  106414. * @param {?} ast
  106415. * @param {?} context
  106416. * @return {?}
  106417. */
  106418. function (ast, context) {
  106419. var _this = this;
  106420. var /** @type {?} */ nodeIndex = this.nodes.length;
  106421. // reserve the space in the nodeDefs array so we can add children
  106422. this.nodes.push(/** @type {?} */ ((null)));
  106423. // Using a null element name creates an anchor.
  106424. var /** @type {?} */ elName = isNgContainer(ast.name) ? null : ast.name;
  106425. var _a = this._visitElementOrTemplate(nodeIndex, ast), flags = _a.flags, usedEvents = _a.usedEvents, queryMatchesExpr = _a.queryMatchesExpr, dirHostBindings = _a.hostBindings, hostEvents = _a.hostEvents;
  106426. var /** @type {?} */ inputDefs = [];
  106427. var /** @type {?} */ updateRendererExpressions = [];
  106428. var /** @type {?} */ outputDefs = [];
  106429. if (elName) {
  106430. var /** @type {?} */ hostBindings = ast.inputs
  106431. .map(function (inputAst) {
  106432. return ({
  106433. context: /** @type {?} */ (COMP_VAR),
  106434. inputAst: inputAst,
  106435. dirAst: /** @type {?} */ (null),
  106436. });
  106437. })
  106438. .concat(dirHostBindings);
  106439. if (hostBindings.length) {
  106440. updateRendererExpressions =
  106441. hostBindings.map(function (hostBinding, bindingIndex) {
  106442. return _this._preprocessUpdateExpression({
  106443. context: hostBinding.context,
  106444. nodeIndex: nodeIndex,
  106445. bindingIndex: bindingIndex,
  106446. sourceSpan: hostBinding.inputAst.sourceSpan,
  106447. value: hostBinding.inputAst.value
  106448. });
  106449. });
  106450. inputDefs = hostBindings.map(function (hostBinding) { return elementBindingDef(hostBinding.inputAst, hostBinding.dirAst); });
  106451. }
  106452. outputDefs = usedEvents.map(function (_a) {
  106453. var target = _a[0], eventName = _a[1];
  106454. return literalArr([literal(target), literal(eventName)]);
  106455. });
  106456. }
  106457. templateVisitAll(this, ast.children);
  106458. var /** @type {?} */ childCount = this.nodes.length - nodeIndex - 1;
  106459. var /** @type {?} */ compAst = ast.directives.find(function (dirAst) { return dirAst.directive.isComponent; });
  106460. var /** @type {?} */ compRendererType = /** @type {?} */ (NULL_EXPR);
  106461. var /** @type {?} */ compView = /** @type {?} */ (NULL_EXPR);
  106462. if (compAst) {
  106463. compView = this.outputCtx.importExpr(compAst.directive.componentViewType);
  106464. compRendererType = this.outputCtx.importExpr(compAst.directive.rendererType);
  106465. }
  106466. // Check index is the same as the node index during compilation
  106467. // They might only differ at runtime
  106468. var /** @type {?} */ checkIndex = nodeIndex;
  106469. this.nodes[nodeIndex] = function () {
  106470. return ({
  106471. sourceSpan: ast.sourceSpan,
  106472. nodeFlags: 1 /* TypeElement */ | flags,
  106473. nodeDef: importExpr(Identifiers.elementDef).callFn([
  106474. literal(checkIndex),
  106475. literal(flags),
  106476. queryMatchesExpr,
  106477. literal(ast.ngContentIndex),
  106478. literal(childCount),
  106479. literal(elName),
  106480. elName ? fixedAttrsDef(ast) : NULL_EXPR,
  106481. inputDefs.length ? literalArr(inputDefs) : NULL_EXPR,
  106482. outputDefs.length ? literalArr(outputDefs) : NULL_EXPR,
  106483. _this._createElementHandleEventFn(nodeIndex, hostEvents),
  106484. compView,
  106485. compRendererType,
  106486. ]),
  106487. updateRenderer: updateRendererExpressions
  106488. });
  106489. };
  106490. };
  106491. /**
  106492. * @param {?} nodeIndex
  106493. * @param {?} ast
  106494. * @return {?}
  106495. */
  106496. ViewBuilder.prototype._visitElementOrTemplate = /**
  106497. * @param {?} nodeIndex
  106498. * @param {?} ast
  106499. * @return {?}
  106500. */
  106501. function (nodeIndex, ast) {
  106502. var _this = this;
  106503. var /** @type {?} */ flags = 0;
  106504. if (ast.hasViewContainer) {
  106505. flags |= 16777216 /* EmbeddedViews */;
  106506. }
  106507. var /** @type {?} */ usedEvents = new Map();
  106508. ast.outputs.forEach(function (event) {
  106509. var _a = elementEventNameAndTarget(event, null), name = _a.name, target = _a.target;
  106510. usedEvents.set(elementEventFullName(target, name), [target, name]);
  106511. });
  106512. ast.directives.forEach(function (dirAst) {
  106513. dirAst.hostEvents.forEach(function (event) {
  106514. var _a = elementEventNameAndTarget(event, dirAst), name = _a.name, target = _a.target;
  106515. usedEvents.set(elementEventFullName(target, name), [target, name]);
  106516. });
  106517. });
  106518. var /** @type {?} */ hostBindings = [];
  106519. var /** @type {?} */ hostEvents = [];
  106520. this._visitComponentFactoryResolverProvider(ast.directives);
  106521. ast.providers.forEach(function (providerAst, providerIndex) {
  106522. var /** @type {?} */ dirAst = /** @type {?} */ ((undefined));
  106523. var /** @type {?} */ dirIndex = /** @type {?} */ ((undefined));
  106524. ast.directives.forEach(function (localDirAst, i) {
  106525. if (localDirAst.directive.type.reference === tokenReference(providerAst.token)) {
  106526. dirAst = localDirAst;
  106527. dirIndex = i;
  106528. }
  106529. });
  106530. if (dirAst) {
  106531. var _a = _this._visitDirective(providerAst, dirAst, dirIndex, nodeIndex, ast.references, ast.queryMatches, usedEvents, /** @type {?} */ ((_this.staticQueryIds.get(/** @type {?} */ (ast))))), dirHostBindings = _a.hostBindings, dirHostEvents = _a.hostEvents;
  106532. hostBindings.push.apply(hostBindings, dirHostBindings);
  106533. hostEvents.push.apply(hostEvents, dirHostEvents);
  106534. }
  106535. else {
  106536. _this._visitProvider(providerAst, ast.queryMatches);
  106537. }
  106538. });
  106539. var /** @type {?} */ queryMatchExprs = [];
  106540. ast.queryMatches.forEach(function (match) {
  106541. var /** @type {?} */ valueType = /** @type {?} */ ((undefined));
  106542. if (tokenReference(match.value) ===
  106543. _this.reflector.resolveExternalReference(Identifiers.ElementRef)) {
  106544. valueType = 0 /* ElementRef */;
  106545. }
  106546. else if (tokenReference(match.value) ===
  106547. _this.reflector.resolveExternalReference(Identifiers.ViewContainerRef)) {
  106548. valueType = 3 /* ViewContainerRef */;
  106549. }
  106550. else if (tokenReference(match.value) ===
  106551. _this.reflector.resolveExternalReference(Identifiers.TemplateRef)) {
  106552. valueType = 2 /* TemplateRef */;
  106553. }
  106554. if (valueType != null) {
  106555. queryMatchExprs.push(literalArr([literal(match.queryId), literal(valueType)]));
  106556. }
  106557. });
  106558. ast.references.forEach(function (ref) {
  106559. var /** @type {?} */ valueType = /** @type {?} */ ((undefined));
  106560. if (!ref.value) {
  106561. valueType = 1 /* RenderElement */;
  106562. }
  106563. else if (tokenReference(ref.value) ===
  106564. _this.reflector.resolveExternalReference(Identifiers.TemplateRef)) {
  106565. valueType = 2 /* TemplateRef */;
  106566. }
  106567. if (valueType != null) {
  106568. _this.refNodeIndices[ref.name] = nodeIndex;
  106569. queryMatchExprs.push(literalArr([literal(ref.name), literal(valueType)]));
  106570. }
  106571. });
  106572. ast.outputs.forEach(function (outputAst) {
  106573. hostEvents.push({ context: COMP_VAR, eventAst: outputAst, dirAst: /** @type {?} */ ((null)) });
  106574. });
  106575. return {
  106576. flags: flags,
  106577. usedEvents: Array.from(usedEvents.values()),
  106578. queryMatchesExpr: queryMatchExprs.length ? literalArr(queryMatchExprs) : NULL_EXPR,
  106579. hostBindings: hostBindings,
  106580. hostEvents: hostEvents
  106581. };
  106582. };
  106583. /**
  106584. * @param {?} providerAst
  106585. * @param {?} dirAst
  106586. * @param {?} directiveIndex
  106587. * @param {?} elementNodeIndex
  106588. * @param {?} refs
  106589. * @param {?} queryMatches
  106590. * @param {?} usedEvents
  106591. * @param {?} queryIds
  106592. * @return {?}
  106593. */
  106594. ViewBuilder.prototype._visitDirective = /**
  106595. * @param {?} providerAst
  106596. * @param {?} dirAst
  106597. * @param {?} directiveIndex
  106598. * @param {?} elementNodeIndex
  106599. * @param {?} refs
  106600. * @param {?} queryMatches
  106601. * @param {?} usedEvents
  106602. * @param {?} queryIds
  106603. * @return {?}
  106604. */
  106605. function (providerAst, dirAst, directiveIndex, elementNodeIndex, refs, queryMatches, usedEvents, queryIds) {
  106606. var _this = this;
  106607. var /** @type {?} */ nodeIndex = this.nodes.length;
  106608. // reserve the space in the nodeDefs array so we can add children
  106609. this.nodes.push(/** @type {?} */ ((null)));
  106610. dirAst.directive.queries.forEach(function (query, queryIndex) {
  106611. var /** @type {?} */ queryId = dirAst.contentQueryStartId + queryIndex;
  106612. var /** @type {?} */ flags = 67108864 /* TypeContentQuery */ | calcStaticDynamicQueryFlags(queryIds, queryId, query.first);
  106613. var /** @type {?} */ bindingType = query.first ? 0 /* First */ : 1;
  106614. _this.nodes.push(function () {
  106615. return ({
  106616. sourceSpan: dirAst.sourceSpan,
  106617. nodeFlags: flags,
  106618. nodeDef: importExpr(Identifiers.queryDef).callFn([
  106619. literal(flags), literal(queryId),
  106620. new LiteralMapExpr([new LiteralMapEntry(query.propertyName, literal(bindingType), false)])
  106621. ]),
  106622. });
  106623. });
  106624. });
  106625. // Note: the operation below might also create new nodeDefs,
  106626. // but we don't want them to be a child of a directive,
  106627. // as they might be a provider/pipe on their own.
  106628. // I.e. we only allow queries as children of directives nodes.
  106629. var /** @type {?} */ childCount = this.nodes.length - nodeIndex - 1;
  106630. var _a = this._visitProviderOrDirective(providerAst, queryMatches), flags = _a.flags, queryMatchExprs = _a.queryMatchExprs, providerExpr = _a.providerExpr, depsExpr = _a.depsExpr;
  106631. refs.forEach(function (ref) {
  106632. if (ref.value && tokenReference(ref.value) === tokenReference(providerAst.token)) {
  106633. _this.refNodeIndices[ref.name] = nodeIndex;
  106634. queryMatchExprs.push(literalArr([literal(ref.name), literal(4 /* Provider */)]));
  106635. }
  106636. });
  106637. if (dirAst.directive.isComponent) {
  106638. flags |= 32768 /* Component */;
  106639. }
  106640. var /** @type {?} */ inputDefs = dirAst.inputs.map(function (inputAst, inputIndex) {
  106641. var /** @type {?} */ mapValue = literalArr([literal(inputIndex), literal(inputAst.directiveName)]);
  106642. // Note: it's important to not quote the key so that we can capture renames by minifiers!
  106643. return new LiteralMapEntry(inputAst.directiveName, mapValue, false);
  106644. });
  106645. var /** @type {?} */ outputDefs = [];
  106646. var /** @type {?} */ dirMeta = dirAst.directive;
  106647. Object.keys(dirMeta.outputs).forEach(function (propName) {
  106648. var /** @type {?} */ eventName = dirMeta.outputs[propName];
  106649. if (usedEvents.has(eventName)) {
  106650. // Note: it's important to not quote the key so that we can capture renames by minifiers!
  106651. outputDefs.push(new LiteralMapEntry(propName, literal(eventName), false));
  106652. }
  106653. });
  106654. var /** @type {?} */ updateDirectiveExpressions = [];
  106655. if (dirAst.inputs.length || (flags & (262144 /* DoCheck */ | 65536 /* OnInit */)) > 0) {
  106656. updateDirectiveExpressions =
  106657. dirAst.inputs.map(function (input, bindingIndex) {
  106658. return _this._preprocessUpdateExpression({
  106659. nodeIndex: nodeIndex,
  106660. bindingIndex: bindingIndex,
  106661. sourceSpan: input.sourceSpan,
  106662. context: COMP_VAR,
  106663. value: input.value
  106664. });
  106665. });
  106666. }
  106667. var /** @type {?} */ dirContextExpr = importExpr(Identifiers.nodeValue).callFn([VIEW_VAR, literal(nodeIndex)]);
  106668. var /** @type {?} */ hostBindings = dirAst.hostProperties.map(function (inputAst) {
  106669. return ({
  106670. context: dirContextExpr,
  106671. dirAst: dirAst,
  106672. inputAst: inputAst,
  106673. });
  106674. });
  106675. var /** @type {?} */ hostEvents = dirAst.hostEvents.map(function (hostEventAst) {
  106676. return ({
  106677. context: dirContextExpr,
  106678. eventAst: hostEventAst, dirAst: dirAst,
  106679. });
  106680. });
  106681. // Check index is the same as the node index during compilation
  106682. // They might only differ at runtime
  106683. var /** @type {?} */ checkIndex = nodeIndex;
  106684. this.nodes[nodeIndex] = function () {
  106685. return ({
  106686. sourceSpan: dirAst.sourceSpan,
  106687. nodeFlags: 16384 /* TypeDirective */ | flags,
  106688. nodeDef: importExpr(Identifiers.directiveDef).callFn([
  106689. literal(checkIndex),
  106690. literal(flags),
  106691. queryMatchExprs.length ? literalArr(queryMatchExprs) : NULL_EXPR,
  106692. literal(childCount),
  106693. providerExpr,
  106694. depsExpr,
  106695. inputDefs.length ? new LiteralMapExpr(inputDefs) : NULL_EXPR,
  106696. outputDefs.length ? new LiteralMapExpr(outputDefs) : NULL_EXPR,
  106697. ]),
  106698. updateDirectives: updateDirectiveExpressions,
  106699. directive: dirAst.directive.type,
  106700. });
  106701. };
  106702. return { hostBindings: hostBindings, hostEvents: hostEvents };
  106703. };
  106704. /**
  106705. * @param {?} providerAst
  106706. * @param {?} queryMatches
  106707. * @return {?}
  106708. */
  106709. ViewBuilder.prototype._visitProvider = /**
  106710. * @param {?} providerAst
  106711. * @param {?} queryMatches
  106712. * @return {?}
  106713. */
  106714. function (providerAst, queryMatches) {
  106715. this._addProviderNode(this._visitProviderOrDirective(providerAst, queryMatches));
  106716. };
  106717. /**
  106718. * @param {?} directives
  106719. * @return {?}
  106720. */
  106721. ViewBuilder.prototype._visitComponentFactoryResolverProvider = /**
  106722. * @param {?} directives
  106723. * @return {?}
  106724. */
  106725. function (directives) {
  106726. var /** @type {?} */ componentDirMeta = directives.find(function (dirAst) { return dirAst.directive.isComponent; });
  106727. if (componentDirMeta && componentDirMeta.directive.entryComponents.length) {
  106728. var _a = componentFactoryResolverProviderDef(this.reflector, this.outputCtx, 8192 /* PrivateProvider */, componentDirMeta.directive.entryComponents), providerExpr = _a.providerExpr, depsExpr = _a.depsExpr, flags = _a.flags, tokenExpr = _a.tokenExpr;
  106729. this._addProviderNode({
  106730. providerExpr: providerExpr,
  106731. depsExpr: depsExpr,
  106732. flags: flags,
  106733. tokenExpr: tokenExpr,
  106734. queryMatchExprs: [],
  106735. sourceSpan: componentDirMeta.sourceSpan
  106736. });
  106737. }
  106738. };
  106739. /**
  106740. * @param {?} data
  106741. * @return {?}
  106742. */
  106743. ViewBuilder.prototype._addProviderNode = /**
  106744. * @param {?} data
  106745. * @return {?}
  106746. */
  106747. function (data) {
  106748. var /** @type {?} */ nodeIndex = this.nodes.length;
  106749. // providerDef(
  106750. // flags: NodeFlags, matchedQueries: [string, QueryValueType][], token:any,
  106751. // value: any, deps: ([DepFlags, any] | any)[]): NodeDef;
  106752. this.nodes.push(function () {
  106753. return ({
  106754. sourceSpan: data.sourceSpan,
  106755. nodeFlags: data.flags,
  106756. nodeDef: importExpr(Identifiers.providerDef).callFn([
  106757. literal(data.flags),
  106758. data.queryMatchExprs.length ? literalArr(data.queryMatchExprs) : NULL_EXPR,
  106759. data.tokenExpr, data.providerExpr, data.depsExpr
  106760. ])
  106761. });
  106762. });
  106763. };
  106764. /**
  106765. * @param {?} providerAst
  106766. * @param {?} queryMatches
  106767. * @return {?}
  106768. */
  106769. ViewBuilder.prototype._visitProviderOrDirective = /**
  106770. * @param {?} providerAst
  106771. * @param {?} queryMatches
  106772. * @return {?}
  106773. */
  106774. function (providerAst, queryMatches) {
  106775. var /** @type {?} */ flags = 0;
  106776. var /** @type {?} */ queryMatchExprs = [];
  106777. queryMatches.forEach(function (match) {
  106778. if (tokenReference(match.value) === tokenReference(providerAst.token)) {
  106779. queryMatchExprs.push(literalArr([literal(match.queryId), literal(4 /* Provider */)]));
  106780. }
  106781. });
  106782. var _a = providerDef(this.outputCtx, providerAst), providerExpr = _a.providerExpr, depsExpr = _a.depsExpr, providerFlags = _a.flags, tokenExpr = _a.tokenExpr;
  106783. return {
  106784. flags: flags | providerFlags,
  106785. queryMatchExprs: queryMatchExprs,
  106786. providerExpr: providerExpr,
  106787. depsExpr: depsExpr,
  106788. tokenExpr: tokenExpr,
  106789. sourceSpan: providerAst.sourceSpan
  106790. };
  106791. };
  106792. /**
  106793. * @param {?} name
  106794. * @return {?}
  106795. */
  106796. ViewBuilder.prototype.getLocal = /**
  106797. * @param {?} name
  106798. * @return {?}
  106799. */
  106800. function (name) {
  106801. if (name == EventHandlerVars.event.name) {
  106802. return EventHandlerVars.event;
  106803. }
  106804. var /** @type {?} */ currViewExpr = VIEW_VAR;
  106805. for (var /** @type {?} */ currBuilder = this; currBuilder; currBuilder = currBuilder.parent,
  106806. currViewExpr = currViewExpr.prop('parent').cast(DYNAMIC_TYPE)) {
  106807. // check references
  106808. var /** @type {?} */ refNodeIndex = currBuilder.refNodeIndices[name];
  106809. if (refNodeIndex != null) {
  106810. return importExpr(Identifiers.nodeValue).callFn([currViewExpr, literal(refNodeIndex)]);
  106811. }
  106812. // check variables
  106813. var /** @type {?} */ varAst = currBuilder.variables.find(function (varAst) { return varAst.name === name; });
  106814. if (varAst) {
  106815. var /** @type {?} */ varValue = varAst.value || IMPLICIT_TEMPLATE_VAR;
  106816. return currViewExpr.prop('context').prop(varValue);
  106817. }
  106818. }
  106819. return null;
  106820. };
  106821. /**
  106822. * @param {?} sourceSpan
  106823. * @param {?} argCount
  106824. * @return {?}
  106825. */
  106826. ViewBuilder.prototype._createLiteralArrayConverter = /**
  106827. * @param {?} sourceSpan
  106828. * @param {?} argCount
  106829. * @return {?}
  106830. */
  106831. function (sourceSpan, argCount) {
  106832. if (argCount === 0) {
  106833. var /** @type {?} */ valueExpr_1 = importExpr(Identifiers.EMPTY_ARRAY);
  106834. return function () { return valueExpr_1; };
  106835. }
  106836. var /** @type {?} */ checkIndex = this.nodes.length;
  106837. this.nodes.push(function () {
  106838. return ({
  106839. sourceSpan: sourceSpan,
  106840. nodeFlags: 32 /* TypePureArray */,
  106841. nodeDef: importExpr(Identifiers.pureArrayDef).callFn([
  106842. literal(checkIndex),
  106843. literal(argCount),
  106844. ])
  106845. });
  106846. });
  106847. return function (args) { return callCheckStmt(checkIndex, args); };
  106848. };
  106849. /**
  106850. * @param {?} sourceSpan
  106851. * @param {?} keys
  106852. * @return {?}
  106853. */
  106854. ViewBuilder.prototype._createLiteralMapConverter = /**
  106855. * @param {?} sourceSpan
  106856. * @param {?} keys
  106857. * @return {?}
  106858. */
  106859. function (sourceSpan, keys) {
  106860. if (keys.length === 0) {
  106861. var /** @type {?} */ valueExpr_2 = importExpr(Identifiers.EMPTY_MAP);
  106862. return function () { return valueExpr_2; };
  106863. }
  106864. var /** @type {?} */ map = literalMap(keys.map(function (e, i) { return (Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */])({}, e, { value: literal(i) })); }));
  106865. var /** @type {?} */ checkIndex = this.nodes.length;
  106866. this.nodes.push(function () {
  106867. return ({
  106868. sourceSpan: sourceSpan,
  106869. nodeFlags: 64 /* TypePureObject */,
  106870. nodeDef: importExpr(Identifiers.pureObjectDef).callFn([
  106871. literal(checkIndex),
  106872. map,
  106873. ])
  106874. });
  106875. });
  106876. return function (args) { return callCheckStmt(checkIndex, args); };
  106877. };
  106878. /**
  106879. * @param {?} expression
  106880. * @param {?} name
  106881. * @param {?} argCount
  106882. * @return {?}
  106883. */
  106884. ViewBuilder.prototype._createPipeConverter = /**
  106885. * @param {?} expression
  106886. * @param {?} name
  106887. * @param {?} argCount
  106888. * @return {?}
  106889. */
  106890. function (expression, name, argCount) {
  106891. var /** @type {?} */ pipe = /** @type {?} */ ((this.usedPipes.find(function (pipeSummary) { return pipeSummary.name === name; })));
  106892. if (pipe.pure) {
  106893. var /** @type {?} */ checkIndex_1 = this.nodes.length;
  106894. this.nodes.push(function () {
  106895. return ({
  106896. sourceSpan: expression.sourceSpan,
  106897. nodeFlags: 128 /* TypePurePipe */,
  106898. nodeDef: importExpr(Identifiers.purePipeDef).callFn([
  106899. literal(checkIndex_1),
  106900. literal(argCount),
  106901. ])
  106902. });
  106903. });
  106904. // find underlying pipe in the component view
  106905. var /** @type {?} */ compViewExpr = VIEW_VAR;
  106906. var /** @type {?} */ compBuilder = this;
  106907. while (compBuilder.parent) {
  106908. compBuilder = compBuilder.parent;
  106909. compViewExpr = compViewExpr.prop('parent').cast(DYNAMIC_TYPE);
  106910. }
  106911. var /** @type {?} */ pipeNodeIndex = compBuilder.purePipeNodeIndices[name];
  106912. var /** @type {?} */ pipeValueExpr_1 = importExpr(Identifiers.nodeValue).callFn([compViewExpr, literal(pipeNodeIndex)]);
  106913. return function (args) {
  106914. return callUnwrapValue(expression.nodeIndex, expression.bindingIndex, callCheckStmt(checkIndex_1, [pipeValueExpr_1].concat(args)));
  106915. };
  106916. }
  106917. else {
  106918. var /** @type {?} */ nodeIndex = this._createPipe(expression.sourceSpan, pipe);
  106919. var /** @type {?} */ nodeValueExpr_1 = importExpr(Identifiers.nodeValue).callFn([VIEW_VAR, literal(nodeIndex)]);
  106920. return function (args) {
  106921. return callUnwrapValue(expression.nodeIndex, expression.bindingIndex, nodeValueExpr_1.callMethod('transform', args));
  106922. };
  106923. }
  106924. };
  106925. /**
  106926. * @param {?} sourceSpan
  106927. * @param {?} pipe
  106928. * @return {?}
  106929. */
  106930. ViewBuilder.prototype._createPipe = /**
  106931. * @param {?} sourceSpan
  106932. * @param {?} pipe
  106933. * @return {?}
  106934. */
  106935. function (sourceSpan, pipe) {
  106936. var _this = this;
  106937. var /** @type {?} */ nodeIndex = this.nodes.length;
  106938. var /** @type {?} */ flags = 0;
  106939. pipe.type.lifecycleHooks.forEach(function (lifecycleHook) {
  106940. // for pipes, we only support ngOnDestroy
  106941. if (lifecycleHook === LifecycleHooks.OnDestroy) {
  106942. flags |= lifecycleHookToNodeFlag(lifecycleHook);
  106943. }
  106944. });
  106945. var /** @type {?} */ depExprs = pipe.type.diDeps.map(function (diDep) { return depDef(_this.outputCtx, diDep); });
  106946. // function pipeDef(
  106947. // flags: NodeFlags, ctor: any, deps: ([DepFlags, any] | any)[]): NodeDef
  106948. this.nodes.push(function () {
  106949. return ({
  106950. sourceSpan: sourceSpan,
  106951. nodeFlags: 16 /* TypePipe */,
  106952. nodeDef: importExpr(Identifiers.pipeDef).callFn([
  106953. literal(flags), _this.outputCtx.importExpr(pipe.type.reference), literalArr(depExprs)
  106954. ])
  106955. });
  106956. });
  106957. return nodeIndex;
  106958. };
  106959. /**
  106960. * For the AST in `UpdateExpression.value`:
  106961. * - create nodes for pipes, literal arrays and, literal maps,
  106962. * - update the AST to replace pipes, literal arrays and, literal maps with calls to check fn.
  106963. *
  106964. * WARNING: This might create new nodeDefs (for pipes and literal arrays and literal maps)!
  106965. * @param {?} expression
  106966. * @return {?}
  106967. */
  106968. ViewBuilder.prototype._preprocessUpdateExpression = /**
  106969. * For the AST in `UpdateExpression.value`:
  106970. * - create nodes for pipes, literal arrays and, literal maps,
  106971. * - update the AST to replace pipes, literal arrays and, literal maps with calls to check fn.
  106972. *
  106973. * WARNING: This might create new nodeDefs (for pipes and literal arrays and literal maps)!
  106974. * @param {?} expression
  106975. * @return {?}
  106976. */
  106977. function (expression) {
  106978. var _this = this;
  106979. return {
  106980. nodeIndex: expression.nodeIndex,
  106981. bindingIndex: expression.bindingIndex,
  106982. sourceSpan: expression.sourceSpan,
  106983. context: expression.context,
  106984. value: convertPropertyBindingBuiltins({
  106985. createLiteralArrayConverter: function (argCount) {
  106986. return _this._createLiteralArrayConverter(expression.sourceSpan, argCount);
  106987. },
  106988. createLiteralMapConverter: function (keys) {
  106989. return _this._createLiteralMapConverter(expression.sourceSpan, keys);
  106990. },
  106991. createPipeConverter: function (name, argCount) {
  106992. return _this._createPipeConverter(expression, name, argCount);
  106993. }
  106994. }, expression.value)
  106995. };
  106996. };
  106997. /**
  106998. * @return {?}
  106999. */
  107000. ViewBuilder.prototype._createNodeExpressions = /**
  107001. * @return {?}
  107002. */
  107003. function () {
  107004. var /** @type {?} */ self = this;
  107005. var /** @type {?} */ updateBindingCount = 0;
  107006. var /** @type {?} */ updateRendererStmts = [];
  107007. var /** @type {?} */ updateDirectivesStmts = [];
  107008. var /** @type {?} */ nodeDefExprs = this.nodes.map(function (factory, nodeIndex) {
  107009. var _a = factory(), nodeDef = _a.nodeDef, nodeFlags = _a.nodeFlags, updateDirectives = _a.updateDirectives, updateRenderer = _a.updateRenderer, sourceSpan = _a.sourceSpan;
  107010. if (updateRenderer) {
  107011. updateRendererStmts.push.apply(updateRendererStmts, createUpdateStatements(nodeIndex, sourceSpan, updateRenderer, false));
  107012. }
  107013. if (updateDirectives) {
  107014. updateDirectivesStmts.push.apply(updateDirectivesStmts, createUpdateStatements(nodeIndex, sourceSpan, updateDirectives, (nodeFlags & (262144 /* DoCheck */ | 65536 /* OnInit */)) > 0));
  107015. }
  107016. // We use a comma expression to call the log function before
  107017. // the nodeDef function, but still use the result of the nodeDef function
  107018. // as the value.
  107019. // Note: We only add the logger to elements / text nodes,
  107020. // so we don't generate too much code.
  107021. var /** @type {?} */ logWithNodeDef = nodeFlags & 3 /* CatRenderNode */ ?
  107022. new CommaExpr([LOG_VAR$1.callFn([]).callFn([]), nodeDef]) :
  107023. nodeDef;
  107024. return applySourceSpanToExpressionIfNeeded(logWithNodeDef, sourceSpan);
  107025. });
  107026. return { updateRendererStmts: updateRendererStmts, updateDirectivesStmts: updateDirectivesStmts, nodeDefExprs: nodeDefExprs };
  107027. /**
  107028. * @param {?} nodeIndex
  107029. * @param {?} sourceSpan
  107030. * @param {?} expressions
  107031. * @param {?} allowEmptyExprs
  107032. * @return {?}
  107033. */
  107034. function createUpdateStatements(nodeIndex, sourceSpan, expressions, allowEmptyExprs) {
  107035. var /** @type {?} */ updateStmts = [];
  107036. var /** @type {?} */ exprs = expressions.map(function (_a) {
  107037. var sourceSpan = _a.sourceSpan, context = _a.context, value = _a.value;
  107038. var /** @type {?} */ bindingId = "" + updateBindingCount++;
  107039. var /** @type {?} */ nameResolver = context === COMP_VAR ? self : null;
  107040. var _b = convertPropertyBinding(nameResolver, context, value, bindingId, BindingForm.General), stmts = _b.stmts, currValExpr = _b.currValExpr;
  107041. updateStmts.push.apply(updateStmts, stmts.map(function (stmt) { return applySourceSpanToStatementIfNeeded(stmt, sourceSpan); }));
  107042. return applySourceSpanToExpressionIfNeeded(currValExpr, sourceSpan);
  107043. });
  107044. if (expressions.length || allowEmptyExprs) {
  107045. updateStmts.push(applySourceSpanToStatementIfNeeded(callCheckStmt(nodeIndex, exprs).toStmt(), sourceSpan));
  107046. }
  107047. return updateStmts;
  107048. }
  107049. };
  107050. /**
  107051. * @param {?} nodeIndex
  107052. * @param {?} handlers
  107053. * @return {?}
  107054. */
  107055. ViewBuilder.prototype._createElementHandleEventFn = /**
  107056. * @param {?} nodeIndex
  107057. * @param {?} handlers
  107058. * @return {?}
  107059. */
  107060. function (nodeIndex, handlers) {
  107061. var _this = this;
  107062. var /** @type {?} */ handleEventStmts = [];
  107063. var /** @type {?} */ handleEventBindingCount = 0;
  107064. handlers.forEach(function (_a) {
  107065. var context = _a.context, eventAst = _a.eventAst, dirAst = _a.dirAst;
  107066. var /** @type {?} */ bindingId = "" + handleEventBindingCount++;
  107067. var /** @type {?} */ nameResolver = context === COMP_VAR ? _this : null;
  107068. var _b = convertActionBinding(nameResolver, context, eventAst.handler, bindingId), stmts = _b.stmts, allowDefault = _b.allowDefault;
  107069. var /** @type {?} */ trueStmts = stmts;
  107070. if (allowDefault) {
  107071. trueStmts.push(ALLOW_DEFAULT_VAR.set(allowDefault.and(ALLOW_DEFAULT_VAR)).toStmt());
  107072. }
  107073. var _c = elementEventNameAndTarget(eventAst, dirAst), eventTarget = _c.target, eventName = _c.name;
  107074. var /** @type {?} */ fullEventName = elementEventFullName(eventTarget, eventName);
  107075. handleEventStmts.push(applySourceSpanToStatementIfNeeded(new IfStmt(literal(fullEventName).identical(EVENT_NAME_VAR), trueStmts), eventAst.sourceSpan));
  107076. });
  107077. var /** @type {?} */ handleEventFn;
  107078. if (handleEventStmts.length > 0) {
  107079. var /** @type {?} */ preStmts = [ALLOW_DEFAULT_VAR.set(literal(true)).toDeclStmt(BOOL_TYPE)];
  107080. if (!this.component.isHost && findReadVarNames(handleEventStmts).has(/** @type {?} */ ((COMP_VAR.name)))) {
  107081. preStmts.push(COMP_VAR.set(VIEW_VAR.prop('component')).toDeclStmt(this.compType));
  107082. }
  107083. handleEventFn = fn([
  107084. new FnParam(/** @type {?} */ ((VIEW_VAR.name)), INFERRED_TYPE),
  107085. new FnParam(/** @type {?} */ ((EVENT_NAME_VAR.name)), INFERRED_TYPE),
  107086. new FnParam(/** @type {?} */ ((EventHandlerVars.event.name)), INFERRED_TYPE)
  107087. ], preStmts.concat(handleEventStmts, [new ReturnStatement(ALLOW_DEFAULT_VAR)]), INFERRED_TYPE);
  107088. }
  107089. else {
  107090. handleEventFn = NULL_EXPR;
  107091. }
  107092. return handleEventFn;
  107093. };
  107094. /**
  107095. * @param {?} ast
  107096. * @param {?} context
  107097. * @return {?}
  107098. */
  107099. ViewBuilder.prototype.visitDirective = /**
  107100. * @param {?} ast
  107101. * @param {?} context
  107102. * @return {?}
  107103. */
  107104. function (ast, context) { };
  107105. /**
  107106. * @param {?} ast
  107107. * @param {?} context
  107108. * @return {?}
  107109. */
  107110. ViewBuilder.prototype.visitDirectiveProperty = /**
  107111. * @param {?} ast
  107112. * @param {?} context
  107113. * @return {?}
  107114. */
  107115. function (ast, context) { };
  107116. /**
  107117. * @param {?} ast
  107118. * @param {?} context
  107119. * @return {?}
  107120. */
  107121. ViewBuilder.prototype.visitReference = /**
  107122. * @param {?} ast
  107123. * @param {?} context
  107124. * @return {?}
  107125. */
  107126. function (ast, context) { };
  107127. /**
  107128. * @param {?} ast
  107129. * @param {?} context
  107130. * @return {?}
  107131. */
  107132. ViewBuilder.prototype.visitVariable = /**
  107133. * @param {?} ast
  107134. * @param {?} context
  107135. * @return {?}
  107136. */
  107137. function (ast, context) { };
  107138. /**
  107139. * @param {?} ast
  107140. * @param {?} context
  107141. * @return {?}
  107142. */
  107143. ViewBuilder.prototype.visitEvent = /**
  107144. * @param {?} ast
  107145. * @param {?} context
  107146. * @return {?}
  107147. */
  107148. function (ast, context) { };
  107149. /**
  107150. * @param {?} ast
  107151. * @param {?} context
  107152. * @return {?}
  107153. */
  107154. ViewBuilder.prototype.visitElementProperty = /**
  107155. * @param {?} ast
  107156. * @param {?} context
  107157. * @return {?}
  107158. */
  107159. function (ast, context) { };
  107160. /**
  107161. * @param {?} ast
  107162. * @param {?} context
  107163. * @return {?}
  107164. */
  107165. ViewBuilder.prototype.visitAttr = /**
  107166. * @param {?} ast
  107167. * @param {?} context
  107168. * @return {?}
  107169. */
  107170. function (ast, context) { };
  107171. return ViewBuilder;
  107172. }());
  107173. /**
  107174. * @param {?} astNodes
  107175. * @return {?}
  107176. */
  107177. function needsAdditionalRootNode(astNodes) {
  107178. var /** @type {?} */ lastAstNode = astNodes[astNodes.length - 1];
  107179. if (lastAstNode instanceof EmbeddedTemplateAst) {
  107180. return lastAstNode.hasViewContainer;
  107181. }
  107182. if (lastAstNode instanceof ElementAst) {
  107183. if (isNgContainer(lastAstNode.name) && lastAstNode.children.length) {
  107184. return needsAdditionalRootNode(lastAstNode.children);
  107185. }
  107186. return lastAstNode.hasViewContainer;
  107187. }
  107188. return lastAstNode instanceof NgContentAst;
  107189. }
  107190. /**
  107191. * @param {?} inputAst
  107192. * @param {?} dirAst
  107193. * @return {?}
  107194. */
  107195. function elementBindingDef(inputAst, dirAst) {
  107196. switch (inputAst.type) {
  107197. case PropertyBindingType.Attribute:
  107198. return literalArr([
  107199. literal(1 /* TypeElementAttribute */), literal(inputAst.name),
  107200. literal(inputAst.securityContext)
  107201. ]);
  107202. case PropertyBindingType.Property:
  107203. return literalArr([
  107204. literal(8 /* TypeProperty */), literal(inputAst.name),
  107205. literal(inputAst.securityContext)
  107206. ]);
  107207. case PropertyBindingType.Animation:
  107208. var /** @type {?} */ bindingType = 8 /* TypeProperty */ |
  107209. (dirAst && dirAst.directive.isComponent ? 32 /* SyntheticHostProperty */ :
  107210. 16 /* SyntheticProperty */);
  107211. return literalArr([
  107212. literal(bindingType), literal('@' + inputAst.name), literal(inputAst.securityContext)
  107213. ]);
  107214. case PropertyBindingType.Class:
  107215. return literalArr([literal(2 /* TypeElementClass */), literal(inputAst.name), NULL_EXPR]);
  107216. case PropertyBindingType.Style:
  107217. return literalArr([
  107218. literal(4 /* TypeElementStyle */), literal(inputAst.name), literal(inputAst.unit)
  107219. ]);
  107220. }
  107221. }
  107222. /**
  107223. * @param {?} elementAst
  107224. * @return {?}
  107225. */
  107226. function fixedAttrsDef(elementAst) {
  107227. var /** @type {?} */ mapResult = Object.create(null);
  107228. elementAst.attrs.forEach(function (attrAst) { mapResult[attrAst.name] = attrAst.value; });
  107229. elementAst.directives.forEach(function (dirAst) {
  107230. Object.keys(dirAst.directive.hostAttributes).forEach(function (name) {
  107231. var /** @type {?} */ value = dirAst.directive.hostAttributes[name];
  107232. var /** @type {?} */ prevValue = mapResult[name];
  107233. mapResult[name] = prevValue != null ? mergeAttributeValue(name, prevValue, value) : value;
  107234. });
  107235. });
  107236. // Note: We need to sort to get a defined output order
  107237. // for tests and for caching generated artifacts...
  107238. return literalArr(Object.keys(mapResult).sort().map(function (attrName) { return literalArr([literal(attrName), literal(mapResult[attrName])]); }));
  107239. }
  107240. /**
  107241. * @param {?} attrName
  107242. * @param {?} attrValue1
  107243. * @param {?} attrValue2
  107244. * @return {?}
  107245. */
  107246. function mergeAttributeValue(attrName, attrValue1, attrValue2) {
  107247. if (attrName == CLASS_ATTR$1 || attrName == STYLE_ATTR) {
  107248. return attrValue1 + " " + attrValue2;
  107249. }
  107250. else {
  107251. return attrValue2;
  107252. }
  107253. }
  107254. /**
  107255. * @param {?} nodeIndex
  107256. * @param {?} exprs
  107257. * @return {?}
  107258. */
  107259. function callCheckStmt(nodeIndex, exprs) {
  107260. if (exprs.length > 10) {
  107261. return CHECK_VAR.callFn([VIEW_VAR, literal(nodeIndex), literal(1 /* Dynamic */), literalArr(exprs)]);
  107262. }
  107263. else {
  107264. return CHECK_VAR.callFn([VIEW_VAR, literal(nodeIndex), literal(0 /* Inline */)].concat(exprs));
  107265. }
  107266. }
  107267. /**
  107268. * @param {?} nodeIndex
  107269. * @param {?} bindingIdx
  107270. * @param {?} expr
  107271. * @return {?}
  107272. */
  107273. function callUnwrapValue(nodeIndex, bindingIdx, expr) {
  107274. return importExpr(Identifiers.unwrapValue).callFn([
  107275. VIEW_VAR, literal(nodeIndex), literal(bindingIdx), expr
  107276. ]);
  107277. }
  107278. /**
  107279. * @param {?} nodes
  107280. * @param {?=} result
  107281. * @return {?}
  107282. */
  107283. function findStaticQueryIds(nodes, result) {
  107284. if (result === void 0) { result = new Map(); }
  107285. nodes.forEach(function (node) {
  107286. var /** @type {?} */ staticQueryIds = new Set();
  107287. var /** @type {?} */ dynamicQueryIds = new Set();
  107288. var /** @type {?} */ queryMatches = /** @type {?} */ ((undefined));
  107289. if (node instanceof ElementAst) {
  107290. findStaticQueryIds(node.children, result);
  107291. node.children.forEach(function (child) {
  107292. var /** @type {?} */ childData = /** @type {?} */ ((result.get(child)));
  107293. childData.staticQueryIds.forEach(function (queryId) { return staticQueryIds.add(queryId); });
  107294. childData.dynamicQueryIds.forEach(function (queryId) { return dynamicQueryIds.add(queryId); });
  107295. });
  107296. queryMatches = node.queryMatches;
  107297. }
  107298. else if (node instanceof EmbeddedTemplateAst) {
  107299. findStaticQueryIds(node.children, result);
  107300. node.children.forEach(function (child) {
  107301. var /** @type {?} */ childData = /** @type {?} */ ((result.get(child)));
  107302. childData.staticQueryIds.forEach(function (queryId) { return dynamicQueryIds.add(queryId); });
  107303. childData.dynamicQueryIds.forEach(function (queryId) { return dynamicQueryIds.add(queryId); });
  107304. });
  107305. queryMatches = node.queryMatches;
  107306. }
  107307. if (queryMatches) {
  107308. queryMatches.forEach(function (match) { return staticQueryIds.add(match.queryId); });
  107309. }
  107310. dynamicQueryIds.forEach(function (queryId) { return staticQueryIds.delete(queryId); });
  107311. result.set(node, { staticQueryIds: staticQueryIds, dynamicQueryIds: dynamicQueryIds });
  107312. });
  107313. return result;
  107314. }
  107315. /**
  107316. * @param {?} nodeStaticQueryIds
  107317. * @return {?}
  107318. */
  107319. function staticViewQueryIds(nodeStaticQueryIds) {
  107320. var /** @type {?} */ staticQueryIds = new Set();
  107321. var /** @type {?} */ dynamicQueryIds = new Set();
  107322. Array.from(nodeStaticQueryIds.values()).forEach(function (entry) {
  107323. entry.staticQueryIds.forEach(function (queryId) { return staticQueryIds.add(queryId); });
  107324. entry.dynamicQueryIds.forEach(function (queryId) { return dynamicQueryIds.add(queryId); });
  107325. });
  107326. dynamicQueryIds.forEach(function (queryId) { return staticQueryIds.delete(queryId); });
  107327. return { staticQueryIds: staticQueryIds, dynamicQueryIds: dynamicQueryIds };
  107328. }
  107329. /**
  107330. * @param {?} eventAst
  107331. * @param {?} dirAst
  107332. * @return {?}
  107333. */
  107334. function elementEventNameAndTarget(eventAst, dirAst) {
  107335. if (eventAst.isAnimation) {
  107336. return {
  107337. name: "@" + eventAst.name + "." + eventAst.phase,
  107338. target: dirAst && dirAst.directive.isComponent ? 'component' : null
  107339. };
  107340. }
  107341. else {
  107342. return eventAst;
  107343. }
  107344. }
  107345. /**
  107346. * @param {?} queryIds
  107347. * @param {?} queryId
  107348. * @param {?} isFirst
  107349. * @return {?}
  107350. */
  107351. function calcStaticDynamicQueryFlags(queryIds, queryId, isFirst) {
  107352. var /** @type {?} */ flags = 0;
  107353. // Note: We only make queries static that query for a single item.
  107354. // This is because of backwards compatibility with the old view compiler...
  107355. if (isFirst && (queryIds.staticQueryIds.has(queryId) || !queryIds.dynamicQueryIds.has(queryId))) {
  107356. flags |= 268435456 /* StaticQuery */;
  107357. }
  107358. else {
  107359. flags |= 536870912 /* DynamicQuery */;
  107360. }
  107361. return flags;
  107362. }
  107363. /**
  107364. * @param {?} target
  107365. * @param {?} name
  107366. * @return {?}
  107367. */
  107368. function elementEventFullName(target, name) {
  107369. return target ? target + ":" + name : name;
  107370. }
  107371. /**
  107372. * @fileoverview added by tsickle
  107373. * @suppress {checkTypes} checked by tsc
  107374. */
  107375. /**
  107376. * @license
  107377. * Copyright Google Inc. All Rights Reserved.
  107378. *
  107379. * Use of this source code is governed by an MIT-style license that can be
  107380. * found in the LICENSE file at https://angular.io/license
  107381. */
  107382. /**
  107383. * A container for message extracted from the templates.
  107384. */
  107385. var MessageBundle = /** @class */ (function () {
  107386. function MessageBundle(_htmlParser, _implicitTags, _implicitAttrs, _locale) {
  107387. if (_locale === void 0) { _locale = null; }
  107388. this._htmlParser = _htmlParser;
  107389. this._implicitTags = _implicitTags;
  107390. this._implicitAttrs = _implicitAttrs;
  107391. this._locale = _locale;
  107392. this._messages = [];
  107393. }
  107394. /**
  107395. * @param {?} html
  107396. * @param {?} url
  107397. * @param {?} interpolationConfig
  107398. * @return {?}
  107399. */
  107400. MessageBundle.prototype.updateFromTemplate = /**
  107401. * @param {?} html
  107402. * @param {?} url
  107403. * @param {?} interpolationConfig
  107404. * @return {?}
  107405. */
  107406. function (html, url, interpolationConfig) {
  107407. var /** @type {?} */ htmlParserResult = this._htmlParser.parse(html, url, true, interpolationConfig);
  107408. if (htmlParserResult.errors.length) {
  107409. return htmlParserResult.errors;
  107410. }
  107411. var /** @type {?} */ i18nParserResult = extractMessages(htmlParserResult.rootNodes, interpolationConfig, this._implicitTags, this._implicitAttrs);
  107412. if (i18nParserResult.errors.length) {
  107413. return i18nParserResult.errors;
  107414. }
  107415. (_a = this._messages).push.apply(_a, i18nParserResult.messages);
  107416. return [];
  107417. var _a;
  107418. };
  107419. // Return the message in the internal format
  107420. // The public (serialized) format might be different, see the `write` method.
  107421. /**
  107422. * @return {?}
  107423. */
  107424. MessageBundle.prototype.getMessages = /**
  107425. * @return {?}
  107426. */
  107427. function () { return this._messages; };
  107428. /**
  107429. * @param {?} serializer
  107430. * @param {?=} filterSources
  107431. * @return {?}
  107432. */
  107433. MessageBundle.prototype.write = /**
  107434. * @param {?} serializer
  107435. * @param {?=} filterSources
  107436. * @return {?}
  107437. */
  107438. function (serializer, filterSources) {
  107439. var /** @type {?} */ messages = {};
  107440. var /** @type {?} */ mapperVisitor = new MapPlaceholderNames();
  107441. // Deduplicate messages based on their ID
  107442. this._messages.forEach(function (message) {
  107443. var /** @type {?} */ id = serializer.digest(message);
  107444. if (!messages.hasOwnProperty(id)) {
  107445. messages[id] = message;
  107446. }
  107447. else {
  107448. (_a = messages[id].sources).push.apply(_a, message.sources);
  107449. }
  107450. var _a;
  107451. });
  107452. // Transform placeholder names using the serializer mapping
  107453. var /** @type {?} */ msgList = Object.keys(messages).map(function (id) {
  107454. var /** @type {?} */ mapper = serializer.createNameMapper(messages[id]);
  107455. var /** @type {?} */ src = messages[id];
  107456. var /** @type {?} */ nodes = mapper ? mapperVisitor.convert(src.nodes, mapper) : src.nodes;
  107457. var /** @type {?} */ transformedMessage = new Message(nodes, {}, {}, src.meaning, src.description, id);
  107458. transformedMessage.sources = src.sources;
  107459. if (filterSources) {
  107460. transformedMessage.sources.forEach(function (source) { return source.filePath = filterSources(source.filePath); });
  107461. }
  107462. return transformedMessage;
  107463. });
  107464. return serializer.write(msgList, this._locale);
  107465. };
  107466. return MessageBundle;
  107467. }());
  107468. var MapPlaceholderNames = /** @class */ (function (_super) {
  107469. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(MapPlaceholderNames, _super);
  107470. function MapPlaceholderNames() {
  107471. return _super !== null && _super.apply(this, arguments) || this;
  107472. }
  107473. /**
  107474. * @param {?} nodes
  107475. * @param {?} mapper
  107476. * @return {?}
  107477. */
  107478. MapPlaceholderNames.prototype.convert = /**
  107479. * @param {?} nodes
  107480. * @param {?} mapper
  107481. * @return {?}
  107482. */
  107483. function (nodes, mapper) {
  107484. var _this = this;
  107485. return mapper ? nodes.map(function (n) { return n.visit(_this, mapper); }) : nodes;
  107486. };
  107487. /**
  107488. * @param {?} ph
  107489. * @param {?} mapper
  107490. * @return {?}
  107491. */
  107492. MapPlaceholderNames.prototype.visitTagPlaceholder = /**
  107493. * @param {?} ph
  107494. * @param {?} mapper
  107495. * @return {?}
  107496. */
  107497. function (ph, mapper) {
  107498. var _this = this;
  107499. var /** @type {?} */ startName = /** @type {?} */ ((mapper.toPublicName(ph.startName)));
  107500. var /** @type {?} */ closeName = ph.closeName ? /** @type {?} */ ((mapper.toPublicName(ph.closeName))) : ph.closeName;
  107501. var /** @type {?} */ children = ph.children.map(function (n) { return n.visit(_this, mapper); });
  107502. return new TagPlaceholder(ph.tag, ph.attrs, startName, closeName, children, ph.isVoid, ph.sourceSpan);
  107503. };
  107504. /**
  107505. * @param {?} ph
  107506. * @param {?} mapper
  107507. * @return {?}
  107508. */
  107509. MapPlaceholderNames.prototype.visitPlaceholder = /**
  107510. * @param {?} ph
  107511. * @param {?} mapper
  107512. * @return {?}
  107513. */
  107514. function (ph, mapper) {
  107515. return new Placeholder(ph.value, /** @type {?} */ ((mapper.toPublicName(ph.name))), ph.sourceSpan);
  107516. };
  107517. /**
  107518. * @param {?} ph
  107519. * @param {?} mapper
  107520. * @return {?}
  107521. */
  107522. MapPlaceholderNames.prototype.visitIcuPlaceholder = /**
  107523. * @param {?} ph
  107524. * @param {?} mapper
  107525. * @return {?}
  107526. */
  107527. function (ph, mapper) {
  107528. return new IcuPlaceholder(ph.value, /** @type {?} */ ((mapper.toPublicName(ph.name))), ph.sourceSpan);
  107529. };
  107530. return MapPlaceholderNames;
  107531. }(CloneVisitor));
  107532. /**
  107533. * @fileoverview added by tsickle
  107534. * @suppress {checkTypes} checked by tsc
  107535. */
  107536. /**
  107537. * @license
  107538. * Copyright Google Inc. All Rights Reserved.
  107539. *
  107540. * Use of this source code is governed by an MIT-style license that can be
  107541. * found in the LICENSE file at https://angular.io/license
  107542. */
  107543. var GeneratedFile = /** @class */ (function () {
  107544. function GeneratedFile(srcFileUrl, genFileUrl, sourceOrStmts) {
  107545. this.srcFileUrl = srcFileUrl;
  107546. this.genFileUrl = genFileUrl;
  107547. if (typeof sourceOrStmts === 'string') {
  107548. this.source = sourceOrStmts;
  107549. this.stmts = null;
  107550. }
  107551. else {
  107552. this.source = null;
  107553. this.stmts = sourceOrStmts;
  107554. }
  107555. }
  107556. /**
  107557. * @param {?} other
  107558. * @return {?}
  107559. */
  107560. GeneratedFile.prototype.isEquivalent = /**
  107561. * @param {?} other
  107562. * @return {?}
  107563. */
  107564. function (other) {
  107565. if (this.genFileUrl !== other.genFileUrl) {
  107566. return false;
  107567. }
  107568. if (this.source) {
  107569. return this.source === other.source;
  107570. }
  107571. if (other.stmts == null) {
  107572. return false;
  107573. }
  107574. // Note: the constructor guarantees that if this.source is not filled,
  107575. // then this.stmts is.
  107576. return areAllEquivalent(/** @type {?} */ ((this.stmts)), /** @type {?} */ ((other.stmts)));
  107577. };
  107578. return GeneratedFile;
  107579. }());
  107580. /**
  107581. * @param {?} file
  107582. * @param {?=} preamble
  107583. * @return {?}
  107584. */
  107585. function toTypeScript(file, preamble) {
  107586. if (preamble === void 0) { preamble = ''; }
  107587. if (!file.stmts) {
  107588. throw new Error("Illegal state: No stmts present on GeneratedFile " + file.genFileUrl);
  107589. }
  107590. return new TypeScriptEmitter().emitStatements(file.genFileUrl, file.stmts, preamble);
  107591. }
  107592. /**
  107593. * @fileoverview added by tsickle
  107594. * @suppress {checkTypes} checked by tsc
  107595. */
  107596. /**
  107597. * @license
  107598. * Copyright Google Inc. All Rights Reserved.
  107599. *
  107600. * Use of this source code is governed by an MIT-style license that can be
  107601. * found in the LICENSE file at https://angular.io/license
  107602. */
  107603. /**
  107604. * @record
  107605. */
  107606. /**
  107607. * @param {?} moduleMeta
  107608. * @param {?} reflector
  107609. * @return {?}
  107610. */
  107611. function listLazyRoutes(moduleMeta, reflector) {
  107612. var /** @type {?} */ allLazyRoutes = [];
  107613. for (var _i = 0, _a = moduleMeta.transitiveModule.providers; _i < _a.length; _i++) {
  107614. var _b = _a[_i], provider = _b.provider, module = _b.module;
  107615. if (tokenReference(provider.token) === reflector.ROUTES) {
  107616. var /** @type {?} */ loadChildren = _collectLoadChildren(provider.useValue);
  107617. for (var _c = 0, loadChildren_1 = loadChildren; _c < loadChildren_1.length; _c++) {
  107618. var route = loadChildren_1[_c];
  107619. allLazyRoutes.push(parseLazyRoute(route, reflector, module.reference));
  107620. }
  107621. }
  107622. }
  107623. return allLazyRoutes;
  107624. }
  107625. /**
  107626. * @param {?} routes
  107627. * @param {?=} target
  107628. * @return {?}
  107629. */
  107630. function _collectLoadChildren(routes, target) {
  107631. if (target === void 0) { target = []; }
  107632. if (typeof routes === 'string') {
  107633. target.push(routes);
  107634. }
  107635. else if (Array.isArray(routes)) {
  107636. for (var _i = 0, routes_1 = routes; _i < routes_1.length; _i++) {
  107637. var route = routes_1[_i];
  107638. _collectLoadChildren(route, target);
  107639. }
  107640. }
  107641. else if (routes.loadChildren) {
  107642. _collectLoadChildren(routes.loadChildren, target);
  107643. }
  107644. else if (routes.children) {
  107645. _collectLoadChildren(routes.children, target);
  107646. }
  107647. return target;
  107648. }
  107649. /**
  107650. * @param {?} route
  107651. * @param {?} reflector
  107652. * @param {?=} module
  107653. * @return {?}
  107654. */
  107655. function parseLazyRoute(route, reflector, module) {
  107656. var _a = route.split('#'), routePath = _a[0], routeName = _a[1];
  107657. var /** @type {?} */ referencedModule = reflector.resolveExternalReference({
  107658. moduleName: routePath,
  107659. name: routeName,
  107660. }, module ? module.filePath : undefined);
  107661. return { route: route, module: module || referencedModule, referencedModule: referencedModule };
  107662. }
  107663. /**
  107664. * @fileoverview added by tsickle
  107665. * @suppress {checkTypes} checked by tsc
  107666. */
  107667. /**
  107668. * @license
  107669. * Copyright Google Inc. All Rights Reserved.
  107670. *
  107671. * Use of this source code is governed by an MIT-style license that can be
  107672. * found in the LICENSE file at https://angular.io/license
  107673. */
  107674. var ResolvedStaticSymbol = /** @class */ (function () {
  107675. function ResolvedStaticSymbol(symbol, metadata) {
  107676. this.symbol = symbol;
  107677. this.metadata = metadata;
  107678. }
  107679. return ResolvedStaticSymbol;
  107680. }());
  107681. /**
  107682. * The host of the SymbolResolverHost disconnects the implementation from TypeScript / other
  107683. * language
  107684. * services and from underlying file systems.
  107685. * @record
  107686. */
  107687. var SUPPORTED_SCHEMA_VERSION = 4;
  107688. /**
  107689. * This class is responsible for loading metadata per symbol,
  107690. * and normalizing references between symbols.
  107691. *
  107692. * Internally, it only uses symbols without members,
  107693. * and deduces the values for symbols with members based
  107694. * on these symbols.
  107695. */
  107696. var StaticSymbolResolver = /** @class */ (function () {
  107697. function StaticSymbolResolver(host, staticSymbolCache, summaryResolver, errorRecorder) {
  107698. this.host = host;
  107699. this.staticSymbolCache = staticSymbolCache;
  107700. this.summaryResolver = summaryResolver;
  107701. this.errorRecorder = errorRecorder;
  107702. this.metadataCache = new Map();
  107703. this.resolvedSymbols = new Map();
  107704. this.resolvedFilePaths = new Set();
  107705. this.importAs = new Map();
  107706. this.symbolResourcePaths = new Map();
  107707. this.symbolFromFile = new Map();
  107708. this.knownFileNameToModuleNames = new Map();
  107709. }
  107710. /**
  107711. * @param {?} staticSymbol
  107712. * @return {?}
  107713. */
  107714. StaticSymbolResolver.prototype.resolveSymbol = /**
  107715. * @param {?} staticSymbol
  107716. * @return {?}
  107717. */
  107718. function (staticSymbol) {
  107719. if (staticSymbol.members.length > 0) {
  107720. return /** @type {?} */ ((this._resolveSymbolMembers(staticSymbol)));
  107721. }
  107722. // Note: always ask for a summary first,
  107723. // as we might have read shallow metadata via a .d.ts file
  107724. // for the symbol.
  107725. var /** @type {?} */ resultFromSummary = /** @type {?} */ ((this._resolveSymbolFromSummary(staticSymbol)));
  107726. if (resultFromSummary) {
  107727. return resultFromSummary;
  107728. }
  107729. var /** @type {?} */ resultFromCache = this.resolvedSymbols.get(staticSymbol);
  107730. if (resultFromCache) {
  107731. return resultFromCache;
  107732. }
  107733. // Note: Some users use libraries that were not compiled with ngc, i.e. they don't
  107734. // have summaries, only .d.ts files. So we always need to check both, the summary
  107735. // and metadata.
  107736. this._createSymbolsOf(staticSymbol.filePath);
  107737. return /** @type {?} */ ((this.resolvedSymbols.get(staticSymbol)));
  107738. };
  107739. /**
  107740. * getImportAs produces a symbol that can be used to import the given symbol.
  107741. * The import might be different than the symbol if the symbol is exported from
  107742. * a library with a summary; in which case we want to import the symbol from the
  107743. * ngfactory re-export instead of directly to avoid introducing a direct dependency
  107744. * on an otherwise indirect dependency.
  107745. *
  107746. * @param staticSymbol the symbol for which to generate a import symbol
  107747. */
  107748. /**
  107749. * getImportAs produces a symbol that can be used to import the given symbol.
  107750. * The import might be different than the symbol if the symbol is exported from
  107751. * a library with a summary; in which case we want to import the symbol from the
  107752. * ngfactory re-export instead of directly to avoid introducing a direct dependency
  107753. * on an otherwise indirect dependency.
  107754. *
  107755. * @param {?} staticSymbol the symbol for which to generate a import symbol
  107756. * @param {?=} useSummaries
  107757. * @return {?}
  107758. */
  107759. StaticSymbolResolver.prototype.getImportAs = /**
  107760. * getImportAs produces a symbol that can be used to import the given symbol.
  107761. * The import might be different than the symbol if the symbol is exported from
  107762. * a library with a summary; in which case we want to import the symbol from the
  107763. * ngfactory re-export instead of directly to avoid introducing a direct dependency
  107764. * on an otherwise indirect dependency.
  107765. *
  107766. * @param {?} staticSymbol the symbol for which to generate a import symbol
  107767. * @param {?=} useSummaries
  107768. * @return {?}
  107769. */
  107770. function (staticSymbol, useSummaries) {
  107771. if (useSummaries === void 0) { useSummaries = true; }
  107772. if (staticSymbol.members.length) {
  107773. var /** @type {?} */ baseSymbol = this.getStaticSymbol(staticSymbol.filePath, staticSymbol.name);
  107774. var /** @type {?} */ baseImportAs = this.getImportAs(baseSymbol, useSummaries);
  107775. return baseImportAs ?
  107776. this.getStaticSymbol(baseImportAs.filePath, baseImportAs.name, staticSymbol.members) :
  107777. null;
  107778. }
  107779. var /** @type {?} */ summarizedFileName = stripSummaryForJitFileSuffix(staticSymbol.filePath);
  107780. if (summarizedFileName !== staticSymbol.filePath) {
  107781. var /** @type {?} */ summarizedName = stripSummaryForJitNameSuffix(staticSymbol.name);
  107782. var /** @type {?} */ baseSymbol = this.getStaticSymbol(summarizedFileName, summarizedName, staticSymbol.members);
  107783. var /** @type {?} */ baseImportAs = this.getImportAs(baseSymbol, useSummaries);
  107784. return baseImportAs ?
  107785. this.getStaticSymbol(summaryForJitFileName(baseImportAs.filePath), summaryForJitName(baseImportAs.name), baseSymbol.members) :
  107786. null;
  107787. }
  107788. var /** @type {?} */ result = (useSummaries && this.summaryResolver.getImportAs(staticSymbol)) || null;
  107789. if (!result) {
  107790. result = /** @type {?} */ ((this.importAs.get(staticSymbol)));
  107791. }
  107792. return result;
  107793. };
  107794. /**
  107795. * getResourcePath produces the path to the original location of the symbol and should
  107796. * be used to determine the relative location of resource references recorded in
  107797. * symbol metadata.
  107798. */
  107799. /**
  107800. * getResourcePath produces the path to the original location of the symbol and should
  107801. * be used to determine the relative location of resource references recorded in
  107802. * symbol metadata.
  107803. * @param {?} staticSymbol
  107804. * @return {?}
  107805. */
  107806. StaticSymbolResolver.prototype.getResourcePath = /**
  107807. * getResourcePath produces the path to the original location of the symbol and should
  107808. * be used to determine the relative location of resource references recorded in
  107809. * symbol metadata.
  107810. * @param {?} staticSymbol
  107811. * @return {?}
  107812. */
  107813. function (staticSymbol) {
  107814. return this.symbolResourcePaths.get(staticSymbol) || staticSymbol.filePath;
  107815. };
  107816. /**
  107817. * getTypeArity returns the number of generic type parameters the given symbol
  107818. * has. If the symbol is not a type the result is null.
  107819. */
  107820. /**
  107821. * getTypeArity returns the number of generic type parameters the given symbol
  107822. * has. If the symbol is not a type the result is null.
  107823. * @param {?} staticSymbol
  107824. * @return {?}
  107825. */
  107826. StaticSymbolResolver.prototype.getTypeArity = /**
  107827. * getTypeArity returns the number of generic type parameters the given symbol
  107828. * has. If the symbol is not a type the result is null.
  107829. * @param {?} staticSymbol
  107830. * @return {?}
  107831. */
  107832. function (staticSymbol) {
  107833. // If the file is a factory/ngsummary file, don't resolve the symbol as doing so would
  107834. // cause the metadata for an factory/ngsummary file to be loaded which doesn't exist.
  107835. // All references to generated classes must include the correct arity whenever
  107836. // generating code.
  107837. if (isGeneratedFile(staticSymbol.filePath)) {
  107838. return null;
  107839. }
  107840. var /** @type {?} */ resolvedSymbol = unwrapResolvedMetadata(this.resolveSymbol(staticSymbol));
  107841. while (resolvedSymbol && resolvedSymbol.metadata instanceof StaticSymbol) {
  107842. resolvedSymbol = unwrapResolvedMetadata(this.resolveSymbol(resolvedSymbol.metadata));
  107843. }
  107844. return (resolvedSymbol && resolvedSymbol.metadata && resolvedSymbol.metadata.arity) || null;
  107845. };
  107846. /**
  107847. * @param {?} filePath
  107848. * @return {?}
  107849. */
  107850. StaticSymbolResolver.prototype.getKnownModuleName = /**
  107851. * @param {?} filePath
  107852. * @return {?}
  107853. */
  107854. function (filePath) {
  107855. return this.knownFileNameToModuleNames.get(filePath) || null;
  107856. };
  107857. /**
  107858. * @param {?} sourceSymbol
  107859. * @param {?} targetSymbol
  107860. * @return {?}
  107861. */
  107862. StaticSymbolResolver.prototype.recordImportAs = /**
  107863. * @param {?} sourceSymbol
  107864. * @param {?} targetSymbol
  107865. * @return {?}
  107866. */
  107867. function (sourceSymbol, targetSymbol) {
  107868. sourceSymbol.assertNoMembers();
  107869. targetSymbol.assertNoMembers();
  107870. this.importAs.set(sourceSymbol, targetSymbol);
  107871. };
  107872. /**
  107873. * @param {?} fileName
  107874. * @param {?} moduleName
  107875. * @return {?}
  107876. */
  107877. StaticSymbolResolver.prototype.recordModuleNameForFileName = /**
  107878. * @param {?} fileName
  107879. * @param {?} moduleName
  107880. * @return {?}
  107881. */
  107882. function (fileName, moduleName) {
  107883. this.knownFileNameToModuleNames.set(fileName, moduleName);
  107884. };
  107885. /**
  107886. * Invalidate all information derived from the given file.
  107887. *
  107888. * @param fileName the file to invalidate
  107889. */
  107890. /**
  107891. * Invalidate all information derived from the given file.
  107892. *
  107893. * @param {?} fileName the file to invalidate
  107894. * @return {?}
  107895. */
  107896. StaticSymbolResolver.prototype.invalidateFile = /**
  107897. * Invalidate all information derived from the given file.
  107898. *
  107899. * @param {?} fileName the file to invalidate
  107900. * @return {?}
  107901. */
  107902. function (fileName) {
  107903. this.metadataCache.delete(fileName);
  107904. this.resolvedFilePaths.delete(fileName);
  107905. var /** @type {?} */ symbols = this.symbolFromFile.get(fileName);
  107906. if (symbols) {
  107907. this.symbolFromFile.delete(fileName);
  107908. for (var _i = 0, symbols_1 = symbols; _i < symbols_1.length; _i++) {
  107909. var symbol = symbols_1[_i];
  107910. this.resolvedSymbols.delete(symbol);
  107911. this.importAs.delete(symbol);
  107912. this.symbolResourcePaths.delete(symbol);
  107913. }
  107914. }
  107915. };
  107916. /* @internal */
  107917. /**
  107918. * @template T
  107919. * @param {?} cb
  107920. * @return {?}
  107921. */
  107922. StaticSymbolResolver.prototype.ignoreErrorsFor = /**
  107923. * @template T
  107924. * @param {?} cb
  107925. * @return {?}
  107926. */
  107927. function (cb) {
  107928. var /** @type {?} */ recorder = this.errorRecorder;
  107929. this.errorRecorder = function () { };
  107930. try {
  107931. return cb();
  107932. }
  107933. finally {
  107934. this.errorRecorder = recorder;
  107935. }
  107936. };
  107937. /**
  107938. * @param {?} staticSymbol
  107939. * @return {?}
  107940. */
  107941. StaticSymbolResolver.prototype._resolveSymbolMembers = /**
  107942. * @param {?} staticSymbol
  107943. * @return {?}
  107944. */
  107945. function (staticSymbol) {
  107946. var /** @type {?} */ members = staticSymbol.members;
  107947. var /** @type {?} */ baseResolvedSymbol = this.resolveSymbol(this.getStaticSymbol(staticSymbol.filePath, staticSymbol.name));
  107948. if (!baseResolvedSymbol) {
  107949. return null;
  107950. }
  107951. var /** @type {?} */ baseMetadata = unwrapResolvedMetadata(baseResolvedSymbol.metadata);
  107952. if (baseMetadata instanceof StaticSymbol) {
  107953. return new ResolvedStaticSymbol(staticSymbol, this.getStaticSymbol(baseMetadata.filePath, baseMetadata.name, members));
  107954. }
  107955. else if (baseMetadata && baseMetadata.__symbolic === 'class') {
  107956. if (baseMetadata.statics && members.length === 1) {
  107957. return new ResolvedStaticSymbol(staticSymbol, baseMetadata.statics[members[0]]);
  107958. }
  107959. }
  107960. else {
  107961. var /** @type {?} */ value = baseMetadata;
  107962. for (var /** @type {?} */ i = 0; i < members.length && value; i++) {
  107963. value = value[members[i]];
  107964. }
  107965. return new ResolvedStaticSymbol(staticSymbol, value);
  107966. }
  107967. return null;
  107968. };
  107969. /**
  107970. * @param {?} staticSymbol
  107971. * @return {?}
  107972. */
  107973. StaticSymbolResolver.prototype._resolveSymbolFromSummary = /**
  107974. * @param {?} staticSymbol
  107975. * @return {?}
  107976. */
  107977. function (staticSymbol) {
  107978. var /** @type {?} */ summary = this.summaryResolver.resolveSummary(staticSymbol);
  107979. return summary ? new ResolvedStaticSymbol(staticSymbol, summary.metadata) : null;
  107980. };
  107981. /**
  107982. * getStaticSymbol produces a Type whose metadata is known but whose implementation is not loaded.
  107983. * All types passed to the StaticResolver should be pseudo-types returned by this method.
  107984. *
  107985. * @param declarationFile the absolute path of the file where the symbol is declared
  107986. * @param name the name of the type.
  107987. * @param members a symbol for a static member of the named type
  107988. */
  107989. /**
  107990. * getStaticSymbol produces a Type whose metadata is known but whose implementation is not loaded.
  107991. * All types passed to the StaticResolver should be pseudo-types returned by this method.
  107992. *
  107993. * @param {?} declarationFile the absolute path of the file where the symbol is declared
  107994. * @param {?} name the name of the type.
  107995. * @param {?=} members a symbol for a static member of the named type
  107996. * @return {?}
  107997. */
  107998. StaticSymbolResolver.prototype.getStaticSymbol = /**
  107999. * getStaticSymbol produces a Type whose metadata is known but whose implementation is not loaded.
  108000. * All types passed to the StaticResolver should be pseudo-types returned by this method.
  108001. *
  108002. * @param {?} declarationFile the absolute path of the file where the symbol is declared
  108003. * @param {?} name the name of the type.
  108004. * @param {?=} members a symbol for a static member of the named type
  108005. * @return {?}
  108006. */
  108007. function (declarationFile, name, members) {
  108008. return this.staticSymbolCache.get(declarationFile, name, members);
  108009. };
  108010. /**
  108011. * hasDecorators checks a file's metadata for the presense of decorators without evalutating the
  108012. * metadata.
  108013. *
  108014. * @param filePath the absolute path to examine for decorators.
  108015. * @returns true if any class in the file has a decorator.
  108016. */
  108017. /**
  108018. * hasDecorators checks a file's metadata for the presense of decorators without evalutating the
  108019. * metadata.
  108020. *
  108021. * @param {?} filePath the absolute path to examine for decorators.
  108022. * @return {?} true if any class in the file has a decorator.
  108023. */
  108024. StaticSymbolResolver.prototype.hasDecorators = /**
  108025. * hasDecorators checks a file's metadata for the presense of decorators without evalutating the
  108026. * metadata.
  108027. *
  108028. * @param {?} filePath the absolute path to examine for decorators.
  108029. * @return {?} true if any class in the file has a decorator.
  108030. */
  108031. function (filePath) {
  108032. var /** @type {?} */ metadata = this.getModuleMetadata(filePath);
  108033. if (metadata['metadata']) {
  108034. return Object.keys(metadata['metadata']).some(function (metadataKey) {
  108035. var /** @type {?} */ entry = metadata['metadata'][metadataKey];
  108036. return entry && entry.__symbolic === 'class' && entry.decorators;
  108037. });
  108038. }
  108039. return false;
  108040. };
  108041. /**
  108042. * @param {?} filePath
  108043. * @return {?}
  108044. */
  108045. StaticSymbolResolver.prototype.getSymbolsOf = /**
  108046. * @param {?} filePath
  108047. * @return {?}
  108048. */
  108049. function (filePath) {
  108050. var /** @type {?} */ summarySymbols = this.summaryResolver.getSymbolsOf(filePath);
  108051. if (summarySymbols) {
  108052. return summarySymbols;
  108053. }
  108054. // Note: Some users use libraries that were not compiled with ngc, i.e. they don't
  108055. // have summaries, only .d.ts files, but `summaryResolver.isLibraryFile` returns true.
  108056. this._createSymbolsOf(filePath);
  108057. var /** @type {?} */ metadataSymbols = [];
  108058. this.resolvedSymbols.forEach(function (resolvedSymbol) {
  108059. if (resolvedSymbol.symbol.filePath === filePath) {
  108060. metadataSymbols.push(resolvedSymbol.symbol);
  108061. }
  108062. });
  108063. return metadataSymbols;
  108064. };
  108065. /**
  108066. * @param {?} filePath
  108067. * @return {?}
  108068. */
  108069. StaticSymbolResolver.prototype._createSymbolsOf = /**
  108070. * @param {?} filePath
  108071. * @return {?}
  108072. */
  108073. function (filePath) {
  108074. var _this = this;
  108075. if (this.resolvedFilePaths.has(filePath)) {
  108076. return;
  108077. }
  108078. this.resolvedFilePaths.add(filePath);
  108079. var /** @type {?} */ resolvedSymbols = [];
  108080. var /** @type {?} */ metadata = this.getModuleMetadata(filePath);
  108081. if (metadata['importAs']) {
  108082. // Index bundle indices should use the importAs module name defined
  108083. // in the bundle.
  108084. this.knownFileNameToModuleNames.set(filePath, metadata['importAs']);
  108085. }
  108086. // handle the symbols in one of the re-export location
  108087. if (metadata['exports']) {
  108088. var _loop_1 = function (moduleExport) {
  108089. // handle the symbols in the list of explicitly re-exported symbols.
  108090. if (moduleExport.export) {
  108091. moduleExport.export.forEach(function (exportSymbol) {
  108092. var /** @type {?} */ symbolName;
  108093. if (typeof exportSymbol === 'string') {
  108094. symbolName = exportSymbol;
  108095. }
  108096. else {
  108097. symbolName = exportSymbol.as;
  108098. }
  108099. symbolName = unescapeIdentifier(symbolName);
  108100. var /** @type {?} */ symName = symbolName;
  108101. if (typeof exportSymbol !== 'string') {
  108102. symName = unescapeIdentifier(exportSymbol.name);
  108103. }
  108104. var /** @type {?} */ resolvedModule = _this.resolveModule(moduleExport.from, filePath);
  108105. if (resolvedModule) {
  108106. var /** @type {?} */ targetSymbol = _this.getStaticSymbol(resolvedModule, symName);
  108107. var /** @type {?} */ sourceSymbol = _this.getStaticSymbol(filePath, symbolName);
  108108. resolvedSymbols.push(_this.createExport(sourceSymbol, targetSymbol));
  108109. }
  108110. });
  108111. }
  108112. else {
  108113. // handle the symbols via export * directives.
  108114. var /** @type {?} */ resolvedModule = this_1.resolveModule(moduleExport.from, filePath);
  108115. if (resolvedModule) {
  108116. var /** @type {?} */ nestedExports = this_1.getSymbolsOf(resolvedModule);
  108117. nestedExports.forEach(function (targetSymbol) {
  108118. var /** @type {?} */ sourceSymbol = _this.getStaticSymbol(filePath, targetSymbol.name);
  108119. resolvedSymbols.push(_this.createExport(sourceSymbol, targetSymbol));
  108120. });
  108121. }
  108122. }
  108123. };
  108124. var this_1 = this;
  108125. for (var _i = 0, _a = metadata['exports']; _i < _a.length; _i++) {
  108126. var moduleExport = _a[_i];
  108127. _loop_1(moduleExport);
  108128. }
  108129. }
  108130. // handle the actual metadata. Has to be after the exports
  108131. // as there migth be collisions in the names, and we want the symbols
  108132. // of the current module to win ofter reexports.
  108133. if (metadata['metadata']) {
  108134. // handle direct declarations of the symbol
  108135. var /** @type {?} */ topLevelSymbolNames_1 = new Set(Object.keys(metadata['metadata']).map(unescapeIdentifier));
  108136. var /** @type {?} */ origins_1 = metadata['origins'] || {};
  108137. Object.keys(metadata['metadata']).forEach(function (metadataKey) {
  108138. var /** @type {?} */ symbolMeta = metadata['metadata'][metadataKey];
  108139. var /** @type {?} */ name = unescapeIdentifier(metadataKey);
  108140. var /** @type {?} */ symbol = _this.getStaticSymbol(filePath, name);
  108141. var /** @type {?} */ origin = origins_1.hasOwnProperty(metadataKey) && origins_1[metadataKey];
  108142. if (origin) {
  108143. // If the symbol is from a bundled index, use the declaration location of the
  108144. // symbol so relative references (such as './my.html') will be calculated
  108145. // correctly.
  108146. var /** @type {?} */ originFilePath = _this.resolveModule(origin, filePath);
  108147. if (!originFilePath) {
  108148. _this.reportError(new Error("Couldn't resolve original symbol for " + origin + " from " + filePath));
  108149. }
  108150. else {
  108151. _this.symbolResourcePaths.set(symbol, originFilePath);
  108152. }
  108153. }
  108154. resolvedSymbols.push(_this.createResolvedSymbol(symbol, filePath, topLevelSymbolNames_1, symbolMeta));
  108155. });
  108156. }
  108157. resolvedSymbols.forEach(function (resolvedSymbol) { return _this.resolvedSymbols.set(resolvedSymbol.symbol, resolvedSymbol); });
  108158. this.symbolFromFile.set(filePath, resolvedSymbols.map(function (resolvedSymbol) { return resolvedSymbol.symbol; }));
  108159. };
  108160. /**
  108161. * @param {?} sourceSymbol
  108162. * @param {?} topLevelPath
  108163. * @param {?} topLevelSymbolNames
  108164. * @param {?} metadata
  108165. * @return {?}
  108166. */
  108167. StaticSymbolResolver.prototype.createResolvedSymbol = /**
  108168. * @param {?} sourceSymbol
  108169. * @param {?} topLevelPath
  108170. * @param {?} topLevelSymbolNames
  108171. * @param {?} metadata
  108172. * @return {?}
  108173. */
  108174. function (sourceSymbol, topLevelPath, topLevelSymbolNames, metadata) {
  108175. var _this = this;
  108176. // For classes that don't have Angular summaries / metadata,
  108177. // we only keep their arity, but nothing else
  108178. // (e.g. their constructor parameters).
  108179. // We do this to prevent introducing deep imports
  108180. // as we didn't generate .ngfactory.ts files with proper reexports.
  108181. if (this.summaryResolver.isLibraryFile(sourceSymbol.filePath) && metadata &&
  108182. metadata['__symbolic'] === 'class') {
  108183. var /** @type {?} */ transformedMeta_1 = { __symbolic: 'class', arity: metadata.arity };
  108184. return new ResolvedStaticSymbol(sourceSymbol, transformedMeta_1);
  108185. }
  108186. var /** @type {?} */ _originalFileMemo;
  108187. var /** @type {?} */ getOriginalName = function () {
  108188. if (!_originalFileMemo) {
  108189. // Guess what hte original file name is from the reference. If it has a `.d.ts` extension
  108190. // replace it with `.ts`. If it already has `.ts` just leave it in place. If it doesn't have
  108191. // .ts or .d.ts, append `.ts'. Also, if it is in `node_modules`, trim the `node_module`
  108192. // location as it is not important to finding the file.
  108193. _originalFileMemo =
  108194. _this.host.getOutputName(topLevelPath.replace(/((\.ts)|(\.d\.ts)|)$/, '.ts')
  108195. .replace(/^.*node_modules[/\\]/, ''));
  108196. }
  108197. return _originalFileMemo;
  108198. };
  108199. var /** @type {?} */ self = this;
  108200. var ReferenceTransformer = /** @class */ (function (_super) {
  108201. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(ReferenceTransformer, _super);
  108202. function ReferenceTransformer() {
  108203. return _super !== null && _super.apply(this, arguments) || this;
  108204. }
  108205. /**
  108206. * @param {?} map
  108207. * @param {?} functionParams
  108208. * @return {?}
  108209. */
  108210. ReferenceTransformer.prototype.visitStringMap = /**
  108211. * @param {?} map
  108212. * @param {?} functionParams
  108213. * @return {?}
  108214. */
  108215. function (map, functionParams) {
  108216. var /** @type {?} */ symbolic = map['__symbolic'];
  108217. if (symbolic === 'function') {
  108218. var /** @type {?} */ oldLen = functionParams.length;
  108219. functionParams.push.apply(functionParams, (map['parameters'] || []));
  108220. var /** @type {?} */ result = _super.prototype.visitStringMap.call(this, map, functionParams);
  108221. functionParams.length = oldLen;
  108222. return result;
  108223. }
  108224. else if (symbolic === 'reference') {
  108225. var /** @type {?} */ module = map['module'];
  108226. var /** @type {?} */ name_1 = map['name'] ? unescapeIdentifier(map['name']) : map['name'];
  108227. if (!name_1) {
  108228. return null;
  108229. }
  108230. var /** @type {?} */ filePath = void 0;
  108231. if (module) {
  108232. filePath = /** @type {?} */ ((self.resolveModule(module, sourceSymbol.filePath)));
  108233. if (!filePath) {
  108234. return {
  108235. __symbolic: 'error',
  108236. message: "Could not resolve " + module + " relative to " + sourceSymbol.filePath + ".",
  108237. line: map["line"],
  108238. character: map["character"],
  108239. fileName: getOriginalName()
  108240. };
  108241. }
  108242. return {
  108243. __symbolic: 'resolved',
  108244. symbol: self.getStaticSymbol(filePath, name_1),
  108245. line: map["line"],
  108246. character: map["character"],
  108247. fileName: getOriginalName()
  108248. };
  108249. }
  108250. else if (functionParams.indexOf(name_1) >= 0) {
  108251. // reference to a function parameter
  108252. return { __symbolic: 'reference', name: name_1 };
  108253. }
  108254. else {
  108255. if (topLevelSymbolNames.has(name_1)) {
  108256. return self.getStaticSymbol(topLevelPath, name_1);
  108257. }
  108258. // ambient value
  108259. null;
  108260. }
  108261. }
  108262. else if (symbolic === 'error') {
  108263. return Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __assign */])({}, map, { fileName: getOriginalName() });
  108264. }
  108265. else {
  108266. return _super.prototype.visitStringMap.call(this, map, functionParams);
  108267. }
  108268. };
  108269. return ReferenceTransformer;
  108270. }(ValueTransformer));
  108271. var /** @type {?} */ transformedMeta = visitValue(metadata, new ReferenceTransformer(), []);
  108272. var /** @type {?} */ unwrappedTransformedMeta = unwrapResolvedMetadata(transformedMeta);
  108273. if (unwrappedTransformedMeta instanceof StaticSymbol) {
  108274. return this.createExport(sourceSymbol, unwrappedTransformedMeta);
  108275. }
  108276. return new ResolvedStaticSymbol(sourceSymbol, transformedMeta);
  108277. };
  108278. /**
  108279. * @param {?} sourceSymbol
  108280. * @param {?} targetSymbol
  108281. * @return {?}
  108282. */
  108283. StaticSymbolResolver.prototype.createExport = /**
  108284. * @param {?} sourceSymbol
  108285. * @param {?} targetSymbol
  108286. * @return {?}
  108287. */
  108288. function (sourceSymbol, targetSymbol) {
  108289. sourceSymbol.assertNoMembers();
  108290. targetSymbol.assertNoMembers();
  108291. if (this.summaryResolver.isLibraryFile(sourceSymbol.filePath) &&
  108292. this.summaryResolver.isLibraryFile(targetSymbol.filePath)) {
  108293. // This case is for an ng library importing symbols from a plain ts library
  108294. // transitively.
  108295. // Note: We rely on the fact that we discover symbols in the direction
  108296. // from source files to library files
  108297. this.importAs.set(targetSymbol, this.getImportAs(sourceSymbol) || sourceSymbol);
  108298. }
  108299. return new ResolvedStaticSymbol(sourceSymbol, targetSymbol);
  108300. };
  108301. /**
  108302. * @param {?} error
  108303. * @param {?=} context
  108304. * @param {?=} path
  108305. * @return {?}
  108306. */
  108307. StaticSymbolResolver.prototype.reportError = /**
  108308. * @param {?} error
  108309. * @param {?=} context
  108310. * @param {?=} path
  108311. * @return {?}
  108312. */
  108313. function (error, context, path) {
  108314. if (this.errorRecorder) {
  108315. this.errorRecorder(error, (context && context.filePath) || path);
  108316. }
  108317. else {
  108318. throw error;
  108319. }
  108320. };
  108321. /**
  108322. * @param {?} module an absolute path to a module file.
  108323. * @return {?}
  108324. */
  108325. StaticSymbolResolver.prototype.getModuleMetadata = /**
  108326. * @param {?} module an absolute path to a module file.
  108327. * @return {?}
  108328. */
  108329. function (module) {
  108330. var /** @type {?} */ moduleMetadata = this.metadataCache.get(module);
  108331. if (!moduleMetadata) {
  108332. var /** @type {?} */ moduleMetadatas = this.host.getMetadataFor(module);
  108333. if (moduleMetadatas) {
  108334. var /** @type {?} */ maxVersion_1 = -1;
  108335. moduleMetadatas.forEach(function (md) {
  108336. if (md && md['version'] > maxVersion_1) {
  108337. maxVersion_1 = md['version'];
  108338. moduleMetadata = md;
  108339. }
  108340. });
  108341. }
  108342. if (!moduleMetadata) {
  108343. moduleMetadata =
  108344. { __symbolic: 'module', version: SUPPORTED_SCHEMA_VERSION, module: module, metadata: {} };
  108345. }
  108346. if (moduleMetadata['version'] != SUPPORTED_SCHEMA_VERSION) {
  108347. var /** @type {?} */ errorMessage = moduleMetadata['version'] == 2 ?
  108348. "Unsupported metadata version " + moduleMetadata['version'] + " for module " + module + ". This module should be compiled with a newer version of ngc" :
  108349. "Metadata version mismatch for module " + module + ", found version " + moduleMetadata['version'] + ", expected " + SUPPORTED_SCHEMA_VERSION;
  108350. this.reportError(new Error(errorMessage));
  108351. }
  108352. this.metadataCache.set(module, moduleMetadata);
  108353. }
  108354. return moduleMetadata;
  108355. };
  108356. /**
  108357. * @param {?} module
  108358. * @param {?} symbolName
  108359. * @param {?=} containingFile
  108360. * @return {?}
  108361. */
  108362. StaticSymbolResolver.prototype.getSymbolByModule = /**
  108363. * @param {?} module
  108364. * @param {?} symbolName
  108365. * @param {?=} containingFile
  108366. * @return {?}
  108367. */
  108368. function (module, symbolName, containingFile) {
  108369. var /** @type {?} */ filePath = this.resolveModule(module, containingFile);
  108370. if (!filePath) {
  108371. this.reportError(new Error("Could not resolve module " + module + (containingFile ? ' relative to ' +
  108372. containingFile : '')));
  108373. return this.getStaticSymbol("ERROR:" + module, symbolName);
  108374. }
  108375. return this.getStaticSymbol(filePath, symbolName);
  108376. };
  108377. /**
  108378. * @param {?} module
  108379. * @param {?=} containingFile
  108380. * @return {?}
  108381. */
  108382. StaticSymbolResolver.prototype.resolveModule = /**
  108383. * @param {?} module
  108384. * @param {?=} containingFile
  108385. * @return {?}
  108386. */
  108387. function (module, containingFile) {
  108388. try {
  108389. return this.host.moduleNameToFileName(module, containingFile);
  108390. }
  108391. catch (/** @type {?} */ e) {
  108392. console.error("Could not resolve module '" + module + "' relative to file " + containingFile);
  108393. this.reportError(e, undefined, containingFile);
  108394. }
  108395. return null;
  108396. };
  108397. return StaticSymbolResolver;
  108398. }());
  108399. /**
  108400. * @param {?} identifier
  108401. * @return {?}
  108402. */
  108403. function unescapeIdentifier(identifier) {
  108404. return identifier.startsWith('___') ? identifier.substr(1) : identifier;
  108405. }
  108406. /**
  108407. * @param {?} metadata
  108408. * @return {?}
  108409. */
  108410. function unwrapResolvedMetadata(metadata) {
  108411. if (metadata && metadata.__symbolic === 'resolved') {
  108412. return metadata.symbol;
  108413. }
  108414. return metadata;
  108415. }
  108416. /**
  108417. * @fileoverview added by tsickle
  108418. * @suppress {checkTypes} checked by tsc
  108419. */
  108420. /**
  108421. * @param {?} srcFileName
  108422. * @param {?} forJitCtx
  108423. * @param {?} summaryResolver
  108424. * @param {?} symbolResolver
  108425. * @param {?} symbols
  108426. * @param {?} types
  108427. * @return {?}
  108428. */
  108429. function serializeSummaries(srcFileName, forJitCtx, summaryResolver, symbolResolver, symbols, types) {
  108430. var /** @type {?} */ toJsonSerializer = new ToJsonSerializer(symbolResolver, summaryResolver, srcFileName);
  108431. // for symbols, we use everything except for the class metadata itself
  108432. // (we keep the statics though), as the class metadata is contained in the
  108433. // CompileTypeSummary.
  108434. symbols.forEach(function (resolvedSymbol) {
  108435. return toJsonSerializer.addSummary({ symbol: resolvedSymbol.symbol, metadata: resolvedSymbol.metadata });
  108436. });
  108437. // Add type summaries.
  108438. types.forEach(function (_a) {
  108439. var summary = _a.summary, metadata = _a.metadata;
  108440. toJsonSerializer.addSummary({ symbol: summary.type.reference, metadata: undefined, type: summary });
  108441. });
  108442. var _a = toJsonSerializer.serialize(), json = _a.json, exportAs = _a.exportAs;
  108443. if (forJitCtx) {
  108444. var /** @type {?} */ forJitSerializer_1 = new ForJitSerializer(forJitCtx, symbolResolver, summaryResolver);
  108445. types.forEach(function (_a) {
  108446. var summary = _a.summary, metadata = _a.metadata;
  108447. forJitSerializer_1.addSourceType(summary, metadata);
  108448. });
  108449. toJsonSerializer.unprocessedSymbolSummariesBySymbol.forEach(function (summary) {
  108450. if (summaryResolver.isLibraryFile(summary.symbol.filePath) && summary.type) {
  108451. forJitSerializer_1.addLibType(summary.type);
  108452. }
  108453. });
  108454. forJitSerializer_1.serialize(exportAs);
  108455. }
  108456. return { json: json, exportAs: exportAs };
  108457. }
  108458. /**
  108459. * @param {?} symbolCache
  108460. * @param {?} summaryResolver
  108461. * @param {?} libraryFileName
  108462. * @param {?} json
  108463. * @return {?}
  108464. */
  108465. function deserializeSummaries(symbolCache, summaryResolver, libraryFileName, json) {
  108466. var /** @type {?} */ deserializer = new FromJsonDeserializer(symbolCache, summaryResolver);
  108467. return deserializer.deserialize(libraryFileName, json);
  108468. }
  108469. /**
  108470. * @param {?} outputCtx
  108471. * @param {?} reference
  108472. * @return {?}
  108473. */
  108474. function createForJitStub(outputCtx, reference) {
  108475. return createSummaryForJitFunction(outputCtx, reference, NULL_EXPR);
  108476. }
  108477. /**
  108478. * @param {?} outputCtx
  108479. * @param {?} reference
  108480. * @param {?} value
  108481. * @return {?}
  108482. */
  108483. function createSummaryForJitFunction(outputCtx, reference, value) {
  108484. var /** @type {?} */ fnName = summaryForJitName(reference.name);
  108485. outputCtx.statements.push(fn([], [new ReturnStatement(value)], new ArrayType(DYNAMIC_TYPE)).toDeclStmt(fnName, [
  108486. StmtModifier.Final, StmtModifier.Exported
  108487. ]));
  108488. }
  108489. var ToJsonSerializer = /** @class */ (function (_super) {
  108490. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(ToJsonSerializer, _super);
  108491. function ToJsonSerializer(symbolResolver, summaryResolver, srcFileName) {
  108492. var _this = _super.call(this) || this;
  108493. _this.symbolResolver = symbolResolver;
  108494. _this.summaryResolver = summaryResolver;
  108495. _this.srcFileName = srcFileName;
  108496. _this.symbols = [];
  108497. _this.indexBySymbol = new Map();
  108498. _this.reexportedBy = new Map();
  108499. _this.processedSummaryBySymbol = new Map();
  108500. _this.processedSummaries = [];
  108501. _this.unprocessedSymbolSummariesBySymbol = new Map();
  108502. _this.moduleName = symbolResolver.getKnownModuleName(srcFileName);
  108503. return _this;
  108504. }
  108505. /**
  108506. * @param {?} summary
  108507. * @return {?}
  108508. */
  108509. ToJsonSerializer.prototype.addSummary = /**
  108510. * @param {?} summary
  108511. * @return {?}
  108512. */
  108513. function (summary) {
  108514. var _this = this;
  108515. var /** @type {?} */ unprocessedSummary = this.unprocessedSymbolSummariesBySymbol.get(summary.symbol);
  108516. var /** @type {?} */ processedSummary = this.processedSummaryBySymbol.get(summary.symbol);
  108517. if (!unprocessedSummary) {
  108518. unprocessedSummary = { symbol: summary.symbol, metadata: undefined };
  108519. this.unprocessedSymbolSummariesBySymbol.set(summary.symbol, unprocessedSummary);
  108520. processedSummary = { symbol: this.processValue(summary.symbol, 0 /* None */) };
  108521. this.processedSummaries.push(processedSummary);
  108522. this.processedSummaryBySymbol.set(summary.symbol, processedSummary);
  108523. }
  108524. if (!unprocessedSummary.metadata && summary.metadata) {
  108525. var /** @type {?} */ metadata_1 = summary.metadata || {};
  108526. if (metadata_1.__symbolic === 'class') {
  108527. // For classes, we keep everything except their class decorators.
  108528. // We need to keep e.g. the ctor args, method names, method decorators
  108529. // so that the class can be extended in another compilation unit.
  108530. // We don't keep the class decorators as
  108531. // 1) they refer to data
  108532. // that should not cause a rebuild of downstream compilation units
  108533. // (e.g. inline templates of @Component, or @NgModule.declarations)
  108534. // 2) their data is already captured in TypeSummaries, e.g. DirectiveSummary.
  108535. var /** @type {?} */ clone_1 = {};
  108536. Object.keys(metadata_1).forEach(function (propName) {
  108537. if (propName !== 'decorators') {
  108538. clone_1[propName] = metadata_1[propName];
  108539. }
  108540. });
  108541. metadata_1 = clone_1;
  108542. }
  108543. else if (isCall(metadata_1)) {
  108544. if (!isFunctionCall(metadata_1) && !isMethodCallOnVariable(metadata_1)) {
  108545. // Don't store complex calls as we won't be able to simplify them anyways later on.
  108546. // Don't store complex calls as we won't be able to simplify them anyways later on.
  108547. metadata_1 = {
  108548. __symbolic: 'error',
  108549. message: 'Complex function calls are not supported.',
  108550. };
  108551. }
  108552. }
  108553. // Note: We need to keep storing ctor calls for e.g.
  108554. // `export const x = new InjectionToken(...)`
  108555. unprocessedSummary.metadata = metadata_1;
  108556. processedSummary.metadata = this.processValue(metadata_1, 1 /* ResolveValue */);
  108557. if (metadata_1 instanceof StaticSymbol &&
  108558. this.summaryResolver.isLibraryFile(metadata_1.filePath)) {
  108559. var /** @type {?} */ declarationSymbol = this.symbols[/** @type {?} */ ((this.indexBySymbol.get(metadata_1)))];
  108560. if (!isLoweredSymbol(declarationSymbol.name)) {
  108561. // Note: symbols that were introduced during codegen in the user file can have a reexport
  108562. // if a user used `export *`. However, we can't rely on this as tsickle will change
  108563. // `export *` into named exports, using only the information from the typechecker.
  108564. // As we introduce the new symbols after typecheck, Tsickle does not know about them,
  108565. // and omits them when expanding `export *`.
  108566. // So we have to keep reexporting these symbols manually via .ngfactory files.
  108567. this.reexportedBy.set(declarationSymbol, summary.symbol);
  108568. }
  108569. }
  108570. }
  108571. if (!unprocessedSummary.type && summary.type) {
  108572. unprocessedSummary.type = summary.type;
  108573. // Note: We don't add the summaries of all referenced symbols as for the ResolvedSymbols,
  108574. // as the type summaries already contain the transitive data that they require
  108575. // (in a minimal way).
  108576. processedSummary.type = this.processValue(summary.type, 0 /* None */);
  108577. // except for reexported directives / pipes, so we need to store
  108578. // their summaries explicitly.
  108579. if (summary.type.summaryKind === CompileSummaryKind.NgModule) {
  108580. var /** @type {?} */ ngModuleSummary = /** @type {?} */ (summary.type);
  108581. ngModuleSummary.exportedDirectives.concat(ngModuleSummary.exportedPipes).forEach(function (id) {
  108582. var /** @type {?} */ symbol = id.reference;
  108583. if (_this.summaryResolver.isLibraryFile(symbol.filePath) &&
  108584. !_this.unprocessedSymbolSummariesBySymbol.has(symbol)) {
  108585. var /** @type {?} */ summary_1 = _this.summaryResolver.resolveSummary(symbol);
  108586. if (summary_1) {
  108587. _this.addSummary(summary_1);
  108588. }
  108589. }
  108590. });
  108591. }
  108592. }
  108593. };
  108594. /**
  108595. * @return {?}
  108596. */
  108597. ToJsonSerializer.prototype.serialize = /**
  108598. * @return {?}
  108599. */
  108600. function () {
  108601. var _this = this;
  108602. var /** @type {?} */ exportAs = [];
  108603. var /** @type {?} */ json = JSON.stringify({
  108604. moduleName: this.moduleName,
  108605. summaries: this.processedSummaries,
  108606. symbols: this.symbols.map(function (symbol, index) {
  108607. symbol.assertNoMembers();
  108608. var /** @type {?} */ importAs = /** @type {?} */ ((undefined));
  108609. if (_this.summaryResolver.isLibraryFile(symbol.filePath)) {
  108610. var /** @type {?} */ reexportSymbol = _this.reexportedBy.get(symbol);
  108611. if (reexportSymbol) {
  108612. importAs = /** @type {?} */ ((_this.indexBySymbol.get(reexportSymbol)));
  108613. }
  108614. else {
  108615. var /** @type {?} */ summary = _this.unprocessedSymbolSummariesBySymbol.get(symbol);
  108616. if (!summary || !summary.metadata || summary.metadata.__symbolic !== 'interface') {
  108617. importAs = symbol.name + "_" + index;
  108618. exportAs.push({ symbol: symbol, exportAs: importAs });
  108619. }
  108620. }
  108621. }
  108622. return {
  108623. __symbol: index,
  108624. name: symbol.name,
  108625. filePath: _this.summaryResolver.toSummaryFileName(symbol.filePath, _this.srcFileName),
  108626. importAs: importAs
  108627. };
  108628. })
  108629. });
  108630. return { json: json, exportAs: exportAs };
  108631. };
  108632. /**
  108633. * @param {?} value
  108634. * @param {?} flags
  108635. * @return {?}
  108636. */
  108637. ToJsonSerializer.prototype.processValue = /**
  108638. * @param {?} value
  108639. * @param {?} flags
  108640. * @return {?}
  108641. */
  108642. function (value, flags) {
  108643. return visitValue(value, this, flags);
  108644. };
  108645. /**
  108646. * @param {?} value
  108647. * @param {?} context
  108648. * @return {?}
  108649. */
  108650. ToJsonSerializer.prototype.visitOther = /**
  108651. * @param {?} value
  108652. * @param {?} context
  108653. * @return {?}
  108654. */
  108655. function (value, context) {
  108656. if (value instanceof StaticSymbol) {
  108657. var /** @type {?} */ baseSymbol = this.symbolResolver.getStaticSymbol(value.filePath, value.name);
  108658. var /** @type {?} */ index = this.visitStaticSymbol(baseSymbol, context);
  108659. return { __symbol: index, members: value.members };
  108660. }
  108661. };
  108662. /**
  108663. * Returns null if the options.resolveValue is true, and the summary for the symbol
  108664. * resolved to a type or could not be resolved.
  108665. * @param {?} baseSymbol
  108666. * @param {?} flags
  108667. * @return {?}
  108668. */
  108669. ToJsonSerializer.prototype.visitStaticSymbol = /**
  108670. * Returns null if the options.resolveValue is true, and the summary for the symbol
  108671. * resolved to a type or could not be resolved.
  108672. * @param {?} baseSymbol
  108673. * @param {?} flags
  108674. * @return {?}
  108675. */
  108676. function (baseSymbol, flags) {
  108677. var /** @type {?} */ index = this.indexBySymbol.get(baseSymbol);
  108678. var /** @type {?} */ summary = null;
  108679. if (flags & 1 /* ResolveValue */ &&
  108680. this.summaryResolver.isLibraryFile(baseSymbol.filePath)) {
  108681. if (this.unprocessedSymbolSummariesBySymbol.has(baseSymbol)) {
  108682. // the summary for this symbol was already added
  108683. // -> nothing to do.
  108684. return /** @type {?} */ ((index));
  108685. }
  108686. summary = this.loadSummary(baseSymbol);
  108687. if (summary && summary.metadata instanceof StaticSymbol) {
  108688. // The summary is a reexport
  108689. index = this.visitStaticSymbol(summary.metadata, flags);
  108690. // reset the summary as it is just a reexport, so we don't want to store it.
  108691. summary = null;
  108692. }
  108693. }
  108694. else if (index != null) {
  108695. // Note: == on purpose to compare with undefined!
  108696. // No summary and the symbol is already added -> nothing to do.
  108697. return index;
  108698. }
  108699. // Note: == on purpose to compare with undefined!
  108700. if (index == null) {
  108701. index = this.symbols.length;
  108702. this.symbols.push(baseSymbol);
  108703. }
  108704. this.indexBySymbol.set(baseSymbol, index);
  108705. if (summary) {
  108706. this.addSummary(summary);
  108707. }
  108708. return index;
  108709. };
  108710. /**
  108711. * @param {?} symbol
  108712. * @return {?}
  108713. */
  108714. ToJsonSerializer.prototype.loadSummary = /**
  108715. * @param {?} symbol
  108716. * @return {?}
  108717. */
  108718. function (symbol) {
  108719. var /** @type {?} */ summary = this.summaryResolver.resolveSummary(symbol);
  108720. if (!summary) {
  108721. // some symbols might originate from a plain typescript library
  108722. // that just exported .d.ts and .metadata.json files, i.e. where no summary
  108723. // files were created.
  108724. var /** @type {?} */ resolvedSymbol = this.symbolResolver.resolveSymbol(symbol);
  108725. if (resolvedSymbol) {
  108726. summary = { symbol: resolvedSymbol.symbol, metadata: resolvedSymbol.metadata };
  108727. }
  108728. }
  108729. return summary;
  108730. };
  108731. return ToJsonSerializer;
  108732. }(ValueTransformer));
  108733. var ForJitSerializer = /** @class */ (function () {
  108734. function ForJitSerializer(outputCtx, symbolResolver, summaryResolver) {
  108735. this.outputCtx = outputCtx;
  108736. this.symbolResolver = symbolResolver;
  108737. this.summaryResolver = summaryResolver;
  108738. this.data = [];
  108739. }
  108740. /**
  108741. * @param {?} summary
  108742. * @param {?} metadata
  108743. * @return {?}
  108744. */
  108745. ForJitSerializer.prototype.addSourceType = /**
  108746. * @param {?} summary
  108747. * @param {?} metadata
  108748. * @return {?}
  108749. */
  108750. function (summary, metadata) {
  108751. this.data.push({ summary: summary, metadata: metadata, isLibrary: false });
  108752. };
  108753. /**
  108754. * @param {?} summary
  108755. * @return {?}
  108756. */
  108757. ForJitSerializer.prototype.addLibType = /**
  108758. * @param {?} summary
  108759. * @return {?}
  108760. */
  108761. function (summary) {
  108762. this.data.push({ summary: summary, metadata: null, isLibrary: true });
  108763. };
  108764. /**
  108765. * @param {?} exportAsArr
  108766. * @return {?}
  108767. */
  108768. ForJitSerializer.prototype.serialize = /**
  108769. * @param {?} exportAsArr
  108770. * @return {?}
  108771. */
  108772. function (exportAsArr) {
  108773. var _this = this;
  108774. var /** @type {?} */ exportAsBySymbol = new Map();
  108775. for (var _i = 0, exportAsArr_1 = exportAsArr; _i < exportAsArr_1.length; _i++) {
  108776. var _a = exportAsArr_1[_i], symbol = _a.symbol, exportAs = _a.exportAs;
  108777. exportAsBySymbol.set(symbol, exportAs);
  108778. }
  108779. var /** @type {?} */ ngModuleSymbols = new Set();
  108780. for (var _b = 0, _c = this.data; _b < _c.length; _b++) {
  108781. var _d = _c[_b], summary = _d.summary, metadata = _d.metadata, isLibrary = _d.isLibrary;
  108782. if (summary.summaryKind === CompileSummaryKind.NgModule) {
  108783. // collect the symbols that refer to NgModule classes.
  108784. // Note: we can't just rely on `summary.type.summaryKind` to determine this as
  108785. // we don't add the summaries of all referenced symbols when we serialize type summaries.
  108786. // See serializeSummaries for details.
  108787. ngModuleSymbols.add(summary.type.reference);
  108788. var /** @type {?} */ modSummary = /** @type {?} */ (summary);
  108789. for (var _e = 0, _f = modSummary.modules; _e < _f.length; _e++) {
  108790. var mod = _f[_e];
  108791. ngModuleSymbols.add(mod.reference);
  108792. }
  108793. }
  108794. if (!isLibrary) {
  108795. var /** @type {?} */ fnName = summaryForJitName(summary.type.reference.name);
  108796. createSummaryForJitFunction(this.outputCtx, summary.type.reference, this.serializeSummaryWithDeps(summary, /** @type {?} */ ((metadata))));
  108797. }
  108798. }
  108799. ngModuleSymbols.forEach(function (ngModuleSymbol) {
  108800. if (_this.summaryResolver.isLibraryFile(ngModuleSymbol.filePath)) {
  108801. var /** @type {?} */ exportAs = exportAsBySymbol.get(ngModuleSymbol) || ngModuleSymbol.name;
  108802. var /** @type {?} */ jitExportAsName = summaryForJitName(exportAs);
  108803. _this.outputCtx.statements.push(variable(jitExportAsName)
  108804. .set(_this.serializeSummaryRef(ngModuleSymbol))
  108805. .toDeclStmt(null, [StmtModifier.Exported]));
  108806. }
  108807. });
  108808. };
  108809. /**
  108810. * @param {?} summary
  108811. * @param {?} metadata
  108812. * @return {?}
  108813. */
  108814. ForJitSerializer.prototype.serializeSummaryWithDeps = /**
  108815. * @param {?} summary
  108816. * @param {?} metadata
  108817. * @return {?}
  108818. */
  108819. function (summary, metadata) {
  108820. var _this = this;
  108821. var /** @type {?} */ expressions = [this.serializeSummary(summary)];
  108822. var /** @type {?} */ providers = [];
  108823. if (metadata instanceof CompileNgModuleMetadata) {
  108824. expressions.push.apply(expressions,
  108825. // For directives / pipes, we only add the declared ones,
  108826. // and rely on transitively importing NgModules to get the transitive
  108827. // summaries.
  108828. metadata.declaredDirectives.concat(metadata.declaredPipes)
  108829. .map(function (type) { return type.reference; })
  108830. .concat(metadata.transitiveModule.modules.map(function (type) { return type.reference; })
  108831. .filter(function (ref) { return ref !== metadata.type.reference; }))
  108832. .map(function (ref) { return _this.serializeSummaryRef(ref); }));
  108833. // Note: We don't use `NgModuleSummary.providers`, as that one is transitive,
  108834. // and we already have transitive modules.
  108835. providers = metadata.providers;
  108836. }
  108837. else if (summary.summaryKind === CompileSummaryKind.Directive) {
  108838. var /** @type {?} */ dirSummary = /** @type {?} */ (summary);
  108839. providers = dirSummary.providers.concat(dirSummary.viewProviders);
  108840. }
  108841. // Note: We can't just refer to the `ngsummary.ts` files for `useClass` providers (as we do for
  108842. // declaredDirectives / declaredPipes), as we allow
  108843. // providers without ctor arguments to skip the `@Injectable` decorator,
  108844. // i.e. we didn't generate .ngsummary.ts files for these.
  108845. expressions.push.apply(expressions, providers.filter(function (provider) { return !!provider.useClass; }).map(function (provider) {
  108846. return _this.serializeSummary(/** @type {?} */ ({
  108847. summaryKind: CompileSummaryKind.Injectable, type: provider.useClass
  108848. }));
  108849. }));
  108850. return literalArr(expressions);
  108851. };
  108852. /**
  108853. * @param {?} typeSymbol
  108854. * @return {?}
  108855. */
  108856. ForJitSerializer.prototype.serializeSummaryRef = /**
  108857. * @param {?} typeSymbol
  108858. * @return {?}
  108859. */
  108860. function (typeSymbol) {
  108861. var /** @type {?} */ jitImportedSymbol = this.symbolResolver.getStaticSymbol(summaryForJitFileName(typeSymbol.filePath), summaryForJitName(typeSymbol.name));
  108862. return this.outputCtx.importExpr(jitImportedSymbol);
  108863. };
  108864. /**
  108865. * @param {?} data
  108866. * @return {?}
  108867. */
  108868. ForJitSerializer.prototype.serializeSummary = /**
  108869. * @param {?} data
  108870. * @return {?}
  108871. */
  108872. function (data) {
  108873. var /** @type {?} */ outputCtx = this.outputCtx;
  108874. var Transformer = /** @class */ (function () {
  108875. function Transformer() {
  108876. }
  108877. /**
  108878. * @param {?} arr
  108879. * @param {?} context
  108880. * @return {?}
  108881. */
  108882. Transformer.prototype.visitArray = /**
  108883. * @param {?} arr
  108884. * @param {?} context
  108885. * @return {?}
  108886. */
  108887. function (arr, context) {
  108888. var _this = this;
  108889. return literalArr(arr.map(function (entry) { return visitValue(entry, _this, context); }));
  108890. };
  108891. /**
  108892. * @param {?} map
  108893. * @param {?} context
  108894. * @return {?}
  108895. */
  108896. Transformer.prototype.visitStringMap = /**
  108897. * @param {?} map
  108898. * @param {?} context
  108899. * @return {?}
  108900. */
  108901. function (map, context) {
  108902. var _this = this;
  108903. return new LiteralMapExpr(Object.keys(map).map(function (key) { return new LiteralMapEntry(key, visitValue(map[key], _this, context), false); }));
  108904. };
  108905. /**
  108906. * @param {?} value
  108907. * @param {?} context
  108908. * @return {?}
  108909. */
  108910. Transformer.prototype.visitPrimitive = /**
  108911. * @param {?} value
  108912. * @param {?} context
  108913. * @return {?}
  108914. */
  108915. function (value, context) { return literal(value); };
  108916. /**
  108917. * @param {?} value
  108918. * @param {?} context
  108919. * @return {?}
  108920. */
  108921. Transformer.prototype.visitOther = /**
  108922. * @param {?} value
  108923. * @param {?} context
  108924. * @return {?}
  108925. */
  108926. function (value, context) {
  108927. if (value instanceof StaticSymbol) {
  108928. return outputCtx.importExpr(value);
  108929. }
  108930. else {
  108931. throw new Error("Illegal State: Encountered value " + value);
  108932. }
  108933. };
  108934. return Transformer;
  108935. }());
  108936. return visitValue(data, new Transformer(), null);
  108937. };
  108938. return ForJitSerializer;
  108939. }());
  108940. var FromJsonDeserializer = /** @class */ (function (_super) {
  108941. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(FromJsonDeserializer, _super);
  108942. function FromJsonDeserializer(symbolCache, summaryResolver) {
  108943. var _this = _super.call(this) || this;
  108944. _this.symbolCache = symbolCache;
  108945. _this.summaryResolver = summaryResolver;
  108946. return _this;
  108947. }
  108948. /**
  108949. * @param {?} libraryFileName
  108950. * @param {?} json
  108951. * @return {?}
  108952. */
  108953. FromJsonDeserializer.prototype.deserialize = /**
  108954. * @param {?} libraryFileName
  108955. * @param {?} json
  108956. * @return {?}
  108957. */
  108958. function (libraryFileName, json) {
  108959. var _this = this;
  108960. var /** @type {?} */ data = JSON.parse(json);
  108961. var /** @type {?} */ allImportAs = [];
  108962. this.symbols = data.symbols.map(function (serializedSymbol) {
  108963. return _this.symbolCache.get(_this.summaryResolver.fromSummaryFileName(serializedSymbol.filePath, libraryFileName), serializedSymbol.name);
  108964. });
  108965. data.symbols.forEach(function (serializedSymbol, index) {
  108966. var /** @type {?} */ symbol = _this.symbols[index];
  108967. var /** @type {?} */ importAs = serializedSymbol.importAs;
  108968. if (typeof importAs === 'number') {
  108969. allImportAs.push({ symbol: symbol, importAs: _this.symbols[importAs] });
  108970. }
  108971. else if (typeof importAs === 'string') {
  108972. allImportAs.push({ symbol: symbol, importAs: _this.symbolCache.get(ngfactoryFilePath(libraryFileName), importAs) });
  108973. }
  108974. });
  108975. var /** @type {?} */ summaries = /** @type {?} */ (visitValue(data.summaries, this, null));
  108976. return { moduleName: data.moduleName, summaries: summaries, importAs: allImportAs };
  108977. };
  108978. /**
  108979. * @param {?} map
  108980. * @param {?} context
  108981. * @return {?}
  108982. */
  108983. FromJsonDeserializer.prototype.visitStringMap = /**
  108984. * @param {?} map
  108985. * @param {?} context
  108986. * @return {?}
  108987. */
  108988. function (map, context) {
  108989. if ('__symbol' in map) {
  108990. var /** @type {?} */ baseSymbol = this.symbols[map['__symbol']];
  108991. var /** @type {?} */ members = map['members'];
  108992. return members.length ? this.symbolCache.get(baseSymbol.filePath, baseSymbol.name, members) :
  108993. baseSymbol;
  108994. }
  108995. else {
  108996. return _super.prototype.visitStringMap.call(this, map, context);
  108997. }
  108998. };
  108999. return FromJsonDeserializer;
  109000. }(ValueTransformer));
  109001. /**
  109002. * @param {?} metadata
  109003. * @return {?}
  109004. */
  109005. function isCall(metadata) {
  109006. return metadata && metadata.__symbolic === 'call';
  109007. }
  109008. /**
  109009. * @param {?} metadata
  109010. * @return {?}
  109011. */
  109012. function isFunctionCall(metadata) {
  109013. return isCall(metadata) && unwrapResolvedMetadata(metadata.expression) instanceof StaticSymbol;
  109014. }
  109015. /**
  109016. * @param {?} metadata
  109017. * @return {?}
  109018. */
  109019. function isMethodCallOnVariable(metadata) {
  109020. return isCall(metadata) && metadata.expression && metadata.expression.__symbolic === 'select' &&
  109021. unwrapResolvedMetadata(metadata.expression.expression) instanceof StaticSymbol;
  109022. }
  109023. /**
  109024. * @fileoverview added by tsickle
  109025. * @suppress {checkTypes} checked by tsc
  109026. */
  109027. /**
  109028. * @license
  109029. * Copyright Google Inc. All Rights Reserved.
  109030. *
  109031. * Use of this source code is governed by an MIT-style license that can be
  109032. * found in the LICENSE file at https://angular.io/license
  109033. */
  109034. /** @enum {number} */
  109035. var StubEmitFlags = {
  109036. Basic: 1,
  109037. TypeCheck: 2,
  109038. All: 3,
  109039. };
  109040. StubEmitFlags[StubEmitFlags.Basic] = "Basic";
  109041. StubEmitFlags[StubEmitFlags.TypeCheck] = "TypeCheck";
  109042. StubEmitFlags[StubEmitFlags.All] = "All";
  109043. var AotCompiler = /** @class */ (function () {
  109044. function AotCompiler(_config, _options, _host, _reflector, _metadataResolver, _templateParser, _styleCompiler, _viewCompiler, _typeCheckCompiler, _ngModuleCompiler, _outputEmitter, _summaryResolver, _symbolResolver) {
  109045. this._config = _config;
  109046. this._options = _options;
  109047. this._host = _host;
  109048. this._reflector = _reflector;
  109049. this._metadataResolver = _metadataResolver;
  109050. this._templateParser = _templateParser;
  109051. this._styleCompiler = _styleCompiler;
  109052. this._viewCompiler = _viewCompiler;
  109053. this._typeCheckCompiler = _typeCheckCompiler;
  109054. this._ngModuleCompiler = _ngModuleCompiler;
  109055. this._outputEmitter = _outputEmitter;
  109056. this._summaryResolver = _summaryResolver;
  109057. this._symbolResolver = _symbolResolver;
  109058. this._templateAstCache = new Map();
  109059. this._analyzedFiles = new Map();
  109060. }
  109061. /**
  109062. * @return {?}
  109063. */
  109064. AotCompiler.prototype.clearCache = /**
  109065. * @return {?}
  109066. */
  109067. function () { this._metadataResolver.clearCache(); };
  109068. /**
  109069. * @param {?} rootFiles
  109070. * @return {?}
  109071. */
  109072. AotCompiler.prototype.analyzeModulesSync = /**
  109073. * @param {?} rootFiles
  109074. * @return {?}
  109075. */
  109076. function (rootFiles) {
  109077. var _this = this;
  109078. var /** @type {?} */ analyzeResult = analyzeAndValidateNgModules(rootFiles, this._host, this._symbolResolver, this._metadataResolver);
  109079. analyzeResult.ngModules.forEach(function (ngModule) {
  109080. return _this._metadataResolver.loadNgModuleDirectiveAndPipeMetadata(ngModule.type.reference, true);
  109081. });
  109082. return analyzeResult;
  109083. };
  109084. /**
  109085. * @param {?} rootFiles
  109086. * @return {?}
  109087. */
  109088. AotCompiler.prototype.analyzeModulesAsync = /**
  109089. * @param {?} rootFiles
  109090. * @return {?}
  109091. */
  109092. function (rootFiles) {
  109093. var _this = this;
  109094. var /** @type {?} */ analyzeResult = analyzeAndValidateNgModules(rootFiles, this._host, this._symbolResolver, this._metadataResolver);
  109095. return Promise
  109096. .all(analyzeResult.ngModules.map(function (ngModule) {
  109097. return _this._metadataResolver.loadNgModuleDirectiveAndPipeMetadata(ngModule.type.reference, false);
  109098. }))
  109099. .then(function () { return analyzeResult; });
  109100. };
  109101. /**
  109102. * @param {?} fileName
  109103. * @return {?}
  109104. */
  109105. AotCompiler.prototype._analyzeFile = /**
  109106. * @param {?} fileName
  109107. * @return {?}
  109108. */
  109109. function (fileName) {
  109110. var /** @type {?} */ analyzedFile = this._analyzedFiles.get(fileName);
  109111. if (!analyzedFile) {
  109112. analyzedFile =
  109113. analyzeFile(this._host, this._symbolResolver, this._metadataResolver, fileName);
  109114. this._analyzedFiles.set(fileName, analyzedFile);
  109115. }
  109116. return analyzedFile;
  109117. };
  109118. /**
  109119. * @param {?} fileName
  109120. * @return {?}
  109121. */
  109122. AotCompiler.prototype.findGeneratedFileNames = /**
  109123. * @param {?} fileName
  109124. * @return {?}
  109125. */
  109126. function (fileName) {
  109127. var _this = this;
  109128. var /** @type {?} */ genFileNames = [];
  109129. var /** @type {?} */ file = this._analyzeFile(fileName);
  109130. // Make sure we create a .ngfactory if we have a injectable/directive/pipe/NgModule
  109131. // or a reference to a non source file.
  109132. // Note: This is overestimating the required .ngfactory files as the real calculation is harder.
  109133. // Only do this for StubEmitFlags.Basic, as adding a type check block
  109134. // does not change this file (as we generate type check blocks based on NgModules).
  109135. if (this._options.allowEmptyCodegenFiles || file.directives.length || file.pipes.length ||
  109136. file.injectables.length || file.ngModules.length || file.exportsNonSourceFiles) {
  109137. genFileNames.push(ngfactoryFilePath(file.fileName, true));
  109138. if (this._options.enableSummariesForJit) {
  109139. genFileNames.push(summaryForJitFileName(file.fileName, true));
  109140. }
  109141. }
  109142. var /** @type {?} */ fileSuffix = normalizeGenFileSuffix(splitTypescriptSuffix(file.fileName, true)[1]);
  109143. file.directives.forEach(function (dirSymbol) {
  109144. var /** @type {?} */ compMeta = /** @type {?} */ ((_this._metadataResolver.getNonNormalizedDirectiveMetadata(dirSymbol))).metadata;
  109145. if (!compMeta.isComponent) {
  109146. return;
  109147. } /** @type {?} */
  109148. ((
  109149. // Note: compMeta is a component and therefore template is non null.
  109150. compMeta.template)).styleUrls.forEach(function (styleUrl) {
  109151. var /** @type {?} */ normalizedUrl = _this._host.resourceNameToFileName(styleUrl, file.fileName);
  109152. if (!normalizedUrl) {
  109153. throw syntaxError("Couldn't resolve resource " + styleUrl + " relative to " + file.fileName);
  109154. }
  109155. var /** @type {?} */ needsShim = (/** @type {?} */ ((compMeta.template)).encapsulation || _this._config.defaultEncapsulation) === ViewEncapsulation.Emulated;
  109156. genFileNames.push(_stylesModuleUrl(normalizedUrl, needsShim, fileSuffix));
  109157. if (_this._options.allowEmptyCodegenFiles) {
  109158. genFileNames.push(_stylesModuleUrl(normalizedUrl, !needsShim, fileSuffix));
  109159. }
  109160. });
  109161. });
  109162. return genFileNames;
  109163. };
  109164. /**
  109165. * @param {?} genFileName
  109166. * @param {?=} originalFileName
  109167. * @return {?}
  109168. */
  109169. AotCompiler.prototype.emitBasicStub = /**
  109170. * @param {?} genFileName
  109171. * @param {?=} originalFileName
  109172. * @return {?}
  109173. */
  109174. function (genFileName, originalFileName) {
  109175. var /** @type {?} */ outputCtx = this._createOutputContext(genFileName);
  109176. if (genFileName.endsWith('.ngfactory.ts')) {
  109177. if (!originalFileName) {
  109178. throw new Error("Assertion error: require the original file for .ngfactory.ts stubs. File: " + genFileName);
  109179. }
  109180. var /** @type {?} */ originalFile = this._analyzeFile(originalFileName);
  109181. this._createNgFactoryStub(outputCtx, originalFile, StubEmitFlags.Basic);
  109182. }
  109183. else if (genFileName.endsWith('.ngsummary.ts')) {
  109184. if (this._options.enableSummariesForJit) {
  109185. if (!originalFileName) {
  109186. throw new Error("Assertion error: require the original file for .ngsummary.ts stubs. File: " + genFileName);
  109187. }
  109188. var /** @type {?} */ originalFile = this._analyzeFile(originalFileName);
  109189. _createEmptyStub(outputCtx);
  109190. originalFile.ngModules.forEach(function (ngModule) {
  109191. // create exports that user code can reference
  109192. createForJitStub(outputCtx, ngModule.type.reference);
  109193. });
  109194. }
  109195. }
  109196. else if (genFileName.endsWith('.ngstyle.ts')) {
  109197. _createEmptyStub(outputCtx);
  109198. }
  109199. // Note: for the stubs, we don't need a property srcFileUrl,
  109200. // as lateron in emitAllImpls we will create the proper GeneratedFiles with the
  109201. // correct srcFileUrl.
  109202. // This is good as e.g. for .ngstyle.ts files we can't derive
  109203. // the url of components based on the genFileUrl.
  109204. return this._codegenSourceModule('unknown', outputCtx);
  109205. };
  109206. /**
  109207. * @param {?} genFileName
  109208. * @param {?} originalFileName
  109209. * @return {?}
  109210. */
  109211. AotCompiler.prototype.emitTypeCheckStub = /**
  109212. * @param {?} genFileName
  109213. * @param {?} originalFileName
  109214. * @return {?}
  109215. */
  109216. function (genFileName, originalFileName) {
  109217. var /** @type {?} */ originalFile = this._analyzeFile(originalFileName);
  109218. var /** @type {?} */ outputCtx = this._createOutputContext(genFileName);
  109219. if (genFileName.endsWith('.ngfactory.ts')) {
  109220. this._createNgFactoryStub(outputCtx, originalFile, StubEmitFlags.TypeCheck);
  109221. }
  109222. return outputCtx.statements.length > 0 ?
  109223. this._codegenSourceModule(originalFile.fileName, outputCtx) :
  109224. null;
  109225. };
  109226. /**
  109227. * @param {?} fileNames
  109228. * @return {?}
  109229. */
  109230. AotCompiler.prototype.loadFilesAsync = /**
  109231. * @param {?} fileNames
  109232. * @return {?}
  109233. */
  109234. function (fileNames) {
  109235. var _this = this;
  109236. var /** @type {?} */ files = fileNames.map(function (fileName) { return _this._analyzeFile(fileName); });
  109237. var /** @type {?} */ loadingPromises = [];
  109238. files.forEach(function (file) {
  109239. return file.ngModules.forEach(function (ngModule) {
  109240. return loadingPromises.push(_this._metadataResolver.loadNgModuleDirectiveAndPipeMetadata(ngModule.type.reference, false));
  109241. });
  109242. });
  109243. return Promise.all(loadingPromises).then(function (_) { return mergeAndValidateNgFiles(files); });
  109244. };
  109245. /**
  109246. * @param {?} fileNames
  109247. * @return {?}
  109248. */
  109249. AotCompiler.prototype.loadFilesSync = /**
  109250. * @param {?} fileNames
  109251. * @return {?}
  109252. */
  109253. function (fileNames) {
  109254. var _this = this;
  109255. var /** @type {?} */ files = fileNames.map(function (fileName) { return _this._analyzeFile(fileName); });
  109256. files.forEach(function (file) {
  109257. return file.ngModules.forEach(function (ngModule) {
  109258. return _this._metadataResolver.loadNgModuleDirectiveAndPipeMetadata(ngModule.type.reference, true);
  109259. });
  109260. });
  109261. return mergeAndValidateNgFiles(files);
  109262. };
  109263. /**
  109264. * @param {?} outputCtx
  109265. * @param {?} file
  109266. * @param {?} emitFlags
  109267. * @return {?}
  109268. */
  109269. AotCompiler.prototype._createNgFactoryStub = /**
  109270. * @param {?} outputCtx
  109271. * @param {?} file
  109272. * @param {?} emitFlags
  109273. * @return {?}
  109274. */
  109275. function (outputCtx, file, emitFlags) {
  109276. var _this = this;
  109277. var /** @type {?} */ componentId = 0;
  109278. file.ngModules.forEach(function (ngModuleMeta, ngModuleIndex) {
  109279. // Note: the code below needs to executed for StubEmitFlags.Basic and StubEmitFlags.TypeCheck,
  109280. // so we don't change the .ngfactory file too much when adding the typecheck block.
  109281. // create exports that user code can reference
  109282. // Note: the code below needs to executed for StubEmitFlags.Basic and StubEmitFlags.TypeCheck,
  109283. // so we don't change the .ngfactory file too much when adding the typecheck block.
  109284. // create exports that user code can reference
  109285. _this._ngModuleCompiler.createStub(outputCtx, ngModuleMeta.type.reference);
  109286. // add references to the symbols from the metadata.
  109287. // These can be used by the type check block for components,
  109288. // and they also cause TypeScript to include these files into the program too,
  109289. // which will make them part of the analyzedFiles.
  109290. var /** @type {?} */ externalReferences = ngModuleMeta.transitiveModule.directives.map(function (d) { return d.reference; }).concat(ngModuleMeta.transitiveModule.pipes.map(function (d) { return d.reference; }), ngModuleMeta.importedModules.map(function (m) { return m.type.reference; }), ngModuleMeta.exportedModules.map(function (m) { return m.type.reference; }), _this._externalIdentifierReferences([Identifiers.TemplateRef, Identifiers.ElementRef]));
  109291. var /** @type {?} */ externalReferenceVars = new Map();
  109292. externalReferences.forEach(function (ref, typeIndex) {
  109293. externalReferenceVars.set(ref, "_decl" + ngModuleIndex + "_" + typeIndex);
  109294. });
  109295. externalReferenceVars.forEach(function (varName, reference) {
  109296. outputCtx.statements.push(variable(varName)
  109297. .set(NULL_EXPR.cast(DYNAMIC_TYPE))
  109298. .toDeclStmt(expressionType(outputCtx.importExpr(reference, /* typeParams */ null, /* useSummaries */ /* useSummaries */ false))));
  109299. });
  109300. if (emitFlags & StubEmitFlags.TypeCheck) {
  109301. // add the typecheck block for all components of the NgModule
  109302. ngModuleMeta.declaredDirectives.forEach(function (dirId) {
  109303. var /** @type {?} */ compMeta = _this._metadataResolver.getDirectiveMetadata(dirId.reference);
  109304. if (!compMeta.isComponent) {
  109305. return;
  109306. }
  109307. componentId++;
  109308. _this._createTypeCheckBlock(outputCtx, compMeta.type.reference.name + "_Host_" + componentId, ngModuleMeta, _this._metadataResolver.getHostComponentMetadata(compMeta), [compMeta.type], externalReferenceVars);
  109309. _this._createTypeCheckBlock(outputCtx, compMeta.type.reference.name + "_" + componentId, ngModuleMeta, compMeta, ngModuleMeta.transitiveModule.directives, externalReferenceVars);
  109310. });
  109311. }
  109312. });
  109313. if (outputCtx.statements.length === 0) {
  109314. _createEmptyStub(outputCtx);
  109315. }
  109316. };
  109317. /**
  109318. * @param {?} references
  109319. * @return {?}
  109320. */
  109321. AotCompiler.prototype._externalIdentifierReferences = /**
  109322. * @param {?} references
  109323. * @return {?}
  109324. */
  109325. function (references) {
  109326. var /** @type {?} */ result = [];
  109327. for (var _i = 0, references_1 = references; _i < references_1.length; _i++) {
  109328. var reference = references_1[_i];
  109329. var /** @type {?} */ token = createTokenForExternalReference(this._reflector, reference);
  109330. if (token.identifier) {
  109331. result.push(token.identifier.reference);
  109332. }
  109333. }
  109334. return result;
  109335. };
  109336. /**
  109337. * @param {?} ctx
  109338. * @param {?} componentId
  109339. * @param {?} moduleMeta
  109340. * @param {?} compMeta
  109341. * @param {?} directives
  109342. * @param {?} externalReferenceVars
  109343. * @return {?}
  109344. */
  109345. AotCompiler.prototype._createTypeCheckBlock = /**
  109346. * @param {?} ctx
  109347. * @param {?} componentId
  109348. * @param {?} moduleMeta
  109349. * @param {?} compMeta
  109350. * @param {?} directives
  109351. * @param {?} externalReferenceVars
  109352. * @return {?}
  109353. */
  109354. function (ctx, componentId, moduleMeta, compMeta, directives, externalReferenceVars) {
  109355. var _a = this._parseTemplate(compMeta, moduleMeta, directives), parsedTemplate = _a.template, usedPipes = _a.pipes;
  109356. (_b = ctx.statements).push.apply(_b, this._typeCheckCompiler.compileComponent(componentId, compMeta, parsedTemplate, usedPipes, externalReferenceVars, ctx));
  109357. var _b;
  109358. };
  109359. /**
  109360. * @param {?} analyzeResult
  109361. * @param {?} locale
  109362. * @return {?}
  109363. */
  109364. AotCompiler.prototype.emitMessageBundle = /**
  109365. * @param {?} analyzeResult
  109366. * @param {?} locale
  109367. * @return {?}
  109368. */
  109369. function (analyzeResult, locale) {
  109370. var _this = this;
  109371. var /** @type {?} */ errors = [];
  109372. var /** @type {?} */ htmlParser = new HtmlParser();
  109373. // TODO(vicb): implicit tags & attributes
  109374. var /** @type {?} */ messageBundle = new MessageBundle(htmlParser, [], {}, locale);
  109375. analyzeResult.files.forEach(function (file) {
  109376. var /** @type {?} */ compMetas = [];
  109377. file.directives.forEach(function (directiveType) {
  109378. var /** @type {?} */ dirMeta = _this._metadataResolver.getDirectiveMetadata(directiveType);
  109379. if (dirMeta && dirMeta.isComponent) {
  109380. compMetas.push(dirMeta);
  109381. }
  109382. });
  109383. compMetas.forEach(function (compMeta) {
  109384. var /** @type {?} */ html = /** @type {?} */ ((/** @type {?} */ ((compMeta.template)).template));
  109385. var /** @type {?} */ interpolationConfig = InterpolationConfig.fromArray(/** @type {?} */ ((compMeta.template)).interpolation);
  109386. errors.push.apply(errors, /** @type {?} */ ((messageBundle.updateFromTemplate(html, file.fileName, interpolationConfig))));
  109387. });
  109388. });
  109389. if (errors.length) {
  109390. throw new Error(errors.map(function (e) { return e.toString(); }).join('\n'));
  109391. }
  109392. return messageBundle;
  109393. };
  109394. /**
  109395. * @param {?} analyzeResult
  109396. * @return {?}
  109397. */
  109398. AotCompiler.prototype.emitAllImpls = /**
  109399. * @param {?} analyzeResult
  109400. * @return {?}
  109401. */
  109402. function (analyzeResult) {
  109403. var _this = this;
  109404. var ngModuleByPipeOrDirective = analyzeResult.ngModuleByPipeOrDirective, files = analyzeResult.files;
  109405. var /** @type {?} */ sourceModules = files.map(function (file) {
  109406. return _this._compileImplFile(file.fileName, ngModuleByPipeOrDirective, file.directives, file.pipes, file.ngModules, file.injectables);
  109407. });
  109408. return flatten(sourceModules);
  109409. };
  109410. /**
  109411. * @param {?} srcFileUrl
  109412. * @param {?} ngModuleByPipeOrDirective
  109413. * @param {?} directives
  109414. * @param {?} pipes
  109415. * @param {?} ngModules
  109416. * @param {?} injectables
  109417. * @return {?}
  109418. */
  109419. AotCompiler.prototype._compileImplFile = /**
  109420. * @param {?} srcFileUrl
  109421. * @param {?} ngModuleByPipeOrDirective
  109422. * @param {?} directives
  109423. * @param {?} pipes
  109424. * @param {?} ngModules
  109425. * @param {?} injectables
  109426. * @return {?}
  109427. */
  109428. function (srcFileUrl, ngModuleByPipeOrDirective, directives, pipes, ngModules, injectables) {
  109429. var _this = this;
  109430. var /** @type {?} */ fileSuffix = normalizeGenFileSuffix(splitTypescriptSuffix(srcFileUrl, true)[1]);
  109431. var /** @type {?} */ generatedFiles = [];
  109432. var /** @type {?} */ outputCtx = this._createOutputContext(ngfactoryFilePath(srcFileUrl, true));
  109433. generatedFiles.push.apply(generatedFiles, this._createSummary(srcFileUrl, directives, pipes, ngModules, injectables, outputCtx));
  109434. // compile all ng modules
  109435. ngModules.forEach(function (ngModuleMeta) { return _this._compileModule(outputCtx, ngModuleMeta); });
  109436. // compile components
  109437. directives.forEach(function (dirType) {
  109438. var /** @type {?} */ compMeta = _this._metadataResolver.getDirectiveMetadata(/** @type {?} */ (dirType));
  109439. if (!compMeta.isComponent) {
  109440. return;
  109441. }
  109442. var /** @type {?} */ ngModule = ngModuleByPipeOrDirective.get(dirType);
  109443. if (!ngModule) {
  109444. throw new Error("Internal Error: cannot determine the module for component " + identifierName(compMeta.type) + "!");
  109445. }
  109446. // compile styles
  109447. var /** @type {?} */ componentStylesheet = _this._styleCompiler.compileComponent(outputCtx, compMeta); /** @type {?} */
  109448. ((
  109449. // Note: compMeta is a component and therefore template is non null.
  109450. compMeta.template)).externalStylesheets.forEach(function (stylesheetMeta) {
  109451. // Note: fill non shim and shim style files as they might
  109452. // be shared by component with and without ViewEncapsulation.
  109453. var /** @type {?} */ shim = _this._styleCompiler.needsStyleShim(compMeta);
  109454. generatedFiles.push(_this._codegenStyles(srcFileUrl, compMeta, stylesheetMeta, shim, fileSuffix));
  109455. if (_this._options.allowEmptyCodegenFiles) {
  109456. generatedFiles.push(_this._codegenStyles(srcFileUrl, compMeta, stylesheetMeta, !shim, fileSuffix));
  109457. }
  109458. });
  109459. // compile components
  109460. var /** @type {?} */ compViewVars = _this._compileComponent(outputCtx, compMeta, ngModule, ngModule.transitiveModule.directives, componentStylesheet, fileSuffix);
  109461. _this._compileComponentFactory(outputCtx, compMeta, ngModule, fileSuffix);
  109462. });
  109463. if (outputCtx.statements.length > 0 || this._options.allowEmptyCodegenFiles) {
  109464. var /** @type {?} */ srcModule = this._codegenSourceModule(srcFileUrl, outputCtx);
  109465. generatedFiles.unshift(srcModule);
  109466. }
  109467. return generatedFiles;
  109468. };
  109469. /**
  109470. * @param {?} srcFileName
  109471. * @param {?} directives
  109472. * @param {?} pipes
  109473. * @param {?} ngModules
  109474. * @param {?} injectables
  109475. * @param {?} ngFactoryCtx
  109476. * @return {?}
  109477. */
  109478. AotCompiler.prototype._createSummary = /**
  109479. * @param {?} srcFileName
  109480. * @param {?} directives
  109481. * @param {?} pipes
  109482. * @param {?} ngModules
  109483. * @param {?} injectables
  109484. * @param {?} ngFactoryCtx
  109485. * @return {?}
  109486. */
  109487. function (srcFileName, directives, pipes, ngModules, injectables, ngFactoryCtx) {
  109488. var _this = this;
  109489. var /** @type {?} */ symbolSummaries = this._symbolResolver.getSymbolsOf(srcFileName)
  109490. .map(function (symbol) { return _this._symbolResolver.resolveSymbol(symbol); });
  109491. var /** @type {?} */ typeData = ngModules.map(function (meta) {
  109492. return ({
  109493. summary: /** @type {?} */ ((_this._metadataResolver.getNgModuleSummary(meta.type.reference))),
  109494. metadata: /** @type {?} */ ((_this._metadataResolver.getNgModuleMetadata(meta.type.reference)))
  109495. });
  109496. }).concat(directives.map(function (ref) {
  109497. return ({
  109498. summary: /** @type {?} */ ((_this._metadataResolver.getDirectiveSummary(ref))),
  109499. metadata: /** @type {?} */ ((_this._metadataResolver.getDirectiveMetadata(ref)))
  109500. });
  109501. }), pipes.map(function (ref) {
  109502. return ({
  109503. summary: /** @type {?} */ ((_this._metadataResolver.getPipeSummary(ref))),
  109504. metadata: /** @type {?} */ ((_this._metadataResolver.getPipeMetadata(ref)))
  109505. });
  109506. }), injectables.map(function (ref) {
  109507. return ({
  109508. summary: /** @type {?} */ ((_this._metadataResolver.getInjectableSummary(ref))),
  109509. metadata: /** @type {?} */ ((_this._metadataResolver.getInjectableSummary(ref))).type
  109510. });
  109511. }));
  109512. var /** @type {?} */ forJitOutputCtx = this._options.enableSummariesForJit ?
  109513. this._createOutputContext(summaryForJitFileName(srcFileName, true)) :
  109514. null;
  109515. var _a = serializeSummaries(srcFileName, forJitOutputCtx, this._summaryResolver, this._symbolResolver, symbolSummaries, typeData), json = _a.json, exportAs = _a.exportAs;
  109516. exportAs.forEach(function (entry) {
  109517. ngFactoryCtx.statements.push(variable(entry.exportAs).set(ngFactoryCtx.importExpr(entry.symbol)).toDeclStmt(null, [
  109518. StmtModifier.Exported
  109519. ]));
  109520. });
  109521. var /** @type {?} */ summaryJson = new GeneratedFile(srcFileName, summaryFileName(srcFileName), json);
  109522. var /** @type {?} */ result = [summaryJson];
  109523. if (forJitOutputCtx) {
  109524. result.push(this._codegenSourceModule(srcFileName, forJitOutputCtx));
  109525. }
  109526. return result;
  109527. };
  109528. /**
  109529. * @param {?} outputCtx
  109530. * @param {?} ngModule
  109531. * @return {?}
  109532. */
  109533. AotCompiler.prototype._compileModule = /**
  109534. * @param {?} outputCtx
  109535. * @param {?} ngModule
  109536. * @return {?}
  109537. */
  109538. function (outputCtx, ngModule) {
  109539. var /** @type {?} */ providers = [];
  109540. if (this._options.locale) {
  109541. var /** @type {?} */ normalizedLocale = this._options.locale.replace(/_/g, '-');
  109542. providers.push({
  109543. token: createTokenForExternalReference(this._reflector, Identifiers.LOCALE_ID),
  109544. useValue: normalizedLocale,
  109545. });
  109546. }
  109547. if (this._options.i18nFormat) {
  109548. providers.push({
  109549. token: createTokenForExternalReference(this._reflector, Identifiers.TRANSLATIONS_FORMAT),
  109550. useValue: this._options.i18nFormat
  109551. });
  109552. }
  109553. this._ngModuleCompiler.compile(outputCtx, ngModule, providers);
  109554. };
  109555. /**
  109556. * @param {?} outputCtx
  109557. * @param {?} compMeta
  109558. * @param {?} ngModule
  109559. * @param {?} fileSuffix
  109560. * @return {?}
  109561. */
  109562. AotCompiler.prototype._compileComponentFactory = /**
  109563. * @param {?} outputCtx
  109564. * @param {?} compMeta
  109565. * @param {?} ngModule
  109566. * @param {?} fileSuffix
  109567. * @return {?}
  109568. */
  109569. function (outputCtx, compMeta, ngModule, fileSuffix) {
  109570. var /** @type {?} */ hostMeta = this._metadataResolver.getHostComponentMetadata(compMeta);
  109571. var /** @type {?} */ hostViewFactoryVar = this._compileComponent(outputCtx, hostMeta, ngModule, [compMeta.type], null, fileSuffix)
  109572. .viewClassVar;
  109573. var /** @type {?} */ compFactoryVar = componentFactoryName(compMeta.type.reference);
  109574. var /** @type {?} */ inputsExprs = [];
  109575. for (var /** @type {?} */ propName in compMeta.inputs) {
  109576. var /** @type {?} */ templateName = compMeta.inputs[propName];
  109577. // Don't quote so that the key gets minified...
  109578. inputsExprs.push(new LiteralMapEntry(propName, literal(templateName), false));
  109579. }
  109580. var /** @type {?} */ outputsExprs = [];
  109581. for (var /** @type {?} */ propName in compMeta.outputs) {
  109582. var /** @type {?} */ templateName = compMeta.outputs[propName];
  109583. // Don't quote so that the key gets minified...
  109584. outputsExprs.push(new LiteralMapEntry(propName, literal(templateName), false));
  109585. }
  109586. outputCtx.statements.push(variable(compFactoryVar)
  109587. .set(importExpr(Identifiers.createComponentFactory).callFn([
  109588. literal(compMeta.selector), outputCtx.importExpr(compMeta.type.reference),
  109589. variable(hostViewFactoryVar), new LiteralMapExpr(inputsExprs),
  109590. new LiteralMapExpr(outputsExprs),
  109591. literalArr(/** @type {?} */ ((compMeta.template)).ngContentSelectors.map(function (selector) { return literal(selector); }))
  109592. ]))
  109593. .toDeclStmt(importType(Identifiers.ComponentFactory, [/** @type {?} */ ((expressionType(outputCtx.importExpr(compMeta.type.reference))))], [TypeModifier.Const]), [StmtModifier.Final, StmtModifier.Exported]));
  109594. };
  109595. /**
  109596. * @param {?} outputCtx
  109597. * @param {?} compMeta
  109598. * @param {?} ngModule
  109599. * @param {?} directiveIdentifiers
  109600. * @param {?} componentStyles
  109601. * @param {?} fileSuffix
  109602. * @return {?}
  109603. */
  109604. AotCompiler.prototype._compileComponent = /**
  109605. * @param {?} outputCtx
  109606. * @param {?} compMeta
  109607. * @param {?} ngModule
  109608. * @param {?} directiveIdentifiers
  109609. * @param {?} componentStyles
  109610. * @param {?} fileSuffix
  109611. * @return {?}
  109612. */
  109613. function (outputCtx, compMeta, ngModule, directiveIdentifiers, componentStyles, fileSuffix) {
  109614. var _a = this._parseTemplate(compMeta, ngModule, directiveIdentifiers), parsedTemplate = _a.template, usedPipes = _a.pipes;
  109615. var /** @type {?} */ stylesExpr = componentStyles ? variable(componentStyles.stylesVar) : literalArr([]);
  109616. var /** @type {?} */ viewResult = this._viewCompiler.compileComponent(outputCtx, compMeta, parsedTemplate, stylesExpr, usedPipes);
  109617. if (componentStyles) {
  109618. _resolveStyleStatements(this._symbolResolver, componentStyles, this._styleCompiler.needsStyleShim(compMeta), fileSuffix);
  109619. }
  109620. return viewResult;
  109621. };
  109622. /**
  109623. * @param {?} compMeta
  109624. * @param {?} ngModule
  109625. * @param {?} directiveIdentifiers
  109626. * @return {?}
  109627. */
  109628. AotCompiler.prototype._parseTemplate = /**
  109629. * @param {?} compMeta
  109630. * @param {?} ngModule
  109631. * @param {?} directiveIdentifiers
  109632. * @return {?}
  109633. */
  109634. function (compMeta, ngModule, directiveIdentifiers) {
  109635. var _this = this;
  109636. if (this._templateAstCache.has(compMeta.type.reference)) {
  109637. return /** @type {?} */ ((this._templateAstCache.get(compMeta.type.reference)));
  109638. }
  109639. var /** @type {?} */ preserveWhitespaces = /** @type {?} */ ((/** @type {?} */ ((compMeta)).template)).preserveWhitespaces;
  109640. var /** @type {?} */ directives = directiveIdentifiers.map(function (dir) { return _this._metadataResolver.getDirectiveSummary(dir.reference); });
  109641. var /** @type {?} */ pipes = ngModule.transitiveModule.pipes.map(function (pipe) { return _this._metadataResolver.getPipeSummary(pipe.reference); });
  109642. var /** @type {?} */ result = this._templateParser.parse(compMeta, /** @type {?} */ ((/** @type {?} */ ((compMeta.template)).htmlAst)), directives, pipes, ngModule.schemas, templateSourceUrl(ngModule.type, compMeta, /** @type {?} */ ((compMeta.template))), preserveWhitespaces);
  109643. this._templateAstCache.set(compMeta.type.reference, result);
  109644. return result;
  109645. };
  109646. /**
  109647. * @param {?} genFilePath
  109648. * @return {?}
  109649. */
  109650. AotCompiler.prototype._createOutputContext = /**
  109651. * @param {?} genFilePath
  109652. * @return {?}
  109653. */
  109654. function (genFilePath) {
  109655. var _this = this;
  109656. var /** @type {?} */ importExpr$$1 = function (symbol, typeParams, useSummaries) {
  109657. if (typeParams === void 0) { typeParams = null; }
  109658. if (useSummaries === void 0) { useSummaries = true; }
  109659. if (!(symbol instanceof StaticSymbol)) {
  109660. throw new Error("Internal error: unknown identifier " + JSON.stringify(symbol));
  109661. }
  109662. var /** @type {?} */ arity = _this._symbolResolver.getTypeArity(symbol) || 0;
  109663. var _a = _this._symbolResolver.getImportAs(symbol, useSummaries) || symbol, filePath = _a.filePath, name = _a.name, members = _a.members;
  109664. var /** @type {?} */ importModule = _this._fileNameToModuleName(filePath, genFilePath);
  109665. // It should be good enough to compare filePath to genFilePath and if they are equal
  109666. // there is a self reference. However, ngfactory files generate to .ts but their
  109667. // symbols have .d.ts so a simple compare is insufficient. They should be canonical
  109668. // and is tracked by #17705.
  109669. var /** @type {?} */ selfReference = _this._fileNameToModuleName(genFilePath, genFilePath);
  109670. var /** @type {?} */ moduleName = importModule === selfReference ? null : importModule;
  109671. // If we are in a type expression that refers to a generic type then supply
  109672. // the required type parameters. If there were not enough type parameters
  109673. // supplied, supply any as the type. Outside a type expression the reference
  109674. // should not supply type parameters and be treated as a simple value reference
  109675. // to the constructor function itself.
  109676. var /** @type {?} */ suppliedTypeParams = typeParams || [];
  109677. var /** @type {?} */ missingTypeParamsCount = arity - suppliedTypeParams.length;
  109678. var /** @type {?} */ allTypeParams = suppliedTypeParams.concat(new Array(missingTypeParamsCount).fill(DYNAMIC_TYPE));
  109679. return members.reduce(function (expr, memberName) { return expr.prop(memberName); }, /** @type {?} */ (importExpr(new ExternalReference(moduleName, name, null), allTypeParams)));
  109680. };
  109681. return { statements: [], genFilePath: genFilePath, importExpr: importExpr$$1 };
  109682. };
  109683. /**
  109684. * @param {?} importedFilePath
  109685. * @param {?} containingFilePath
  109686. * @return {?}
  109687. */
  109688. AotCompiler.prototype._fileNameToModuleName = /**
  109689. * @param {?} importedFilePath
  109690. * @param {?} containingFilePath
  109691. * @return {?}
  109692. */
  109693. function (importedFilePath, containingFilePath) {
  109694. return this._summaryResolver.getKnownModuleName(importedFilePath) ||
  109695. this._symbolResolver.getKnownModuleName(importedFilePath) ||
  109696. this._host.fileNameToModuleName(importedFilePath, containingFilePath);
  109697. };
  109698. /**
  109699. * @param {?} srcFileUrl
  109700. * @param {?} compMeta
  109701. * @param {?} stylesheetMetadata
  109702. * @param {?} isShimmed
  109703. * @param {?} fileSuffix
  109704. * @return {?}
  109705. */
  109706. AotCompiler.prototype._codegenStyles = /**
  109707. * @param {?} srcFileUrl
  109708. * @param {?} compMeta
  109709. * @param {?} stylesheetMetadata
  109710. * @param {?} isShimmed
  109711. * @param {?} fileSuffix
  109712. * @return {?}
  109713. */
  109714. function (srcFileUrl, compMeta, stylesheetMetadata, isShimmed, fileSuffix) {
  109715. var /** @type {?} */ outputCtx = this._createOutputContext(_stylesModuleUrl(/** @type {?} */ ((stylesheetMetadata.moduleUrl)), isShimmed, fileSuffix));
  109716. var /** @type {?} */ compiledStylesheet = this._styleCompiler.compileStyles(outputCtx, compMeta, stylesheetMetadata, isShimmed);
  109717. _resolveStyleStatements(this._symbolResolver, compiledStylesheet, isShimmed, fileSuffix);
  109718. return this._codegenSourceModule(srcFileUrl, outputCtx);
  109719. };
  109720. /**
  109721. * @param {?} srcFileUrl
  109722. * @param {?} ctx
  109723. * @return {?}
  109724. */
  109725. AotCompiler.prototype._codegenSourceModule = /**
  109726. * @param {?} srcFileUrl
  109727. * @param {?} ctx
  109728. * @return {?}
  109729. */
  109730. function (srcFileUrl, ctx) {
  109731. return new GeneratedFile(srcFileUrl, ctx.genFilePath, ctx.statements);
  109732. };
  109733. /**
  109734. * @param {?=} entryRoute
  109735. * @param {?=} analyzedModules
  109736. * @return {?}
  109737. */
  109738. AotCompiler.prototype.listLazyRoutes = /**
  109739. * @param {?=} entryRoute
  109740. * @param {?=} analyzedModules
  109741. * @return {?}
  109742. */
  109743. function (entryRoute, analyzedModules) {
  109744. var /** @type {?} */ self = this;
  109745. if (entryRoute) {
  109746. var /** @type {?} */ symbol = parseLazyRoute(entryRoute, this._reflector).referencedModule;
  109747. return visitLazyRoute(symbol);
  109748. }
  109749. else if (analyzedModules) {
  109750. var /** @type {?} */ allLazyRoutes = [];
  109751. for (var _i = 0, _a = analyzedModules.ngModules; _i < _a.length; _i++) {
  109752. var ngModule = _a[_i];
  109753. var /** @type {?} */ lazyRoutes = listLazyRoutes(ngModule, this._reflector);
  109754. for (var _b = 0, lazyRoutes_1 = lazyRoutes; _b < lazyRoutes_1.length; _b++) {
  109755. var lazyRoute = lazyRoutes_1[_b];
  109756. allLazyRoutes.push(lazyRoute);
  109757. }
  109758. }
  109759. return allLazyRoutes;
  109760. }
  109761. else {
  109762. throw new Error("Either route or analyzedModules has to be specified!");
  109763. }
  109764. /**
  109765. * @param {?} symbol
  109766. * @param {?=} seenRoutes
  109767. * @param {?=} allLazyRoutes
  109768. * @return {?}
  109769. */
  109770. function visitLazyRoute(symbol, seenRoutes, allLazyRoutes) {
  109771. if (seenRoutes === void 0) { seenRoutes = new Set(); }
  109772. if (allLazyRoutes === void 0) { allLazyRoutes = []; }
  109773. // Support pointing to default exports, but stop recursing there,
  109774. // as the StaticReflector does not yet support default exports.
  109775. if (seenRoutes.has(symbol) || !symbol.name) {
  109776. return allLazyRoutes;
  109777. }
  109778. seenRoutes.add(symbol);
  109779. var /** @type {?} */ lazyRoutes = listLazyRoutes(/** @type {?} */ ((self._metadataResolver.getNgModuleMetadata(symbol, true))), self._reflector);
  109780. for (var _i = 0, lazyRoutes_2 = lazyRoutes; _i < lazyRoutes_2.length; _i++) {
  109781. var lazyRoute = lazyRoutes_2[_i];
  109782. allLazyRoutes.push(lazyRoute);
  109783. visitLazyRoute(lazyRoute.referencedModule, seenRoutes, allLazyRoutes);
  109784. }
  109785. return allLazyRoutes;
  109786. }
  109787. };
  109788. return AotCompiler;
  109789. }());
  109790. /**
  109791. * @param {?} outputCtx
  109792. * @return {?}
  109793. */
  109794. function _createEmptyStub(outputCtx) {
  109795. // Note: We need to produce at least one import statement so that
  109796. // TypeScript knows that the file is an es6 module. Otherwise our generated
  109797. // exports / imports won't be emitted properly by TypeScript.
  109798. outputCtx.statements.push(importExpr(Identifiers.ComponentFactory).toStmt());
  109799. }
  109800. /**
  109801. * @param {?} symbolResolver
  109802. * @param {?} compileResult
  109803. * @param {?} needsShim
  109804. * @param {?} fileSuffix
  109805. * @return {?}
  109806. */
  109807. function _resolveStyleStatements(symbolResolver, compileResult, needsShim, fileSuffix) {
  109808. compileResult.dependencies.forEach(function (dep) {
  109809. dep.setValue(symbolResolver.getStaticSymbol(_stylesModuleUrl(dep.moduleUrl, needsShim, fileSuffix), dep.name));
  109810. });
  109811. }
  109812. /**
  109813. * @param {?} stylesheetUrl
  109814. * @param {?} shim
  109815. * @param {?} suffix
  109816. * @return {?}
  109817. */
  109818. function _stylesModuleUrl(stylesheetUrl, shim, suffix) {
  109819. return "" + stylesheetUrl + (shim ? '.shim' : '') + ".ngstyle" + suffix;
  109820. }
  109821. /**
  109822. * @record
  109823. */
  109824. /**
  109825. * @record
  109826. */
  109827. /**
  109828. * @record
  109829. */
  109830. /**
  109831. * @param {?} fileNames
  109832. * @param {?} host
  109833. * @param {?} staticSymbolResolver
  109834. * @param {?} metadataResolver
  109835. * @return {?}
  109836. */
  109837. function analyzeNgModules(fileNames, host, staticSymbolResolver, metadataResolver) {
  109838. var /** @type {?} */ files = _analyzeFilesIncludingNonProgramFiles(fileNames, host, staticSymbolResolver, metadataResolver);
  109839. return mergeAnalyzedFiles(files);
  109840. }
  109841. /**
  109842. * @param {?} fileNames
  109843. * @param {?} host
  109844. * @param {?} staticSymbolResolver
  109845. * @param {?} metadataResolver
  109846. * @return {?}
  109847. */
  109848. function analyzeAndValidateNgModules(fileNames, host, staticSymbolResolver, metadataResolver) {
  109849. return validateAnalyzedModules(analyzeNgModules(fileNames, host, staticSymbolResolver, metadataResolver));
  109850. }
  109851. /**
  109852. * @param {?} analyzedModules
  109853. * @return {?}
  109854. */
  109855. function validateAnalyzedModules(analyzedModules) {
  109856. if (analyzedModules.symbolsMissingModule && analyzedModules.symbolsMissingModule.length) {
  109857. var /** @type {?} */ messages = analyzedModules.symbolsMissingModule.map(function (s) {
  109858. return "Cannot determine the module for class " + s.name + " in " + s.filePath + "! Add " + s.name + " to the NgModule to fix it.";
  109859. });
  109860. throw syntaxError(messages.join('\n'));
  109861. }
  109862. return analyzedModules;
  109863. }
  109864. /**
  109865. * @param {?} fileNames
  109866. * @param {?} host
  109867. * @param {?} staticSymbolResolver
  109868. * @param {?} metadataResolver
  109869. * @return {?}
  109870. */
  109871. function _analyzeFilesIncludingNonProgramFiles(fileNames, host, staticSymbolResolver, metadataResolver) {
  109872. var /** @type {?} */ seenFiles = new Set();
  109873. var /** @type {?} */ files = [];
  109874. var /** @type {?} */ visitFile = function (fileName) {
  109875. if (seenFiles.has(fileName) || !host.isSourceFile(fileName)) {
  109876. return false;
  109877. }
  109878. seenFiles.add(fileName);
  109879. var /** @type {?} */ analyzedFile = analyzeFile(host, staticSymbolResolver, metadataResolver, fileName);
  109880. files.push(analyzedFile);
  109881. analyzedFile.ngModules.forEach(function (ngModule) {
  109882. ngModule.transitiveModule.modules.forEach(function (modMeta) { return visitFile(modMeta.reference.filePath); });
  109883. });
  109884. };
  109885. fileNames.forEach(function (fileName) { return visitFile(fileName); });
  109886. return files;
  109887. }
  109888. /**
  109889. * @param {?} host
  109890. * @param {?} staticSymbolResolver
  109891. * @param {?} metadataResolver
  109892. * @param {?} fileName
  109893. * @return {?}
  109894. */
  109895. function analyzeFile(host, staticSymbolResolver, metadataResolver, fileName) {
  109896. var /** @type {?} */ directives = [];
  109897. var /** @type {?} */ pipes = [];
  109898. var /** @type {?} */ injectables = [];
  109899. var /** @type {?} */ ngModules = [];
  109900. var /** @type {?} */ hasDecorators = staticSymbolResolver.hasDecorators(fileName);
  109901. var /** @type {?} */ exportsNonSourceFiles = false;
  109902. // Don't analyze .d.ts files that have no decorators as a shortcut
  109903. // to speed up the analysis. This prevents us from
  109904. // resolving the references in these files.
  109905. // Note: exportsNonSourceFiles is only needed when compiling with summaries,
  109906. // which is not the case when .d.ts files are treated as input files.
  109907. if (!fileName.endsWith('.d.ts') || hasDecorators) {
  109908. staticSymbolResolver.getSymbolsOf(fileName).forEach(function (symbol) {
  109909. var /** @type {?} */ resolvedSymbol = staticSymbolResolver.resolveSymbol(symbol);
  109910. var /** @type {?} */ symbolMeta = resolvedSymbol.metadata;
  109911. if (!symbolMeta || symbolMeta.__symbolic === 'error') {
  109912. return;
  109913. }
  109914. var /** @type {?} */ isNgSymbol = false;
  109915. if (symbolMeta.__symbolic === 'class') {
  109916. if (metadataResolver.isDirective(symbol)) {
  109917. isNgSymbol = true;
  109918. directives.push(symbol);
  109919. }
  109920. else if (metadataResolver.isPipe(symbol)) {
  109921. isNgSymbol = true;
  109922. pipes.push(symbol);
  109923. }
  109924. else if (metadataResolver.isNgModule(symbol)) {
  109925. var /** @type {?} */ ngModule = metadataResolver.getNgModuleMetadata(symbol, false);
  109926. if (ngModule) {
  109927. isNgSymbol = true;
  109928. ngModules.push(ngModule);
  109929. }
  109930. }
  109931. else if (metadataResolver.isInjectable(symbol)) {
  109932. isNgSymbol = true;
  109933. injectables.push(symbol);
  109934. }
  109935. }
  109936. if (!isNgSymbol) {
  109937. exportsNonSourceFiles =
  109938. exportsNonSourceFiles || isValueExportingNonSourceFile(host, symbolMeta);
  109939. }
  109940. });
  109941. }
  109942. return {
  109943. fileName: fileName, directives: directives, pipes: pipes, ngModules: ngModules, injectables: injectables, exportsNonSourceFiles: exportsNonSourceFiles,
  109944. };
  109945. }
  109946. /**
  109947. * @param {?} host
  109948. * @param {?} metadata
  109949. * @return {?}
  109950. */
  109951. function isValueExportingNonSourceFile(host, metadata) {
  109952. var /** @type {?} */ exportsNonSourceFiles = false;
  109953. var Visitor = /** @class */ (function () {
  109954. function Visitor() {
  109955. }
  109956. /**
  109957. * @param {?} arr
  109958. * @param {?} context
  109959. * @return {?}
  109960. */
  109961. Visitor.prototype.visitArray = /**
  109962. * @param {?} arr
  109963. * @param {?} context
  109964. * @return {?}
  109965. */
  109966. function (arr, context) {
  109967. var _this = this;
  109968. arr.forEach(function (v) { return visitValue(v, _this, context); });
  109969. };
  109970. /**
  109971. * @param {?} map
  109972. * @param {?} context
  109973. * @return {?}
  109974. */
  109975. Visitor.prototype.visitStringMap = /**
  109976. * @param {?} map
  109977. * @param {?} context
  109978. * @return {?}
  109979. */
  109980. function (map, context) {
  109981. var _this = this;
  109982. Object.keys(map).forEach(function (key) { return visitValue(map[key], _this, context); });
  109983. };
  109984. /**
  109985. * @param {?} value
  109986. * @param {?} context
  109987. * @return {?}
  109988. */
  109989. Visitor.prototype.visitPrimitive = /**
  109990. * @param {?} value
  109991. * @param {?} context
  109992. * @return {?}
  109993. */
  109994. function (value, context) { };
  109995. /**
  109996. * @param {?} value
  109997. * @param {?} context
  109998. * @return {?}
  109999. */
  110000. Visitor.prototype.visitOther = /**
  110001. * @param {?} value
  110002. * @param {?} context
  110003. * @return {?}
  110004. */
  110005. function (value, context) {
  110006. if (value instanceof StaticSymbol && !host.isSourceFile(value.filePath)) {
  110007. exportsNonSourceFiles = true;
  110008. }
  110009. };
  110010. return Visitor;
  110011. }());
  110012. visitValue(metadata, new Visitor(), null);
  110013. return exportsNonSourceFiles;
  110014. }
  110015. /**
  110016. * @param {?} analyzedFiles
  110017. * @return {?}
  110018. */
  110019. function mergeAnalyzedFiles(analyzedFiles) {
  110020. var /** @type {?} */ allNgModules = [];
  110021. var /** @type {?} */ ngModuleByPipeOrDirective = new Map();
  110022. var /** @type {?} */ allPipesAndDirectives = new Set();
  110023. analyzedFiles.forEach(function (af) {
  110024. af.ngModules.forEach(function (ngModule) {
  110025. allNgModules.push(ngModule);
  110026. ngModule.declaredDirectives.forEach(function (d) { return ngModuleByPipeOrDirective.set(d.reference, ngModule); });
  110027. ngModule.declaredPipes.forEach(function (p) { return ngModuleByPipeOrDirective.set(p.reference, ngModule); });
  110028. });
  110029. af.directives.forEach(function (d) { return allPipesAndDirectives.add(d); });
  110030. af.pipes.forEach(function (p) { return allPipesAndDirectives.add(p); });
  110031. });
  110032. var /** @type {?} */ symbolsMissingModule = [];
  110033. allPipesAndDirectives.forEach(function (ref) {
  110034. if (!ngModuleByPipeOrDirective.has(ref)) {
  110035. symbolsMissingModule.push(ref);
  110036. }
  110037. });
  110038. return {
  110039. ngModules: allNgModules,
  110040. ngModuleByPipeOrDirective: ngModuleByPipeOrDirective,
  110041. symbolsMissingModule: symbolsMissingModule,
  110042. files: analyzedFiles
  110043. };
  110044. }
  110045. /**
  110046. * @param {?} files
  110047. * @return {?}
  110048. */
  110049. function mergeAndValidateNgFiles(files) {
  110050. return validateAnalyzedModules(mergeAnalyzedFiles(files));
  110051. }
  110052. /**
  110053. * @fileoverview added by tsickle
  110054. * @suppress {checkTypes} checked by tsc
  110055. */
  110056. /**
  110057. * @license
  110058. * Copyright Google Inc. All Rights Reserved.
  110059. *
  110060. * Use of this source code is governed by an MIT-style license that can be
  110061. * found in the LICENSE file at https://angular.io/license
  110062. */
  110063. /**
  110064. * @record
  110065. */
  110066. /**
  110067. * @record
  110068. */
  110069. var FORMATTED_MESSAGE = 'ngFormattedMessage';
  110070. /**
  110071. * @param {?} level
  110072. * @return {?}
  110073. */
  110074. function indentStr(level) {
  110075. if (level <= 0)
  110076. return '';
  110077. if (level < 6)
  110078. return ['', ' ', ' ', ' ', ' ', ' '][level];
  110079. var /** @type {?} */ half = indentStr(Math.floor(level / 2));
  110080. return half + half + (level % 2 === 1 ? ' ' : '');
  110081. }
  110082. /**
  110083. * @param {?} chain
  110084. * @param {?=} indent
  110085. * @return {?}
  110086. */
  110087. function formatChain(chain, indent) {
  110088. if (indent === void 0) { indent = 0; }
  110089. if (!chain)
  110090. return '';
  110091. var /** @type {?} */ position = chain.position ?
  110092. chain.position.fileName + "(" + (chain.position.line + 1) + "," + (chain.position.column + 1) + ")" :
  110093. '';
  110094. var /** @type {?} */ prefix = position && indent === 0 ? position + ": " : '';
  110095. var /** @type {?} */ postfix = position && indent !== 0 ? " at " + position : '';
  110096. var /** @type {?} */ message = "" + prefix + chain.message + postfix;
  110097. return "" + indentStr(indent) + message + ((chain.next && ('\n' + formatChain(chain.next, indent + 2))) || '');
  110098. }
  110099. /**
  110100. * @param {?} chain
  110101. * @return {?}
  110102. */
  110103. function formattedError(chain) {
  110104. var /** @type {?} */ message = formatChain(chain) + '.';
  110105. var /** @type {?} */ error = /** @type {?} */ (syntaxError(message));
  110106. (/** @type {?} */ (error))[FORMATTED_MESSAGE] = true;
  110107. error.chain = chain;
  110108. error.position = chain.position;
  110109. return error;
  110110. }
  110111. /**
  110112. * @param {?} error
  110113. * @return {?}
  110114. */
  110115. function isFormattedError(error) {
  110116. return !!(/** @type {?} */ (error))[FORMATTED_MESSAGE];
  110117. }
  110118. /**
  110119. * @fileoverview added by tsickle
  110120. * @suppress {checkTypes} checked by tsc
  110121. */
  110122. /**
  110123. * @license
  110124. * Copyright Google Inc. All Rights Reserved.
  110125. *
  110126. * Use of this source code is governed by an MIT-style license that can be
  110127. * found in the LICENSE file at https://angular.io/license
  110128. */
  110129. var ANGULAR_CORE = '@angular/core';
  110130. var ANGULAR_ROUTER = '@angular/router';
  110131. var HIDDEN_KEY = /^\$.*\$$/;
  110132. var IGNORE = {
  110133. __symbolic: 'ignore'
  110134. };
  110135. var USE_VALUE = 'useValue';
  110136. var PROVIDE = 'provide';
  110137. var REFERENCE_SET = new Set([USE_VALUE, 'useFactory', 'data']);
  110138. var TYPEGUARD_POSTFIX = 'TypeGuard';
  110139. var USE_IF = 'UseIf';
  110140. /**
  110141. * @param {?} value
  110142. * @return {?}
  110143. */
  110144. function shouldIgnore(value) {
  110145. return value && value.__symbolic == 'ignore';
  110146. }
  110147. /**
  110148. * A static reflector implements enough of the Reflector API that is necessary to compile
  110149. * templates statically.
  110150. */
  110151. var StaticReflector = /** @class */ (function () {
  110152. function StaticReflector(summaryResolver, symbolResolver, knownMetadataClasses, knownMetadataFunctions, errorRecorder) {
  110153. if (knownMetadataClasses === void 0) { knownMetadataClasses = []; }
  110154. if (knownMetadataFunctions === void 0) { knownMetadataFunctions = []; }
  110155. var _this = this;
  110156. this.summaryResolver = summaryResolver;
  110157. this.symbolResolver = symbolResolver;
  110158. this.errorRecorder = errorRecorder;
  110159. this.annotationCache = new Map();
  110160. this.propertyCache = new Map();
  110161. this.parameterCache = new Map();
  110162. this.methodCache = new Map();
  110163. this.staticCache = new Map();
  110164. this.conversionMap = new Map();
  110165. this.resolvedExternalReferences = new Map();
  110166. this.annotationForParentClassWithSummaryKind = new Map();
  110167. this.initializeConversionMap();
  110168. knownMetadataClasses.forEach(function (kc) {
  110169. return _this._registerDecoratorOrConstructor(_this.getStaticSymbol(kc.filePath, kc.name), kc.ctor);
  110170. });
  110171. knownMetadataFunctions.forEach(function (kf) { return _this._registerFunction(_this.getStaticSymbol(kf.filePath, kf.name), kf.fn); });
  110172. this.annotationForParentClassWithSummaryKind.set(CompileSummaryKind.Directive, [createDirective, createComponent]);
  110173. this.annotationForParentClassWithSummaryKind.set(CompileSummaryKind.Pipe, [createPipe]);
  110174. this.annotationForParentClassWithSummaryKind.set(CompileSummaryKind.NgModule, [createNgModule]);
  110175. this.annotationForParentClassWithSummaryKind.set(CompileSummaryKind.Injectable, [createInjectable, createPipe, createDirective, createComponent, createNgModule]);
  110176. }
  110177. /**
  110178. * @param {?} typeOrFunc
  110179. * @return {?}
  110180. */
  110181. StaticReflector.prototype.componentModuleUrl = /**
  110182. * @param {?} typeOrFunc
  110183. * @return {?}
  110184. */
  110185. function (typeOrFunc) {
  110186. var /** @type {?} */ staticSymbol = this.findSymbolDeclaration(typeOrFunc);
  110187. return this.symbolResolver.getResourcePath(staticSymbol);
  110188. };
  110189. /**
  110190. * @param {?} ref
  110191. * @param {?=} containingFile
  110192. * @return {?}
  110193. */
  110194. StaticReflector.prototype.resolveExternalReference = /**
  110195. * @param {?} ref
  110196. * @param {?=} containingFile
  110197. * @return {?}
  110198. */
  110199. function (ref, containingFile) {
  110200. var /** @type {?} */ key = undefined;
  110201. if (!containingFile) {
  110202. key = ref.moduleName + ":" + ref.name;
  110203. var /** @type {?} */ declarationSymbol_1 = this.resolvedExternalReferences.get(key);
  110204. if (declarationSymbol_1)
  110205. return declarationSymbol_1;
  110206. }
  110207. var /** @type {?} */ refSymbol = this.symbolResolver.getSymbolByModule(/** @type {?} */ ((ref.moduleName)), /** @type {?} */ ((ref.name)), containingFile);
  110208. var /** @type {?} */ declarationSymbol = this.findSymbolDeclaration(refSymbol);
  110209. if (!containingFile) {
  110210. this.symbolResolver.recordModuleNameForFileName(refSymbol.filePath, /** @type {?} */ ((ref.moduleName)));
  110211. this.symbolResolver.recordImportAs(declarationSymbol, refSymbol);
  110212. }
  110213. if (key) {
  110214. this.resolvedExternalReferences.set(key, declarationSymbol);
  110215. }
  110216. return declarationSymbol;
  110217. };
  110218. /**
  110219. * @param {?} moduleUrl
  110220. * @param {?} name
  110221. * @param {?=} containingFile
  110222. * @return {?}
  110223. */
  110224. StaticReflector.prototype.findDeclaration = /**
  110225. * @param {?} moduleUrl
  110226. * @param {?} name
  110227. * @param {?=} containingFile
  110228. * @return {?}
  110229. */
  110230. function (moduleUrl, name, containingFile) {
  110231. return this.findSymbolDeclaration(this.symbolResolver.getSymbolByModule(moduleUrl, name, containingFile));
  110232. };
  110233. /**
  110234. * @param {?} moduleUrl
  110235. * @param {?} name
  110236. * @return {?}
  110237. */
  110238. StaticReflector.prototype.tryFindDeclaration = /**
  110239. * @param {?} moduleUrl
  110240. * @param {?} name
  110241. * @return {?}
  110242. */
  110243. function (moduleUrl, name) {
  110244. var _this = this;
  110245. return this.symbolResolver.ignoreErrorsFor(function () { return _this.findDeclaration(moduleUrl, name); });
  110246. };
  110247. /**
  110248. * @param {?} symbol
  110249. * @return {?}
  110250. */
  110251. StaticReflector.prototype.findSymbolDeclaration = /**
  110252. * @param {?} symbol
  110253. * @return {?}
  110254. */
  110255. function (symbol) {
  110256. var /** @type {?} */ resolvedSymbol = this.symbolResolver.resolveSymbol(symbol);
  110257. if (resolvedSymbol) {
  110258. var /** @type {?} */ resolvedMetadata = resolvedSymbol.metadata;
  110259. if (resolvedMetadata && resolvedMetadata.__symbolic === 'resolved') {
  110260. resolvedMetadata = resolvedMetadata.symbol;
  110261. }
  110262. if (resolvedMetadata instanceof StaticSymbol) {
  110263. return this.findSymbolDeclaration(resolvedSymbol.metadata);
  110264. }
  110265. }
  110266. return symbol;
  110267. };
  110268. /**
  110269. * @param {?} type
  110270. * @return {?}
  110271. */
  110272. StaticReflector.prototype.annotations = /**
  110273. * @param {?} type
  110274. * @return {?}
  110275. */
  110276. function (type) {
  110277. var /** @type {?} */ annotations = this.annotationCache.get(type);
  110278. if (!annotations) {
  110279. annotations = [];
  110280. var /** @type {?} */ classMetadata = this.getTypeMetadata(type);
  110281. var /** @type {?} */ parentType = this.findParentType(type, classMetadata);
  110282. if (parentType) {
  110283. var /** @type {?} */ parentAnnotations = this.annotations(parentType);
  110284. annotations.push.apply(annotations, parentAnnotations);
  110285. }
  110286. var /** @type {?} */ ownAnnotations_1 = [];
  110287. if (classMetadata['decorators']) {
  110288. ownAnnotations_1 = this.simplify(type, classMetadata['decorators']);
  110289. annotations.push.apply(annotations, ownAnnotations_1);
  110290. }
  110291. if (parentType && !this.summaryResolver.isLibraryFile(type.filePath) &&
  110292. this.summaryResolver.isLibraryFile(parentType.filePath)) {
  110293. var /** @type {?} */ summary = this.summaryResolver.resolveSummary(parentType);
  110294. if (summary && summary.type) {
  110295. var /** @type {?} */ requiredAnnotationTypes = /** @type {?} */ ((this.annotationForParentClassWithSummaryKind.get(/** @type {?} */ ((summary.type.summaryKind)))));
  110296. var /** @type {?} */ typeHasRequiredAnnotation = requiredAnnotationTypes.some(function (requiredType) { return ownAnnotations_1.some(function (ann) { return requiredType.isTypeOf(ann); }); });
  110297. if (!typeHasRequiredAnnotation) {
  110298. this.reportError(formatMetadataError(metadataError("Class " + type.name + " in " + type.filePath + " extends from a " + CompileSummaryKind[(/** @type {?} */ ((summary.type.summaryKind)))] + " in another compilation unit without duplicating the decorator", undefined, "Please add a " + requiredAnnotationTypes.map(function (type) { return type.ngMetadataName; }).join(' or ') + " decorator to the class"), type), type);
  110299. }
  110300. }
  110301. }
  110302. this.annotationCache.set(type, annotations.filter(function (ann) { return !!ann; }));
  110303. }
  110304. return annotations;
  110305. };
  110306. /**
  110307. * @param {?} type
  110308. * @return {?}
  110309. */
  110310. StaticReflector.prototype.propMetadata = /**
  110311. * @param {?} type
  110312. * @return {?}
  110313. */
  110314. function (type) {
  110315. var _this = this;
  110316. var /** @type {?} */ propMetadata = this.propertyCache.get(type);
  110317. if (!propMetadata) {
  110318. var /** @type {?} */ classMetadata = this.getTypeMetadata(type);
  110319. propMetadata = {};
  110320. var /** @type {?} */ parentType = this.findParentType(type, classMetadata);
  110321. if (parentType) {
  110322. var /** @type {?} */ parentPropMetadata_1 = this.propMetadata(parentType);
  110323. Object.keys(parentPropMetadata_1).forEach(function (parentProp) {
  110324. /** @type {?} */ ((propMetadata))[parentProp] = parentPropMetadata_1[parentProp];
  110325. });
  110326. }
  110327. var /** @type {?} */ members_1 = classMetadata['members'] || {};
  110328. Object.keys(members_1).forEach(function (propName) {
  110329. var /** @type {?} */ propData = members_1[propName];
  110330. var /** @type {?} */ prop = (/** @type {?} */ (propData))
  110331. .find(function (a) { return a['__symbolic'] == 'property' || a['__symbolic'] == 'method'; });
  110332. var /** @type {?} */ decorators = [];
  110333. if (/** @type {?} */ ((propMetadata))[propName]) {
  110334. decorators.push.apply(decorators, /** @type {?} */ ((propMetadata))[propName]);
  110335. } /** @type {?} */
  110336. ((propMetadata))[propName] = decorators;
  110337. if (prop && prop['decorators']) {
  110338. decorators.push.apply(decorators, _this.simplify(type, prop['decorators']));
  110339. }
  110340. });
  110341. this.propertyCache.set(type, propMetadata);
  110342. }
  110343. return propMetadata;
  110344. };
  110345. /**
  110346. * @param {?} type
  110347. * @return {?}
  110348. */
  110349. StaticReflector.prototype.parameters = /**
  110350. * @param {?} type
  110351. * @return {?}
  110352. */
  110353. function (type) {
  110354. var _this = this;
  110355. if (!(type instanceof StaticSymbol)) {
  110356. this.reportError(new Error("parameters received " + JSON.stringify(type) + " which is not a StaticSymbol"), type);
  110357. return [];
  110358. }
  110359. try {
  110360. var /** @type {?} */ parameters_1 = this.parameterCache.get(type);
  110361. if (!parameters_1) {
  110362. var /** @type {?} */ classMetadata = this.getTypeMetadata(type);
  110363. var /** @type {?} */ parentType = this.findParentType(type, classMetadata);
  110364. var /** @type {?} */ members = classMetadata ? classMetadata['members'] : null;
  110365. var /** @type {?} */ ctorData = members ? members['__ctor__'] : null;
  110366. if (ctorData) {
  110367. var /** @type {?} */ ctor = (/** @type {?} */ (ctorData)).find(function (a) { return a['__symbolic'] == 'constructor'; });
  110368. var /** @type {?} */ rawParameterTypes = /** @type {?} */ (ctor['parameters']) || [];
  110369. var /** @type {?} */ parameterDecorators_1 = /** @type {?} */ (this.simplify(type, ctor['parameterDecorators'] || []));
  110370. parameters_1 = [];
  110371. rawParameterTypes.forEach(function (rawParamType, index) {
  110372. var /** @type {?} */ nestedResult = [];
  110373. var /** @type {?} */ paramType = _this.trySimplify(type, rawParamType);
  110374. if (paramType)
  110375. nestedResult.push(paramType);
  110376. var /** @type {?} */ decorators = parameterDecorators_1 ? parameterDecorators_1[index] : null;
  110377. if (decorators) {
  110378. nestedResult.push.apply(nestedResult, decorators);
  110379. } /** @type {?} */
  110380. ((parameters_1)).push(nestedResult);
  110381. });
  110382. }
  110383. else if (parentType) {
  110384. parameters_1 = this.parameters(parentType);
  110385. }
  110386. if (!parameters_1) {
  110387. parameters_1 = [];
  110388. }
  110389. this.parameterCache.set(type, parameters_1);
  110390. }
  110391. return parameters_1;
  110392. }
  110393. catch (/** @type {?} */ e) {
  110394. console.error("Failed on type " + JSON.stringify(type) + " with error " + e);
  110395. throw e;
  110396. }
  110397. };
  110398. /**
  110399. * @param {?} type
  110400. * @return {?}
  110401. */
  110402. StaticReflector.prototype._methodNames = /**
  110403. * @param {?} type
  110404. * @return {?}
  110405. */
  110406. function (type) {
  110407. var /** @type {?} */ methodNames = this.methodCache.get(type);
  110408. if (!methodNames) {
  110409. var /** @type {?} */ classMetadata = this.getTypeMetadata(type);
  110410. methodNames = {};
  110411. var /** @type {?} */ parentType = this.findParentType(type, classMetadata);
  110412. if (parentType) {
  110413. var /** @type {?} */ parentMethodNames_1 = this._methodNames(parentType);
  110414. Object.keys(parentMethodNames_1).forEach(function (parentProp) {
  110415. /** @type {?} */ ((methodNames))[parentProp] = parentMethodNames_1[parentProp];
  110416. });
  110417. }
  110418. var /** @type {?} */ members_2 = classMetadata['members'] || {};
  110419. Object.keys(members_2).forEach(function (propName) {
  110420. var /** @type {?} */ propData = members_2[propName];
  110421. var /** @type {?} */ isMethod = (/** @type {?} */ (propData)).some(function (a) { return a['__symbolic'] == 'method'; }); /** @type {?} */
  110422. ((methodNames))[propName] = /** @type {?} */ ((methodNames))[propName] || isMethod;
  110423. });
  110424. this.methodCache.set(type, methodNames);
  110425. }
  110426. return methodNames;
  110427. };
  110428. /**
  110429. * @param {?} type
  110430. * @return {?}
  110431. */
  110432. StaticReflector.prototype._staticMembers = /**
  110433. * @param {?} type
  110434. * @return {?}
  110435. */
  110436. function (type) {
  110437. var /** @type {?} */ staticMembers = this.staticCache.get(type);
  110438. if (!staticMembers) {
  110439. var /** @type {?} */ classMetadata = this.getTypeMetadata(type);
  110440. var /** @type {?} */ staticMemberData = classMetadata['statics'] || {};
  110441. staticMembers = Object.keys(staticMemberData);
  110442. this.staticCache.set(type, staticMembers);
  110443. }
  110444. return staticMembers;
  110445. };
  110446. /**
  110447. * @param {?} type
  110448. * @param {?} classMetadata
  110449. * @return {?}
  110450. */
  110451. StaticReflector.prototype.findParentType = /**
  110452. * @param {?} type
  110453. * @param {?} classMetadata
  110454. * @return {?}
  110455. */
  110456. function (type, classMetadata) {
  110457. var /** @type {?} */ parentType = this.trySimplify(type, classMetadata['extends']);
  110458. if (parentType instanceof StaticSymbol) {
  110459. return parentType;
  110460. }
  110461. };
  110462. /**
  110463. * @param {?} type
  110464. * @param {?} lcProperty
  110465. * @return {?}
  110466. */
  110467. StaticReflector.prototype.hasLifecycleHook = /**
  110468. * @param {?} type
  110469. * @param {?} lcProperty
  110470. * @return {?}
  110471. */
  110472. function (type, lcProperty) {
  110473. if (!(type instanceof StaticSymbol)) {
  110474. this.reportError(new Error("hasLifecycleHook received " + JSON.stringify(type) + " which is not a StaticSymbol"), type);
  110475. }
  110476. try {
  110477. return !!this._methodNames(type)[lcProperty];
  110478. }
  110479. catch (/** @type {?} */ e) {
  110480. console.error("Failed on type " + JSON.stringify(type) + " with error " + e);
  110481. throw e;
  110482. }
  110483. };
  110484. /**
  110485. * @param {?} type
  110486. * @return {?}
  110487. */
  110488. StaticReflector.prototype.guards = /**
  110489. * @param {?} type
  110490. * @return {?}
  110491. */
  110492. function (type) {
  110493. if (!(type instanceof StaticSymbol)) {
  110494. this.reportError(new Error("guards received " + JSON.stringify(type) + " which is not a StaticSymbol"), type);
  110495. return {};
  110496. }
  110497. var /** @type {?} */ staticMembers = this._staticMembers(type);
  110498. var /** @type {?} */ result = {};
  110499. for (var _i = 0, staticMembers_1 = staticMembers; _i < staticMembers_1.length; _i++) {
  110500. var name_1 = staticMembers_1[_i];
  110501. if (name_1.endsWith(TYPEGUARD_POSTFIX)) {
  110502. var /** @type {?} */ property = name_1.substr(0, name_1.length - TYPEGUARD_POSTFIX.length);
  110503. var /** @type {?} */ value = void 0;
  110504. if (property.endsWith(USE_IF)) {
  110505. property = name_1.substr(0, property.length - USE_IF.length);
  110506. value = USE_IF;
  110507. }
  110508. else {
  110509. value = this.getStaticSymbol(type.filePath, type.name, [name_1]);
  110510. }
  110511. result[property] = value;
  110512. }
  110513. }
  110514. return result;
  110515. };
  110516. /**
  110517. * @param {?} type
  110518. * @param {?} ctor
  110519. * @return {?}
  110520. */
  110521. StaticReflector.prototype._registerDecoratorOrConstructor = /**
  110522. * @param {?} type
  110523. * @param {?} ctor
  110524. * @return {?}
  110525. */
  110526. function (type, ctor) {
  110527. this.conversionMap.set(type, function (context, args) { return new (ctor.bind.apply(ctor, [void 0].concat(args)))(); });
  110528. };
  110529. /**
  110530. * @param {?} type
  110531. * @param {?} fn
  110532. * @return {?}
  110533. */
  110534. StaticReflector.prototype._registerFunction = /**
  110535. * @param {?} type
  110536. * @param {?} fn
  110537. * @return {?}
  110538. */
  110539. function (type, fn) {
  110540. this.conversionMap.set(type, function (context, args) { return fn.apply(undefined, args); });
  110541. };
  110542. /**
  110543. * @return {?}
  110544. */
  110545. StaticReflector.prototype.initializeConversionMap = /**
  110546. * @return {?}
  110547. */
  110548. function () {
  110549. this.injectionToken = this.findDeclaration(ANGULAR_CORE, 'InjectionToken');
  110550. this.opaqueToken = this.findDeclaration(ANGULAR_CORE, 'OpaqueToken');
  110551. this.ROUTES = this.tryFindDeclaration(ANGULAR_ROUTER, 'ROUTES');
  110552. this.ANALYZE_FOR_ENTRY_COMPONENTS =
  110553. this.findDeclaration(ANGULAR_CORE, 'ANALYZE_FOR_ENTRY_COMPONENTS');
  110554. this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Host'), createHost);
  110555. this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Injectable'), createInjectable);
  110556. this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Self'), createSelf);
  110557. this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'SkipSelf'), createSkipSelf);
  110558. this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Inject'), createInject);
  110559. this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Optional'), createOptional);
  110560. this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Attribute'), createAttribute);
  110561. this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'ContentChild'), createContentChild);
  110562. this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'ContentChildren'), createContentChildren);
  110563. this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'ViewChild'), createViewChild);
  110564. this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'ViewChildren'), createViewChildren);
  110565. this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Input'), createInput);
  110566. this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Output'), createOutput);
  110567. this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Pipe'), createPipe);
  110568. this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'HostBinding'), createHostBinding);
  110569. this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'HostListener'), createHostListener);
  110570. this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Directive'), createDirective);
  110571. this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Component'), createComponent);
  110572. this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'NgModule'), createNgModule);
  110573. // Note: Some metadata classes can be used directly with Provider.deps.
  110574. this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Host'), createHost);
  110575. this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Self'), createSelf);
  110576. this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'SkipSelf'), createSkipSelf);
  110577. this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Optional'), createOptional);
  110578. };
  110579. /**
  110580. * getStaticSymbol produces a Type whose metadata is known but whose implementation is not loaded.
  110581. * All types passed to the StaticResolver should be pseudo-types returned by this method.
  110582. *
  110583. * @param declarationFile the absolute path of the file where the symbol is declared
  110584. * @param name the name of the type.
  110585. */
  110586. /**
  110587. * getStaticSymbol produces a Type whose metadata is known but whose implementation is not loaded.
  110588. * All types passed to the StaticResolver should be pseudo-types returned by this method.
  110589. *
  110590. * @param {?} declarationFile the absolute path of the file where the symbol is declared
  110591. * @param {?} name the name of the type.
  110592. * @param {?=} members
  110593. * @return {?}
  110594. */
  110595. StaticReflector.prototype.getStaticSymbol = /**
  110596. * getStaticSymbol produces a Type whose metadata is known but whose implementation is not loaded.
  110597. * All types passed to the StaticResolver should be pseudo-types returned by this method.
  110598. *
  110599. * @param {?} declarationFile the absolute path of the file where the symbol is declared
  110600. * @param {?} name the name of the type.
  110601. * @param {?=} members
  110602. * @return {?}
  110603. */
  110604. function (declarationFile, name, members) {
  110605. return this.symbolResolver.getStaticSymbol(declarationFile, name, members);
  110606. };
  110607. /**
  110608. * Simplify but discard any errors
  110609. * @param {?} context
  110610. * @param {?} value
  110611. * @return {?}
  110612. */
  110613. StaticReflector.prototype.trySimplify = /**
  110614. * Simplify but discard any errors
  110615. * @param {?} context
  110616. * @param {?} value
  110617. * @return {?}
  110618. */
  110619. function (context, value) {
  110620. var /** @type {?} */ originalRecorder = this.errorRecorder;
  110621. this.errorRecorder = function (error, fileName) { };
  110622. var /** @type {?} */ result = this.simplify(context, value);
  110623. this.errorRecorder = originalRecorder;
  110624. return result;
  110625. };
  110626. /**
  110627. * \@internal
  110628. * @param {?} context
  110629. * @param {?} value
  110630. * @return {?}
  110631. */
  110632. StaticReflector.prototype.simplify = /**
  110633. * \@internal
  110634. * @param {?} context
  110635. * @param {?} value
  110636. * @return {?}
  110637. */
  110638. function (context, value) {
  110639. var /** @type {?} */ self = this;
  110640. var /** @type {?} */ scope = BindingScope.empty;
  110641. var /** @type {?} */ calling = new Map();
  110642. var /** @type {?} */ rootContext = context;
  110643. /**
  110644. * @param {?} context
  110645. * @param {?} value
  110646. * @param {?} depth
  110647. * @param {?} references
  110648. * @return {?}
  110649. */
  110650. function simplifyInContext(context, value, depth, references) {
  110651. /**
  110652. * @param {?} staticSymbol
  110653. * @return {?}
  110654. */
  110655. function resolveReferenceValue(staticSymbol) {
  110656. var /** @type {?} */ resolvedSymbol = self.symbolResolver.resolveSymbol(staticSymbol);
  110657. return resolvedSymbol ? resolvedSymbol.metadata : null;
  110658. }
  110659. /**
  110660. * @param {?} value
  110661. * @return {?}
  110662. */
  110663. function simplifyEagerly(value) {
  110664. return simplifyInContext(context, value, depth, 0);
  110665. }
  110666. /**
  110667. * @param {?} value
  110668. * @return {?}
  110669. */
  110670. function simplifyLazily(value) {
  110671. return simplifyInContext(context, value, depth, references + 1);
  110672. }
  110673. /**
  110674. * @param {?} nestedContext
  110675. * @param {?} value
  110676. * @return {?}
  110677. */
  110678. function simplifyNested(nestedContext, value) {
  110679. if (nestedContext === context) {
  110680. // If the context hasn't changed let the exception propagate unmodified.
  110681. return simplifyInContext(nestedContext, value, depth + 1, references);
  110682. }
  110683. try {
  110684. return simplifyInContext(nestedContext, value, depth + 1, references);
  110685. }
  110686. catch (/** @type {?} */ e) {
  110687. if (isMetadataError(e)) {
  110688. // Propagate the message text up but add a message to the chain that explains how we got
  110689. // here.
  110690. // e.chain implies e.symbol
  110691. var /** @type {?} */ summaryMsg = e.chain ? 'references \'' + /** @type {?} */ ((e.symbol)).name + '\'' : errorSummary(e);
  110692. var /** @type {?} */ summary = "'" + nestedContext.name + "' " + summaryMsg;
  110693. var /** @type {?} */ chain = { message: summary, position: e.position, next: e.chain };
  110694. // TODO(chuckj): retrieve the position information indirectly from the collectors node
  110695. // map if the metadata is from a .ts file.
  110696. self.error({
  110697. message: e.message,
  110698. advise: e.advise,
  110699. context: e.context, chain: chain,
  110700. symbol: nestedContext
  110701. }, context);
  110702. }
  110703. else {
  110704. // It is probably an internal error.
  110705. throw e;
  110706. }
  110707. }
  110708. }
  110709. /**
  110710. * @param {?} functionSymbol
  110711. * @param {?} targetFunction
  110712. * @param {?} args
  110713. * @param {?} targetExpression
  110714. * @return {?}
  110715. */
  110716. function simplifyCall(functionSymbol, targetFunction, args, targetExpression) {
  110717. if (targetFunction && targetFunction['__symbolic'] == 'function') {
  110718. if (calling.get(functionSymbol)) {
  110719. self.error({
  110720. message: 'Recursion is not supported',
  110721. summary: "called '" + functionSymbol.name + "' recursively",
  110722. value: targetFunction
  110723. }, functionSymbol);
  110724. }
  110725. try {
  110726. var /** @type {?} */ value_1 = targetFunction['value'];
  110727. if (value_1 && (depth != 0 || value_1.__symbolic != 'error')) {
  110728. var /** @type {?} */ parameters = targetFunction['parameters'];
  110729. var /** @type {?} */ defaults = targetFunction.defaults;
  110730. args = args.map(function (arg) { return simplifyNested(context, arg); })
  110731. .map(function (arg) { return shouldIgnore(arg) ? undefined : arg; });
  110732. if (defaults && defaults.length > args.length) {
  110733. args.push.apply(args, defaults.slice(args.length).map(function (value) { return simplify(value); }));
  110734. }
  110735. calling.set(functionSymbol, true);
  110736. var /** @type {?} */ functionScope = BindingScope.build();
  110737. for (var /** @type {?} */ i = 0; i < parameters.length; i++) {
  110738. functionScope.define(parameters[i], args[i]);
  110739. }
  110740. var /** @type {?} */ oldScope = scope;
  110741. var /** @type {?} */ result_1;
  110742. try {
  110743. scope = functionScope.done();
  110744. result_1 = simplifyNested(functionSymbol, value_1);
  110745. }
  110746. finally {
  110747. scope = oldScope;
  110748. }
  110749. return result_1;
  110750. }
  110751. }
  110752. finally {
  110753. calling.delete(functionSymbol);
  110754. }
  110755. }
  110756. if (depth === 0) {
  110757. // If depth is 0 we are evaluating the top level expression that is describing element
  110758. // decorator. In this case, it is a decorator we don't understand, such as a custom
  110759. // non-angular decorator, and we should just ignore it.
  110760. return IGNORE;
  110761. }
  110762. var /** @type {?} */ position = undefined;
  110763. if (targetExpression && targetExpression.__symbolic == 'resolved') {
  110764. var /** @type {?} */ line = targetExpression.line;
  110765. var /** @type {?} */ character = targetExpression.character;
  110766. var /** @type {?} */ fileName = targetExpression.fileName;
  110767. if (fileName != null && line != null && character != null) {
  110768. position = { fileName: fileName, line: line, column: character };
  110769. }
  110770. }
  110771. self.error({
  110772. message: FUNCTION_CALL_NOT_SUPPORTED,
  110773. context: functionSymbol,
  110774. value: targetFunction, position: position
  110775. }, context);
  110776. }
  110777. /**
  110778. * @param {?} expression
  110779. * @return {?}
  110780. */
  110781. function simplify(expression) {
  110782. if (isPrimitive(expression)) {
  110783. return expression;
  110784. }
  110785. if (expression instanceof Array) {
  110786. var /** @type {?} */ result_2 = [];
  110787. for (var _i = 0, _a = (/** @type {?} */ (expression)); _i < _a.length; _i++) {
  110788. var item = _a[_i];
  110789. // Check for a spread expression
  110790. if (item && item.__symbolic === 'spread') {
  110791. // We call with references as 0 because we require the actual value and cannot
  110792. // tolerate a reference here.
  110793. var /** @type {?} */ spreadArray = simplifyEagerly(item.expression);
  110794. if (Array.isArray(spreadArray)) {
  110795. for (var _b = 0, spreadArray_1 = spreadArray; _b < spreadArray_1.length; _b++) {
  110796. var spreadItem = spreadArray_1[_b];
  110797. result_2.push(spreadItem);
  110798. }
  110799. continue;
  110800. }
  110801. }
  110802. var /** @type {?} */ value_2 = simplify(item);
  110803. if (shouldIgnore(value_2)) {
  110804. continue;
  110805. }
  110806. result_2.push(value_2);
  110807. }
  110808. return result_2;
  110809. }
  110810. if (expression instanceof StaticSymbol) {
  110811. // Stop simplification at builtin symbols or if we are in a reference context and
  110812. // the symbol doesn't have members.
  110813. if (expression === self.injectionToken || self.conversionMap.has(expression) ||
  110814. (references > 0 && !expression.members.length)) {
  110815. return expression;
  110816. }
  110817. else {
  110818. var /** @type {?} */ staticSymbol = expression;
  110819. var /** @type {?} */ declarationValue = resolveReferenceValue(staticSymbol);
  110820. if (declarationValue != null) {
  110821. return simplifyNested(staticSymbol, declarationValue);
  110822. }
  110823. else {
  110824. return staticSymbol;
  110825. }
  110826. }
  110827. }
  110828. if (expression) {
  110829. if (expression['__symbolic']) {
  110830. var /** @type {?} */ staticSymbol = void 0;
  110831. switch (expression['__symbolic']) {
  110832. case 'binop':
  110833. var /** @type {?} */ left = simplify(expression['left']);
  110834. if (shouldIgnore(left))
  110835. return left;
  110836. var /** @type {?} */ right = simplify(expression['right']);
  110837. if (shouldIgnore(right))
  110838. return right;
  110839. switch (expression['operator']) {
  110840. case '&&':
  110841. return left && right;
  110842. case '||':
  110843. return left || right;
  110844. case '|':
  110845. return left | right;
  110846. case '^':
  110847. return left ^ right;
  110848. case '&':
  110849. return left & right;
  110850. case '==':
  110851. return left == right;
  110852. case '!=':
  110853. return left != right;
  110854. case '===':
  110855. return left === right;
  110856. case '!==':
  110857. return left !== right;
  110858. case '<':
  110859. return left < right;
  110860. case '>':
  110861. return left > right;
  110862. case '<=':
  110863. return left <= right;
  110864. case '>=':
  110865. return left >= right;
  110866. case '<<':
  110867. return left << right;
  110868. case '>>':
  110869. return left >> right;
  110870. case '+':
  110871. return left + right;
  110872. case '-':
  110873. return left - right;
  110874. case '*':
  110875. return left * right;
  110876. case '/':
  110877. return left / right;
  110878. case '%':
  110879. return left % right;
  110880. }
  110881. return null;
  110882. case 'if':
  110883. var /** @type {?} */ condition = simplify(expression['condition']);
  110884. return condition ? simplify(expression['thenExpression']) :
  110885. simplify(expression['elseExpression']);
  110886. case 'pre':
  110887. var /** @type {?} */ operand = simplify(expression['operand']);
  110888. if (shouldIgnore(operand))
  110889. return operand;
  110890. switch (expression['operator']) {
  110891. case '+':
  110892. return operand;
  110893. case '-':
  110894. return -operand;
  110895. case '!':
  110896. return !operand;
  110897. case '~':
  110898. return ~operand;
  110899. }
  110900. return null;
  110901. case 'index':
  110902. var /** @type {?} */ indexTarget = simplifyEagerly(expression['expression']);
  110903. var /** @type {?} */ index = simplifyEagerly(expression['index']);
  110904. if (indexTarget && isPrimitive(index))
  110905. return indexTarget[index];
  110906. return null;
  110907. case 'select':
  110908. var /** @type {?} */ member = expression['member'];
  110909. var /** @type {?} */ selectContext = context;
  110910. var /** @type {?} */ selectTarget = simplify(expression['expression']);
  110911. if (selectTarget instanceof StaticSymbol) {
  110912. var /** @type {?} */ members = selectTarget.members.concat(member);
  110913. selectContext =
  110914. self.getStaticSymbol(selectTarget.filePath, selectTarget.name, members);
  110915. var /** @type {?} */ declarationValue = resolveReferenceValue(selectContext);
  110916. if (declarationValue != null) {
  110917. return simplifyNested(selectContext, declarationValue);
  110918. }
  110919. else {
  110920. return selectContext;
  110921. }
  110922. }
  110923. if (selectTarget && isPrimitive(member))
  110924. return simplifyNested(selectContext, selectTarget[member]);
  110925. return null;
  110926. case 'reference':
  110927. // Note: This only has to deal with variable references, as symbol references have
  110928. // been converted into 'resolved'
  110929. // in the StaticSymbolResolver.
  110930. var /** @type {?} */ name_2 = expression['name'];
  110931. var /** @type {?} */ localValue = scope.resolve(name_2);
  110932. if (localValue != BindingScope.missing) {
  110933. return localValue;
  110934. }
  110935. break;
  110936. case 'resolved':
  110937. try {
  110938. return simplify(expression.symbol);
  110939. }
  110940. catch (/** @type {?} */ e) {
  110941. // If an error is reported evaluating the symbol record the position of the
  110942. // reference in the error so it can
  110943. // be reported in the error message generated from the exception.
  110944. if (isMetadataError(e) && expression.fileName != null &&
  110945. expression.line != null && expression.character != null) {
  110946. e.position = {
  110947. fileName: expression.fileName,
  110948. line: expression.line,
  110949. column: expression.character
  110950. };
  110951. }
  110952. throw e;
  110953. }
  110954. case 'class':
  110955. return context;
  110956. case 'function':
  110957. return context;
  110958. case 'new':
  110959. case 'call':
  110960. // Determine if the function is a built-in conversion
  110961. staticSymbol = simplifyInContext(context, expression['expression'], depth + 1, /* references */ 0);
  110962. if (staticSymbol instanceof StaticSymbol) {
  110963. if (staticSymbol === self.injectionToken || staticSymbol === self.opaqueToken) {
  110964. // if somebody calls new InjectionToken, don't create an InjectionToken,
  110965. // but rather return the symbol to which the InjectionToken is assigned to.
  110966. // OpaqueToken is supported too as it is required by the language service to
  110967. // support v4 and prior versions of Angular.
  110968. return context;
  110969. }
  110970. var /** @type {?} */ argExpressions = expression['arguments'] || [];
  110971. var /** @type {?} */ converter = self.conversionMap.get(staticSymbol);
  110972. if (converter) {
  110973. var /** @type {?} */ args = argExpressions.map(function (arg) { return simplifyNested(context, arg); })
  110974. .map(function (arg) { return shouldIgnore(arg) ? undefined : arg; });
  110975. return converter(context, args);
  110976. }
  110977. else {
  110978. // Determine if the function is one we can simplify.
  110979. var /** @type {?} */ targetFunction = resolveReferenceValue(staticSymbol);
  110980. return simplifyCall(staticSymbol, targetFunction, argExpressions, expression['expression']);
  110981. }
  110982. }
  110983. return IGNORE;
  110984. case 'error':
  110985. var /** @type {?} */ message = expression.message;
  110986. if (expression['line'] != null) {
  110987. self.error({
  110988. message: message,
  110989. context: expression.context,
  110990. value: expression,
  110991. position: {
  110992. fileName: expression['fileName'],
  110993. line: expression['line'],
  110994. column: expression['character']
  110995. }
  110996. }, context);
  110997. }
  110998. else {
  110999. self.error({ message: message, context: expression.context }, context);
  111000. }
  111001. return IGNORE;
  111002. case 'ignore':
  111003. return expression;
  111004. }
  111005. return null;
  111006. }
  111007. return mapStringMap(expression, function (value, name) {
  111008. if (REFERENCE_SET.has(name)) {
  111009. if (name === USE_VALUE && PROVIDE in expression) {
  111010. // If this is a provider expression, check for special tokens that need the value
  111011. // during analysis.
  111012. var /** @type {?} */ provide = simplify(expression.provide);
  111013. if (provide === self.ROUTES || provide == self.ANALYZE_FOR_ENTRY_COMPONENTS) {
  111014. return simplify(value);
  111015. }
  111016. }
  111017. return simplifyLazily(value);
  111018. }
  111019. return simplify(value);
  111020. });
  111021. }
  111022. return IGNORE;
  111023. }
  111024. return simplify(value);
  111025. }
  111026. var /** @type {?} */ result;
  111027. try {
  111028. result = simplifyInContext(context, value, 0, 0);
  111029. }
  111030. catch (/** @type {?} */ e) {
  111031. if (this.errorRecorder) {
  111032. this.reportError(e, context);
  111033. }
  111034. else {
  111035. throw formatMetadataError(e, context);
  111036. }
  111037. }
  111038. if (shouldIgnore(result)) {
  111039. return undefined;
  111040. }
  111041. return result;
  111042. };
  111043. /**
  111044. * @param {?} type
  111045. * @return {?}
  111046. */
  111047. StaticReflector.prototype.getTypeMetadata = /**
  111048. * @param {?} type
  111049. * @return {?}
  111050. */
  111051. function (type) {
  111052. var /** @type {?} */ resolvedSymbol = this.symbolResolver.resolveSymbol(type);
  111053. return resolvedSymbol && resolvedSymbol.metadata ? resolvedSymbol.metadata :
  111054. { __symbolic: 'class' };
  111055. };
  111056. /**
  111057. * @param {?} error
  111058. * @param {?} context
  111059. * @param {?=} path
  111060. * @return {?}
  111061. */
  111062. StaticReflector.prototype.reportError = /**
  111063. * @param {?} error
  111064. * @param {?} context
  111065. * @param {?=} path
  111066. * @return {?}
  111067. */
  111068. function (error, context, path) {
  111069. if (this.errorRecorder) {
  111070. this.errorRecorder(formatMetadataError(error, context), (context && context.filePath) || path);
  111071. }
  111072. else {
  111073. throw error;
  111074. }
  111075. };
  111076. /**
  111077. * @param {?} __0
  111078. * @param {?} reportingContext
  111079. * @return {?}
  111080. */
  111081. StaticReflector.prototype.error = /**
  111082. * @param {?} __0
  111083. * @param {?} reportingContext
  111084. * @return {?}
  111085. */
  111086. function (_a, reportingContext) {
  111087. var message = _a.message, summary = _a.summary, advise = _a.advise, position = _a.position, context = _a.context, value = _a.value, symbol = _a.symbol, chain = _a.chain;
  111088. this.reportError(metadataError(message, summary, advise, position, symbol, context, chain), reportingContext);
  111089. };
  111090. return StaticReflector;
  111091. }());
  111092. var METADATA_ERROR = 'ngMetadataError';
  111093. /**
  111094. * @param {?} message
  111095. * @param {?=} summary
  111096. * @param {?=} advise
  111097. * @param {?=} position
  111098. * @param {?=} symbol
  111099. * @param {?=} context
  111100. * @param {?=} chain
  111101. * @return {?}
  111102. */
  111103. function metadataError(message, summary, advise, position, symbol, context, chain) {
  111104. var /** @type {?} */ error = /** @type {?} */ (syntaxError(message));
  111105. (/** @type {?} */ (error))[METADATA_ERROR] = true;
  111106. if (advise)
  111107. error.advise = advise;
  111108. if (position)
  111109. error.position = position;
  111110. if (summary)
  111111. error.summary = summary;
  111112. if (context)
  111113. error.context = context;
  111114. if (chain)
  111115. error.chain = chain;
  111116. if (symbol)
  111117. error.symbol = symbol;
  111118. return error;
  111119. }
  111120. /**
  111121. * @param {?} error
  111122. * @return {?}
  111123. */
  111124. function isMetadataError(error) {
  111125. return !!(/** @type {?} */ (error))[METADATA_ERROR];
  111126. }
  111127. var REFERENCE_TO_NONEXPORTED_CLASS = 'Reference to non-exported class';
  111128. var VARIABLE_NOT_INITIALIZED = 'Variable not initialized';
  111129. var DESTRUCTURE_NOT_SUPPORTED = 'Destructuring not supported';
  111130. var COULD_NOT_RESOLVE_TYPE = 'Could not resolve type';
  111131. var FUNCTION_CALL_NOT_SUPPORTED = 'Function call not supported';
  111132. var REFERENCE_TO_LOCAL_SYMBOL = 'Reference to a local symbol';
  111133. var LAMBDA_NOT_SUPPORTED = 'Lambda not supported';
  111134. /**
  111135. * @param {?} message
  111136. * @param {?} context
  111137. * @return {?}
  111138. */
  111139. function expandedMessage(message, context) {
  111140. switch (message) {
  111141. case REFERENCE_TO_NONEXPORTED_CLASS:
  111142. if (context && context.className) {
  111143. return "References to a non-exported class are not supported in decorators but " + context.className + " was referenced.";
  111144. }
  111145. break;
  111146. case VARIABLE_NOT_INITIALIZED:
  111147. return 'Only initialized variables and constants can be referenced in decorators because the value of this variable is needed by the template compiler';
  111148. case DESTRUCTURE_NOT_SUPPORTED:
  111149. return 'Referencing an exported destructured variable or constant is not supported in decorators and this value is needed by the template compiler';
  111150. case COULD_NOT_RESOLVE_TYPE:
  111151. if (context && context.typeName) {
  111152. return "Could not resolve type " + context.typeName;
  111153. }
  111154. break;
  111155. case FUNCTION_CALL_NOT_SUPPORTED:
  111156. if (context && context.name) {
  111157. return "Function calls are not supported in decorators but '" + context.name + "' was called";
  111158. }
  111159. return 'Function calls are not supported in decorators';
  111160. case REFERENCE_TO_LOCAL_SYMBOL:
  111161. if (context && context.name) {
  111162. return "Reference to a local (non-exported) symbols are not supported in decorators but '" + context.name + "' was referenced";
  111163. }
  111164. break;
  111165. case LAMBDA_NOT_SUPPORTED:
  111166. return "Function expressions are not supported in decorators";
  111167. }
  111168. return message;
  111169. }
  111170. /**
  111171. * @param {?} message
  111172. * @param {?} context
  111173. * @return {?}
  111174. */
  111175. function messageAdvise(message, context) {
  111176. switch (message) {
  111177. case REFERENCE_TO_NONEXPORTED_CLASS:
  111178. if (context && context.className) {
  111179. return "Consider exporting '" + context.className + "'";
  111180. }
  111181. break;
  111182. case DESTRUCTURE_NOT_SUPPORTED:
  111183. return 'Consider simplifying to avoid destructuring';
  111184. case REFERENCE_TO_LOCAL_SYMBOL:
  111185. if (context && context.name) {
  111186. return "Consider exporting '" + context.name + "'";
  111187. }
  111188. break;
  111189. case LAMBDA_NOT_SUPPORTED:
  111190. return "Consider changing the function expression into an exported function";
  111191. }
  111192. return undefined;
  111193. }
  111194. /**
  111195. * @param {?} error
  111196. * @return {?}
  111197. */
  111198. function errorSummary(error) {
  111199. if (error.summary) {
  111200. return error.summary;
  111201. }
  111202. switch (error.message) {
  111203. case REFERENCE_TO_NONEXPORTED_CLASS:
  111204. if (error.context && error.context.className) {
  111205. return "references non-exported class " + error.context.className;
  111206. }
  111207. break;
  111208. case VARIABLE_NOT_INITIALIZED:
  111209. return 'is not initialized';
  111210. case DESTRUCTURE_NOT_SUPPORTED:
  111211. return 'is a destructured variable';
  111212. case COULD_NOT_RESOLVE_TYPE:
  111213. return 'could not be resolved';
  111214. case FUNCTION_CALL_NOT_SUPPORTED:
  111215. if (error.context && error.context.name) {
  111216. return "calls '" + error.context.name + "'";
  111217. }
  111218. return "calls a function";
  111219. case REFERENCE_TO_LOCAL_SYMBOL:
  111220. if (error.context && error.context.name) {
  111221. return "references local variable " + error.context.name;
  111222. }
  111223. return "references a local variable";
  111224. }
  111225. return 'contains the error';
  111226. }
  111227. /**
  111228. * @param {?} input
  111229. * @param {?} transform
  111230. * @return {?}
  111231. */
  111232. function mapStringMap(input, transform) {
  111233. if (!input)
  111234. return {};
  111235. var /** @type {?} */ result = {};
  111236. Object.keys(input).forEach(function (key) {
  111237. var /** @type {?} */ value = transform(input[key], key);
  111238. if (!shouldIgnore(value)) {
  111239. if (HIDDEN_KEY.test(key)) {
  111240. Object.defineProperty(result, key, { enumerable: false, configurable: true, value: value });
  111241. }
  111242. else {
  111243. result[key] = value;
  111244. }
  111245. }
  111246. });
  111247. return result;
  111248. }
  111249. /**
  111250. * @param {?} o
  111251. * @return {?}
  111252. */
  111253. function isPrimitive(o) {
  111254. return o === null || (typeof o !== 'function' && typeof o !== 'object');
  111255. }
  111256. /**
  111257. * @abstract
  111258. */
  111259. var BindingScope = /** @class */ (function () {
  111260. function BindingScope() {
  111261. }
  111262. /**
  111263. * @return {?}
  111264. */
  111265. BindingScope.build = /**
  111266. * @return {?}
  111267. */
  111268. function () {
  111269. var /** @type {?} */ current = new Map();
  111270. return {
  111271. define: function (name, value) {
  111272. current.set(name, value);
  111273. return this;
  111274. },
  111275. done: function () {
  111276. return current.size > 0 ? new PopulatedScope(current) : BindingScope.empty;
  111277. }
  111278. };
  111279. };
  111280. BindingScope.missing = {};
  111281. BindingScope.empty = { resolve: function (name) { return BindingScope.missing; } };
  111282. return BindingScope;
  111283. }());
  111284. var PopulatedScope = /** @class */ (function (_super) {
  111285. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(PopulatedScope, _super);
  111286. function PopulatedScope(bindings) {
  111287. var _this = _super.call(this) || this;
  111288. _this.bindings = bindings;
  111289. return _this;
  111290. }
  111291. /**
  111292. * @param {?} name
  111293. * @return {?}
  111294. */
  111295. PopulatedScope.prototype.resolve = /**
  111296. * @param {?} name
  111297. * @return {?}
  111298. */
  111299. function (name) {
  111300. return this.bindings.has(name) ? this.bindings.get(name) : BindingScope.missing;
  111301. };
  111302. return PopulatedScope;
  111303. }(BindingScope));
  111304. /**
  111305. * @param {?} chain
  111306. * @param {?} advise
  111307. * @return {?}
  111308. */
  111309. function formatMetadataMessageChain(chain, advise) {
  111310. var /** @type {?} */ expanded = expandedMessage(chain.message, chain.context);
  111311. var /** @type {?} */ nesting = chain.symbol ? " in '" + chain.symbol.name + "'" : '';
  111312. var /** @type {?} */ message = "" + expanded + nesting;
  111313. var /** @type {?} */ position = chain.position;
  111314. var /** @type {?} */ next = chain.next ?
  111315. formatMetadataMessageChain(chain.next, advise) :
  111316. advise ? { message: advise } : undefined;
  111317. return { message: message, position: position, next: next };
  111318. }
  111319. /**
  111320. * @param {?} e
  111321. * @param {?} context
  111322. * @return {?}
  111323. */
  111324. function formatMetadataError(e, context) {
  111325. if (isMetadataError(e)) {
  111326. // Produce a formatted version of the and leaving enough information in the original error
  111327. // to recover the formatting information to eventually produce a diagnostic error message.
  111328. var /** @type {?} */ position = e.position;
  111329. var /** @type {?} */ chain = {
  111330. message: "Error during template compile of '" + context.name + "'",
  111331. position: position,
  111332. next: { message: e.message, next: e.chain, context: e.context, symbol: e.symbol }
  111333. };
  111334. var /** @type {?} */ advise = e.advise || messageAdvise(e.message, e.context);
  111335. return formattedError(formatMetadataMessageChain(chain, advise));
  111336. }
  111337. return e;
  111338. }
  111339. /**
  111340. * @fileoverview added by tsickle
  111341. * @suppress {checkTypes} checked by tsc
  111342. */
  111343. /**
  111344. * @license
  111345. * Copyright Google Inc. All Rights Reserved.
  111346. *
  111347. * Use of this source code is governed by an MIT-style license that can be
  111348. * found in the LICENSE file at https://angular.io/license
  111349. */
  111350. /**
  111351. * @record
  111352. */
  111353. var AotSummaryResolver = /** @class */ (function () {
  111354. function AotSummaryResolver(host, staticSymbolCache) {
  111355. this.host = host;
  111356. this.staticSymbolCache = staticSymbolCache;
  111357. this.summaryCache = new Map();
  111358. this.loadedFilePaths = new Map();
  111359. this.importAs = new Map();
  111360. this.knownFileNameToModuleNames = new Map();
  111361. }
  111362. /**
  111363. * @param {?} filePath
  111364. * @return {?}
  111365. */
  111366. AotSummaryResolver.prototype.isLibraryFile = /**
  111367. * @param {?} filePath
  111368. * @return {?}
  111369. */
  111370. function (filePath) {
  111371. // Note: We need to strip the .ngfactory. file path,
  111372. // so this method also works for generated files
  111373. // (for which host.isSourceFile will always return false).
  111374. return !this.host.isSourceFile(stripGeneratedFileSuffix(filePath));
  111375. };
  111376. /**
  111377. * @param {?} filePath
  111378. * @param {?} referringSrcFileName
  111379. * @return {?}
  111380. */
  111381. AotSummaryResolver.prototype.toSummaryFileName = /**
  111382. * @param {?} filePath
  111383. * @param {?} referringSrcFileName
  111384. * @return {?}
  111385. */
  111386. function (filePath, referringSrcFileName) {
  111387. return this.host.toSummaryFileName(filePath, referringSrcFileName);
  111388. };
  111389. /**
  111390. * @param {?} fileName
  111391. * @param {?} referringLibFileName
  111392. * @return {?}
  111393. */
  111394. AotSummaryResolver.prototype.fromSummaryFileName = /**
  111395. * @param {?} fileName
  111396. * @param {?} referringLibFileName
  111397. * @return {?}
  111398. */
  111399. function (fileName, referringLibFileName) {
  111400. return this.host.fromSummaryFileName(fileName, referringLibFileName);
  111401. };
  111402. /**
  111403. * @param {?} staticSymbol
  111404. * @return {?}
  111405. */
  111406. AotSummaryResolver.prototype.resolveSummary = /**
  111407. * @param {?} staticSymbol
  111408. * @return {?}
  111409. */
  111410. function (staticSymbol) {
  111411. var /** @type {?} */ rootSymbol = staticSymbol.members.length ?
  111412. this.staticSymbolCache.get(staticSymbol.filePath, staticSymbol.name) :
  111413. staticSymbol;
  111414. var /** @type {?} */ summary = this.summaryCache.get(rootSymbol);
  111415. if (!summary) {
  111416. this._loadSummaryFile(staticSymbol.filePath);
  111417. summary = /** @type {?} */ ((this.summaryCache.get(staticSymbol)));
  111418. }
  111419. return (rootSymbol === staticSymbol && summary) || null;
  111420. };
  111421. /**
  111422. * @param {?} filePath
  111423. * @return {?}
  111424. */
  111425. AotSummaryResolver.prototype.getSymbolsOf = /**
  111426. * @param {?} filePath
  111427. * @return {?}
  111428. */
  111429. function (filePath) {
  111430. if (this._loadSummaryFile(filePath)) {
  111431. return Array.from(this.summaryCache.keys()).filter(function (symbol) { return symbol.filePath === filePath; });
  111432. }
  111433. return null;
  111434. };
  111435. /**
  111436. * @param {?} staticSymbol
  111437. * @return {?}
  111438. */
  111439. AotSummaryResolver.prototype.getImportAs = /**
  111440. * @param {?} staticSymbol
  111441. * @return {?}
  111442. */
  111443. function (staticSymbol) {
  111444. staticSymbol.assertNoMembers();
  111445. return /** @type {?} */ ((this.importAs.get(staticSymbol)));
  111446. };
  111447. /**
  111448. * Converts a file path to a module name that can be used as an `import`.
  111449. */
  111450. /**
  111451. * Converts a file path to a module name that can be used as an `import`.
  111452. * @param {?} importedFilePath
  111453. * @return {?}
  111454. */
  111455. AotSummaryResolver.prototype.getKnownModuleName = /**
  111456. * Converts a file path to a module name that can be used as an `import`.
  111457. * @param {?} importedFilePath
  111458. * @return {?}
  111459. */
  111460. function (importedFilePath) {
  111461. return this.knownFileNameToModuleNames.get(importedFilePath) || null;
  111462. };
  111463. /**
  111464. * @param {?} summary
  111465. * @return {?}
  111466. */
  111467. AotSummaryResolver.prototype.addSummary = /**
  111468. * @param {?} summary
  111469. * @return {?}
  111470. */
  111471. function (summary) { this.summaryCache.set(summary.symbol, summary); };
  111472. /**
  111473. * @param {?} filePath
  111474. * @return {?}
  111475. */
  111476. AotSummaryResolver.prototype._loadSummaryFile = /**
  111477. * @param {?} filePath
  111478. * @return {?}
  111479. */
  111480. function (filePath) {
  111481. var _this = this;
  111482. var /** @type {?} */ hasSummary = this.loadedFilePaths.get(filePath);
  111483. if (hasSummary != null) {
  111484. return hasSummary;
  111485. }
  111486. var /** @type {?} */ json = null;
  111487. if (this.isLibraryFile(filePath)) {
  111488. var /** @type {?} */ summaryFilePath = summaryFileName(filePath);
  111489. try {
  111490. json = this.host.loadSummary(summaryFilePath);
  111491. }
  111492. catch (/** @type {?} */ e) {
  111493. console.error("Error loading summary file " + summaryFilePath);
  111494. throw e;
  111495. }
  111496. }
  111497. hasSummary = json != null;
  111498. this.loadedFilePaths.set(filePath, hasSummary);
  111499. if (json) {
  111500. var _a = deserializeSummaries(this.staticSymbolCache, this, filePath, json), moduleName = _a.moduleName, summaries = _a.summaries, importAs = _a.importAs;
  111501. summaries.forEach(function (summary) { return _this.summaryCache.set(summary.symbol, summary); });
  111502. if (moduleName) {
  111503. this.knownFileNameToModuleNames.set(filePath, moduleName);
  111504. }
  111505. importAs.forEach(function (importAs) { _this.importAs.set(importAs.symbol, importAs.importAs); });
  111506. }
  111507. return hasSummary;
  111508. };
  111509. return AotSummaryResolver;
  111510. }());
  111511. /**
  111512. * @fileoverview added by tsickle
  111513. * @suppress {checkTypes} checked by tsc
  111514. */
  111515. /**
  111516. * @license
  111517. * Copyright Google Inc. All Rights Reserved.
  111518. *
  111519. * Use of this source code is governed by an MIT-style license that can be
  111520. * found in the LICENSE file at https://angular.io/license
  111521. */
  111522. /**
  111523. * @param {?} host
  111524. * @return {?}
  111525. */
  111526. function createAotUrlResolver(host) {
  111527. return {
  111528. resolve: function (basePath, url) {
  111529. var /** @type {?} */ filePath = host.resourceNameToFileName(url, basePath);
  111530. if (!filePath) {
  111531. throw syntaxError("Couldn't resolve resource " + url + " from " + basePath);
  111532. }
  111533. return filePath;
  111534. }
  111535. };
  111536. }
  111537. /**
  111538. * Creates a new AotCompiler based on options and a host.
  111539. * @param {?} compilerHost
  111540. * @param {?} options
  111541. * @param {?=} errorCollector
  111542. * @return {?}
  111543. */
  111544. function createAotCompiler(compilerHost, options, errorCollector) {
  111545. var /** @type {?} */ translations = options.translations || '';
  111546. var /** @type {?} */ urlResolver = createAotUrlResolver(compilerHost);
  111547. var /** @type {?} */ symbolCache = new StaticSymbolCache();
  111548. var /** @type {?} */ summaryResolver = new AotSummaryResolver(compilerHost, symbolCache);
  111549. var /** @type {?} */ symbolResolver = new StaticSymbolResolver(compilerHost, symbolCache, summaryResolver);
  111550. var /** @type {?} */ staticReflector = new StaticReflector(summaryResolver, symbolResolver, [], [], errorCollector);
  111551. var /** @type {?} */ htmlParser = new I18NHtmlParser(new HtmlParser(), translations, options.i18nFormat, options.missingTranslation, console);
  111552. var /** @type {?} */ config = new CompilerConfig({
  111553. defaultEncapsulation: ViewEncapsulation.Emulated,
  111554. useJit: false,
  111555. enableLegacyTemplate: options.enableLegacyTemplate === true,
  111556. missingTranslation: options.missingTranslation,
  111557. preserveWhitespaces: options.preserveWhitespaces,
  111558. strictInjectionParameters: options.strictInjectionParameters,
  111559. });
  111560. var /** @type {?} */ normalizer = new DirectiveNormalizer({ get: function (url) { return compilerHost.loadResource(url); } }, urlResolver, htmlParser, config);
  111561. var /** @type {?} */ expressionParser = new Parser(new Lexer());
  111562. var /** @type {?} */ elementSchemaRegistry = new DomElementSchemaRegistry();
  111563. var /** @type {?} */ tmplParser = new TemplateParser(config, staticReflector, expressionParser, elementSchemaRegistry, htmlParser, console, []);
  111564. var /** @type {?} */ resolver = new CompileMetadataResolver(config, htmlParser, new NgModuleResolver(staticReflector), new DirectiveResolver(staticReflector), new PipeResolver(staticReflector), summaryResolver, elementSchemaRegistry, normalizer, console, symbolCache, staticReflector, errorCollector);
  111565. // TODO(vicb): do not pass options.i18nFormat here
  111566. var /** @type {?} */ viewCompiler = new ViewCompiler(staticReflector);
  111567. var /** @type {?} */ typeCheckCompiler = new TypeCheckCompiler(options, staticReflector);
  111568. var /** @type {?} */ compiler = new AotCompiler(config, options, compilerHost, staticReflector, resolver, tmplParser, new StyleCompiler(urlResolver), viewCompiler, typeCheckCompiler, new NgModuleCompiler(staticReflector), new TypeScriptEmitter(), summaryResolver, symbolResolver);
  111569. return { compiler: compiler, reflector: staticReflector };
  111570. }
  111571. /**
  111572. * @fileoverview added by tsickle
  111573. * @suppress {checkTypes} checked by tsc
  111574. */
  111575. /**
  111576. * @record
  111577. * @template T
  111578. */
  111579. /**
  111580. * @abstract
  111581. * @template T
  111582. */
  111583. var SummaryResolver = /** @class */ (function () {
  111584. function SummaryResolver() {
  111585. }
  111586. return SummaryResolver;
  111587. }());
  111588. var JitSummaryResolver = /** @class */ (function () {
  111589. function JitSummaryResolver() {
  111590. this._summaries = new Map();
  111591. }
  111592. /**
  111593. * @return {?}
  111594. */
  111595. JitSummaryResolver.prototype.isLibraryFile = /**
  111596. * @return {?}
  111597. */
  111598. function () { return false; };
  111599. /**
  111600. * @param {?} fileName
  111601. * @return {?}
  111602. */
  111603. JitSummaryResolver.prototype.toSummaryFileName = /**
  111604. * @param {?} fileName
  111605. * @return {?}
  111606. */
  111607. function (fileName) { return fileName; };
  111608. /**
  111609. * @param {?} fileName
  111610. * @return {?}
  111611. */
  111612. JitSummaryResolver.prototype.fromSummaryFileName = /**
  111613. * @param {?} fileName
  111614. * @return {?}
  111615. */
  111616. function (fileName) { return fileName; };
  111617. /**
  111618. * @param {?} reference
  111619. * @return {?}
  111620. */
  111621. JitSummaryResolver.prototype.resolveSummary = /**
  111622. * @param {?} reference
  111623. * @return {?}
  111624. */
  111625. function (reference) {
  111626. return this._summaries.get(reference) || null;
  111627. };
  111628. /**
  111629. * @return {?}
  111630. */
  111631. JitSummaryResolver.prototype.getSymbolsOf = /**
  111632. * @return {?}
  111633. */
  111634. function () { return []; };
  111635. /**
  111636. * @param {?} reference
  111637. * @return {?}
  111638. */
  111639. JitSummaryResolver.prototype.getImportAs = /**
  111640. * @param {?} reference
  111641. * @return {?}
  111642. */
  111643. function (reference) { return reference; };
  111644. /**
  111645. * @param {?} fileName
  111646. * @return {?}
  111647. */
  111648. JitSummaryResolver.prototype.getKnownModuleName = /**
  111649. * @param {?} fileName
  111650. * @return {?}
  111651. */
  111652. function (fileName) { return null; };
  111653. /**
  111654. * @param {?} summary
  111655. * @return {?}
  111656. */
  111657. JitSummaryResolver.prototype.addSummary = /**
  111658. * @param {?} summary
  111659. * @return {?}
  111660. */
  111661. function (summary) { this._summaries.set(summary.symbol, summary); };
  111662. return JitSummaryResolver;
  111663. }());
  111664. /**
  111665. * @fileoverview added by tsickle
  111666. * @suppress {checkTypes} checked by tsc
  111667. */
  111668. /**
  111669. * @license
  111670. * Copyright Google Inc. All Rights Reserved.
  111671. *
  111672. * Use of this source code is governed by an MIT-style license that can be
  111673. * found in the LICENSE file at https://angular.io/license
  111674. */
  111675. /**
  111676. * @param {?} statements
  111677. * @param {?} reflector
  111678. * @return {?}
  111679. */
  111680. function interpretStatements(statements, reflector) {
  111681. var /** @type {?} */ ctx = new _ExecutionContext(null, null, null, new Map());
  111682. var /** @type {?} */ visitor = new StatementInterpreter(reflector);
  111683. visitor.visitAllStatements(statements, ctx);
  111684. var /** @type {?} */ result = {};
  111685. ctx.exports.forEach(function (exportName) { result[exportName] = ctx.vars.get(exportName); });
  111686. return result;
  111687. }
  111688. /**
  111689. * @param {?} varNames
  111690. * @param {?} varValues
  111691. * @param {?} statements
  111692. * @param {?} ctx
  111693. * @param {?} visitor
  111694. * @return {?}
  111695. */
  111696. function _executeFunctionStatements(varNames, varValues, statements, ctx, visitor) {
  111697. var /** @type {?} */ childCtx = ctx.createChildWihtLocalVars();
  111698. for (var /** @type {?} */ i = 0; i < varNames.length; i++) {
  111699. childCtx.vars.set(varNames[i], varValues[i]);
  111700. }
  111701. var /** @type {?} */ result = visitor.visitAllStatements(statements, childCtx);
  111702. return result ? result.value : null;
  111703. }
  111704. var _ExecutionContext = /** @class */ (function () {
  111705. function _ExecutionContext(parent, instance, className, vars) {
  111706. this.parent = parent;
  111707. this.instance = instance;
  111708. this.className = className;
  111709. this.vars = vars;
  111710. this.exports = [];
  111711. }
  111712. /**
  111713. * @return {?}
  111714. */
  111715. _ExecutionContext.prototype.createChildWihtLocalVars = /**
  111716. * @return {?}
  111717. */
  111718. function () {
  111719. return new _ExecutionContext(this, this.instance, this.className, new Map());
  111720. };
  111721. return _ExecutionContext;
  111722. }());
  111723. var ReturnValue = /** @class */ (function () {
  111724. function ReturnValue(value) {
  111725. this.value = value;
  111726. }
  111727. return ReturnValue;
  111728. }());
  111729. /**
  111730. * @param {?} _classStmt
  111731. * @param {?} _ctx
  111732. * @param {?} _visitor
  111733. * @return {?}
  111734. */
  111735. function createDynamicClass(_classStmt, _ctx, _visitor) {
  111736. var /** @type {?} */ propertyDescriptors = {};
  111737. _classStmt.getters.forEach(function (getter) {
  111738. // Note: use `function` instead of arrow function to capture `this`
  111739. propertyDescriptors[getter.name] = {
  111740. configurable: false,
  111741. get: function () {
  111742. var /** @type {?} */ instanceCtx = new _ExecutionContext(_ctx, this, _classStmt.name, _ctx.vars);
  111743. return _executeFunctionStatements([], [], getter.body, instanceCtx, _visitor);
  111744. }
  111745. };
  111746. });
  111747. _classStmt.methods.forEach(function (method) {
  111748. var /** @type {?} */ paramNames = method.params.map(function (param) { return param.name; });
  111749. // Note: use `function` instead of arrow function to capture `this`
  111750. propertyDescriptors[/** @type {?} */ ((method.name))] = {
  111751. writable: false,
  111752. configurable: false,
  111753. value: function () {
  111754. var args = [];
  111755. for (var _i = 0; _i < arguments.length; _i++) {
  111756. args[_i] = arguments[_i];
  111757. }
  111758. var /** @type {?} */ instanceCtx = new _ExecutionContext(_ctx, this, _classStmt.name, _ctx.vars);
  111759. return _executeFunctionStatements(paramNames, args, method.body, instanceCtx, _visitor);
  111760. }
  111761. };
  111762. });
  111763. var /** @type {?} */ ctorParamNames = _classStmt.constructorMethod.params.map(function (param) { return param.name; });
  111764. // Note: use `function` instead of arrow function to capture `this`
  111765. var /** @type {?} */ ctor = function () {
  111766. var _this = this;
  111767. var args = [];
  111768. for (var _i = 0; _i < arguments.length; _i++) {
  111769. args[_i] = arguments[_i];
  111770. }
  111771. var /** @type {?} */ instanceCtx = new _ExecutionContext(_ctx, this, _classStmt.name, _ctx.vars);
  111772. _classStmt.fields.forEach(function (field) { _this[field.name] = undefined; });
  111773. _executeFunctionStatements(ctorParamNames, args, _classStmt.constructorMethod.body, instanceCtx, _visitor);
  111774. };
  111775. var /** @type {?} */ superClass = _classStmt.parent ? _classStmt.parent.visitExpression(_visitor, _ctx) : Object;
  111776. ctor.prototype = Object.create(superClass.prototype, propertyDescriptors);
  111777. return ctor;
  111778. }
  111779. var StatementInterpreter = /** @class */ (function () {
  111780. function StatementInterpreter(reflector) {
  111781. this.reflector = reflector;
  111782. }
  111783. /**
  111784. * @param {?} ast
  111785. * @return {?}
  111786. */
  111787. StatementInterpreter.prototype.debugAst = /**
  111788. * @param {?} ast
  111789. * @return {?}
  111790. */
  111791. function (ast) { return debugOutputAstAsTypeScript(ast); };
  111792. /**
  111793. * @param {?} stmt
  111794. * @param {?} ctx
  111795. * @return {?}
  111796. */
  111797. StatementInterpreter.prototype.visitDeclareVarStmt = /**
  111798. * @param {?} stmt
  111799. * @param {?} ctx
  111800. * @return {?}
  111801. */
  111802. function (stmt, ctx) {
  111803. ctx.vars.set(stmt.name, stmt.value.visitExpression(this, ctx));
  111804. if (stmt.hasModifier(StmtModifier.Exported)) {
  111805. ctx.exports.push(stmt.name);
  111806. }
  111807. return null;
  111808. };
  111809. /**
  111810. * @param {?} expr
  111811. * @param {?} ctx
  111812. * @return {?}
  111813. */
  111814. StatementInterpreter.prototype.visitWriteVarExpr = /**
  111815. * @param {?} expr
  111816. * @param {?} ctx
  111817. * @return {?}
  111818. */
  111819. function (expr, ctx) {
  111820. var /** @type {?} */ value = expr.value.visitExpression(this, ctx);
  111821. var /** @type {?} */ currCtx = ctx;
  111822. while (currCtx != null) {
  111823. if (currCtx.vars.has(expr.name)) {
  111824. currCtx.vars.set(expr.name, value);
  111825. return value;
  111826. }
  111827. currCtx = /** @type {?} */ ((currCtx.parent));
  111828. }
  111829. throw new Error("Not declared variable " + expr.name);
  111830. };
  111831. /**
  111832. * @param {?} ast
  111833. * @param {?} ctx
  111834. * @return {?}
  111835. */
  111836. StatementInterpreter.prototype.visitReadVarExpr = /**
  111837. * @param {?} ast
  111838. * @param {?} ctx
  111839. * @return {?}
  111840. */
  111841. function (ast, ctx) {
  111842. var /** @type {?} */ varName = /** @type {?} */ ((ast.name));
  111843. if (ast.builtin != null) {
  111844. switch (ast.builtin) {
  111845. case BuiltinVar.Super:
  111846. return ctx.instance.__proto__;
  111847. case BuiltinVar.This:
  111848. return ctx.instance;
  111849. case BuiltinVar.CatchError:
  111850. varName = CATCH_ERROR_VAR$2;
  111851. break;
  111852. case BuiltinVar.CatchStack:
  111853. varName = CATCH_STACK_VAR$2;
  111854. break;
  111855. default:
  111856. throw new Error("Unknown builtin variable " + ast.builtin);
  111857. }
  111858. }
  111859. var /** @type {?} */ currCtx = ctx;
  111860. while (currCtx != null) {
  111861. if (currCtx.vars.has(varName)) {
  111862. return currCtx.vars.get(varName);
  111863. }
  111864. currCtx = /** @type {?} */ ((currCtx.parent));
  111865. }
  111866. throw new Error("Not declared variable " + varName);
  111867. };
  111868. /**
  111869. * @param {?} expr
  111870. * @param {?} ctx
  111871. * @return {?}
  111872. */
  111873. StatementInterpreter.prototype.visitWriteKeyExpr = /**
  111874. * @param {?} expr
  111875. * @param {?} ctx
  111876. * @return {?}
  111877. */
  111878. function (expr, ctx) {
  111879. var /** @type {?} */ receiver = expr.receiver.visitExpression(this, ctx);
  111880. var /** @type {?} */ index = expr.index.visitExpression(this, ctx);
  111881. var /** @type {?} */ value = expr.value.visitExpression(this, ctx);
  111882. receiver[index] = value;
  111883. return value;
  111884. };
  111885. /**
  111886. * @param {?} expr
  111887. * @param {?} ctx
  111888. * @return {?}
  111889. */
  111890. StatementInterpreter.prototype.visitWritePropExpr = /**
  111891. * @param {?} expr
  111892. * @param {?} ctx
  111893. * @return {?}
  111894. */
  111895. function (expr, ctx) {
  111896. var /** @type {?} */ receiver = expr.receiver.visitExpression(this, ctx);
  111897. var /** @type {?} */ value = expr.value.visitExpression(this, ctx);
  111898. receiver[expr.name] = value;
  111899. return value;
  111900. };
  111901. /**
  111902. * @param {?} expr
  111903. * @param {?} ctx
  111904. * @return {?}
  111905. */
  111906. StatementInterpreter.prototype.visitInvokeMethodExpr = /**
  111907. * @param {?} expr
  111908. * @param {?} ctx
  111909. * @return {?}
  111910. */
  111911. function (expr, ctx) {
  111912. var /** @type {?} */ receiver = expr.receiver.visitExpression(this, ctx);
  111913. var /** @type {?} */ args = this.visitAllExpressions(expr.args, ctx);
  111914. var /** @type {?} */ result;
  111915. if (expr.builtin != null) {
  111916. switch (expr.builtin) {
  111917. case BuiltinMethod.ConcatArray:
  111918. result = receiver.concat.apply(receiver, args);
  111919. break;
  111920. case BuiltinMethod.SubscribeObservable:
  111921. result = receiver.subscribe({ next: args[0] });
  111922. break;
  111923. case BuiltinMethod.Bind:
  111924. result = receiver.bind.apply(receiver, args);
  111925. break;
  111926. default:
  111927. throw new Error("Unknown builtin method " + expr.builtin);
  111928. }
  111929. }
  111930. else {
  111931. result = receiver[/** @type {?} */ ((expr.name))].apply(receiver, args);
  111932. }
  111933. return result;
  111934. };
  111935. /**
  111936. * @param {?} stmt
  111937. * @param {?} ctx
  111938. * @return {?}
  111939. */
  111940. StatementInterpreter.prototype.visitInvokeFunctionExpr = /**
  111941. * @param {?} stmt
  111942. * @param {?} ctx
  111943. * @return {?}
  111944. */
  111945. function (stmt, ctx) {
  111946. var /** @type {?} */ args = this.visitAllExpressions(stmt.args, ctx);
  111947. var /** @type {?} */ fnExpr = stmt.fn;
  111948. if (fnExpr instanceof ReadVarExpr && fnExpr.builtin === BuiltinVar.Super) {
  111949. ctx.instance.constructor.prototype.constructor.apply(ctx.instance, args);
  111950. return null;
  111951. }
  111952. else {
  111953. var /** @type {?} */ fn$$1 = stmt.fn.visitExpression(this, ctx);
  111954. return fn$$1.apply(null, args);
  111955. }
  111956. };
  111957. /**
  111958. * @param {?} stmt
  111959. * @param {?} ctx
  111960. * @return {?}
  111961. */
  111962. StatementInterpreter.prototype.visitReturnStmt = /**
  111963. * @param {?} stmt
  111964. * @param {?} ctx
  111965. * @return {?}
  111966. */
  111967. function (stmt, ctx) {
  111968. return new ReturnValue(stmt.value.visitExpression(this, ctx));
  111969. };
  111970. /**
  111971. * @param {?} stmt
  111972. * @param {?} ctx
  111973. * @return {?}
  111974. */
  111975. StatementInterpreter.prototype.visitDeclareClassStmt = /**
  111976. * @param {?} stmt
  111977. * @param {?} ctx
  111978. * @return {?}
  111979. */
  111980. function (stmt, ctx) {
  111981. var /** @type {?} */ clazz = createDynamicClass(stmt, ctx, this);
  111982. ctx.vars.set(stmt.name, clazz);
  111983. if (stmt.hasModifier(StmtModifier.Exported)) {
  111984. ctx.exports.push(stmt.name);
  111985. }
  111986. return null;
  111987. };
  111988. /**
  111989. * @param {?} stmt
  111990. * @param {?} ctx
  111991. * @return {?}
  111992. */
  111993. StatementInterpreter.prototype.visitExpressionStmt = /**
  111994. * @param {?} stmt
  111995. * @param {?} ctx
  111996. * @return {?}
  111997. */
  111998. function (stmt, ctx) {
  111999. return stmt.expr.visitExpression(this, ctx);
  112000. };
  112001. /**
  112002. * @param {?} stmt
  112003. * @param {?} ctx
  112004. * @return {?}
  112005. */
  112006. StatementInterpreter.prototype.visitIfStmt = /**
  112007. * @param {?} stmt
  112008. * @param {?} ctx
  112009. * @return {?}
  112010. */
  112011. function (stmt, ctx) {
  112012. var /** @type {?} */ condition = stmt.condition.visitExpression(this, ctx);
  112013. if (condition) {
  112014. return this.visitAllStatements(stmt.trueCase, ctx);
  112015. }
  112016. else if (stmt.falseCase != null) {
  112017. return this.visitAllStatements(stmt.falseCase, ctx);
  112018. }
  112019. return null;
  112020. };
  112021. /**
  112022. * @param {?} stmt
  112023. * @param {?} ctx
  112024. * @return {?}
  112025. */
  112026. StatementInterpreter.prototype.visitTryCatchStmt = /**
  112027. * @param {?} stmt
  112028. * @param {?} ctx
  112029. * @return {?}
  112030. */
  112031. function (stmt, ctx) {
  112032. try {
  112033. return this.visitAllStatements(stmt.bodyStmts, ctx);
  112034. }
  112035. catch (/** @type {?} */ e) {
  112036. var /** @type {?} */ childCtx = ctx.createChildWihtLocalVars();
  112037. childCtx.vars.set(CATCH_ERROR_VAR$2, e);
  112038. childCtx.vars.set(CATCH_STACK_VAR$2, e.stack);
  112039. return this.visitAllStatements(stmt.catchStmts, childCtx);
  112040. }
  112041. };
  112042. /**
  112043. * @param {?} stmt
  112044. * @param {?} ctx
  112045. * @return {?}
  112046. */
  112047. StatementInterpreter.prototype.visitThrowStmt = /**
  112048. * @param {?} stmt
  112049. * @param {?} ctx
  112050. * @return {?}
  112051. */
  112052. function (stmt, ctx) {
  112053. throw stmt.error.visitExpression(this, ctx);
  112054. };
  112055. /**
  112056. * @param {?} stmt
  112057. * @param {?=} context
  112058. * @return {?}
  112059. */
  112060. StatementInterpreter.prototype.visitCommentStmt = /**
  112061. * @param {?} stmt
  112062. * @param {?=} context
  112063. * @return {?}
  112064. */
  112065. function (stmt, context) { return null; };
  112066. /**
  112067. * @param {?} ast
  112068. * @param {?} ctx
  112069. * @return {?}
  112070. */
  112071. StatementInterpreter.prototype.visitInstantiateExpr = /**
  112072. * @param {?} ast
  112073. * @param {?} ctx
  112074. * @return {?}
  112075. */
  112076. function (ast, ctx) {
  112077. var /** @type {?} */ args = this.visitAllExpressions(ast.args, ctx);
  112078. var /** @type {?} */ clazz = ast.classExpr.visitExpression(this, ctx);
  112079. return new (clazz.bind.apply(clazz, [void 0].concat(args)))();
  112080. };
  112081. /**
  112082. * @param {?} ast
  112083. * @param {?} ctx
  112084. * @return {?}
  112085. */
  112086. StatementInterpreter.prototype.visitLiteralExpr = /**
  112087. * @param {?} ast
  112088. * @param {?} ctx
  112089. * @return {?}
  112090. */
  112091. function (ast, ctx) { return ast.value; };
  112092. /**
  112093. * @param {?} ast
  112094. * @param {?} ctx
  112095. * @return {?}
  112096. */
  112097. StatementInterpreter.prototype.visitExternalExpr = /**
  112098. * @param {?} ast
  112099. * @param {?} ctx
  112100. * @return {?}
  112101. */
  112102. function (ast, ctx) {
  112103. return this.reflector.resolveExternalReference(ast.value);
  112104. };
  112105. /**
  112106. * @param {?} ast
  112107. * @param {?} ctx
  112108. * @return {?}
  112109. */
  112110. StatementInterpreter.prototype.visitConditionalExpr = /**
  112111. * @param {?} ast
  112112. * @param {?} ctx
  112113. * @return {?}
  112114. */
  112115. function (ast, ctx) {
  112116. if (ast.condition.visitExpression(this, ctx)) {
  112117. return ast.trueCase.visitExpression(this, ctx);
  112118. }
  112119. else if (ast.falseCase != null) {
  112120. return ast.falseCase.visitExpression(this, ctx);
  112121. }
  112122. return null;
  112123. };
  112124. /**
  112125. * @param {?} ast
  112126. * @param {?} ctx
  112127. * @return {?}
  112128. */
  112129. StatementInterpreter.prototype.visitNotExpr = /**
  112130. * @param {?} ast
  112131. * @param {?} ctx
  112132. * @return {?}
  112133. */
  112134. function (ast, ctx) {
  112135. return !ast.condition.visitExpression(this, ctx);
  112136. };
  112137. /**
  112138. * @param {?} ast
  112139. * @param {?} ctx
  112140. * @return {?}
  112141. */
  112142. StatementInterpreter.prototype.visitAssertNotNullExpr = /**
  112143. * @param {?} ast
  112144. * @param {?} ctx
  112145. * @return {?}
  112146. */
  112147. function (ast, ctx) {
  112148. return ast.condition.visitExpression(this, ctx);
  112149. };
  112150. /**
  112151. * @param {?} ast
  112152. * @param {?} ctx
  112153. * @return {?}
  112154. */
  112155. StatementInterpreter.prototype.visitCastExpr = /**
  112156. * @param {?} ast
  112157. * @param {?} ctx
  112158. * @return {?}
  112159. */
  112160. function (ast, ctx) {
  112161. return ast.value.visitExpression(this, ctx);
  112162. };
  112163. /**
  112164. * @param {?} ast
  112165. * @param {?} ctx
  112166. * @return {?}
  112167. */
  112168. StatementInterpreter.prototype.visitFunctionExpr = /**
  112169. * @param {?} ast
  112170. * @param {?} ctx
  112171. * @return {?}
  112172. */
  112173. function (ast, ctx) {
  112174. var /** @type {?} */ paramNames = ast.params.map(function (param) { return param.name; });
  112175. return _declareFn(paramNames, ast.statements, ctx, this);
  112176. };
  112177. /**
  112178. * @param {?} stmt
  112179. * @param {?} ctx
  112180. * @return {?}
  112181. */
  112182. StatementInterpreter.prototype.visitDeclareFunctionStmt = /**
  112183. * @param {?} stmt
  112184. * @param {?} ctx
  112185. * @return {?}
  112186. */
  112187. function (stmt, ctx) {
  112188. var /** @type {?} */ paramNames = stmt.params.map(function (param) { return param.name; });
  112189. ctx.vars.set(stmt.name, _declareFn(paramNames, stmt.statements, ctx, this));
  112190. if (stmt.hasModifier(StmtModifier.Exported)) {
  112191. ctx.exports.push(stmt.name);
  112192. }
  112193. return null;
  112194. };
  112195. /**
  112196. * @param {?} ast
  112197. * @param {?} ctx
  112198. * @return {?}
  112199. */
  112200. StatementInterpreter.prototype.visitBinaryOperatorExpr = /**
  112201. * @param {?} ast
  112202. * @param {?} ctx
  112203. * @return {?}
  112204. */
  112205. function (ast, ctx) {
  112206. var _this = this;
  112207. var /** @type {?} */ lhs = function () { return ast.lhs.visitExpression(_this, ctx); };
  112208. var /** @type {?} */ rhs = function () { return ast.rhs.visitExpression(_this, ctx); };
  112209. switch (ast.operator) {
  112210. case BinaryOperator.Equals:
  112211. return lhs() == rhs();
  112212. case BinaryOperator.Identical:
  112213. return lhs() === rhs();
  112214. case BinaryOperator.NotEquals:
  112215. return lhs() != rhs();
  112216. case BinaryOperator.NotIdentical:
  112217. return lhs() !== rhs();
  112218. case BinaryOperator.And:
  112219. return lhs() && rhs();
  112220. case BinaryOperator.Or:
  112221. return lhs() || rhs();
  112222. case BinaryOperator.Plus:
  112223. return lhs() + rhs();
  112224. case BinaryOperator.Minus:
  112225. return lhs() - rhs();
  112226. case BinaryOperator.Divide:
  112227. return lhs() / rhs();
  112228. case BinaryOperator.Multiply:
  112229. return lhs() * rhs();
  112230. case BinaryOperator.Modulo:
  112231. return lhs() % rhs();
  112232. case BinaryOperator.Lower:
  112233. return lhs() < rhs();
  112234. case BinaryOperator.LowerEquals:
  112235. return lhs() <= rhs();
  112236. case BinaryOperator.Bigger:
  112237. return lhs() > rhs();
  112238. case BinaryOperator.BiggerEquals:
  112239. return lhs() >= rhs();
  112240. default:
  112241. throw new Error("Unknown operator " + ast.operator);
  112242. }
  112243. };
  112244. /**
  112245. * @param {?} ast
  112246. * @param {?} ctx
  112247. * @return {?}
  112248. */
  112249. StatementInterpreter.prototype.visitReadPropExpr = /**
  112250. * @param {?} ast
  112251. * @param {?} ctx
  112252. * @return {?}
  112253. */
  112254. function (ast, ctx) {
  112255. var /** @type {?} */ result;
  112256. var /** @type {?} */ receiver = ast.receiver.visitExpression(this, ctx);
  112257. result = receiver[ast.name];
  112258. return result;
  112259. };
  112260. /**
  112261. * @param {?} ast
  112262. * @param {?} ctx
  112263. * @return {?}
  112264. */
  112265. StatementInterpreter.prototype.visitReadKeyExpr = /**
  112266. * @param {?} ast
  112267. * @param {?} ctx
  112268. * @return {?}
  112269. */
  112270. function (ast, ctx) {
  112271. var /** @type {?} */ receiver = ast.receiver.visitExpression(this, ctx);
  112272. var /** @type {?} */ prop = ast.index.visitExpression(this, ctx);
  112273. return receiver[prop];
  112274. };
  112275. /**
  112276. * @param {?} ast
  112277. * @param {?} ctx
  112278. * @return {?}
  112279. */
  112280. StatementInterpreter.prototype.visitLiteralArrayExpr = /**
  112281. * @param {?} ast
  112282. * @param {?} ctx
  112283. * @return {?}
  112284. */
  112285. function (ast, ctx) {
  112286. return this.visitAllExpressions(ast.entries, ctx);
  112287. };
  112288. /**
  112289. * @param {?} ast
  112290. * @param {?} ctx
  112291. * @return {?}
  112292. */
  112293. StatementInterpreter.prototype.visitLiteralMapExpr = /**
  112294. * @param {?} ast
  112295. * @param {?} ctx
  112296. * @return {?}
  112297. */
  112298. function (ast, ctx) {
  112299. var _this = this;
  112300. var /** @type {?} */ result = {};
  112301. ast.entries.forEach(function (entry) { return result[entry.key] = entry.value.visitExpression(_this, ctx); });
  112302. return result;
  112303. };
  112304. /**
  112305. * @param {?} ast
  112306. * @param {?} context
  112307. * @return {?}
  112308. */
  112309. StatementInterpreter.prototype.visitCommaExpr = /**
  112310. * @param {?} ast
  112311. * @param {?} context
  112312. * @return {?}
  112313. */
  112314. function (ast, context) {
  112315. var /** @type {?} */ values = this.visitAllExpressions(ast.parts, context);
  112316. return values[values.length - 1];
  112317. };
  112318. /**
  112319. * @param {?} expressions
  112320. * @param {?} ctx
  112321. * @return {?}
  112322. */
  112323. StatementInterpreter.prototype.visitAllExpressions = /**
  112324. * @param {?} expressions
  112325. * @param {?} ctx
  112326. * @return {?}
  112327. */
  112328. function (expressions, ctx) {
  112329. var _this = this;
  112330. return expressions.map(function (expr) { return expr.visitExpression(_this, ctx); });
  112331. };
  112332. /**
  112333. * @param {?} statements
  112334. * @param {?} ctx
  112335. * @return {?}
  112336. */
  112337. StatementInterpreter.prototype.visitAllStatements = /**
  112338. * @param {?} statements
  112339. * @param {?} ctx
  112340. * @return {?}
  112341. */
  112342. function (statements, ctx) {
  112343. for (var /** @type {?} */ i = 0; i < statements.length; i++) {
  112344. var /** @type {?} */ stmt = statements[i];
  112345. var /** @type {?} */ val = stmt.visitStatement(this, ctx);
  112346. if (val instanceof ReturnValue) {
  112347. return val;
  112348. }
  112349. }
  112350. return null;
  112351. };
  112352. return StatementInterpreter;
  112353. }());
  112354. /**
  112355. * @param {?} varNames
  112356. * @param {?} statements
  112357. * @param {?} ctx
  112358. * @param {?} visitor
  112359. * @return {?}
  112360. */
  112361. function _declareFn(varNames, statements, ctx, visitor) {
  112362. return function () {
  112363. var args = [];
  112364. for (var _i = 0; _i < arguments.length; _i++) {
  112365. args[_i] = arguments[_i];
  112366. }
  112367. return _executeFunctionStatements(varNames, args, statements, ctx, visitor);
  112368. };
  112369. }
  112370. var CATCH_ERROR_VAR$2 = 'error';
  112371. var CATCH_STACK_VAR$2 = 'stack';
  112372. /**
  112373. * @fileoverview added by tsickle
  112374. * @suppress {checkTypes} checked by tsc
  112375. */
  112376. /**
  112377. * @license
  112378. * Copyright Google Inc. All Rights Reserved.
  112379. *
  112380. * Use of this source code is governed by an MIT-style license that can be
  112381. * found in the LICENSE file at https://angular.io/license
  112382. */
  112383. /**
  112384. * @abstract
  112385. */
  112386. var AbstractJsEmitterVisitor = /** @class */ (function (_super) {
  112387. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(AbstractJsEmitterVisitor, _super);
  112388. function AbstractJsEmitterVisitor() {
  112389. return _super.call(this, false) || this;
  112390. }
  112391. /**
  112392. * @param {?} stmt
  112393. * @param {?} ctx
  112394. * @return {?}
  112395. */
  112396. AbstractJsEmitterVisitor.prototype.visitDeclareClassStmt = /**
  112397. * @param {?} stmt
  112398. * @param {?} ctx
  112399. * @return {?}
  112400. */
  112401. function (stmt, ctx) {
  112402. var _this = this;
  112403. ctx.pushClass(stmt);
  112404. this._visitClassConstructor(stmt, ctx);
  112405. if (stmt.parent != null) {
  112406. ctx.print(stmt, stmt.name + ".prototype = Object.create(");
  112407. stmt.parent.visitExpression(this, ctx);
  112408. ctx.println(stmt, ".prototype);");
  112409. }
  112410. stmt.getters.forEach(function (getter) { return _this._visitClassGetter(stmt, getter, ctx); });
  112411. stmt.methods.forEach(function (method) { return _this._visitClassMethod(stmt, method, ctx); });
  112412. ctx.popClass();
  112413. return null;
  112414. };
  112415. /**
  112416. * @param {?} stmt
  112417. * @param {?} ctx
  112418. * @return {?}
  112419. */
  112420. AbstractJsEmitterVisitor.prototype._visitClassConstructor = /**
  112421. * @param {?} stmt
  112422. * @param {?} ctx
  112423. * @return {?}
  112424. */
  112425. function (stmt, ctx) {
  112426. ctx.print(stmt, "function " + stmt.name + "(");
  112427. if (stmt.constructorMethod != null) {
  112428. this._visitParams(stmt.constructorMethod.params, ctx);
  112429. }
  112430. ctx.println(stmt, ") {");
  112431. ctx.incIndent();
  112432. if (stmt.constructorMethod != null) {
  112433. if (stmt.constructorMethod.body.length > 0) {
  112434. ctx.println(stmt, "var self = this;");
  112435. this.visitAllStatements(stmt.constructorMethod.body, ctx);
  112436. }
  112437. }
  112438. ctx.decIndent();
  112439. ctx.println(stmt, "}");
  112440. };
  112441. /**
  112442. * @param {?} stmt
  112443. * @param {?} getter
  112444. * @param {?} ctx
  112445. * @return {?}
  112446. */
  112447. AbstractJsEmitterVisitor.prototype._visitClassGetter = /**
  112448. * @param {?} stmt
  112449. * @param {?} getter
  112450. * @param {?} ctx
  112451. * @return {?}
  112452. */
  112453. function (stmt, getter, ctx) {
  112454. ctx.println(stmt, "Object.defineProperty(" + stmt.name + ".prototype, '" + getter.name + "', { get: function() {");
  112455. ctx.incIndent();
  112456. if (getter.body.length > 0) {
  112457. ctx.println(stmt, "var self = this;");
  112458. this.visitAllStatements(getter.body, ctx);
  112459. }
  112460. ctx.decIndent();
  112461. ctx.println(stmt, "}});");
  112462. };
  112463. /**
  112464. * @param {?} stmt
  112465. * @param {?} method
  112466. * @param {?} ctx
  112467. * @return {?}
  112468. */
  112469. AbstractJsEmitterVisitor.prototype._visitClassMethod = /**
  112470. * @param {?} stmt
  112471. * @param {?} method
  112472. * @param {?} ctx
  112473. * @return {?}
  112474. */
  112475. function (stmt, method, ctx) {
  112476. ctx.print(stmt, stmt.name + ".prototype." + method.name + " = function(");
  112477. this._visitParams(method.params, ctx);
  112478. ctx.println(stmt, ") {");
  112479. ctx.incIndent();
  112480. if (method.body.length > 0) {
  112481. ctx.println(stmt, "var self = this;");
  112482. this.visitAllStatements(method.body, ctx);
  112483. }
  112484. ctx.decIndent();
  112485. ctx.println(stmt, "};");
  112486. };
  112487. /**
  112488. * @param {?} ast
  112489. * @param {?} ctx
  112490. * @return {?}
  112491. */
  112492. AbstractJsEmitterVisitor.prototype.visitReadVarExpr = /**
  112493. * @param {?} ast
  112494. * @param {?} ctx
  112495. * @return {?}
  112496. */
  112497. function (ast, ctx) {
  112498. if (ast.builtin === BuiltinVar.This) {
  112499. ctx.print(ast, 'self');
  112500. }
  112501. else if (ast.builtin === BuiltinVar.Super) {
  112502. throw new Error("'super' needs to be handled at a parent ast node, not at the variable level!");
  112503. }
  112504. else {
  112505. _super.prototype.visitReadVarExpr.call(this, ast, ctx);
  112506. }
  112507. return null;
  112508. };
  112509. /**
  112510. * @param {?} stmt
  112511. * @param {?} ctx
  112512. * @return {?}
  112513. */
  112514. AbstractJsEmitterVisitor.prototype.visitDeclareVarStmt = /**
  112515. * @param {?} stmt
  112516. * @param {?} ctx
  112517. * @return {?}
  112518. */
  112519. function (stmt, ctx) {
  112520. ctx.print(stmt, "var " + stmt.name + " = ");
  112521. stmt.value.visitExpression(this, ctx);
  112522. ctx.println(stmt, ";");
  112523. return null;
  112524. };
  112525. /**
  112526. * @param {?} ast
  112527. * @param {?} ctx
  112528. * @return {?}
  112529. */
  112530. AbstractJsEmitterVisitor.prototype.visitCastExpr = /**
  112531. * @param {?} ast
  112532. * @param {?} ctx
  112533. * @return {?}
  112534. */
  112535. function (ast, ctx) {
  112536. ast.value.visitExpression(this, ctx);
  112537. return null;
  112538. };
  112539. /**
  112540. * @param {?} expr
  112541. * @param {?} ctx
  112542. * @return {?}
  112543. */
  112544. AbstractJsEmitterVisitor.prototype.visitInvokeFunctionExpr = /**
  112545. * @param {?} expr
  112546. * @param {?} ctx
  112547. * @return {?}
  112548. */
  112549. function (expr, ctx) {
  112550. var /** @type {?} */ fnExpr = expr.fn;
  112551. if (fnExpr instanceof ReadVarExpr && fnExpr.builtin === BuiltinVar.Super) {
  112552. /** @type {?} */ ((/** @type {?} */ ((ctx.currentClass)).parent)).visitExpression(this, ctx);
  112553. ctx.print(expr, ".call(this");
  112554. if (expr.args.length > 0) {
  112555. ctx.print(expr, ", ");
  112556. this.visitAllExpressions(expr.args, ctx, ',');
  112557. }
  112558. ctx.print(expr, ")");
  112559. }
  112560. else {
  112561. _super.prototype.visitInvokeFunctionExpr.call(this, expr, ctx);
  112562. }
  112563. return null;
  112564. };
  112565. /**
  112566. * @param {?} ast
  112567. * @param {?} ctx
  112568. * @return {?}
  112569. */
  112570. AbstractJsEmitterVisitor.prototype.visitFunctionExpr = /**
  112571. * @param {?} ast
  112572. * @param {?} ctx
  112573. * @return {?}
  112574. */
  112575. function (ast, ctx) {
  112576. ctx.print(ast, "function(");
  112577. this._visitParams(ast.params, ctx);
  112578. ctx.println(ast, ") {");
  112579. ctx.incIndent();
  112580. this.visitAllStatements(ast.statements, ctx);
  112581. ctx.decIndent();
  112582. ctx.print(ast, "}");
  112583. return null;
  112584. };
  112585. /**
  112586. * @param {?} stmt
  112587. * @param {?} ctx
  112588. * @return {?}
  112589. */
  112590. AbstractJsEmitterVisitor.prototype.visitDeclareFunctionStmt = /**
  112591. * @param {?} stmt
  112592. * @param {?} ctx
  112593. * @return {?}
  112594. */
  112595. function (stmt, ctx) {
  112596. ctx.print(stmt, "function " + stmt.name + "(");
  112597. this._visitParams(stmt.params, ctx);
  112598. ctx.println(stmt, ") {");
  112599. ctx.incIndent();
  112600. this.visitAllStatements(stmt.statements, ctx);
  112601. ctx.decIndent();
  112602. ctx.println(stmt, "}");
  112603. return null;
  112604. };
  112605. /**
  112606. * @param {?} stmt
  112607. * @param {?} ctx
  112608. * @return {?}
  112609. */
  112610. AbstractJsEmitterVisitor.prototype.visitTryCatchStmt = /**
  112611. * @param {?} stmt
  112612. * @param {?} ctx
  112613. * @return {?}
  112614. */
  112615. function (stmt, ctx) {
  112616. ctx.println(stmt, "try {");
  112617. ctx.incIndent();
  112618. this.visitAllStatements(stmt.bodyStmts, ctx);
  112619. ctx.decIndent();
  112620. ctx.println(stmt, "} catch (" + CATCH_ERROR_VAR$1.name + ") {");
  112621. ctx.incIndent();
  112622. var /** @type {?} */ catchStmts = [/** @type {?} */ (CATCH_STACK_VAR$1.set(CATCH_ERROR_VAR$1.prop('stack')).toDeclStmt(null, [
  112623. StmtModifier.Final
  112624. ]))].concat(stmt.catchStmts);
  112625. this.visitAllStatements(catchStmts, ctx);
  112626. ctx.decIndent();
  112627. ctx.println(stmt, "}");
  112628. return null;
  112629. };
  112630. /**
  112631. * @param {?} params
  112632. * @param {?} ctx
  112633. * @return {?}
  112634. */
  112635. AbstractJsEmitterVisitor.prototype._visitParams = /**
  112636. * @param {?} params
  112637. * @param {?} ctx
  112638. * @return {?}
  112639. */
  112640. function (params, ctx) {
  112641. this.visitAllObjects(function (param) { return ctx.print(null, param.name); }, params, ctx, ',');
  112642. };
  112643. /**
  112644. * @param {?} method
  112645. * @return {?}
  112646. */
  112647. AbstractJsEmitterVisitor.prototype.getBuiltinMethodName = /**
  112648. * @param {?} method
  112649. * @return {?}
  112650. */
  112651. function (method) {
  112652. var /** @type {?} */ name;
  112653. switch (method) {
  112654. case BuiltinMethod.ConcatArray:
  112655. name = 'concat';
  112656. break;
  112657. case BuiltinMethod.SubscribeObservable:
  112658. name = 'subscribe';
  112659. break;
  112660. case BuiltinMethod.Bind:
  112661. name = 'bind';
  112662. break;
  112663. default:
  112664. throw new Error("Unknown builtin method: " + method);
  112665. }
  112666. return name;
  112667. };
  112668. return AbstractJsEmitterVisitor;
  112669. }(AbstractEmitterVisitor));
  112670. /**
  112671. * @fileoverview added by tsickle
  112672. * @suppress {checkTypes} checked by tsc
  112673. */
  112674. /**
  112675. * @license
  112676. * Copyright Google Inc. All Rights Reserved.
  112677. *
  112678. * Use of this source code is governed by an MIT-style license that can be
  112679. * found in the LICENSE file at https://angular.io/license
  112680. */
  112681. /**
  112682. * @param {?} sourceUrl
  112683. * @param {?} ctx
  112684. * @param {?} vars
  112685. * @param {?} createSourceMap
  112686. * @return {?}
  112687. */
  112688. function evalExpression(sourceUrl, ctx, vars, createSourceMap) {
  112689. var /** @type {?} */ fnBody = ctx.toSource() + "\n//# sourceURL=" + sourceUrl;
  112690. var /** @type {?} */ fnArgNames = [];
  112691. var /** @type {?} */ fnArgValues = [];
  112692. for (var /** @type {?} */ argName in vars) {
  112693. fnArgNames.push(argName);
  112694. fnArgValues.push(vars[argName]);
  112695. }
  112696. if (createSourceMap) {
  112697. // using `new Function(...)` generates a header, 1 line of no arguments, 2 lines otherwise
  112698. // E.g. ```
  112699. // function anonymous(a,b,c
  112700. // /**/) { ... }```
  112701. // We don't want to hard code this fact, so we auto detect it via an empty function first.
  112702. var /** @type {?} */ emptyFn = new (Function.bind.apply(Function, [void 0].concat(fnArgNames.concat('return null;'))))().toString();
  112703. var /** @type {?} */ headerLines = emptyFn.slice(0, emptyFn.indexOf('return null;')).split('\n').length - 1;
  112704. fnBody += "\n" + ctx.toSourceMapGenerator(sourceUrl, headerLines).toJsComment();
  112705. }
  112706. return new (Function.bind.apply(Function, [void 0].concat(fnArgNames.concat(fnBody))))().apply(void 0, fnArgValues);
  112707. }
  112708. /**
  112709. * @param {?} sourceUrl
  112710. * @param {?} statements
  112711. * @param {?} reflector
  112712. * @param {?} createSourceMaps
  112713. * @return {?}
  112714. */
  112715. function jitStatements(sourceUrl, statements, reflector, createSourceMaps) {
  112716. var /** @type {?} */ converter = new JitEmitterVisitor(reflector);
  112717. var /** @type {?} */ ctx = EmitterVisitorContext.createRoot();
  112718. converter.visitAllStatements(statements, ctx);
  112719. converter.createReturnStmt(ctx);
  112720. return evalExpression(sourceUrl, ctx, converter.getArgs(), createSourceMaps);
  112721. }
  112722. var JitEmitterVisitor = /** @class */ (function (_super) {
  112723. Object(__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */])(JitEmitterVisitor, _super);
  112724. function JitEmitterVisitor(reflector) {
  112725. var _this = _super.call(this) || this;
  112726. _this.reflector = reflector;
  112727. _this._evalArgNames = [];
  112728. _this._evalArgValues = [];
  112729. _this._evalExportedVars = [];
  112730. return _this;
  112731. }
  112732. /**
  112733. * @param {?} ctx
  112734. * @return {?}
  112735. */
  112736. JitEmitterVisitor.prototype.createReturnStmt = /**
  112737. * @param {?} ctx
  112738. * @return {?}
  112739. */
  112740. function (ctx) {
  112741. var /** @type {?} */ stmt = new ReturnStatement(new LiteralMapExpr(this._evalExportedVars.map(function (resultVar) { return new LiteralMapEntry(resultVar, variable(resultVar), false); })));
  112742. stmt.visitStatement(this, ctx);
  112743. };
  112744. /**
  112745. * @return {?}
  112746. */
  112747. JitEmitterVisitor.prototype.getArgs = /**
  112748. * @return {?}
  112749. */
  112750. function () {
  112751. var /** @type {?} */ result = {};
  112752. for (var /** @type {?} */ i = 0; i < this._evalArgNames.length; i++) {
  112753. result[this._evalArgNames[i]] = this._evalArgValues[i];
  112754. }
  112755. return result;
  112756. };
  112757. /**
  112758. * @param {?} ast
  112759. * @param {?} ctx
  112760. * @return {?}
  112761. */
  112762. JitEmitterVisitor.prototype.visitExternalExpr = /**
  112763. * @param {?} ast
  112764. * @param {?} ctx
  112765. * @return {?}
  112766. */
  112767. function (ast, ctx) {
  112768. var /** @type {?} */ value = this.reflector.resolveExternalReference(ast.value);
  112769. var /** @type {?} */ id = this._evalArgValues.indexOf(value);
  112770. if (id === -1) {
  112771. id = this._evalArgValues.length;
  112772. this._evalArgValues.push(value);
  112773. var /** @type {?} */ name_1 = identifierName({ reference: value }) || 'val';
  112774. this._evalArgNames.push("jit_" + name_1 + "_" + id);
  112775. }
  112776. ctx.print(ast, this._evalArgNames[id]);
  112777. return null;
  112778. };
  112779. /**
  112780. * @param {?} stmt
  112781. * @param {?} ctx
  112782. * @return {?}
  112783. */
  112784. JitEmitterVisitor.prototype.visitDeclareVarStmt = /**
  112785. * @param {?} stmt
  112786. * @param {?} ctx
  112787. * @return {?}
  112788. */
  112789. function (stmt, ctx) {
  112790. if (stmt.hasModifier(StmtModifier.Exported)) {
  112791. this._evalExportedVars.push(stmt.name);
  112792. }
  112793. return _super.prototype.visitDeclareVarStmt.call(this, stmt, ctx);
  112794. };
  112795. /**
  112796. * @param {?} stmt
  112797. * @param {?} ctx
  112798. * @return {?}
  112799. */
  112800. JitEmitterVisitor.prototype.visitDeclareFunctionStmt = /**
  112801. * @param {?} stmt
  112802. * @param {?} ctx
  112803. * @return {?}
  112804. */
  112805. function (stmt, ctx) {
  112806. if (stmt.hasModifier(StmtModifier.Exported)) {
  112807. this._evalExportedVars.push(stmt.name);
  112808. }
  112809. return _super.prototype.visitDeclareFunctionStmt.call(this, stmt, ctx);
  112810. };
  112811. /**
  112812. * @param {?} stmt
  112813. * @param {?} ctx
  112814. * @return {?}
  112815. */
  112816. JitEmitterVisitor.prototype.visitDeclareClassStmt = /**
  112817. * @param {?} stmt
  112818. * @param {?} ctx
  112819. * @return {?}
  112820. */
  112821. function (stmt, ctx) {
  112822. if (stmt.hasModifier(StmtModifier.Exported)) {
  112823. this._evalExportedVars.push(stmt.name);
  112824. }
  112825. return _super.prototype.visitDeclareClassStmt.call(this, stmt, ctx);
  112826. };
  112827. return JitEmitterVisitor;
  112828. }(AbstractJsEmitterVisitor));
  112829. /**
  112830. * @fileoverview added by tsickle
  112831. * @suppress {checkTypes} checked by tsc
  112832. */
  112833. /**
  112834. * @license
  112835. * Copyright Google Inc. All Rights Reserved.
  112836. *
  112837. * Use of this source code is governed by an MIT-style license that can be
  112838. * found in the LICENSE file at https://angular.io/license
  112839. */
  112840. /**
  112841. * @record
  112842. */
  112843. /**
  112844. * An internal module of the Angular compiler that begins with component types,
  112845. * extracts templates, and eventually produces a compiled version of the component
  112846. * ready for linking into an application.
  112847. *
  112848. * \@security When compiling templates at runtime, you must ensure that the entire template comes
  112849. * from a trusted source. Attacker-controlled data introduced by a template could expose your
  112850. * application to XSS risks. For more detail, see the [Security Guide](http://g.co/ng/security).
  112851. */
  112852. var JitCompiler = /** @class */ (function () {
  112853. function JitCompiler(_metadataResolver, _templateParser, _styleCompiler, _viewCompiler, _ngModuleCompiler, _summaryResolver, _reflector, _compilerConfig, _console, getExtraNgModuleProviders) {
  112854. this._metadataResolver = _metadataResolver;
  112855. this._templateParser = _templateParser;
  112856. this._styleCompiler = _styleCompiler;
  112857. this._viewCompiler = _viewCompiler;
  112858. this._ngModuleCompiler = _ngModuleCompiler;
  112859. this._summaryResolver = _summaryResolver;
  112860. this._reflector = _reflector;
  112861. this._compilerConfig = _compilerConfig;
  112862. this._console = _console;
  112863. this.getExtraNgModuleProviders = getExtraNgModuleProviders;
  112864. this._compiledTemplateCache = new Map();
  112865. this._compiledHostTemplateCache = new Map();
  112866. this._compiledDirectiveWrapperCache = new Map();
  112867. this._compiledNgModuleCache = new Map();
  112868. this._sharedStylesheetCount = 0;
  112869. this._addedAotSummaries = new Set();
  112870. }
  112871. /**
  112872. * @param {?} moduleType
  112873. * @return {?}
  112874. */
  112875. JitCompiler.prototype.compileModuleSync = /**
  112876. * @param {?} moduleType
  112877. * @return {?}
  112878. */
  112879. function (moduleType) {
  112880. return SyncAsync.assertSync(this._compileModuleAndComponents(moduleType, true));
  112881. };
  112882. /**
  112883. * @param {?} moduleType
  112884. * @return {?}
  112885. */
  112886. JitCompiler.prototype.compileModuleAsync = /**
  112887. * @param {?} moduleType
  112888. * @return {?}
  112889. */
  112890. function (moduleType) {
  112891. return Promise.resolve(this._compileModuleAndComponents(moduleType, false));
  112892. };
  112893. /**
  112894. * @param {?} moduleType
  112895. * @return {?}
  112896. */
  112897. JitCompiler.prototype.compileModuleAndAllComponentsSync = /**
  112898. * @param {?} moduleType
  112899. * @return {?}
  112900. */
  112901. function (moduleType) {
  112902. return SyncAsync.assertSync(this._compileModuleAndAllComponents(moduleType, true));
  112903. };
  112904. /**
  112905. * @param {?} moduleType
  112906. * @return {?}
  112907. */
  112908. JitCompiler.prototype.compileModuleAndAllComponentsAsync = /**
  112909. * @param {?} moduleType
  112910. * @return {?}
  112911. */
  112912. function (moduleType) {
  112913. return Promise.resolve(this._compileModuleAndAllComponents(moduleType, false));
  112914. };
  112915. /**
  112916. * @param {?} component
  112917. * @return {?}
  112918. */
  112919. JitCompiler.prototype.getComponentFactory = /**
  112920. * @param {?} component
  112921. * @return {?}
  112922. */
  112923. function (component) {
  112924. var /** @type {?} */ summary = this._metadataResolver.getDirectiveSummary(component);
  112925. return /** @type {?} */ (summary.componentFactory);
  112926. };
  112927. /**
  112928. * @param {?} summaries
  112929. * @return {?}
  112930. */
  112931. JitCompiler.prototype.loadAotSummaries = /**
  112932. * @param {?} summaries
  112933. * @return {?}
  112934. */
  112935. function (summaries) {
  112936. this.clearCache();
  112937. this._addAotSummaries(summaries);
  112938. };
  112939. /**
  112940. * @param {?} fn
  112941. * @return {?}
  112942. */
  112943. JitCompiler.prototype._addAotSummaries = /**
  112944. * @param {?} fn
  112945. * @return {?}
  112946. */
  112947. function (fn$$1) {
  112948. if (this._addedAotSummaries.has(fn$$1)) {
  112949. return;
  112950. }
  112951. this._addedAotSummaries.add(fn$$1);
  112952. var /** @type {?} */ summaries = fn$$1();
  112953. for (var /** @type {?} */ i = 0; i < summaries.length; i++) {
  112954. var /** @type {?} */ entry = summaries[i];
  112955. if (typeof entry === 'function') {
  112956. this._addAotSummaries(entry);
  112957. }
  112958. else {
  112959. var /** @type {?} */ summary = /** @type {?} */ (entry);
  112960. this._summaryResolver.addSummary({ symbol: summary.type.reference, metadata: null, type: summary });
  112961. }
  112962. }
  112963. };
  112964. /**
  112965. * @param {?} ref
  112966. * @return {?}
  112967. */
  112968. JitCompiler.prototype.hasAotSummary = /**
  112969. * @param {?} ref
  112970. * @return {?}
  112971. */
  112972. function (ref) { return !!this._summaryResolver.resolveSummary(ref); };
  112973. /**
  112974. * @param {?} ids
  112975. * @return {?}
  112976. */
  112977. JitCompiler.prototype._filterJitIdentifiers = /**
  112978. * @param {?} ids
  112979. * @return {?}
  112980. */
  112981. function (ids) {
  112982. var _this = this;
  112983. return ids.map(function (mod) { return mod.reference; }).filter(function (ref) { return !_this.hasAotSummary(ref); });
  112984. };
  112985. /**
  112986. * @param {?} moduleType
  112987. * @param {?} isSync
  112988. * @return {?}
  112989. */
  112990. JitCompiler.prototype._compileModuleAndComponents = /**
  112991. * @param {?} moduleType
  112992. * @param {?} isSync
  112993. * @return {?}
  112994. */
  112995. function (moduleType, isSync) {
  112996. var _this = this;
  112997. return SyncAsync.then(this._loadModules(moduleType, isSync), function () {
  112998. _this._compileComponents(moduleType, null);
  112999. return _this._compileModule(moduleType);
  113000. });
  113001. };
  113002. /**
  113003. * @param {?} moduleType
  113004. * @param {?} isSync
  113005. * @return {?}
  113006. */
  113007. JitCompiler.prototype._compileModuleAndAllComponents = /**
  113008. * @param {?} moduleType
  113009. * @param {?} isSync
  113010. * @return {?}
  113011. */
  113012. function (moduleType, isSync) {
  113013. var _this = this;
  113014. return SyncAsync.then(this._loadModules(moduleType, isSync), function () {
  113015. var /** @type {?} */ componentFactories = [];
  113016. _this._compileComponents(moduleType, componentFactories);
  113017. return {
  113018. ngModuleFactory: _this._compileModule(moduleType),
  113019. componentFactories: componentFactories
  113020. };
  113021. });
  113022. };
  113023. /**
  113024. * @param {?} mainModule
  113025. * @param {?} isSync
  113026. * @return {?}
  113027. */
  113028. JitCompiler.prototype._loadModules = /**
  113029. * @param {?} mainModule
  113030. * @param {?} isSync
  113031. * @return {?}
  113032. */
  113033. function (mainModule, isSync) {
  113034. var _this = this;
  113035. var /** @type {?} */ loading = [];
  113036. var /** @type {?} */ mainNgModule = /** @type {?} */ ((this._metadataResolver.getNgModuleMetadata(mainModule)));
  113037. // Note: for runtime compilation, we want to transitively compile all modules,
  113038. // so we also need to load the declared directives / pipes for all nested modules.
  113039. this._filterJitIdentifiers(mainNgModule.transitiveModule.modules).forEach(function (nestedNgModule) {
  113040. // getNgModuleMetadata only returns null if the value passed in is not an NgModule
  113041. var /** @type {?} */ moduleMeta = /** @type {?} */ ((_this._metadataResolver.getNgModuleMetadata(nestedNgModule)));
  113042. _this._filterJitIdentifiers(moduleMeta.declaredDirectives).forEach(function (ref) {
  113043. var /** @type {?} */ promise = _this._metadataResolver.loadDirectiveMetadata(moduleMeta.type.reference, ref, isSync);
  113044. if (promise) {
  113045. loading.push(promise);
  113046. }
  113047. });
  113048. _this._filterJitIdentifiers(moduleMeta.declaredPipes)
  113049. .forEach(function (ref) { return _this._metadataResolver.getOrLoadPipeMetadata(ref); });
  113050. });
  113051. return SyncAsync.all(loading);
  113052. };
  113053. /**
  113054. * @param {?} moduleType
  113055. * @return {?}
  113056. */
  113057. JitCompiler.prototype._compileModule = /**
  113058. * @param {?} moduleType
  113059. * @return {?}
  113060. */
  113061. function (moduleType) {
  113062. var /** @type {?} */ ngModuleFactory = /** @type {?} */ ((this._compiledNgModuleCache.get(moduleType)));
  113063. if (!ngModuleFactory) {
  113064. var /** @type {?} */ moduleMeta = /** @type {?} */ ((this._metadataResolver.getNgModuleMetadata(moduleType)));
  113065. // Always provide a bound Compiler
  113066. var /** @type {?} */ extraProviders = this.getExtraNgModuleProviders(moduleMeta.type.reference);
  113067. var /** @type {?} */ outputCtx = createOutputContext();
  113068. var /** @type {?} */ compileResult = this._ngModuleCompiler.compile(outputCtx, moduleMeta, extraProviders);
  113069. ngModuleFactory = this._interpretOrJit(ngModuleJitUrl(moduleMeta), outputCtx.statements)[compileResult.ngModuleFactoryVar];
  113070. this._compiledNgModuleCache.set(moduleMeta.type.reference, ngModuleFactory);
  113071. }
  113072. return ngModuleFactory;
  113073. };
  113074. /**
  113075. * @internal
  113076. */
  113077. /**
  113078. * \@internal
  113079. * @param {?} mainModule
  113080. * @param {?} allComponentFactories
  113081. * @return {?}
  113082. */
  113083. JitCompiler.prototype._compileComponents = /**
  113084. * \@internal
  113085. * @param {?} mainModule
  113086. * @param {?} allComponentFactories
  113087. * @return {?}
  113088. */
  113089. function (mainModule, allComponentFactories) {
  113090. var _this = this;
  113091. var /** @type {?} */ ngModule = /** @type {?} */ ((this._metadataResolver.getNgModuleMetadata(mainModule)));
  113092. var /** @type {?} */ moduleByJitDirective = new Map();
  113093. var /** @type {?} */ templates = new Set();
  113094. var /** @type {?} */ transJitModules = this._filterJitIdentifiers(ngModule.transitiveModule.modules);
  113095. transJitModules.forEach(function (localMod) {
  113096. var /** @type {?} */ localModuleMeta = /** @type {?} */ ((_this._metadataResolver.getNgModuleMetadata(localMod)));
  113097. _this._filterJitIdentifiers(localModuleMeta.declaredDirectives).forEach(function (dirRef) {
  113098. moduleByJitDirective.set(dirRef, localModuleMeta);
  113099. var /** @type {?} */ dirMeta = _this._metadataResolver.getDirectiveMetadata(dirRef);
  113100. if (dirMeta.isComponent) {
  113101. templates.add(_this._createCompiledTemplate(dirMeta, localModuleMeta));
  113102. if (allComponentFactories) {
  113103. var /** @type {?} */ template = _this._createCompiledHostTemplate(dirMeta.type.reference, localModuleMeta);
  113104. templates.add(template);
  113105. allComponentFactories.push(/** @type {?} */ (dirMeta.componentFactory));
  113106. }
  113107. }
  113108. });
  113109. });
  113110. transJitModules.forEach(function (localMod) {
  113111. var /** @type {?} */ localModuleMeta = /** @type {?} */ ((_this._metadataResolver.getNgModuleMetadata(localMod)));
  113112. _this._filterJitIdentifiers(localModuleMeta.declaredDirectives).forEach(function (dirRef) {
  113113. var /** @type {?} */ dirMeta = _this._metadataResolver.getDirectiveMetadata(dirRef);
  113114. if (dirMeta.isComponent) {
  113115. dirMeta.entryComponents.forEach(function (entryComponentType) {
  113116. var /** @type {?} */ moduleMeta = /** @type {?} */ ((moduleByJitDirective.get(entryComponentType.componentType)));
  113117. templates.add(_this._createCompiledHostTemplate(entryComponentType.componentType, moduleMeta));
  113118. });
  113119. }
  113120. });
  113121. localModuleMeta.entryComponents.forEach(function (entryComponentType) {
  113122. if (!_this.hasAotSummary(entryComponentType.componentType.reference)) {
  113123. var /** @type {?} */ moduleMeta = /** @type {?} */ ((moduleByJitDirective.get(entryComponentType.componentType)));
  113124. templates.add(_this._createCompiledHostTemplate(entryComponentType.componentType, moduleMeta));
  113125. }
  113126. });
  113127. });
  113128. templates.forEach(function (template) { return _this._compileTemplate(template); });
  113129. };
  113130. /**
  113131. * @param {?} type
  113132. * @return {?}
  113133. */
  113134. JitCompiler.prototype.clearCacheFor = /**
  113135. * @param {?} type
  113136. * @return {?}
  113137. */
  113138. function (type) {
  113139. this._compiledNgModuleCache.delete(type);
  113140. this._metadataResolver.clearCacheFor(type);
  113141. this._compiledHostTemplateCache.delete(type);
  113142. var /** @type {?} */ compiledTemplate = this._compiledTemplateCache.get(type);
  113143. if (compiledTemplate) {
  113144. this._compiledTemplateCache.delete(type);
  113145. }
  113146. };
  113147. /**
  113148. * @return {?}
  113149. */
  113150. JitCompiler.prototype.clearCache = /**
  113151. * @return {?}
  113152. */
  113153. function () {
  113154. // Note: don't clear the _addedAotSummaries, as they don't change!
  113155. this._metadataResolver.clearCache();
  113156. this._compiledTemplateCache.clear();
  113157. this._compiledHostTemplateCache.clear();
  113158. this._compiledNgModuleCache.clear();
  113159. };
  113160. /**
  113161. * @param {?} compType
  113162. * @param {?} ngModule
  113163. * @return {?}
  113164. */
  113165. JitCompiler.prototype._createCompiledHostTemplate = /**
  113166. * @param {?} compType
  113167. * @param {?} ngModule
  113168. * @return {?}
  113169. */
  113170. function (compType, ngModule) {
  113171. if (!ngModule) {
  113172. throw new Error("Component " + stringify(compType) + " is not part of any NgModule or the module has not been imported into your module.");
  113173. }
  113174. var /** @type {?} */ compiledTemplate = this._compiledHostTemplateCache.get(compType);
  113175. if (!compiledTemplate) {
  113176. var /** @type {?} */ compMeta = this._metadataResolver.getDirectiveMetadata(compType);
  113177. assertComponent(compMeta);
  113178. var /** @type {?} */ hostMeta = this._metadataResolver.getHostComponentMetadata(compMeta, (/** @type {?} */ (compMeta.componentFactory)).viewDefFactory);
  113179. compiledTemplate =
  113180. new CompiledTemplate(true, compMeta.type, hostMeta, ngModule, [compMeta.type]);
  113181. this._compiledHostTemplateCache.set(compType, compiledTemplate);
  113182. }
  113183. return compiledTemplate;
  113184. };
  113185. /**
  113186. * @param {?} compMeta
  113187. * @param {?} ngModule
  113188. * @return {?}
  113189. */
  113190. JitCompiler.prototype._createCompiledTemplate = /**
  113191. * @param {?} compMeta
  113192. * @param {?} ngModule
  113193. * @return {?}
  113194. */
  113195. function (compMeta, ngModule) {
  113196. var /** @type {?} */ compiledTemplate = this._compiledTemplateCache.get(compMeta.type.reference);
  113197. if (!compiledTemplate) {
  113198. assertComponent(compMeta);
  113199. compiledTemplate = new CompiledTemplate(false, compMeta.type, compMeta, ngModule, ngModule.transitiveModule.directives);
  113200. this._compiledTemplateCache.set(compMeta.type.reference, compiledTemplate);
  113201. }
  113202. return compiledTemplate;
  113203. };
  113204. /**
  113205. * @param {?} template
  113206. * @return {?}
  113207. */
  113208. JitCompiler.prototype._compileTemplate = /**
  113209. * @param {?} template
  113210. * @return {?}
  113211. */
  113212. function (template) {
  113213. var _this = this;
  113214. if (template.isCompiled) {
  113215. return;
  113216. }
  113217. var /** @type {?} */ compMeta = template.compMeta;
  113218. var /** @type {?} */ externalStylesheetsByModuleUrl = new Map();
  113219. var /** @type {?} */ outputContext = createOutputContext();
  113220. var /** @type {?} */ componentStylesheet = this._styleCompiler.compileComponent(outputContext, compMeta); /** @type {?} */
  113221. ((compMeta.template)).externalStylesheets.forEach(function (stylesheetMeta) {
  113222. var /** @type {?} */ compiledStylesheet = _this._styleCompiler.compileStyles(createOutputContext(), compMeta, stylesheetMeta);
  113223. externalStylesheetsByModuleUrl.set(/** @type {?} */ ((stylesheetMeta.moduleUrl)), compiledStylesheet);
  113224. });
  113225. this._resolveStylesCompileResult(componentStylesheet, externalStylesheetsByModuleUrl);
  113226. var /** @type {?} */ pipes = template.ngModule.transitiveModule.pipes.map(function (pipe) { return _this._metadataResolver.getPipeSummary(pipe.reference); });
  113227. var _a = this._parseTemplate(compMeta, template.ngModule, template.directives), parsedTemplate = _a.template, usedPipes = _a.pipes;
  113228. var /** @type {?} */ compileResult = this._viewCompiler.compileComponent(outputContext, compMeta, parsedTemplate, variable(componentStylesheet.stylesVar), usedPipes);
  113229. var /** @type {?} */ evalResult = this._interpretOrJit(templateJitUrl(template.ngModule.type, template.compMeta), outputContext.statements);
  113230. var /** @type {?} */ viewClass = evalResult[compileResult.viewClassVar];
  113231. var /** @type {?} */ rendererType = evalResult[compileResult.rendererTypeVar];
  113232. template.compiled(viewClass, rendererType);
  113233. };
  113234. /**
  113235. * @param {?} compMeta
  113236. * @param {?} ngModule
  113237. * @param {?} directiveIdentifiers
  113238. * @return {?}
  113239. */
  113240. JitCompiler.prototype._parseTemplate = /**
  113241. * @param {?} compMeta
  113242. * @param {?} ngModule
  113243. * @param {?} directiveIdentifiers
  113244. * @return {?}
  113245. */
  113246. function (compMeta, ngModule, directiveIdentifiers) {
  113247. var _this = this;
  113248. // Note: ! is ok here as components always have a template.
  113249. var /** @type {?} */ preserveWhitespaces = /** @type {?} */ ((compMeta.template)).preserveWhitespaces;
  113250. var /** @type {?} */ directives = directiveIdentifiers.map(function (dir) { return _this._metadataResolver.getDirectiveSummary(dir.reference); });
  113251. var /** @type {?} */ pipes = ngModule.transitiveModule.pipes.map(function (pipe) { return _this._metadataResolver.getPipeSummary(pipe.reference); });
  113252. return this._templateParser.parse(compMeta, /** @type {?} */ ((/** @type {?} */ ((compMeta.template)).htmlAst)), directives, pipes, ngModule.schemas, templateSourceUrl(ngModule.type, compMeta, /** @type {?} */ ((compMeta.template))), preserveWhitespaces);
  113253. };
  113254. /**
  113255. * @param {?} result
  113256. * @param {?} externalStylesheetsByModuleUrl
  113257. * @return {?}
  113258. */
  113259. JitCompiler.prototype._resolveStylesCompileResult = /**
  113260. * @param {?} result
  113261. * @param {?} externalStylesheetsByModuleUrl
  113262. * @return {?}
  113263. */
  113264. function (result, externalStylesheetsByModuleUrl) {
  113265. var _this = this;
  113266. result.dependencies.forEach(function (dep, i) {
  113267. var /** @type {?} */ nestedCompileResult = /** @type {?} */ ((externalStylesheetsByModuleUrl.get(dep.moduleUrl)));
  113268. var /** @type {?} */ nestedStylesArr = _this._resolveAndEvalStylesCompileResult(nestedCompileResult, externalStylesheetsByModuleUrl);
  113269. dep.setValue(nestedStylesArr);
  113270. });
  113271. };
  113272. /**
  113273. * @param {?} result
  113274. * @param {?} externalStylesheetsByModuleUrl
  113275. * @return {?}
  113276. */
  113277. JitCompiler.prototype._resolveAndEvalStylesCompileResult = /**
  113278. * @param {?} result
  113279. * @param {?} externalStylesheetsByModuleUrl
  113280. * @return {?}
  113281. */
  113282. function (result, externalStylesheetsByModuleUrl) {
  113283. this._resolveStylesCompileResult(result, externalStylesheetsByModuleUrl);
  113284. return this._interpretOrJit(sharedStylesheetJitUrl(result.meta, this._sharedStylesheetCount++), result.outputCtx.statements)[result.stylesVar];
  113285. };
  113286. /**
  113287. * @param {?} sourceUrl
  113288. * @param {?} statements
  113289. * @return {?}
  113290. */
  113291. JitCompiler.prototype._interpretOrJit = /**
  113292. * @param {?} sourceUrl
  113293. * @param {?} statements
  113294. * @return {?}
  113295. */
  113296. function (sourceUrl, statements) {
  113297. if (!this._compilerConfig.useJit) {
  113298. return interpretStatements(statements, this._reflector);
  113299. }
  113300. else {
  113301. return jitStatements(sourceUrl, statements, this._reflector, this._compilerConfig.jitDevMode);
  113302. }
  113303. };
  113304. return JitCompiler;
  113305. }());
  113306. var CompiledTemplate = /** @class */ (function () {
  113307. function CompiledTemplate(isHost, compType, compMeta, ngModule, directives) {
  113308. this.isHost = isHost;
  113309. this.compType = compType;
  113310. this.compMeta = compMeta;
  113311. this.ngModule = ngModule;
  113312. this.directives = directives;
  113313. this._viewClass = /** @type {?} */ ((null));
  113314. this.isCompiled = false;
  113315. }
  113316. /**
  113317. * @param {?} viewClass
  113318. * @param {?} rendererType
  113319. * @return {?}
  113320. */
  113321. CompiledTemplate.prototype.compiled = /**
  113322. * @param {?} viewClass
  113323. * @param {?} rendererType
  113324. * @return {?}
  113325. */
  113326. function (viewClass, rendererType) {
  113327. this._viewClass = viewClass;
  113328. (/** @type {?} */ (this.compMeta.componentViewType)).setDelegate(viewClass);
  113329. for (var /** @type {?} */ prop in rendererType) {
  113330. (/** @type {?} */ (this.compMeta.rendererType))[prop] = rendererType[prop];
  113331. }
  113332. this.isCompiled = true;
  113333. };
  113334. return CompiledTemplate;
  113335. }());
  113336. /**
  113337. * @param {?} meta
  113338. * @return {?}
  113339. */
  113340. function assertComponent(meta) {
  113341. if (!meta.isComponent) {
  113342. throw new Error("Could not compile '" + identifierName(meta.type) + "' because it is not a component.");
  113343. }
  113344. }
  113345. /**
  113346. * @return {?}
  113347. */
  113348. function createOutputContext() {
  113349. var /** @type {?} */ importExpr$$1 = function (symbol) {
  113350. return importExpr({ name: identifierName(symbol), moduleName: null, runtime: symbol });
  113351. };
  113352. return { statements: [], genFilePath: '', importExpr: importExpr$$1 };
  113353. }
  113354. /**
  113355. * @fileoverview added by tsickle
  113356. * @suppress {checkTypes} checked by tsc
  113357. */
  113358. /**
  113359. * @license
  113360. * Copyright Google Inc. All Rights Reserved.
  113361. *
  113362. * Use of this source code is governed by an MIT-style license that can be
  113363. * found in the LICENSE file at https://angular.io/license
  113364. */
  113365. /**
  113366. * Provides access to reflection data about symbols that the compiler needs.
  113367. * @abstract
  113368. */
  113369. var CompileReflector = /** @class */ (function () {
  113370. function CompileReflector() {
  113371. }
  113372. return CompileReflector;
  113373. }());
  113374. /**
  113375. * @fileoverview added by tsickle
  113376. * @suppress {checkTypes} checked by tsc
  113377. */
  113378. /**
  113379. * @license
  113380. * Copyright Google Inc. All Rights Reserved.
  113381. *
  113382. * Use of this source code is governed by an MIT-style license that can be
  113383. * found in the LICENSE file at https://angular.io/license
  113384. */
  113385. /**
  113386. * Create a {\@link UrlResolver} with no package prefix.
  113387. * @return {?}
  113388. */
  113389. function createUrlResolverWithoutPackagePrefix() {
  113390. return new UrlResolver();
  113391. }
  113392. /**
  113393. * @return {?}
  113394. */
  113395. function createOfflineCompileUrlResolver() {
  113396. return new UrlResolver('.');
  113397. }
  113398. /**
  113399. * @record
  113400. */
  113401. var UrlResolver = /** @class */ (function () {
  113402. function UrlResolverImpl(_packagePrefix) {
  113403. if (_packagePrefix === void 0) { _packagePrefix = null; }
  113404. this._packagePrefix = _packagePrefix;
  113405. }
  113406. /**
  113407. * Resolves the `url` given the `baseUrl`:
  113408. * - when the `url` is null, the `baseUrl` is returned,
  113409. * - if `url` is relative ('path/to/here', './path/to/here'), the resolved url is a combination of
  113410. * `baseUrl` and `url`,
  113411. * - if `url` is absolute (it has a scheme: 'http://', 'https://' or start with '/'), the `url` is
  113412. * returned as is (ignoring the `baseUrl`)
  113413. */
  113414. /**
  113415. * Resolves the `url` given the `baseUrl`:
  113416. * - when the `url` is null, the `baseUrl` is returned,
  113417. * - if `url` is relative ('path/to/here', './path/to/here'), the resolved url is a combination of
  113418. * `baseUrl` and `url`,
  113419. * - if `url` is absolute (it has a scheme: 'http://', 'https://' or start with '/'), the `url` is
  113420. * returned as is (ignoring the `baseUrl`)
  113421. * @param {?} baseUrl
  113422. * @param {?} url
  113423. * @return {?}
  113424. */
  113425. UrlResolverImpl.prototype.resolve = /**
  113426. * Resolves the `url` given the `baseUrl`:
  113427. * - when the `url` is null, the `baseUrl` is returned,
  113428. * - if `url` is relative ('path/to/here', './path/to/here'), the resolved url is a combination of
  113429. * `baseUrl` and `url`,
  113430. * - if `url` is absolute (it has a scheme: 'http://', 'https://' or start with '/'), the `url` is
  113431. * returned as is (ignoring the `baseUrl`)
  113432. * @param {?} baseUrl
  113433. * @param {?} url
  113434. * @return {?}
  113435. */
  113436. function (baseUrl, url) {
  113437. var /** @type {?} */ resolvedUrl = url;
  113438. if (baseUrl != null && baseUrl.length > 0) {
  113439. resolvedUrl = _resolveUrl(baseUrl, resolvedUrl);
  113440. }
  113441. var /** @type {?} */ resolvedParts = _split(resolvedUrl);
  113442. var /** @type {?} */ prefix = this._packagePrefix;
  113443. if (prefix != null && resolvedParts != null &&
  113444. resolvedParts[_ComponentIndex.Scheme] == 'package') {
  113445. var /** @type {?} */ path = resolvedParts[_ComponentIndex.Path];
  113446. prefix = prefix.replace(/\/+$/, '');
  113447. path = path.replace(/^\/+/, '');
  113448. return prefix + "/" + path;
  113449. }
  113450. return resolvedUrl;
  113451. };
  113452. return UrlResolverImpl;
  113453. }());
  113454. /**
  113455. * Extract the scheme of a URL.
  113456. * @param {?} url
  113457. * @return {?}
  113458. */
  113459. function getUrlScheme(url) {
  113460. var /** @type {?} */ match = _split(url);
  113461. return (match && match[_ComponentIndex.Scheme]) || '';
  113462. }
  113463. /**
  113464. * Builds a URI string from already-encoded parts.
  113465. *
  113466. * No encoding is performed. Any component may be omitted as either null or
  113467. * undefined.
  113468. *
  113469. * @param {?=} opt_scheme The scheme such as 'http'.
  113470. * @param {?=} opt_userInfo The user name before the '\@'.
  113471. * @param {?=} opt_domain The domain such as 'www.google.com', already
  113472. * URI-encoded.
  113473. * @param {?=} opt_port The port number.
  113474. * @param {?=} opt_path The path, already URI-encoded. If it is not
  113475. * empty, it must begin with a slash.
  113476. * @param {?=} opt_queryData The URI-encoded query data.
  113477. * @param {?=} opt_fragment The URI-encoded fragment identifier.
  113478. * @return {?} The fully combined URI.
  113479. */
  113480. function _buildFromEncodedParts(opt_scheme, opt_userInfo, opt_domain, opt_port, opt_path, opt_queryData, opt_fragment) {
  113481. var /** @type {?} */ out = [];
  113482. if (opt_scheme != null) {
  113483. out.push(opt_scheme + ':');
  113484. }
  113485. if (opt_domain != null) {
  113486. out.push('//');
  113487. if (opt_userInfo != null) {
  113488. out.push(opt_userInfo + '@');
  113489. }
  113490. out.push(opt_domain);
  113491. if (opt_port != null) {
  113492. out.push(':' + opt_port);
  113493. }
  113494. }
  113495. if (opt_path != null) {
  113496. out.push(opt_path);
  113497. }
  113498. if (opt_queryData != null) {
  113499. out.push('?' + opt_queryData);
  113500. }
  113501. if (opt_fragment != null) {
  113502. out.push('#' + opt_fragment);
  113503. }
  113504. return out.join('');
  113505. }
  113506. /**
  113507. * A regular expression for breaking a URI into its component parts.
  113508. *
  113509. * {\@link http://www.gbiv.com/protocols/uri/rfc/rfc3986.html#RFC2234} says
  113510. * As the "first-match-wins" algorithm is identical to the "greedy"
  113511. * disambiguation method used by POSIX regular expressions, it is natural and
  113512. * commonplace to use a regular expression for parsing the potential five
  113513. * components of a URI reference.
  113514. *
  113515. * The following line is the regular expression for breaking-down a
  113516. * well-formed URI reference into its components.
  113517. *
  113518. * <pre>
  113519. * ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?
  113520. * 12 3 4 5 6 7 8 9
  113521. * </pre>
  113522. *
  113523. * The numbers in the second line above are only to assist readability; they
  113524. * indicate the reference points for each subexpression (i.e., each paired
  113525. * parenthesis). We refer to the value matched for subexpression <n> as $<n>.
  113526. * For example, matching the above expression to
  113527. * <pre>
  113528. * http://www.ics.uci.edu/pub/ietf/uri/#Related
  113529. * </pre>
  113530. * results in the following subexpression matches:
  113531. * <pre>
  113532. * $1 = http:
  113533. * $2 = http
  113534. * $3 = //www.ics.uci.edu
  113535. * $4 = www.ics.uci.edu
  113536. * $5 = /pub/ietf/uri/
  113537. * $6 = <undefined>
  113538. * $7 = <undefined>
  113539. * $8 = #Related
  113540. * $9 = Related
  113541. * </pre>
  113542. * where <undefined> indicates that the component is not present, as is the
  113543. * case for the query component in the above example. Therefore, we can
  113544. * determine the value of the five components as
  113545. * <pre>
  113546. * scheme = $2
  113547. * authority = $4
  113548. * path = $5
  113549. * query = $7
  113550. * fragment = $9
  113551. * </pre>
  113552. *
  113553. * The regular expression has been modified slightly to expose the
  113554. * userInfo, domain, and port separately from the authority.
  113555. * The modified version yields
  113556. * <pre>
  113557. * $1 = http scheme
  113558. * $2 = <undefined> userInfo -\
  113559. * $3 = www.ics.uci.edu domain | authority
  113560. * $4 = <undefined> port -/
  113561. * $5 = /pub/ietf/uri/ path
  113562. * $6 = <undefined> query without ?
  113563. * $7 = Related fragment without #
  113564. * </pre>
  113565. * \@internal
  113566. */
  113567. var _splitRe = new RegExp('^' +
  113568. '(?:' +
  113569. '([^:/?#.]+)' + // scheme - ignore special characters
  113570. ':)?' +
  113571. '(?://' +
  113572. '(?:([^/?#]*)@)?' + // userInfo
  113573. '([\\w\\d\\-\\u0100-\\uffff.%]*)' + // domain - restrict to letters,
  113574. '(?::([0-9]+))?' + // port
  113575. ')?' +
  113576. '([^?#]+)?' + // path
  113577. '(?:\\?([^#]*))?' + // query
  113578. '(?:#(.*))?' + // fragment
  113579. '$');
  113580. /** @enum {number} */
  113581. var _ComponentIndex = {
  113582. Scheme: 1,
  113583. UserInfo: 2,
  113584. Domain: 3,
  113585. Port: 4,
  113586. Path: 5,
  113587. QueryData: 6,
  113588. Fragment: 7,
  113589. };
  113590. _ComponentIndex[_ComponentIndex.Scheme] = "Scheme";
  113591. _ComponentIndex[_ComponentIndex.UserInfo] = "UserInfo";
  113592. _ComponentIndex[_ComponentIndex.Domain] = "Domain";
  113593. _ComponentIndex[_ComponentIndex.Port] = "Port";
  113594. _ComponentIndex[_ComponentIndex.Path] = "Path";
  113595. _ComponentIndex[_ComponentIndex.QueryData] = "QueryData";
  113596. _ComponentIndex[_ComponentIndex.Fragment] = "Fragment";
  113597. /**
  113598. * Splits a URI into its component parts.
  113599. *
  113600. * Each component can be accessed via the component indices; for example:
  113601. * <pre>
  113602. * goog.uri.utils.split(someStr)[goog.uri.utils.CompontentIndex.QUERY_DATA];
  113603. * </pre>
  113604. *
  113605. * @param {?} uri The URI string to examine.
  113606. * @return {?} Each component still URI-encoded.
  113607. * Each component that is present will contain the encoded value, whereas
  113608. * components that are not present will be undefined or empty, depending
  113609. * on the browser's regular expression implementation. Never null, since
  113610. * arbitrary strings may still look like path names.
  113611. */
  113612. function _split(uri) {
  113613. return /** @type {?} */ ((uri.match(_splitRe)));
  113614. }
  113615. /**
  113616. * Removes dot segments in given path component, as described in
  113617. * RFC 3986, section 5.2.4.
  113618. *
  113619. * @param {?} path A non-empty path component.
  113620. * @return {?} Path component with removed dot segments.
  113621. */
  113622. function _removeDotSegments(path) {
  113623. if (path == '/')
  113624. return '/';
  113625. var /** @type {?} */ leadingSlash = path[0] == '/' ? '/' : '';
  113626. var /** @type {?} */ trailingSlash = path[path.length - 1] === '/' ? '/' : '';
  113627. var /** @type {?} */ segments = path.split('/');
  113628. var /** @type {?} */ out = [];
  113629. var /** @type {?} */ up = 0;
  113630. for (var /** @type {?} */ pos = 0; pos < segments.length; pos++) {
  113631. var /** @type {?} */ segment = segments[pos];
  113632. switch (segment) {
  113633. case '':
  113634. case '.':
  113635. break;
  113636. case '..':
  113637. if (out.length > 0) {
  113638. out.pop();
  113639. }
  113640. else {
  113641. up++;
  113642. }
  113643. break;
  113644. default:
  113645. out.push(segment);
  113646. }
  113647. }
  113648. if (leadingSlash == '') {
  113649. while (up-- > 0) {
  113650. out.unshift('..');
  113651. }
  113652. if (out.length === 0)
  113653. out.push('.');
  113654. }
  113655. return leadingSlash + out.join('/') + trailingSlash;
  113656. }
  113657. /**
  113658. * Takes an array of the parts from split and canonicalizes the path part
  113659. * and then joins all the parts.
  113660. * @param {?} parts
  113661. * @return {?}
  113662. */
  113663. function _joinAndCanonicalizePath(parts) {
  113664. var /** @type {?} */ path = parts[_ComponentIndex.Path];
  113665. path = path == null ? '' : _removeDotSegments(path);
  113666. parts[_ComponentIndex.Path] = path;
  113667. return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);
  113668. }
  113669. /**
  113670. * Resolves a URL.
  113671. * @param {?} base The URL acting as the base URL.
  113672. * @param {?} url
  113673. * @return {?}
  113674. */
  113675. function _resolveUrl(base, url) {
  113676. var /** @type {?} */ parts = _split(encodeURI(url));
  113677. var /** @type {?} */ baseParts = _split(base);
  113678. if (parts[_ComponentIndex.Scheme] != null) {
  113679. return _joinAndCanonicalizePath(parts);
  113680. }
  113681. else {
  113682. parts[_ComponentIndex.Scheme] = baseParts[_ComponentIndex.Scheme];
  113683. }
  113684. for (var /** @type {?} */ i = _ComponentIndex.Scheme; i <= _ComponentIndex.Port; i++) {
  113685. if (parts[i] == null) {
  113686. parts[i] = baseParts[i];
  113687. }
  113688. }
  113689. if (parts[_ComponentIndex.Path][0] == '/') {
  113690. return _joinAndCanonicalizePath(parts);
  113691. }
  113692. var /** @type {?} */ path = baseParts[_ComponentIndex.Path];
  113693. if (path == null)
  113694. path = '/';
  113695. var /** @type {?} */ index = path.lastIndexOf('/');
  113696. path = path.substring(0, index + 1) + parts[_ComponentIndex.Path];
  113697. parts[_ComponentIndex.Path] = path;
  113698. return _joinAndCanonicalizePath(parts);
  113699. }
  113700. /**
  113701. * @fileoverview added by tsickle
  113702. * @suppress {checkTypes} checked by tsc
  113703. */
  113704. /**
  113705. * @license
  113706. * Copyright Google Inc. All Rights Reserved.
  113707. *
  113708. * Use of this source code is governed by an MIT-style license that can be
  113709. * found in the LICENSE file at https://angular.io/license
  113710. */
  113711. /**
  113712. * An interface for retrieving documents by URL that the compiler uses
  113713. * to load templates.
  113714. */
  113715. var ResourceLoader = /** @class */ (function () {
  113716. function ResourceLoader() {
  113717. }
  113718. /**
  113719. * @param {?} url
  113720. * @return {?}
  113721. */
  113722. ResourceLoader.prototype.get = /**
  113723. * @param {?} url
  113724. * @return {?}
  113725. */
  113726. function (url) { return ''; };
  113727. return ResourceLoader;
  113728. }());
  113729. /**
  113730. * @fileoverview added by tsickle
  113731. * @suppress {checkTypes} checked by tsc
  113732. */
  113733. /**
  113734. * @license
  113735. * Copyright Google Inc. All Rights Reserved.
  113736. *
  113737. * Use of this source code is governed by an MIT-style license that can be
  113738. * found in the LICENSE file at https://angular.io/license
  113739. */
  113740. /**
  113741. * The host of the Extractor disconnects the implementation from TypeScript / other language
  113742. * services and from underlying file systems.
  113743. * @record
  113744. */
  113745. var Extractor = /** @class */ (function () {
  113746. function Extractor(host, staticSymbolResolver, messageBundle, metadataResolver) {
  113747. this.host = host;
  113748. this.staticSymbolResolver = staticSymbolResolver;
  113749. this.messageBundle = messageBundle;
  113750. this.metadataResolver = metadataResolver;
  113751. }
  113752. /**
  113753. * @param {?} rootFiles
  113754. * @return {?}
  113755. */
  113756. Extractor.prototype.extract = /**
  113757. * @param {?} rootFiles
  113758. * @return {?}
  113759. */
  113760. function (rootFiles) {
  113761. var _this = this;
  113762. var _a = analyzeAndValidateNgModules(rootFiles, this.host, this.staticSymbolResolver, this.metadataResolver), files = _a.files, ngModules = _a.ngModules;
  113763. return Promise
  113764. .all(ngModules.map(function (ngModule) {
  113765. return _this.metadataResolver.loadNgModuleDirectiveAndPipeMetadata(ngModule.type.reference, false);
  113766. }))
  113767. .then(function () {
  113768. var /** @type {?} */ errors = [];
  113769. files.forEach(function (file) {
  113770. var /** @type {?} */ compMetas = [];
  113771. file.directives.forEach(function (directiveType) {
  113772. var /** @type {?} */ dirMeta = _this.metadataResolver.getDirectiveMetadata(directiveType);
  113773. if (dirMeta && dirMeta.isComponent) {
  113774. compMetas.push(dirMeta);
  113775. }
  113776. });
  113777. compMetas.forEach(function (compMeta) {
  113778. var /** @type {?} */ html = /** @type {?} */ ((/** @type {?} */ ((compMeta.template)).template));
  113779. var /** @type {?} */ interpolationConfig = InterpolationConfig.fromArray(/** @type {?} */ ((compMeta.template)).interpolation);
  113780. errors.push.apply(errors, /** @type {?} */ ((_this.messageBundle.updateFromTemplate(html, file.fileName, interpolationConfig))));
  113781. });
  113782. });
  113783. if (errors.length) {
  113784. throw new Error(errors.map(function (e) { return e.toString(); }).join('\n'));
  113785. }
  113786. return _this.messageBundle;
  113787. });
  113788. };
  113789. /**
  113790. * @param {?} host
  113791. * @param {?} locale
  113792. * @return {?}
  113793. */
  113794. Extractor.create = /**
  113795. * @param {?} host
  113796. * @param {?} locale
  113797. * @return {?}
  113798. */
  113799. function (host, locale) {
  113800. var /** @type {?} */ htmlParser = new HtmlParser();
  113801. var /** @type {?} */ urlResolver = createAotUrlResolver(host);
  113802. var /** @type {?} */ symbolCache = new StaticSymbolCache();
  113803. var /** @type {?} */ summaryResolver = new AotSummaryResolver(host, symbolCache);
  113804. var /** @type {?} */ staticSymbolResolver = new StaticSymbolResolver(host, symbolCache, summaryResolver);
  113805. var /** @type {?} */ staticReflector = new StaticReflector(summaryResolver, staticSymbolResolver);
  113806. var /** @type {?} */ config = new CompilerConfig({ defaultEncapsulation: ViewEncapsulation.Emulated, useJit: false });
  113807. var /** @type {?} */ normalizer = new DirectiveNormalizer({ get: function (url) { return host.loadResource(url); } }, urlResolver, htmlParser, config);
  113808. var /** @type {?} */ elementSchemaRegistry = new DomElementSchemaRegistry();
  113809. var /** @type {?} */ resolver = new CompileMetadataResolver(config, htmlParser, new NgModuleResolver(staticReflector), new DirectiveResolver(staticReflector), new PipeResolver(staticReflector), summaryResolver, elementSchemaRegistry, normalizer, console, symbolCache, staticReflector);
  113810. // TODO(vicb): implicit tags & attributes
  113811. var /** @type {?} */ messageBundle = new MessageBundle(htmlParser, [], {}, locale);
  113812. var /** @type {?} */ extractor = new Extractor(host, staticSymbolResolver, messageBundle, resolver);
  113813. return { extractor: extractor, staticReflector: staticReflector };
  113814. };
  113815. return Extractor;
  113816. }());
  113817. /**
  113818. * @fileoverview added by tsickle
  113819. * @suppress {checkTypes} checked by tsc
  113820. */
  113821. /**
  113822. * @license
  113823. * Copyright Google Inc. All Rights Reserved.
  113824. *
  113825. * Use of this source code is governed by an MIT-style license that can be
  113826. * found in the LICENSE file at https://angular.io/license
  113827. */
  113828. /**
  113829. * @fileoverview added by tsickle
  113830. * @suppress {checkTypes} checked by tsc
  113831. */
  113832. /**
  113833. * @license
  113834. * Copyright Google Inc. All Rights Reserved.
  113835. *
  113836. * Use of this source code is governed by an MIT-style license that can be
  113837. * found in the LICENSE file at https://angular.io/license
  113838. */
  113839. // This file only reexports content of the `src` folder. Keep it that way.
  113840. /**
  113841. * @fileoverview added by tsickle
  113842. * @suppress {checkTypes} checked by tsc
  113843. */
  113844. /**
  113845. * @license
  113846. * Copyright Google Inc. All Rights Reserved.
  113847. *
  113848. * Use of this source code is governed by an MIT-style license that can be
  113849. * found in the LICENSE file at https://angular.io/license
  113850. */
  113851. /**
  113852. * @module
  113853. * @description
  113854. * Entry point for all public APIs of this package.
  113855. */
  113856. // This file only reexports content of the `src` folder. Keep it that way.
  113857. /**
  113858. * @fileoverview added by tsickle
  113859. * @suppress {checkTypes} checked by tsc
  113860. */
  113861. /**
  113862. * @license
  113863. * Copyright Google Inc. All Rights Reserved.
  113864. *
  113865. * Use of this source code is governed by an MIT-style license that can be
  113866. * found in the LICENSE file at https://angular.io/license
  113867. */
  113868. // This file is not used to build this module. It is only used during editing
  113869. // by the TypeScript language service and during build for verification. `ngc`
  113870. // replaces this file with production index.ts when it rewrites private symbol
  113871. // names.
  113872. //# sourceMappingURL=compiler.js.map
  113873. /***/ }),
  113874. /* 206 */
  113875. /***/ (function(module, exports, __webpack_require__) {
  113876. "use strict";
  113877. var Subscriber_1 = __webpack_require__(20);
  113878. var rxSubscriber_1 = __webpack_require__(52);
  113879. var Observer_1 = __webpack_require__(107);
  113880. function toSubscriber(nextOrObserver, error, complete) {
  113881. if (nextOrObserver) {
  113882. if (nextOrObserver instanceof Subscriber_1.Subscriber) {
  113883. return nextOrObserver;
  113884. }
  113885. if (nextOrObserver[rxSubscriber_1.rxSubscriber]) {
  113886. return nextOrObserver[rxSubscriber_1.rxSubscriber]();
  113887. }
  113888. }
  113889. if (!nextOrObserver && !error && !complete) {
  113890. return new Subscriber_1.Subscriber(Observer_1.empty);
  113891. }
  113892. return new Subscriber_1.Subscriber(nextOrObserver, error, complete);
  113893. }
  113894. exports.toSubscriber = toSubscriber;
  113895. //# sourceMappingURL=toSubscriber.js.map
  113896. /***/ }),
  113897. /* 207 */
  113898. /***/ (function(module, exports, __webpack_require__) {
  113899. "use strict";
  113900. var __extends = (this && this.__extends) || function (d, b) {
  113901. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  113902. function __() { this.constructor = d; }
  113903. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  113904. };
  113905. /**
  113906. * An error thrown when one or more errors have occurred during the
  113907. * `unsubscribe` of a {@link Subscription}.
  113908. */
  113909. var UnsubscriptionError = (function (_super) {
  113910. __extends(UnsubscriptionError, _super);
  113911. function UnsubscriptionError(errors) {
  113912. _super.call(this);
  113913. this.errors = errors;
  113914. var err = Error.call(this, errors ?
  113915. errors.length + " errors occurred during unsubscription:\n " + errors.map(function (err, i) { return ((i + 1) + ") " + err.toString()); }).join('\n ') : '');
  113916. this.name = err.name = 'UnsubscriptionError';
  113917. this.stack = err.stack;
  113918. this.message = err.message;
  113919. }
  113920. return UnsubscriptionError;
  113921. }(Error));
  113922. exports.UnsubscriptionError = UnsubscriptionError;
  113923. //# sourceMappingURL=UnsubscriptionError.js.map
  113924. /***/ }),
  113925. /* 208 */
  113926. /***/ (function(module, exports, __webpack_require__) {
  113927. "use strict";
  113928. var noop_1 = __webpack_require__(209);
  113929. /* tslint:enable:max-line-length */
  113930. function pipe() {
  113931. var fns = [];
  113932. for (var _i = 0; _i < arguments.length; _i++) {
  113933. fns[_i - 0] = arguments[_i];
  113934. }
  113935. return pipeFromArray(fns);
  113936. }
  113937. exports.pipe = pipe;
  113938. /* @internal */
  113939. function pipeFromArray(fns) {
  113940. if (!fns) {
  113941. return noop_1.noop;
  113942. }
  113943. if (fns.length === 1) {
  113944. return fns[0];
  113945. }
  113946. return function piped(input) {
  113947. return fns.reduce(function (prev, fn) { return fn(prev); }, input);
  113948. };
  113949. }
  113950. exports.pipeFromArray = pipeFromArray;
  113951. //# sourceMappingURL=pipe.js.map
  113952. /***/ }),
  113953. /* 209 */
  113954. /***/ (function(module, exports, __webpack_require__) {
  113955. "use strict";
  113956. /* tslint:disable:no-empty */
  113957. function noop() { }
  113958. exports.noop = noop;
  113959. //# sourceMappingURL=noop.js.map
  113960. /***/ }),
  113961. /* 210 */
  113962. /***/ (function(module, exports, __webpack_require__) {
  113963. "use strict";
  113964. var Observable_1 = __webpack_require__(9);
  113965. var ArrayObservable_1 = __webpack_require__(109);
  113966. var isScheduler_1 = __webpack_require__(111);
  113967. var mergeAll_1 = __webpack_require__(212);
  113968. /* tslint:enable:max-line-length */
  113969. /**
  113970. * Creates an output Observable which concurrently emits all values from every
  113971. * given input Observable.
  113972. *
  113973. * <span class="informal">Flattens multiple Observables together by blending
  113974. * their values into one Observable.</span>
  113975. *
  113976. * <img src="./img/merge.png" width="100%">
  113977. *
  113978. * `merge` subscribes to each given input Observable (as arguments), and simply
  113979. * forwards (without doing any transformation) all the values from all the input
  113980. * Observables to the output Observable. The output Observable only completes
  113981. * once all input Observables have completed. Any error delivered by an input
  113982. * Observable will be immediately emitted on the output Observable.
  113983. *
  113984. * @example <caption>Merge together two Observables: 1s interval and clicks</caption>
  113985. * var clicks = Rx.Observable.fromEvent(document, 'click');
  113986. * var timer = Rx.Observable.interval(1000);
  113987. * var clicksOrTimer = Rx.Observable.merge(clicks, timer);
  113988. * clicksOrTimer.subscribe(x => console.log(x));
  113989. *
  113990. * // Results in the following:
  113991. * // timer will emit ascending values, one every second(1000ms) to console
  113992. * // clicks logs MouseEvents to console everytime the "document" is clicked
  113993. * // Since the two streams are merged you see these happening
  113994. * // as they occur.
  113995. *
  113996. * @example <caption>Merge together 3 Observables, but only 2 run concurrently</caption>
  113997. * var timer1 = Rx.Observable.interval(1000).take(10);
  113998. * var timer2 = Rx.Observable.interval(2000).take(6);
  113999. * var timer3 = Rx.Observable.interval(500).take(10);
  114000. * var concurrent = 2; // the argument
  114001. * var merged = Rx.Observable.merge(timer1, timer2, timer3, concurrent);
  114002. * merged.subscribe(x => console.log(x));
  114003. *
  114004. * // Results in the following:
  114005. * // - First timer1 and timer2 will run concurrently
  114006. * // - timer1 will emit a value every 1000ms for 10 iterations
  114007. * // - timer2 will emit a value every 2000ms for 6 iterations
  114008. * // - after timer1 hits it's max iteration, timer2 will
  114009. * // continue, and timer3 will start to run concurrently with timer2
  114010. * // - when timer2 hits it's max iteration it terminates, and
  114011. * // timer3 will continue to emit a value every 500ms until it is complete
  114012. *
  114013. * @see {@link mergeAll}
  114014. * @see {@link mergeMap}
  114015. * @see {@link mergeMapTo}
  114016. * @see {@link mergeScan}
  114017. *
  114018. * @param {...ObservableInput} observables Input Observables to merge together.
  114019. * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of input
  114020. * Observables being subscribed to concurrently.
  114021. * @param {Scheduler} [scheduler=null] The IScheduler to use for managing
  114022. * concurrency of input Observables.
  114023. * @return {Observable} an Observable that emits items that are the result of
  114024. * every input Observable.
  114025. * @static true
  114026. * @name merge
  114027. * @owner Observable
  114028. */
  114029. function merge() {
  114030. var observables = [];
  114031. for (var _i = 0; _i < arguments.length; _i++) {
  114032. observables[_i - 0] = arguments[_i];
  114033. }
  114034. var concurrent = Number.POSITIVE_INFINITY;
  114035. var scheduler = null;
  114036. var last = observables[observables.length - 1];
  114037. if (isScheduler_1.isScheduler(last)) {
  114038. scheduler = observables.pop();
  114039. if (observables.length > 1 && typeof observables[observables.length - 1] === 'number') {
  114040. concurrent = observables.pop();
  114041. }
  114042. }
  114043. else if (typeof last === 'number') {
  114044. concurrent = observables.pop();
  114045. }
  114046. if (scheduler === null && observables.length === 1 && observables[0] instanceof Observable_1.Observable) {
  114047. return observables[0];
  114048. }
  114049. return mergeAll_1.mergeAll(concurrent)(new ArrayObservable_1.ArrayObservable(observables, scheduler));
  114050. }
  114051. exports.merge = merge;
  114052. //# sourceMappingURL=merge.js.map
  114053. /***/ }),
  114054. /* 211 */
  114055. /***/ (function(module, exports, __webpack_require__) {
  114056. "use strict";
  114057. var __extends = (this && this.__extends) || function (d, b) {
  114058. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  114059. function __() { this.constructor = d; }
  114060. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  114061. };
  114062. var Observable_1 = __webpack_require__(9);
  114063. /**
  114064. * We need this JSDoc comment for affecting ESDoc.
  114065. * @extends {Ignored}
  114066. * @hide true
  114067. */
  114068. var ScalarObservable = (function (_super) {
  114069. __extends(ScalarObservable, _super);
  114070. function ScalarObservable(value, scheduler) {
  114071. _super.call(this);
  114072. this.value = value;
  114073. this.scheduler = scheduler;
  114074. this._isScalar = true;
  114075. if (scheduler) {
  114076. this._isScalar = false;
  114077. }
  114078. }
  114079. ScalarObservable.create = function (value, scheduler) {
  114080. return new ScalarObservable(value, scheduler);
  114081. };
  114082. ScalarObservable.dispatch = function (state) {
  114083. var done = state.done, value = state.value, subscriber = state.subscriber;
  114084. if (done) {
  114085. subscriber.complete();
  114086. return;
  114087. }
  114088. subscriber.next(value);
  114089. if (subscriber.closed) {
  114090. return;
  114091. }
  114092. state.done = true;
  114093. this.schedule(state);
  114094. };
  114095. /** @deprecated internal use only */ ScalarObservable.prototype._subscribe = function (subscriber) {
  114096. var value = this.value;
  114097. var scheduler = this.scheduler;
  114098. if (scheduler) {
  114099. return scheduler.schedule(ScalarObservable.dispatch, 0, {
  114100. done: false, value: value, subscriber: subscriber
  114101. });
  114102. }
  114103. else {
  114104. subscriber.next(value);
  114105. if (!subscriber.closed) {
  114106. subscriber.complete();
  114107. }
  114108. }
  114109. };
  114110. return ScalarObservable;
  114111. }(Observable_1.Observable));
  114112. exports.ScalarObservable = ScalarObservable;
  114113. //# sourceMappingURL=ScalarObservable.js.map
  114114. /***/ }),
  114115. /* 212 */
  114116. /***/ (function(module, exports, __webpack_require__) {
  114117. "use strict";
  114118. var mergeMap_1 = __webpack_require__(112);
  114119. var identity_1 = __webpack_require__(217);
  114120. /**
  114121. * Converts a higher-order Observable into a first-order Observable which
  114122. * concurrently delivers all values that are emitted on the inner Observables.
  114123. *
  114124. * <span class="informal">Flattens an Observable-of-Observables.</span>
  114125. *
  114126. * <img src="./img/mergeAll.png" width="100%">
  114127. *
  114128. * `mergeAll` subscribes to an Observable that emits Observables, also known as
  114129. * a higher-order Observable. Each time it observes one of these emitted inner
  114130. * Observables, it subscribes to that and delivers all the values from the
  114131. * inner Observable on the output Observable. The output Observable only
  114132. * completes once all inner Observables have completed. Any error delivered by
  114133. * a inner Observable will be immediately emitted on the output Observable.
  114134. *
  114135. * @example <caption>Spawn a new interval Observable for each click event, and blend their outputs as one Observable</caption>
  114136. * var clicks = Rx.Observable.fromEvent(document, 'click');
  114137. * var higherOrder = clicks.map((ev) => Rx.Observable.interval(1000));
  114138. * var firstOrder = higherOrder.mergeAll();
  114139. * firstOrder.subscribe(x => console.log(x));
  114140. *
  114141. * @example <caption>Count from 0 to 9 every second for each click, but only allow 2 concurrent timers</caption>
  114142. * var clicks = Rx.Observable.fromEvent(document, 'click');
  114143. * var higherOrder = clicks.map((ev) => Rx.Observable.interval(1000).take(10));
  114144. * var firstOrder = higherOrder.mergeAll(2);
  114145. * firstOrder.subscribe(x => console.log(x));
  114146. *
  114147. * @see {@link combineAll}
  114148. * @see {@link concatAll}
  114149. * @see {@link exhaust}
  114150. * @see {@link merge}
  114151. * @see {@link mergeMap}
  114152. * @see {@link mergeMapTo}
  114153. * @see {@link mergeScan}
  114154. * @see {@link switch}
  114155. * @see {@link zipAll}
  114156. *
  114157. * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of inner
  114158. * Observables being subscribed to concurrently.
  114159. * @return {Observable} An Observable that emits values coming from all the
  114160. * inner Observables emitted by the source Observable.
  114161. * @method mergeAll
  114162. * @owner Observable
  114163. */
  114164. function mergeAll(concurrent) {
  114165. if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; }
  114166. return mergeMap_1.mergeMap(identity_1.identity, null, concurrent);
  114167. }
  114168. exports.mergeAll = mergeAll;
  114169. //# sourceMappingURL=mergeAll.js.map
  114170. /***/ }),
  114171. /* 213 */
  114172. /***/ (function(module, exports, __webpack_require__) {
  114173. "use strict";
  114174. exports.isArrayLike = (function (x) { return x && typeof x.length === 'number'; });
  114175. //# sourceMappingURL=isArrayLike.js.map
  114176. /***/ }),
  114177. /* 214 */
  114178. /***/ (function(module, exports, __webpack_require__) {
  114179. "use strict";
  114180. function isPromise(value) {
  114181. return value && typeof value.subscribe !== 'function' && typeof value.then === 'function';
  114182. }
  114183. exports.isPromise = isPromise;
  114184. //# sourceMappingURL=isPromise.js.map
  114185. /***/ }),
  114186. /* 215 */
  114187. /***/ (function(module, exports, __webpack_require__) {
  114188. "use strict";
  114189. var root_1 = __webpack_require__(29);
  114190. function symbolIteratorPonyfill(root) {
  114191. var Symbol = root.Symbol;
  114192. if (typeof Symbol === 'function') {
  114193. if (!Symbol.iterator) {
  114194. Symbol.iterator = Symbol('iterator polyfill');
  114195. }
  114196. return Symbol.iterator;
  114197. }
  114198. else {
  114199. // [for Mozilla Gecko 27-35:](https://mzl.la/2ewE1zC)
  114200. var Set_1 = root.Set;
  114201. if (Set_1 && typeof new Set_1()['@@iterator'] === 'function') {
  114202. return '@@iterator';
  114203. }
  114204. var Map_1 = root.Map;
  114205. // required for compatability with es6-shim
  114206. if (Map_1) {
  114207. var keys = Object.getOwnPropertyNames(Map_1.prototype);
  114208. for (var i = 0; i < keys.length; ++i) {
  114209. var key = keys[i];
  114210. // according to spec, Map.prototype[@@iterator] and Map.orototype.entries must be equal.
  114211. if (key !== 'entries' && key !== 'size' && Map_1.prototype[key] === Map_1.prototype['entries']) {
  114212. return key;
  114213. }
  114214. }
  114215. }
  114216. return '@@iterator';
  114217. }
  114218. }
  114219. exports.symbolIteratorPonyfill = symbolIteratorPonyfill;
  114220. exports.iterator = symbolIteratorPonyfill(root_1.root);
  114221. /**
  114222. * @deprecated use iterator instead
  114223. */
  114224. exports.$$iterator = exports.iterator;
  114225. //# sourceMappingURL=iterator.js.map
  114226. /***/ }),
  114227. /* 216 */
  114228. /***/ (function(module, exports, __webpack_require__) {
  114229. "use strict";
  114230. var __extends = (this && this.__extends) || function (d, b) {
  114231. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  114232. function __() { this.constructor = d; }
  114233. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  114234. };
  114235. var Subscriber_1 = __webpack_require__(20);
  114236. /**
  114237. * We need this JSDoc comment for affecting ESDoc.
  114238. * @ignore
  114239. * @extends {Ignored}
  114240. */
  114241. var InnerSubscriber = (function (_super) {
  114242. __extends(InnerSubscriber, _super);
  114243. function InnerSubscriber(parent, outerValue, outerIndex) {
  114244. _super.call(this);
  114245. this.parent = parent;
  114246. this.outerValue = outerValue;
  114247. this.outerIndex = outerIndex;
  114248. this.index = 0;
  114249. }
  114250. InnerSubscriber.prototype._next = function (value) {
  114251. this.parent.notifyNext(this.outerValue, value, this.outerIndex, this.index++, this);
  114252. };
  114253. InnerSubscriber.prototype._error = function (error) {
  114254. this.parent.notifyError(error, this);
  114255. this.unsubscribe();
  114256. };
  114257. InnerSubscriber.prototype._complete = function () {
  114258. this.parent.notifyComplete(this);
  114259. this.unsubscribe();
  114260. };
  114261. return InnerSubscriber;
  114262. }(Subscriber_1.Subscriber));
  114263. exports.InnerSubscriber = InnerSubscriber;
  114264. //# sourceMappingURL=InnerSubscriber.js.map
  114265. /***/ }),
  114266. /* 217 */
  114267. /***/ (function(module, exports, __webpack_require__) {
  114268. "use strict";
  114269. function identity(x) {
  114270. return x;
  114271. }
  114272. exports.identity = identity;
  114273. //# sourceMappingURL=identity.js.map
  114274. /***/ }),
  114275. /* 218 */
  114276. /***/ (function(module, exports, __webpack_require__) {
  114277. "use strict";
  114278. var share_1 = __webpack_require__(219);
  114279. /**
  114280. * Returns a new Observable that multicasts (shares) the original Observable. As long as there is at least one
  114281. * Subscriber this Observable will be subscribed and emitting data. When all subscribers have unsubscribed it will
  114282. * unsubscribe from the source Observable. Because the Observable is multicasting it makes the stream `hot`.
  114283. *
  114284. * This behaves similarly to .publish().refCount(), with a behavior difference when the source observable emits complete.
  114285. * .publish().refCount() will not resubscribe to the original source, however .share() will resubscribe to the original source.
  114286. * Observable.of("test").publish().refCount() will not re-emit "test" on new subscriptions, Observable.of("test").share() will
  114287. * re-emit "test" to new subscriptions.
  114288. *
  114289. * <img src="./img/share.png" width="100%">
  114290. *
  114291. * @return {Observable<T>} An Observable that upon connection causes the source Observable to emit items to its Observers.
  114292. * @method share
  114293. * @owner Observable
  114294. */
  114295. function share() {
  114296. return share_1.share()(this);
  114297. }
  114298. exports.share = share;
  114299. ;
  114300. //# sourceMappingURL=share.js.map
  114301. /***/ }),
  114302. /* 219 */
  114303. /***/ (function(module, exports, __webpack_require__) {
  114304. "use strict";
  114305. var multicast_1 = __webpack_require__(220);
  114306. var refCount_1 = __webpack_require__(113);
  114307. var Subject_1 = __webpack_require__(33);
  114308. function shareSubjectFactory() {
  114309. return new Subject_1.Subject();
  114310. }
  114311. /**
  114312. * Returns a new Observable that multicasts (shares) the original Observable. As long as there is at least one
  114313. * Subscriber this Observable will be subscribed and emitting data. When all subscribers have unsubscribed it will
  114314. * unsubscribe from the source Observable. Because the Observable is multicasting it makes the stream `hot`.
  114315. * This is an alias for .multicast(() => new Subject()).refCount().
  114316. *
  114317. * <img src="./img/share.png" width="100%">
  114318. *
  114319. * @return {Observable<T>} An Observable that upon connection causes the source Observable to emit items to its Observers.
  114320. * @method share
  114321. * @owner Observable
  114322. */
  114323. function share() {
  114324. return function (source) { return refCount_1.refCount()(multicast_1.multicast(shareSubjectFactory)(source)); };
  114325. }
  114326. exports.share = share;
  114327. ;
  114328. //# sourceMappingURL=share.js.map
  114329. /***/ }),
  114330. /* 220 */
  114331. /***/ (function(module, exports, __webpack_require__) {
  114332. "use strict";
  114333. var ConnectableObservable_1 = __webpack_require__(221);
  114334. /* tslint:enable:max-line-length */
  114335. /**
  114336. * Returns an Observable that emits the results of invoking a specified selector on items
  114337. * emitted by a ConnectableObservable that shares a single subscription to the underlying stream.
  114338. *
  114339. * <img src="./img/multicast.png" width="100%">
  114340. *
  114341. * @param {Function|Subject} subjectOrSubjectFactory - Factory function to create an intermediate subject through
  114342. * which the source sequence's elements will be multicast to the selector function
  114343. * or Subject to push source elements into.
  114344. * @param {Function} [selector] - Optional selector function that can use the multicasted source stream
  114345. * as many times as needed, without causing multiple subscriptions to the source stream.
  114346. * Subscribers to the given source will receive all notifications of the source from the
  114347. * time of the subscription forward.
  114348. * @return {Observable} An Observable that emits the results of invoking the selector
  114349. * on the items emitted by a `ConnectableObservable` that shares a single subscription to
  114350. * the underlying stream.
  114351. * @method multicast
  114352. * @owner Observable
  114353. */
  114354. function multicast(subjectOrSubjectFactory, selector) {
  114355. return function multicastOperatorFunction(source) {
  114356. var subjectFactory;
  114357. if (typeof subjectOrSubjectFactory === 'function') {
  114358. subjectFactory = subjectOrSubjectFactory;
  114359. }
  114360. else {
  114361. subjectFactory = function subjectFactory() {
  114362. return subjectOrSubjectFactory;
  114363. };
  114364. }
  114365. if (typeof selector === 'function') {
  114366. return source.lift(new MulticastOperator(subjectFactory, selector));
  114367. }
  114368. var connectable = Object.create(source, ConnectableObservable_1.connectableObservableDescriptor);
  114369. connectable.source = source;
  114370. connectable.subjectFactory = subjectFactory;
  114371. return connectable;
  114372. };
  114373. }
  114374. exports.multicast = multicast;
  114375. var MulticastOperator = (function () {
  114376. function MulticastOperator(subjectFactory, selector) {
  114377. this.subjectFactory = subjectFactory;
  114378. this.selector = selector;
  114379. }
  114380. MulticastOperator.prototype.call = function (subscriber, source) {
  114381. var selector = this.selector;
  114382. var subject = this.subjectFactory();
  114383. var subscription = selector(subject).subscribe(subscriber);
  114384. subscription.add(source.subscribe(subject));
  114385. return subscription;
  114386. };
  114387. return MulticastOperator;
  114388. }());
  114389. exports.MulticastOperator = MulticastOperator;
  114390. //# sourceMappingURL=multicast.js.map
  114391. /***/ }),
  114392. /* 221 */
  114393. /***/ (function(module, exports, __webpack_require__) {
  114394. "use strict";
  114395. var __extends = (this && this.__extends) || function (d, b) {
  114396. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  114397. function __() { this.constructor = d; }
  114398. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  114399. };
  114400. var Subject_1 = __webpack_require__(33);
  114401. var Observable_1 = __webpack_require__(9);
  114402. var Subscriber_1 = __webpack_require__(20);
  114403. var Subscription_1 = __webpack_require__(30);
  114404. var refCount_1 = __webpack_require__(113);
  114405. /**
  114406. * @class ConnectableObservable<T>
  114407. */
  114408. var ConnectableObservable = (function (_super) {
  114409. __extends(ConnectableObservable, _super);
  114410. function ConnectableObservable(/** @deprecated internal use only */ source,
  114411. /** @deprecated internal use only */ subjectFactory) {
  114412. _super.call(this);
  114413. this.source = source;
  114414. this.subjectFactory = subjectFactory;
  114415. /** @deprecated internal use only */ this._refCount = 0;
  114416. this._isComplete = false;
  114417. }
  114418. /** @deprecated internal use only */ ConnectableObservable.prototype._subscribe = function (subscriber) {
  114419. return this.getSubject().subscribe(subscriber);
  114420. };
  114421. /** @deprecated internal use only */ ConnectableObservable.prototype.getSubject = function () {
  114422. var subject = this._subject;
  114423. if (!subject || subject.isStopped) {
  114424. this._subject = this.subjectFactory();
  114425. }
  114426. return this._subject;
  114427. };
  114428. ConnectableObservable.prototype.connect = function () {
  114429. var connection = this._connection;
  114430. if (!connection) {
  114431. this._isComplete = false;
  114432. connection = this._connection = new Subscription_1.Subscription();
  114433. connection.add(this.source
  114434. .subscribe(new ConnectableSubscriber(this.getSubject(), this)));
  114435. if (connection.closed) {
  114436. this._connection = null;
  114437. connection = Subscription_1.Subscription.EMPTY;
  114438. }
  114439. else {
  114440. this._connection = connection;
  114441. }
  114442. }
  114443. return connection;
  114444. };
  114445. ConnectableObservable.prototype.refCount = function () {
  114446. return refCount_1.refCount()(this);
  114447. };
  114448. return ConnectableObservable;
  114449. }(Observable_1.Observable));
  114450. exports.ConnectableObservable = ConnectableObservable;
  114451. var connectableProto = ConnectableObservable.prototype;
  114452. exports.connectableObservableDescriptor = {
  114453. operator: { value: null },
  114454. _refCount: { value: 0, writable: true },
  114455. _subject: { value: null, writable: true },
  114456. _connection: { value: null, writable: true },
  114457. _subscribe: { value: connectableProto._subscribe },
  114458. _isComplete: { value: connectableProto._isComplete, writable: true },
  114459. getSubject: { value: connectableProto.getSubject },
  114460. connect: { value: connectableProto.connect },
  114461. refCount: { value: connectableProto.refCount }
  114462. };
  114463. var ConnectableSubscriber = (function (_super) {
  114464. __extends(ConnectableSubscriber, _super);
  114465. function ConnectableSubscriber(destination, connectable) {
  114466. _super.call(this, destination);
  114467. this.connectable = connectable;
  114468. }
  114469. ConnectableSubscriber.prototype._error = function (err) {
  114470. this._unsubscribe();
  114471. _super.prototype._error.call(this, err);
  114472. };
  114473. ConnectableSubscriber.prototype._complete = function () {
  114474. this.connectable._isComplete = true;
  114475. this._unsubscribe();
  114476. _super.prototype._complete.call(this);
  114477. };
  114478. /** @deprecated internal use only */ ConnectableSubscriber.prototype._unsubscribe = function () {
  114479. var connectable = this.connectable;
  114480. if (connectable) {
  114481. this.connectable = null;
  114482. var connection = connectable._connection;
  114483. connectable._refCount = 0;
  114484. connectable._subject = null;
  114485. connectable._connection = null;
  114486. if (connection) {
  114487. connection.unsubscribe();
  114488. }
  114489. }
  114490. };
  114491. return ConnectableSubscriber;
  114492. }(Subject_1.SubjectSubscriber));
  114493. var RefCountOperator = (function () {
  114494. function RefCountOperator(connectable) {
  114495. this.connectable = connectable;
  114496. }
  114497. RefCountOperator.prototype.call = function (subscriber, source) {
  114498. var connectable = this.connectable;
  114499. connectable._refCount++;
  114500. var refCounter = new RefCountSubscriber(subscriber, connectable);
  114501. var subscription = source.subscribe(refCounter);
  114502. if (!refCounter.closed) {
  114503. refCounter.connection = connectable.connect();
  114504. }
  114505. return subscription;
  114506. };
  114507. return RefCountOperator;
  114508. }());
  114509. var RefCountSubscriber = (function (_super) {
  114510. __extends(RefCountSubscriber, _super);
  114511. function RefCountSubscriber(destination, connectable) {
  114512. _super.call(this, destination);
  114513. this.connectable = connectable;
  114514. }
  114515. /** @deprecated internal use only */ RefCountSubscriber.prototype._unsubscribe = function () {
  114516. var connectable = this.connectable;
  114517. if (!connectable) {
  114518. this.connection = null;
  114519. return;
  114520. }
  114521. this.connectable = null;
  114522. var refCount = connectable._refCount;
  114523. if (refCount <= 0) {
  114524. this.connection = null;
  114525. return;
  114526. }
  114527. connectable._refCount = refCount - 1;
  114528. if (refCount > 1) {
  114529. this.connection = null;
  114530. return;
  114531. }
  114532. ///
  114533. // Compare the local RefCountSubscriber's connection Subscription to the
  114534. // connection Subscription on the shared ConnectableObservable. In cases
  114535. // where the ConnectableObservable source synchronously emits values, and
  114536. // the RefCountSubscriber's downstream Observers synchronously unsubscribe,
  114537. // execution continues to here before the RefCountOperator has a chance to
  114538. // supply the RefCountSubscriber with the shared connection Subscription.
  114539. // For example:
  114540. // ```
  114541. // Observable.range(0, 10)
  114542. // .publish()
  114543. // .refCount()
  114544. // .take(5)
  114545. // .subscribe();
  114546. // ```
  114547. // In order to account for this case, RefCountSubscriber should only dispose
  114548. // the ConnectableObservable's shared connection Subscription if the
  114549. // connection Subscription exists, *and* either:
  114550. // a. RefCountSubscriber doesn't have a reference to the shared connection
  114551. // Subscription yet, or,
  114552. // b. RefCountSubscriber's connection Subscription reference is identical
  114553. // to the shared connection Subscription
  114554. ///
  114555. var connection = this.connection;
  114556. var sharedConnection = connectable._connection;
  114557. this.connection = null;
  114558. if (sharedConnection && (!connection || sharedConnection === connection)) {
  114559. sharedConnection.unsubscribe();
  114560. }
  114561. };
  114562. return RefCountSubscriber;
  114563. }(Subscriber_1.Subscriber));
  114564. //# sourceMappingURL=ConnectableObservable.js.map
  114565. /***/ }),
  114566. /* 222 */
  114567. /***/ (function(module, exports, __webpack_require__) {
  114568. "use strict";
  114569. var __extends = (this && this.__extends) || function (d, b) {
  114570. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  114571. function __() { this.constructor = d; }
  114572. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  114573. };
  114574. /**
  114575. * An error thrown when an action is invalid because the object has been
  114576. * unsubscribed.
  114577. *
  114578. * @see {@link Subject}
  114579. * @see {@link BehaviorSubject}
  114580. *
  114581. * @class ObjectUnsubscribedError
  114582. */
  114583. var ObjectUnsubscribedError = (function (_super) {
  114584. __extends(ObjectUnsubscribedError, _super);
  114585. function ObjectUnsubscribedError() {
  114586. var err = _super.call(this, 'object unsubscribed');
  114587. this.name = err.name = 'ObjectUnsubscribedError';
  114588. this.stack = err.stack;
  114589. this.message = err.message;
  114590. }
  114591. return ObjectUnsubscribedError;
  114592. }(Error));
  114593. exports.ObjectUnsubscribedError = ObjectUnsubscribedError;
  114594. //# sourceMappingURL=ObjectUnsubscribedError.js.map
  114595. /***/ }),
  114596. /* 223 */
  114597. /***/ (function(module, exports, __webpack_require__) {
  114598. "use strict";
  114599. var __extends = (this && this.__extends) || function (d, b) {
  114600. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  114601. function __() { this.constructor = d; }
  114602. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  114603. };
  114604. var Subscription_1 = __webpack_require__(30);
  114605. /**
  114606. * We need this JSDoc comment for affecting ESDoc.
  114607. * @ignore
  114608. * @extends {Ignored}
  114609. */
  114610. var SubjectSubscription = (function (_super) {
  114611. __extends(SubjectSubscription, _super);
  114612. function SubjectSubscription(subject, subscriber) {
  114613. _super.call(this);
  114614. this.subject = subject;
  114615. this.subscriber = subscriber;
  114616. this.closed = false;
  114617. }
  114618. SubjectSubscription.prototype.unsubscribe = function () {
  114619. if (this.closed) {
  114620. return;
  114621. }
  114622. this.closed = true;
  114623. var subject = this.subject;
  114624. var observers = subject.observers;
  114625. this.subject = null;
  114626. if (!observers || observers.length === 0 || subject.isStopped || subject.closed) {
  114627. return;
  114628. }
  114629. var subscriberIndex = observers.indexOf(this.subscriber);
  114630. if (subscriberIndex !== -1) {
  114631. observers.splice(subscriberIndex, 1);
  114632. }
  114633. };
  114634. return SubjectSubscription;
  114635. }(Subscription_1.Subscription));
  114636. exports.SubjectSubscription = SubjectSubscription;
  114637. //# sourceMappingURL=SubjectSubscription.js.map
  114638. /***/ }),
  114639. /* 224 */,
  114640. /* 225 */
  114641. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114642. "use strict";
  114643. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return QueryParams; });
  114644. /**
  114645. * @hidden
  114646. */
  114647. var QueryParams = (function () {
  114648. function QueryParams() {
  114649. this.data = {};
  114650. }
  114651. QueryParams.prototype.parseUrl = function (url) {
  114652. if (url) {
  114653. var startIndex = url.indexOf('?');
  114654. if (startIndex > -1) {
  114655. var queries = url.slice(startIndex + 1).split('&');
  114656. for (var i = 0; i < queries.length; i++) {
  114657. if (queries[i].indexOf('=') > 0) {
  114658. var split = queries[i].split('=');
  114659. if (split.length > 1) {
  114660. this.data[split[0].toLowerCase()] = split[1].split('#')[0];
  114661. }
  114662. }
  114663. }
  114664. }
  114665. }
  114666. };
  114667. QueryParams.prototype.get = function (key) {
  114668. return this.data[key.toLowerCase()];
  114669. };
  114670. return QueryParams;
  114671. }());
  114672. //# sourceMappingURL=query-params.js.map
  114673. /***/ }),
  114674. /* 226 */
  114675. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114676. "use strict";
  114677. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return IOSTransition; });
  114678. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__animations_animation__ = __webpack_require__(11);
  114679. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_util__ = __webpack_require__(2);
  114680. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__page_transition__ = __webpack_require__(32);
  114681. var __extends = (this && this.__extends) || (function () {
  114682. var extendStatics = Object.setPrototypeOf ||
  114683. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  114684. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  114685. return function (d, b) {
  114686. extendStatics(d, b);
  114687. function __() { this.constructor = d; }
  114688. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  114689. };
  114690. })();
  114691. var DURATION = 500;
  114692. var EASING = 'cubic-bezier(0.36,0.66,0.04,1)';
  114693. var OPACITY = 'opacity';
  114694. var TRANSFORM = 'transform';
  114695. var TRANSLATEX = 'translateX';
  114696. var CENTER = '0%';
  114697. var OFF_OPACITY = 0.8;
  114698. var SHOW_BACK_BTN_CSS = 'show-back-button';
  114699. var IOSTransition = (function (_super) {
  114700. __extends(IOSTransition, _super);
  114701. function IOSTransition() {
  114702. return _super !== null && _super.apply(this, arguments) || this;
  114703. }
  114704. IOSTransition.prototype.init = function () {
  114705. _super.prototype.init.call(this);
  114706. var plt = this.plt;
  114707. var OFF_RIGHT = plt.isRTL ? '-99.5%' : '99.5%';
  114708. var OFF_LEFT = plt.isRTL ? '33%' : '-33%';
  114709. var enteringView = this.enteringView;
  114710. var leavingView = this.leavingView;
  114711. var opts = this.opts;
  114712. this.duration(Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["l" /* isPresent */])(opts.duration) ? opts.duration : DURATION);
  114713. this.easing(Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["l" /* isPresent */])(opts.easing) ? opts.easing : EASING);
  114714. var backDirection = (opts.direction === 'back');
  114715. var enteringHasNavbar = (enteringView && enteringView.hasNavbar());
  114716. var leavingHasNavbar = (leavingView && leavingView.hasNavbar());
  114717. if (enteringView) {
  114718. // get the native element for the entering page
  114719. var enteringPageEle = enteringView.pageRef().nativeElement;
  114720. // entering content
  114721. var enteringContent = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](plt, enteringView.contentRef());
  114722. enteringContent.element(enteringPageEle.querySelectorAll('ion-header > *:not(ion-navbar),ion-footer > *'));
  114723. this.add(enteringContent);
  114724. if (backDirection) {
  114725. // entering content, back direction
  114726. enteringContent
  114727. .fromTo(TRANSLATEX, OFF_LEFT, CENTER, true)
  114728. .fromTo(OPACITY, OFF_OPACITY, 1, true);
  114729. }
  114730. else {
  114731. // entering content, forward direction
  114732. enteringContent
  114733. .beforeClearStyles([OPACITY])
  114734. .fromTo(TRANSLATEX, OFF_RIGHT, CENTER, true);
  114735. }
  114736. if (enteringHasNavbar) {
  114737. // entering page has a navbar
  114738. var enteringNavbarEle = enteringPageEle.querySelector('ion-navbar');
  114739. var enteringNavBar = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](plt, enteringNavbarEle);
  114740. this.add(enteringNavBar);
  114741. var enteringTitle = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](plt, enteringNavbarEle.querySelector('ion-title'));
  114742. var enteringNavbarItems = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](plt, enteringNavbarEle.querySelectorAll('ion-buttons,[menuToggle]'));
  114743. var enteringNavbarBg = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](plt, enteringNavbarEle.querySelector('.toolbar-background'));
  114744. var enteringBackButton = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](plt, enteringNavbarEle.querySelector('.back-button'));
  114745. enteringNavBar
  114746. .add(enteringTitle)
  114747. .add(enteringNavbarItems)
  114748. .add(enteringNavbarBg)
  114749. .add(enteringBackButton);
  114750. enteringTitle.fromTo(OPACITY, 0.01, 1, true);
  114751. enteringNavbarItems.fromTo(OPACITY, 0.01, 1, true);
  114752. // set properties depending on direction
  114753. if (backDirection) {
  114754. // entering navbar, back direction
  114755. enteringTitle.fromTo(TRANSLATEX, OFF_LEFT, CENTER, true);
  114756. if (enteringView.enableBack()) {
  114757. // back direction, entering page has a back button
  114758. enteringBackButton
  114759. .beforeAddClass(SHOW_BACK_BTN_CSS)
  114760. .fromTo(OPACITY, 0.01, 1, true);
  114761. }
  114762. }
  114763. else {
  114764. // entering navbar, forward direction
  114765. enteringTitle.fromTo(TRANSLATEX, OFF_RIGHT, CENTER, true);
  114766. enteringNavbarBg
  114767. .beforeClearStyles([OPACITY])
  114768. .fromTo(TRANSLATEX, OFF_RIGHT, CENTER, true);
  114769. if (enteringView.enableBack()) {
  114770. // forward direction, entering page has a back button
  114771. enteringBackButton
  114772. .beforeAddClass(SHOW_BACK_BTN_CSS)
  114773. .fromTo(OPACITY, 0.01, 1, true);
  114774. var enteringBackBtnText = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](plt, enteringNavbarEle.querySelector('.back-button-text'));
  114775. enteringBackBtnText.fromTo(TRANSLATEX, (plt.isRTL ? '-100px' : '100px'), '0px');
  114776. enteringNavBar.add(enteringBackBtnText);
  114777. }
  114778. else {
  114779. enteringBackButton.beforeRemoveClass(SHOW_BACK_BTN_CSS);
  114780. }
  114781. }
  114782. }
  114783. }
  114784. // setup leaving view
  114785. if (leavingView && leavingView.pageRef()) {
  114786. // leaving content
  114787. var leavingPageEle = leavingView.pageRef().nativeElement;
  114788. var leavingContent = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](plt, leavingView.contentRef());
  114789. leavingContent.element(leavingPageEle.querySelectorAll('ion-header > *:not(ion-navbar),ion-footer > *'));
  114790. this.add(leavingContent);
  114791. if (backDirection) {
  114792. // leaving content, back direction
  114793. leavingContent
  114794. .beforeClearStyles([OPACITY])
  114795. .fromTo(TRANSLATEX, CENTER, (plt.isRTL ? '-100%' : '100%'));
  114796. }
  114797. else {
  114798. // leaving content, forward direction
  114799. leavingContent
  114800. .fromTo(TRANSLATEX, CENTER, OFF_LEFT)
  114801. .fromTo(OPACITY, 1, OFF_OPACITY)
  114802. .afterClearStyles([TRANSFORM, OPACITY]);
  114803. }
  114804. if (leavingHasNavbar) {
  114805. // leaving page has a navbar
  114806. var leavingNavbarEle = leavingPageEle.querySelector('ion-navbar');
  114807. var leavingNavBar = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](plt, leavingNavbarEle);
  114808. var leavingTitle = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](plt, leavingNavbarEle.querySelector('ion-title'));
  114809. var leavingNavbarItems = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](plt, leavingNavbarEle.querySelectorAll('ion-buttons,[menuToggle]'));
  114810. var leavingNavbarBg = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](plt, leavingNavbarEle.querySelector('.toolbar-background'));
  114811. var leavingBackButton = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](plt, leavingNavbarEle.querySelector('.back-button'));
  114812. leavingNavBar
  114813. .add(leavingTitle)
  114814. .add(leavingNavbarItems)
  114815. .add(leavingBackButton)
  114816. .add(leavingNavbarBg);
  114817. this.add(leavingNavBar);
  114818. // fade out leaving navbar items
  114819. leavingBackButton.fromTo(OPACITY, 0.99, 0);
  114820. leavingTitle.fromTo(OPACITY, 0.99, 0);
  114821. leavingNavbarItems.fromTo(OPACITY, 0.99, 0);
  114822. if (backDirection) {
  114823. // leaving navbar, back direction
  114824. leavingTitle.fromTo(TRANSLATEX, CENTER, (plt.isRTL ? '-100%' : '100%'));
  114825. // leaving navbar, back direction, and there's no entering navbar
  114826. // should just slide out, no fading out
  114827. leavingNavbarBg
  114828. .beforeClearStyles([OPACITY])
  114829. .fromTo(TRANSLATEX, CENTER, (plt.isRTL ? '-100%' : '100%'));
  114830. var leavingBackBtnText = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](plt, leavingNavbarEle.querySelector('.back-button-text'));
  114831. leavingBackBtnText.fromTo(TRANSLATEX, CENTER, (plt.isRTL ? -300 : 300) + 'px');
  114832. leavingNavBar.add(leavingBackBtnText);
  114833. }
  114834. else {
  114835. // leaving navbar, forward direction
  114836. leavingTitle
  114837. .fromTo(TRANSLATEX, CENTER, OFF_LEFT)
  114838. .afterClearStyles([TRANSFORM]);
  114839. leavingBackButton.afterClearStyles([OPACITY]);
  114840. leavingTitle.afterClearStyles([OPACITY]);
  114841. leavingNavbarItems.afterClearStyles([OPACITY]);
  114842. }
  114843. }
  114844. }
  114845. };
  114846. return IOSTransition;
  114847. }(__WEBPACK_IMPORTED_MODULE_2__page_transition__["a" /* PageTransition */]));
  114848. //# sourceMappingURL=transition-ios.js.map
  114849. /***/ }),
  114850. /* 227 */
  114851. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114852. "use strict";
  114853. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDTransition; });
  114854. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__animations_animation__ = __webpack_require__(11);
  114855. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_util__ = __webpack_require__(2);
  114856. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__page_transition__ = __webpack_require__(32);
  114857. var __extends = (this && this.__extends) || (function () {
  114858. var extendStatics = Object.setPrototypeOf ||
  114859. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  114860. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  114861. return function (d, b) {
  114862. extendStatics(d, b);
  114863. function __() { this.constructor = d; }
  114864. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  114865. };
  114866. })();
  114867. var TRANSLATEY = 'translateY';
  114868. var OFF_BOTTOM = '40px';
  114869. var CENTER = '0px';
  114870. var SHOW_BACK_BTN_CSS = 'show-back-button';
  114871. var MDTransition = (function (_super) {
  114872. __extends(MDTransition, _super);
  114873. function MDTransition() {
  114874. return _super !== null && _super.apply(this, arguments) || this;
  114875. }
  114876. MDTransition.prototype.init = function () {
  114877. _super.prototype.init.call(this);
  114878. var plt = this.plt;
  114879. var enteringView = this.enteringView;
  114880. var leavingView = this.leavingView;
  114881. var opts = this.opts;
  114882. // what direction is the transition going
  114883. var backDirection = (opts.direction === 'back');
  114884. if (enteringView) {
  114885. if (backDirection) {
  114886. this.duration(Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["l" /* isPresent */])(opts.duration) ? opts.duration : 200).easing('cubic-bezier(0.47,0,0.745,0.715)');
  114887. }
  114888. else {
  114889. this.duration(Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["l" /* isPresent */])(opts.duration) ? opts.duration : 280).easing('cubic-bezier(0.36,0.66,0.04,1)');
  114890. this.enteringPage
  114891. .fromTo(TRANSLATEY, OFF_BOTTOM, CENTER, true)
  114892. .fromTo('opacity', 0.01, 1, true);
  114893. }
  114894. if (enteringView.hasNavbar()) {
  114895. var enteringPageEle = enteringView.pageRef().nativeElement;
  114896. var enteringNavbarEle = enteringPageEle.querySelector('ion-navbar');
  114897. var enteringNavBar = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](plt, enteringNavbarEle);
  114898. this.add(enteringNavBar);
  114899. var enteringBackButton = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](plt, enteringNavbarEle.querySelector('.back-button'));
  114900. this.add(enteringBackButton);
  114901. if (enteringView.enableBack()) {
  114902. enteringBackButton.beforeAddClass(SHOW_BACK_BTN_CSS);
  114903. }
  114904. else {
  114905. enteringBackButton.beforeRemoveClass(SHOW_BACK_BTN_CSS);
  114906. }
  114907. }
  114908. }
  114909. // setup leaving view
  114910. if (leavingView && backDirection) {
  114911. // leaving content
  114912. this.duration(opts.duration || 200).easing('cubic-bezier(0.47,0,0.745,0.715)');
  114913. var leavingPage = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](plt, leavingView.pageRef());
  114914. this.add(leavingPage.fromTo(TRANSLATEY, CENTER, OFF_BOTTOM).fromTo('opacity', 1, 0));
  114915. }
  114916. };
  114917. return MDTransition;
  114918. }(__WEBPACK_IMPORTED_MODULE_2__page_transition__["a" /* PageTransition */]));
  114919. //# sourceMappingURL=transition-md.js.map
  114920. /***/ }),
  114921. /* 228 */
  114922. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114923. "use strict";
  114924. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return WPTransition; });
  114925. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__animations_animation__ = __webpack_require__(11);
  114926. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_util__ = __webpack_require__(2);
  114927. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__page_transition__ = __webpack_require__(32);
  114928. var __extends = (this && this.__extends) || (function () {
  114929. var extendStatics = Object.setPrototypeOf ||
  114930. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  114931. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  114932. return function (d, b) {
  114933. extendStatics(d, b);
  114934. function __() { this.constructor = d; }
  114935. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  114936. };
  114937. })();
  114938. var SHOW_BACK_BTN_CSS = 'show-back-button';
  114939. var SCALE_SMALL = .95;
  114940. var WPTransition = (function (_super) {
  114941. __extends(WPTransition, _super);
  114942. function WPTransition() {
  114943. return _super !== null && _super.apply(this, arguments) || this;
  114944. }
  114945. WPTransition.prototype.init = function () {
  114946. _super.prototype.init.call(this);
  114947. var plt = this.plt;
  114948. var enteringView = this.enteringView;
  114949. var leavingView = this.leavingView;
  114950. var opts = this.opts;
  114951. // what direction is the transition going
  114952. var backDirection = (opts.direction === 'back');
  114953. if (enteringView) {
  114954. if (backDirection) {
  114955. this.duration(Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["l" /* isPresent */])(opts.duration) ? opts.duration : 120).easing('cubic-bezier(0.47,0,0.745,0.715)');
  114956. this.enteringPage.beforeClearStyles(['scale']);
  114957. }
  114958. else {
  114959. this.duration(Object(__WEBPACK_IMPORTED_MODULE_1__util_util__["l" /* isPresent */])(opts.duration) ? opts.duration : 280).easing('cubic-bezier(0,0,0.05,1)');
  114960. this.enteringPage
  114961. .fromTo('scale', SCALE_SMALL, 1, true)
  114962. .fromTo('opacity', 0.01, 1, true);
  114963. }
  114964. if (enteringView.hasNavbar()) {
  114965. var enteringPageEle = enteringView.pageRef().nativeElement;
  114966. var enteringNavbarEle = enteringPageEle.querySelector('ion-navbar');
  114967. var enteringNavBar = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](plt, enteringNavbarEle);
  114968. this.add(enteringNavBar);
  114969. var enteringBackButton = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](plt, enteringNavbarEle.querySelector('.back-button'));
  114970. this.add(enteringBackButton);
  114971. if (enteringView.enableBack()) {
  114972. enteringBackButton.beforeAddClass(SHOW_BACK_BTN_CSS);
  114973. }
  114974. else {
  114975. enteringBackButton.beforeRemoveClass(SHOW_BACK_BTN_CSS);
  114976. }
  114977. }
  114978. }
  114979. // setup leaving view
  114980. if (leavingView && backDirection) {
  114981. // leaving content
  114982. this.duration(opts.duration || 200).easing('cubic-bezier(0.47,0,0.745,0.715)');
  114983. var leavingPage = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](plt, leavingView.pageRef());
  114984. this.add(leavingPage.fromTo('scale', 1, SCALE_SMALL).fromTo('opacity', 0.99, 0));
  114985. }
  114986. };
  114987. return WPTransition;
  114988. }(__WEBPACK_IMPORTED_MODULE_2__page_transition__["a" /* PageTransition */]));
  114989. //# sourceMappingURL=transition-wp.js.map
  114990. /***/ }),
  114991. /* 229 */
  114992. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114993. "use strict";
  114994. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SwipeBackGesture; });
  114995. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_util__ = __webpack_require__(2);
  114996. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__gestures_gesture_controller__ = __webpack_require__(7);
  114997. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__gestures_slide_edge_gesture__ = __webpack_require__(56);
  114998. var __extends = (this && this.__extends) || (function () {
  114999. var extendStatics = Object.setPrototypeOf ||
  115000. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  115001. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  115002. return function (d, b) {
  115003. extendStatics(d, b);
  115004. function __() { this.constructor = d; }
  115005. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  115006. };
  115007. })();
  115008. /**
  115009. * @hidden
  115010. */
  115011. var SwipeBackGesture = (function (_super) {
  115012. __extends(SwipeBackGesture, _super);
  115013. function SwipeBackGesture(plt, _nav, gestureCtlr, domCtrl) {
  115014. var _this = _super.call(this, plt, plt.doc().body, {
  115015. direction: 'x',
  115016. edge: 'start',
  115017. maxEdgeStart: 75,
  115018. threshold: 5,
  115019. zone: false,
  115020. domController: domCtrl,
  115021. gesture: gestureCtlr.createGesture({
  115022. name: __WEBPACK_IMPORTED_MODULE_1__gestures_gesture_controller__["b" /* GESTURE_GO_BACK_SWIPE */],
  115023. priority: __WEBPACK_IMPORTED_MODULE_1__gestures_gesture_controller__["e" /* GESTURE_PRIORITY_GO_BACK_SWIPE */],
  115024. disableScroll: true
  115025. })
  115026. }) || this;
  115027. _this._nav = _nav;
  115028. return _this;
  115029. }
  115030. SwipeBackGesture.prototype.canStart = function (ev) {
  115031. // the gesture swipe angle must be mainly horizontal and the
  115032. // gesture distance would be relatively short for a swipe back
  115033. // and swipe back must be possible on this nav controller
  115034. return (this._nav.canSwipeBack() &&
  115035. _super.prototype.canStart.call(this, ev));
  115036. };
  115037. SwipeBackGesture.prototype.onSlideBeforeStart = function (_ev) {
  115038. this._nav.swipeBackStart();
  115039. };
  115040. SwipeBackGesture.prototype.onSlide = function (slide, ev) {
  115041. ev.preventDefault();
  115042. ev.stopPropagation();
  115043. var stepValue = (slide.distance / slide.max);
  115044. this._nav.swipeBackProgress(stepValue);
  115045. };
  115046. SwipeBackGesture.prototype.onSlideEnd = function (slide, _ev) {
  115047. var velocity = slide.velocity;
  115048. var currentStepValue = (slide.distance / slide.max);
  115049. var isResetDirecction = velocity < 0;
  115050. var isMovingFast = Math.abs(slide.velocity) > 0.4;
  115051. var isInResetZone = Math.abs(slide.delta) < Math.abs(slide.max) * 0.5;
  115052. var shouldComplete = !Object(__WEBPACK_IMPORTED_MODULE_0__util_util__["t" /* swipeShouldReset */])(isResetDirecction, isMovingFast, isInResetZone);
  115053. this._nav.swipeBackEnd(shouldComplete, currentStepValue, velocity);
  115054. };
  115055. return SwipeBackGesture;
  115056. }(__WEBPACK_IMPORTED_MODULE_2__gestures_slide_edge_gesture__["a" /* SlideEdgeGesture */]));
  115057. //# sourceMappingURL=swipe-back.js.map
  115058. /***/ }),
  115059. /* 230 */
  115060. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115061. "use strict";
  115062. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PanRecognizer; });
  115063. var PanRecognizer = (function () {
  115064. function PanRecognizer(direction, threshold, maxAngle) {
  115065. this.direction = direction;
  115066. this.dirty = false;
  115067. this._angle = 0;
  115068. this._isPan = 0;
  115069. var radians = maxAngle * (Math.PI / 180);
  115070. this.maxCosine = Math.cos(radians);
  115071. this.threshold = threshold * threshold;
  115072. }
  115073. PanRecognizer.prototype.start = function (coord) {
  115074. this.startCoord = coord;
  115075. this._angle = 0;
  115076. this._isPan = 0;
  115077. this.dirty = true;
  115078. };
  115079. PanRecognizer.prototype.detect = function (coord) {
  115080. if (!this.dirty) {
  115081. return false;
  115082. }
  115083. var deltaX = (coord.x - this.startCoord.x);
  115084. var deltaY = (coord.y - this.startCoord.y);
  115085. var distance = deltaX * deltaX + deltaY * deltaY;
  115086. if (distance >= this.threshold) {
  115087. var angle = Math.atan2(deltaY, deltaX);
  115088. var cosine = (this.direction === 'y')
  115089. ? Math.sin(angle)
  115090. : Math.cos(angle);
  115091. this._angle = angle;
  115092. if (cosine > this.maxCosine) {
  115093. this._isPan = 1;
  115094. }
  115095. else if (cosine < -this.maxCosine) {
  115096. this._isPan = -1;
  115097. }
  115098. else {
  115099. this._isPan = 0;
  115100. }
  115101. this.dirty = false;
  115102. return true;
  115103. }
  115104. return false;
  115105. };
  115106. PanRecognizer.prototype.angle = function () {
  115107. return this._angle;
  115108. };
  115109. PanRecognizer.prototype.pan = function () {
  115110. return this._isPan;
  115111. };
  115112. return PanRecognizer;
  115113. }());
  115114. //# sourceMappingURL=recognizers.js.map
  115115. /***/ }),
  115116. /* 231 */
  115117. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115118. "use strict";
  115119. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return ActionSheetSlideIn; });
  115120. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return ActionSheetSlideOut; });
  115121. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ActionSheetMdSlideIn; });
  115122. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return ActionSheetMdSlideOut; });
  115123. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return ActionSheetWpSlideIn; });
  115124. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return ActionSheetWpSlideOut; });
  115125. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__animations_animation__ = __webpack_require__(11);
  115126. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__transitions_transition__ = __webpack_require__(27);
  115127. var __extends = (this && this.__extends) || (function () {
  115128. var extendStatics = Object.setPrototypeOf ||
  115129. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  115130. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  115131. return function (d, b) {
  115132. extendStatics(d, b);
  115133. function __() { this.constructor = d; }
  115134. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  115135. };
  115136. })();
  115137. var ActionSheetSlideIn = (function (_super) {
  115138. __extends(ActionSheetSlideIn, _super);
  115139. function ActionSheetSlideIn() {
  115140. return _super !== null && _super.apply(this, arguments) || this;
  115141. }
  115142. ActionSheetSlideIn.prototype.init = function () {
  115143. var ele = this.enteringView.pageRef().nativeElement;
  115144. var backdrop = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('ion-backdrop'));
  115145. var wrapper = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('.action-sheet-wrapper'));
  115146. backdrop.fromTo('opacity', 0.01, 0.4);
  115147. wrapper.fromTo('translateY', '100%', '0%');
  115148. this.easing('cubic-bezier(.36,.66,.04,1)').duration(400).add(backdrop).add(wrapper);
  115149. };
  115150. return ActionSheetSlideIn;
  115151. }(__WEBPACK_IMPORTED_MODULE_1__transitions_transition__["a" /* Transition */]));
  115152. var ActionSheetSlideOut = (function (_super) {
  115153. __extends(ActionSheetSlideOut, _super);
  115154. function ActionSheetSlideOut() {
  115155. return _super !== null && _super.apply(this, arguments) || this;
  115156. }
  115157. ActionSheetSlideOut.prototype.init = function () {
  115158. var ele = this.leavingView.pageRef().nativeElement;
  115159. var backdrop = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('ion-backdrop'));
  115160. var wrapper = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('.action-sheet-wrapper'));
  115161. backdrop.fromTo('opacity', 0.4, 0);
  115162. wrapper.fromTo('translateY', '0%', '100%');
  115163. this.easing('cubic-bezier(.36,.66,.04,1)').duration(300).add(backdrop).add(wrapper);
  115164. };
  115165. return ActionSheetSlideOut;
  115166. }(__WEBPACK_IMPORTED_MODULE_1__transitions_transition__["a" /* Transition */]));
  115167. var ActionSheetMdSlideIn = (function (_super) {
  115168. __extends(ActionSheetMdSlideIn, _super);
  115169. function ActionSheetMdSlideIn() {
  115170. return _super !== null && _super.apply(this, arguments) || this;
  115171. }
  115172. ActionSheetMdSlideIn.prototype.init = function () {
  115173. var ele = this.enteringView.pageRef().nativeElement;
  115174. var backdrop = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('ion-backdrop'));
  115175. var wrapper = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('.action-sheet-wrapper'));
  115176. backdrop.fromTo('opacity', 0.01, 0.26);
  115177. wrapper.fromTo('translateY', '100%', '0%');
  115178. this.easing('cubic-bezier(.36,.66,.04,1)').duration(400).add(backdrop).add(wrapper);
  115179. };
  115180. return ActionSheetMdSlideIn;
  115181. }(__WEBPACK_IMPORTED_MODULE_1__transitions_transition__["a" /* Transition */]));
  115182. var ActionSheetMdSlideOut = (function (_super) {
  115183. __extends(ActionSheetMdSlideOut, _super);
  115184. function ActionSheetMdSlideOut() {
  115185. return _super !== null && _super.apply(this, arguments) || this;
  115186. }
  115187. ActionSheetMdSlideOut.prototype.init = function () {
  115188. var ele = this.leavingView.pageRef().nativeElement;
  115189. var backdrop = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('ion-backdrop'));
  115190. var wrapper = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('.action-sheet-wrapper'));
  115191. backdrop.fromTo('opacity', 0.26, 0);
  115192. wrapper.fromTo('translateY', '0%', '100%');
  115193. this.easing('cubic-bezier(.36,.66,.04,1)').duration(450).add(backdrop).add(wrapper);
  115194. };
  115195. return ActionSheetMdSlideOut;
  115196. }(__WEBPACK_IMPORTED_MODULE_1__transitions_transition__["a" /* Transition */]));
  115197. var ActionSheetWpSlideIn = (function (_super) {
  115198. __extends(ActionSheetWpSlideIn, _super);
  115199. function ActionSheetWpSlideIn() {
  115200. return _super !== null && _super.apply(this, arguments) || this;
  115201. }
  115202. ActionSheetWpSlideIn.prototype.init = function () {
  115203. var ele = this.enteringView.pageRef().nativeElement;
  115204. var backdrop = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('ion-backdrop'));
  115205. var wrapper = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('.action-sheet-wrapper'));
  115206. backdrop.fromTo('opacity', 0.01, 0.16);
  115207. wrapper.fromTo('translateY', '100%', '0%');
  115208. this.easing('cubic-bezier(.36,.66,.04,1)').duration(400).add(backdrop).add(wrapper);
  115209. };
  115210. return ActionSheetWpSlideIn;
  115211. }(__WEBPACK_IMPORTED_MODULE_1__transitions_transition__["a" /* Transition */]));
  115212. var ActionSheetWpSlideOut = (function (_super) {
  115213. __extends(ActionSheetWpSlideOut, _super);
  115214. function ActionSheetWpSlideOut() {
  115215. return _super !== null && _super.apply(this, arguments) || this;
  115216. }
  115217. ActionSheetWpSlideOut.prototype.init = function () {
  115218. var ele = this.leavingView.pageRef().nativeElement;
  115219. var backdrop = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('ion-backdrop'));
  115220. var wrapper = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('.action-sheet-wrapper'));
  115221. backdrop.fromTo('opacity', 0.1, 0);
  115222. wrapper.fromTo('translateY', '0%', '100%');
  115223. this.easing('cubic-bezier(.36,.66,.04,1)').duration(450).add(backdrop).add(wrapper);
  115224. };
  115225. return ActionSheetWpSlideOut;
  115226. }(__WEBPACK_IMPORTED_MODULE_1__transitions_transition__["a" /* Transition */]));
  115227. //# sourceMappingURL=action-sheet-transitions.js.map
  115228. /***/ }),
  115229. /* 232 */
  115230. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115231. "use strict";
  115232. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return AlertPopIn; });
  115233. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return AlertPopOut; });
  115234. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AlertMdPopIn; });
  115235. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return AlertMdPopOut; });
  115236. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return AlertWpPopIn; });
  115237. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return AlertWpPopOut; });
  115238. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__animations_animation__ = __webpack_require__(11);
  115239. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__transitions_transition__ = __webpack_require__(27);
  115240. var __extends = (this && this.__extends) || (function () {
  115241. var extendStatics = Object.setPrototypeOf ||
  115242. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  115243. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  115244. return function (d, b) {
  115245. extendStatics(d, b);
  115246. function __() { this.constructor = d; }
  115247. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  115248. };
  115249. })();
  115250. /**
  115251. * Animations for alerts
  115252. */
  115253. var AlertPopIn = (function (_super) {
  115254. __extends(AlertPopIn, _super);
  115255. function AlertPopIn() {
  115256. return _super !== null && _super.apply(this, arguments) || this;
  115257. }
  115258. AlertPopIn.prototype.init = function () {
  115259. var ele = this.enteringView.pageRef().nativeElement;
  115260. var backdrop = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('ion-backdrop'));
  115261. var wrapper = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('.alert-wrapper'));
  115262. wrapper.fromTo('opacity', 0.01, 1).fromTo('scale', 1.1, 1);
  115263. backdrop.fromTo('opacity', 0.01, 0.3);
  115264. this
  115265. .easing('ease-in-out')
  115266. .duration(200)
  115267. .add(backdrop)
  115268. .add(wrapper);
  115269. };
  115270. return AlertPopIn;
  115271. }(__WEBPACK_IMPORTED_MODULE_1__transitions_transition__["a" /* Transition */]));
  115272. var AlertPopOut = (function (_super) {
  115273. __extends(AlertPopOut, _super);
  115274. function AlertPopOut() {
  115275. return _super !== null && _super.apply(this, arguments) || this;
  115276. }
  115277. AlertPopOut.prototype.init = function () {
  115278. var ele = this.leavingView.pageRef().nativeElement;
  115279. var backdrop = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('ion-backdrop'));
  115280. var wrapper = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('.alert-wrapper'));
  115281. wrapper.fromTo('opacity', 0.99, 0).fromTo('scale', 1, 0.9);
  115282. backdrop.fromTo('opacity', 0.3, 0);
  115283. this
  115284. .easing('ease-in-out')
  115285. .duration(200)
  115286. .add(backdrop)
  115287. .add(wrapper);
  115288. };
  115289. return AlertPopOut;
  115290. }(__WEBPACK_IMPORTED_MODULE_1__transitions_transition__["a" /* Transition */]));
  115291. var AlertMdPopIn = (function (_super) {
  115292. __extends(AlertMdPopIn, _super);
  115293. function AlertMdPopIn() {
  115294. return _super !== null && _super.apply(this, arguments) || this;
  115295. }
  115296. AlertMdPopIn.prototype.init = function () {
  115297. var ele = this.enteringView.pageRef().nativeElement;
  115298. var backdrop = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('ion-backdrop'));
  115299. var wrapper = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('.alert-wrapper'));
  115300. wrapper.fromTo('opacity', 0.01, 1).fromTo('scale', 1.1, 1);
  115301. backdrop.fromTo('opacity', 0.01, 0.5);
  115302. this
  115303. .easing('ease-in-out')
  115304. .duration(200)
  115305. .add(backdrop)
  115306. .add(wrapper);
  115307. };
  115308. return AlertMdPopIn;
  115309. }(__WEBPACK_IMPORTED_MODULE_1__transitions_transition__["a" /* Transition */]));
  115310. var AlertMdPopOut = (function (_super) {
  115311. __extends(AlertMdPopOut, _super);
  115312. function AlertMdPopOut() {
  115313. return _super !== null && _super.apply(this, arguments) || this;
  115314. }
  115315. AlertMdPopOut.prototype.init = function () {
  115316. var ele = this.leavingView.pageRef().nativeElement;
  115317. var backdrop = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('ion-backdrop'));
  115318. var wrapper = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('.alert-wrapper'));
  115319. wrapper.fromTo('opacity', 0.99, 0).fromTo('scale', 1, 0.9);
  115320. backdrop.fromTo('opacity', 0.5, 0);
  115321. this
  115322. .easing('ease-in-out')
  115323. .duration(200)
  115324. .add(backdrop)
  115325. .add(wrapper);
  115326. };
  115327. return AlertMdPopOut;
  115328. }(__WEBPACK_IMPORTED_MODULE_1__transitions_transition__["a" /* Transition */]));
  115329. var AlertWpPopIn = (function (_super) {
  115330. __extends(AlertWpPopIn, _super);
  115331. function AlertWpPopIn() {
  115332. return _super !== null && _super.apply(this, arguments) || this;
  115333. }
  115334. AlertWpPopIn.prototype.init = function () {
  115335. var ele = this.enteringView.pageRef().nativeElement;
  115336. var backdrop = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('ion-backdrop'));
  115337. var wrapper = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('.alert-wrapper'));
  115338. wrapper.fromTo('opacity', 0.01, 1).fromTo('scale', 1.3, 1);
  115339. backdrop.fromTo('opacity', 0.01, 0.5);
  115340. this
  115341. .easing('cubic-bezier(0,0,0.05,1)')
  115342. .duration(200)
  115343. .add(backdrop)
  115344. .add(wrapper);
  115345. };
  115346. return AlertWpPopIn;
  115347. }(__WEBPACK_IMPORTED_MODULE_1__transitions_transition__["a" /* Transition */]));
  115348. var AlertWpPopOut = (function (_super) {
  115349. __extends(AlertWpPopOut, _super);
  115350. function AlertWpPopOut() {
  115351. return _super !== null && _super.apply(this, arguments) || this;
  115352. }
  115353. AlertWpPopOut.prototype.init = function () {
  115354. var ele = this.leavingView.pageRef().nativeElement;
  115355. var backdrop = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('ion-backdrop'));
  115356. var wrapper = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('.alert-wrapper'));
  115357. wrapper.fromTo('opacity', 0.99, 0).fromTo('scale', 1, 1.3);
  115358. backdrop.fromTo('opacity', 0.5, 0);
  115359. this
  115360. .easing('ease-out')
  115361. .duration(150)
  115362. .add(backdrop)
  115363. .add(wrapper);
  115364. };
  115365. return AlertWpPopOut;
  115366. }(__WEBPACK_IMPORTED_MODULE_1__transitions_transition__["a" /* Transition */]));
  115367. //# sourceMappingURL=alert-transitions.js.map
  115368. /***/ }),
  115369. /* 233 */
  115370. /***/ (function(module, exports, __webpack_require__) {
  115371. "use strict";
  115372. var ForkJoinObservable_1 = __webpack_require__(234);
  115373. exports.forkJoin = ForkJoinObservable_1.ForkJoinObservable.create;
  115374. //# sourceMappingURL=forkJoin.js.map
  115375. /***/ }),
  115376. /* 234 */
  115377. /***/ (function(module, exports, __webpack_require__) {
  115378. "use strict";
  115379. var __extends = (this && this.__extends) || function (d, b) {
  115380. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  115381. function __() { this.constructor = d; }
  115382. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  115383. };
  115384. var Observable_1 = __webpack_require__(9);
  115385. var EmptyObservable_1 = __webpack_require__(110);
  115386. var isArray_1 = __webpack_require__(104);
  115387. var subscribeToResult_1 = __webpack_require__(53);
  115388. var OuterSubscriber_1 = __webpack_require__(54);
  115389. /**
  115390. * We need this JSDoc comment for affecting ESDoc.
  115391. * @extends {Ignored}
  115392. * @hide true
  115393. */
  115394. var ForkJoinObservable = (function (_super) {
  115395. __extends(ForkJoinObservable, _super);
  115396. function ForkJoinObservable(sources, resultSelector) {
  115397. _super.call(this);
  115398. this.sources = sources;
  115399. this.resultSelector = resultSelector;
  115400. }
  115401. /* tslint:enable:max-line-length */
  115402. /**
  115403. * Joins last values emitted by passed Observables.
  115404. *
  115405. * <span class="informal">Wait for Observables to complete and then combine last values they emitted.</span>
  115406. *
  115407. * <img src="./img/forkJoin.png" width="100%">
  115408. *
  115409. * `forkJoin` is an operator that takes any number of Observables which can be passed either as an array
  115410. * or directly as arguments. If no input Observables are provided, resulting stream will complete
  115411. * immediately.
  115412. *
  115413. * `forkJoin` will wait for all passed Observables to complete and then it will emit an array with last
  115414. * values from corresponding Observables. So if you pass `n` Observables to the operator, resulting
  115415. * array will have `n` values, where first value is the last thing emitted by the first Observable,
  115416. * second value is the last thing emitted by the second Observable and so on. That means `forkJoin` will
  115417. * not emit more than once and it will complete after that. If you need to emit combined values not only
  115418. * at the end of lifecycle of passed Observables, but also throughout it, try out {@link combineLatest}
  115419. * or {@link zip} instead.
  115420. *
  115421. * In order for resulting array to have the same length as the number of input Observables, whenever any of
  115422. * that Observables completes without emitting any value, `forkJoin` will complete at that moment as well
  115423. * and it will not emit anything either, even if it already has some last values from other Observables.
  115424. * Conversely, if there is an Observable that never completes, `forkJoin` will never complete as well,
  115425. * unless at any point some other Observable completes without emitting value, which brings us back to
  115426. * the previous case. Overall, in order for `forkJoin` to emit a value, all Observables passed as arguments
  115427. * have to emit something at least once and complete.
  115428. *
  115429. * If any input Observable errors at some point, `forkJoin` will error as well and all other Observables
  115430. * will be immediately unsubscribed.
  115431. *
  115432. * Optionally `forkJoin` accepts project function, that will be called with values which normally
  115433. * would land in emitted array. Whatever is returned by project function, will appear in output
  115434. * Observable instead. This means that default project can be thought of as a function that takes
  115435. * all its arguments and puts them into an array. Note that project function will be called only
  115436. * when output Observable is supposed to emit a result.
  115437. *
  115438. * @example <caption>Use forkJoin with operator emitting immediately</caption>
  115439. * const observable = Rx.Observable.forkJoin(
  115440. * Rx.Observable.of(1, 2, 3, 4),
  115441. * Rx.Observable.of(5, 6, 7, 8)
  115442. * );
  115443. * observable.subscribe(
  115444. * value => console.log(value),
  115445. * err => {},
  115446. * () => console.log('This is how it ends!')
  115447. * );
  115448. *
  115449. * // Logs:
  115450. * // [4, 8]
  115451. * // "This is how it ends!"
  115452. *
  115453. *
  115454. * @example <caption>Use forkJoin with operator emitting after some time</caption>
  115455. * const observable = Rx.Observable.forkJoin(
  115456. * Rx.Observable.interval(1000).take(3), // emit 0, 1, 2 every second and complete
  115457. * Rx.Observable.interval(500).take(4) // emit 0, 1, 2, 3 every half a second and complete
  115458. * );
  115459. * observable.subscribe(
  115460. * value => console.log(value),
  115461. * err => {},
  115462. * () => console.log('This is how it ends!')
  115463. * );
  115464. *
  115465. * // Logs:
  115466. * // [2, 3] after 3 seconds
  115467. * // "This is how it ends!" immediately after
  115468. *
  115469. *
  115470. * @example <caption>Use forkJoin with project function</caption>
  115471. * const observable = Rx.Observable.forkJoin(
  115472. * Rx.Observable.interval(1000).take(3), // emit 0, 1, 2 every second and complete
  115473. * Rx.Observable.interval(500).take(4), // emit 0, 1, 2, 3 every half a second and complete
  115474. * (n, m) => n + m
  115475. * );
  115476. * observable.subscribe(
  115477. * value => console.log(value),
  115478. * err => {},
  115479. * () => console.log('This is how it ends!')
  115480. * );
  115481. *
  115482. * // Logs:
  115483. * // 5 after 3 seconds
  115484. * // "This is how it ends!" immediately after
  115485. *
  115486. * @see {@link combineLatest}
  115487. * @see {@link zip}
  115488. *
  115489. * @param {...SubscribableOrPromise} sources Any number of Observables provided either as an array or as an arguments
  115490. * passed directly to the operator.
  115491. * @param {function} [project] Function that takes values emitted by input Observables and returns value
  115492. * that will appear in resulting Observable instead of default array.
  115493. * @return {Observable} Observable emitting either an array of last values emitted by passed Observables
  115494. * or value from project function.
  115495. * @static true
  115496. * @name forkJoin
  115497. * @owner Observable
  115498. */
  115499. ForkJoinObservable.create = function () {
  115500. var sources = [];
  115501. for (var _i = 0; _i < arguments.length; _i++) {
  115502. sources[_i - 0] = arguments[_i];
  115503. }
  115504. if (sources === null || arguments.length === 0) {
  115505. return new EmptyObservable_1.EmptyObservable();
  115506. }
  115507. var resultSelector = null;
  115508. if (typeof sources[sources.length - 1] === 'function') {
  115509. resultSelector = sources.pop();
  115510. }
  115511. // if the first and only other argument besides the resultSelector is an array
  115512. // assume it's been called with `forkJoin([obs1, obs2, obs3], resultSelector)`
  115513. if (sources.length === 1 && isArray_1.isArray(sources[0])) {
  115514. sources = sources[0];
  115515. }
  115516. if (sources.length === 0) {
  115517. return new EmptyObservable_1.EmptyObservable();
  115518. }
  115519. return new ForkJoinObservable(sources, resultSelector);
  115520. };
  115521. /** @deprecated internal use only */ ForkJoinObservable.prototype._subscribe = function (subscriber) {
  115522. return new ForkJoinSubscriber(subscriber, this.sources, this.resultSelector);
  115523. };
  115524. return ForkJoinObservable;
  115525. }(Observable_1.Observable));
  115526. exports.ForkJoinObservable = ForkJoinObservable;
  115527. /**
  115528. * We need this JSDoc comment for affecting ESDoc.
  115529. * @ignore
  115530. * @extends {Ignored}
  115531. */
  115532. var ForkJoinSubscriber = (function (_super) {
  115533. __extends(ForkJoinSubscriber, _super);
  115534. function ForkJoinSubscriber(destination, sources, resultSelector) {
  115535. _super.call(this, destination);
  115536. this.sources = sources;
  115537. this.resultSelector = resultSelector;
  115538. this.completed = 0;
  115539. this.haveValues = 0;
  115540. var len = sources.length;
  115541. this.total = len;
  115542. this.values = new Array(len);
  115543. for (var i = 0; i < len; i++) {
  115544. var source = sources[i];
  115545. var innerSubscription = subscribeToResult_1.subscribeToResult(this, source, null, i);
  115546. if (innerSubscription) {
  115547. innerSubscription.outerIndex = i;
  115548. this.add(innerSubscription);
  115549. }
  115550. }
  115551. }
  115552. ForkJoinSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  115553. this.values[outerIndex] = innerValue;
  115554. if (!innerSub._hasValue) {
  115555. innerSub._hasValue = true;
  115556. this.haveValues++;
  115557. }
  115558. };
  115559. ForkJoinSubscriber.prototype.notifyComplete = function (innerSub) {
  115560. var destination = this.destination;
  115561. var _a = this, haveValues = _a.haveValues, resultSelector = _a.resultSelector, values = _a.values;
  115562. var len = values.length;
  115563. if (!innerSub._hasValue) {
  115564. destination.complete();
  115565. return;
  115566. }
  115567. this.completed++;
  115568. if (this.completed !== len) {
  115569. return;
  115570. }
  115571. if (haveValues === len) {
  115572. var value = resultSelector ? resultSelector.apply(this, values) : values;
  115573. destination.next(value);
  115574. }
  115575. destination.complete();
  115576. };
  115577. return ForkJoinSubscriber;
  115578. }(OuterSubscriber_1.OuterSubscriber));
  115579. //# sourceMappingURL=ForkJoinObservable.js.map
  115580. /***/ }),
  115581. /* 235 */
  115582. /***/ (function(module, exports, __webpack_require__) {
  115583. "use strict";
  115584. var PromiseObservable_1 = __webpack_require__(236);
  115585. exports.fromPromise = PromiseObservable_1.PromiseObservable.create;
  115586. //# sourceMappingURL=fromPromise.js.map
  115587. /***/ }),
  115588. /* 236 */
  115589. /***/ (function(module, exports, __webpack_require__) {
  115590. "use strict";
  115591. var __extends = (this && this.__extends) || function (d, b) {
  115592. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  115593. function __() { this.constructor = d; }
  115594. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  115595. };
  115596. var root_1 = __webpack_require__(29);
  115597. var Observable_1 = __webpack_require__(9);
  115598. /**
  115599. * We need this JSDoc comment for affecting ESDoc.
  115600. * @extends {Ignored}
  115601. * @hide true
  115602. */
  115603. var PromiseObservable = (function (_super) {
  115604. __extends(PromiseObservable, _super);
  115605. function PromiseObservable(promise, scheduler) {
  115606. _super.call(this);
  115607. this.promise = promise;
  115608. this.scheduler = scheduler;
  115609. }
  115610. /**
  115611. * Converts a Promise to an Observable.
  115612. *
  115613. * <span class="informal">Returns an Observable that just emits the Promise's
  115614. * resolved value, then completes.</span>
  115615. *
  115616. * Converts an ES2015 Promise or a Promises/A+ spec compliant Promise to an
  115617. * Observable. If the Promise resolves with a value, the output Observable
  115618. * emits that resolved value as a `next`, and then completes. If the Promise
  115619. * is rejected, then the output Observable emits the corresponding Error.
  115620. *
  115621. * @example <caption>Convert the Promise returned by Fetch to an Observable</caption>
  115622. * var result = Rx.Observable.fromPromise(fetch('http://myserver.com/'));
  115623. * result.subscribe(x => console.log(x), e => console.error(e));
  115624. *
  115625. * @see {@link bindCallback}
  115626. * @see {@link from}
  115627. *
  115628. * @param {PromiseLike<T>} promise The promise to be converted.
  115629. * @param {Scheduler} [scheduler] An optional IScheduler to use for scheduling
  115630. * the delivery of the resolved value (or the rejection).
  115631. * @return {Observable<T>} An Observable which wraps the Promise.
  115632. * @static true
  115633. * @name fromPromise
  115634. * @owner Observable
  115635. */
  115636. PromiseObservable.create = function (promise, scheduler) {
  115637. return new PromiseObservable(promise, scheduler);
  115638. };
  115639. /** @deprecated internal use only */ PromiseObservable.prototype._subscribe = function (subscriber) {
  115640. var _this = this;
  115641. var promise = this.promise;
  115642. var scheduler = this.scheduler;
  115643. if (scheduler == null) {
  115644. if (this._isScalar) {
  115645. if (!subscriber.closed) {
  115646. subscriber.next(this.value);
  115647. subscriber.complete();
  115648. }
  115649. }
  115650. else {
  115651. promise.then(function (value) {
  115652. _this.value = value;
  115653. _this._isScalar = true;
  115654. if (!subscriber.closed) {
  115655. subscriber.next(value);
  115656. subscriber.complete();
  115657. }
  115658. }, function (err) {
  115659. if (!subscriber.closed) {
  115660. subscriber.error(err);
  115661. }
  115662. })
  115663. .then(null, function (err) {
  115664. // escape the promise trap, throw unhandled errors
  115665. root_1.root.setTimeout(function () { throw err; });
  115666. });
  115667. }
  115668. }
  115669. else {
  115670. if (this._isScalar) {
  115671. if (!subscriber.closed) {
  115672. return scheduler.schedule(dispatchNext, 0, { value: this.value, subscriber: subscriber });
  115673. }
  115674. }
  115675. else {
  115676. promise.then(function (value) {
  115677. _this.value = value;
  115678. _this._isScalar = true;
  115679. if (!subscriber.closed) {
  115680. subscriber.add(scheduler.schedule(dispatchNext, 0, { value: value, subscriber: subscriber }));
  115681. }
  115682. }, function (err) {
  115683. if (!subscriber.closed) {
  115684. subscriber.add(scheduler.schedule(dispatchError, 0, { err: err, subscriber: subscriber }));
  115685. }
  115686. })
  115687. .then(null, function (err) {
  115688. // escape the promise trap, throw unhandled errors
  115689. root_1.root.setTimeout(function () { throw err; });
  115690. });
  115691. }
  115692. }
  115693. };
  115694. return PromiseObservable;
  115695. }(Observable_1.Observable));
  115696. exports.PromiseObservable = PromiseObservable;
  115697. function dispatchNext(arg) {
  115698. var value = arg.value, subscriber = arg.subscriber;
  115699. if (!subscriber.closed) {
  115700. subscriber.next(value);
  115701. subscriber.complete();
  115702. }
  115703. }
  115704. function dispatchError(arg) {
  115705. var err = arg.err, subscriber = arg.subscriber;
  115706. if (!subscriber.closed) {
  115707. subscriber.error(err);
  115708. }
  115709. }
  115710. //# sourceMappingURL=PromiseObservable.js.map
  115711. /***/ }),
  115712. /* 237 */
  115713. /***/ (function(module, exports, __webpack_require__) {
  115714. "use strict";
  115715. var __extends = (this && this.__extends) || function (d, b) {
  115716. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  115717. function __() { this.constructor = d; }
  115718. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  115719. };
  115720. var Subscriber_1 = __webpack_require__(20);
  115721. /**
  115722. * Applies a given `project` function to each value emitted by the source
  115723. * Observable, and emits the resulting values as an Observable.
  115724. *
  115725. * <span class="informal">Like [Array.prototype.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map),
  115726. * it passes each source value through a transformation function to get
  115727. * corresponding output values.</span>
  115728. *
  115729. * <img src="./img/map.png" width="100%">
  115730. *
  115731. * Similar to the well known `Array.prototype.map` function, this operator
  115732. * applies a projection to each value and emits that projection in the output
  115733. * Observable.
  115734. *
  115735. * @example <caption>Map every click to the clientX position of that click</caption>
  115736. * var clicks = Rx.Observable.fromEvent(document, 'click');
  115737. * var positions = clicks.map(ev => ev.clientX);
  115738. * positions.subscribe(x => console.log(x));
  115739. *
  115740. * @see {@link mapTo}
  115741. * @see {@link pluck}
  115742. *
  115743. * @param {function(value: T, index: number): R} project The function to apply
  115744. * to each `value` emitted by the source Observable. The `index` parameter is
  115745. * the number `i` for the i-th emission that has happened since the
  115746. * subscription, starting from the number `0`.
  115747. * @param {any} [thisArg] An optional argument to define what `this` is in the
  115748. * `project` function.
  115749. * @return {Observable<R>} An Observable that emits the values from the source
  115750. * Observable transformed by the given `project` function.
  115751. * @method map
  115752. * @owner Observable
  115753. */
  115754. function map(project, thisArg) {
  115755. return function mapOperation(source) {
  115756. if (typeof project !== 'function') {
  115757. throw new TypeError('argument is not a function. Are you looking for `mapTo()`?');
  115758. }
  115759. return source.lift(new MapOperator(project, thisArg));
  115760. };
  115761. }
  115762. exports.map = map;
  115763. var MapOperator = (function () {
  115764. function MapOperator(project, thisArg) {
  115765. this.project = project;
  115766. this.thisArg = thisArg;
  115767. }
  115768. MapOperator.prototype.call = function (subscriber, source) {
  115769. return source.subscribe(new MapSubscriber(subscriber, this.project, this.thisArg));
  115770. };
  115771. return MapOperator;
  115772. }());
  115773. exports.MapOperator = MapOperator;
  115774. /**
  115775. * We need this JSDoc comment for affecting ESDoc.
  115776. * @ignore
  115777. * @extends {Ignored}
  115778. */
  115779. var MapSubscriber = (function (_super) {
  115780. __extends(MapSubscriber, _super);
  115781. function MapSubscriber(destination, project, thisArg) {
  115782. _super.call(this, destination);
  115783. this.project = project;
  115784. this.count = 0;
  115785. this.thisArg = thisArg || this;
  115786. }
  115787. // NOTE: This looks unoptimized, but it's actually purposefully NOT
  115788. // using try/catch optimizations.
  115789. MapSubscriber.prototype._next = function (value) {
  115790. var result;
  115791. try {
  115792. result = this.project.call(this.thisArg, value, this.count++);
  115793. }
  115794. catch (err) {
  115795. this.destination.error(err);
  115796. return;
  115797. }
  115798. this.destination.next(result);
  115799. };
  115800. return MapSubscriber;
  115801. }(Subscriber_1.Subscriber));
  115802. //# sourceMappingURL=map.js.map
  115803. /***/ }),
  115804. /* 238 */
  115805. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115806. "use strict";
  115807. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ItemReorderGesture; });
  115808. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__item_reorder_util__ = __webpack_require__(130);
  115809. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_dom__ = __webpack_require__(10);
  115810. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__gestures_ui_event_manager__ = __webpack_require__(23);
  115811. /**
  115812. * @hidden
  115813. */
  115814. var ItemReorderGesture = (function () {
  115815. function ItemReorderGesture(plt, reorderList) {
  115816. this.plt = plt;
  115817. this.reorderList = reorderList;
  115818. this.selectedItemEle = null;
  115819. this.events = new __WEBPACK_IMPORTED_MODULE_2__gestures_ui_event_manager__["a" /* UIEventManager */](plt);
  115820. this.events.pointerEvents({
  115821. element: this.reorderList.getNativeElement(),
  115822. pointerDown: this.onDragStart.bind(this),
  115823. pointerMove: this.onDragMove.bind(this),
  115824. pointerUp: this.onDragEnd.bind(this),
  115825. zone: false
  115826. });
  115827. }
  115828. ItemReorderGesture.prototype.onDragStart = function (ev) {
  115829. if (this.selectedItemEle) {
  115830. return false;
  115831. }
  115832. var reorderElement = ev.target;
  115833. if (reorderElement.nodeName !== 'ION-REORDER') {
  115834. return false;
  115835. }
  115836. var reorderMark = reorderElement['$ionComponent'];
  115837. if (!reorderMark) {
  115838. console.error('ion-reorder does not contain $ionComponent');
  115839. return false;
  115840. }
  115841. this.reorderList._reorderPrepare();
  115842. var item = reorderMark.getReorderNode();
  115843. if (!item) {
  115844. console.error('reorder node not found');
  115845. return false;
  115846. }
  115847. ev.preventDefault();
  115848. // Preparing state
  115849. this.selectedItemEle = item;
  115850. this.selectedItemHeight = item.offsetHeight;
  115851. this.lastYcoord = -100;
  115852. this.lastToIndex = Object(__WEBPACK_IMPORTED_MODULE_0__item_reorder_util__["b" /* indexForItem */])(item);
  115853. this.windowHeight = this.plt.height() - AUTO_SCROLL_MARGIN;
  115854. this.lastScrollPosition = this.reorderList._scrollContent(0);
  115855. this.offset = Object(__WEBPACK_IMPORTED_MODULE_1__util_dom__["f" /* pointerCoord */])(ev);
  115856. this.offset.y += this.lastScrollPosition;
  115857. item.classList.add(ITEM_REORDER_ACTIVE);
  115858. this.reorderList._reorderStart();
  115859. return true;
  115860. };
  115861. ItemReorderGesture.prototype.onDragMove = function (ev) {
  115862. var selectedItem = this.selectedItemEle;
  115863. if (!selectedItem) {
  115864. return;
  115865. }
  115866. ev.preventDefault();
  115867. // Get coordinate
  115868. var coord = Object(__WEBPACK_IMPORTED_MODULE_1__util_dom__["f" /* pointerCoord */])(ev);
  115869. var posY = coord.y;
  115870. // Scroll if we reach the scroll margins
  115871. var scrollPosition = this.scroll(posY);
  115872. // Only perform hit test if we moved at least 30px from previous position
  115873. if (Math.abs(posY - this.lastYcoord) > 30) {
  115874. var overItem = this.itemForCoord(coord);
  115875. if (overItem) {
  115876. var toIndex = Object(__WEBPACK_IMPORTED_MODULE_0__item_reorder_util__["b" /* indexForItem */])(overItem);
  115877. if (toIndex !== undefined && (toIndex !== this.lastToIndex || this.emptyZone)) {
  115878. var fromIndex = Object(__WEBPACK_IMPORTED_MODULE_0__item_reorder_util__["b" /* indexForItem */])(selectedItem);
  115879. this.lastToIndex = toIndex;
  115880. this.lastYcoord = posY;
  115881. this.emptyZone = false;
  115882. this.reorderList._reorderMove(fromIndex, toIndex, this.selectedItemHeight);
  115883. }
  115884. }
  115885. else {
  115886. this.emptyZone = true;
  115887. }
  115888. }
  115889. // Update selected item position
  115890. var ydiff = Math.round(posY - this.offset.y + scrollPosition);
  115891. selectedItem.style[this.plt.Css.transform] = "translateY(" + ydiff + "px)";
  115892. };
  115893. ItemReorderGesture.prototype.onDragEnd = function (ev) {
  115894. var _this = this;
  115895. var selectedItem = this.selectedItemEle;
  115896. if (!selectedItem) {
  115897. return;
  115898. }
  115899. if (ev) {
  115900. ev.preventDefault();
  115901. ev.stopPropagation();
  115902. }
  115903. var toIndex = this.lastToIndex;
  115904. var fromIndex = Object(__WEBPACK_IMPORTED_MODULE_0__item_reorder_util__["b" /* indexForItem */])(selectedItem);
  115905. var reorderInactive = function () {
  115906. _this.selectedItemEle.style.transition = '';
  115907. _this.selectedItemEle.classList.remove(ITEM_REORDER_ACTIVE);
  115908. _this.selectedItemEle = null;
  115909. };
  115910. if (toIndex === fromIndex) {
  115911. selectedItem.style.transition = 'transform 200ms ease-in-out';
  115912. setTimeout(reorderInactive, 200);
  115913. }
  115914. else {
  115915. reorderInactive();
  115916. }
  115917. this.reorderList._reorderEmit(fromIndex, toIndex);
  115918. };
  115919. ItemReorderGesture.prototype.itemForCoord = function (coord) {
  115920. var sideOffset = this.reorderList._isStart === this.plt.isRTL ? -100 : 100;
  115921. var x = this.offset.x + sideOffset;
  115922. var y = coord.y;
  115923. var element = this.plt.getElementFromPoint(x, y);
  115924. return Object(__WEBPACK_IMPORTED_MODULE_0__item_reorder_util__["a" /* findReorderItem */])(element, this.reorderList.getNativeElement());
  115925. };
  115926. ItemReorderGesture.prototype.scroll = function (posY) {
  115927. if (posY < AUTO_SCROLL_MARGIN) {
  115928. this.lastScrollPosition = this.reorderList._scrollContent(-SCROLL_JUMP);
  115929. }
  115930. else if (posY > this.windowHeight) {
  115931. this.lastScrollPosition = this.reorderList._scrollContent(SCROLL_JUMP);
  115932. }
  115933. return this.lastScrollPosition;
  115934. };
  115935. /**
  115936. * @hidden
  115937. */
  115938. ItemReorderGesture.prototype.destroy = function () {
  115939. this.onDragEnd(null);
  115940. this.events.destroy();
  115941. this.events = null;
  115942. this.reorderList = null;
  115943. };
  115944. return ItemReorderGesture;
  115945. }());
  115946. var AUTO_SCROLL_MARGIN = 60;
  115947. var SCROLL_JUMP = 10;
  115948. var ITEM_REORDER_ACTIVE = 'reorder-active';
  115949. //# sourceMappingURL=item-reorder-gesture.js.map
  115950. /***/ }),
  115951. /* 239 */
  115952. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115953. "use strict";
  115954. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return PICKER_OPT_SELECTED; });
  115955. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DECELERATION_FRICTION; });
  115956. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return FRAME_MS; });
  115957. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return MAX_PICKER_SPEED; });
  115958. var PICKER_OPT_SELECTED = 'picker-opt-selected';
  115959. var DECELERATION_FRICTION = 0.97;
  115960. var FRAME_MS = (1000 / 60);
  115961. var MAX_PICKER_SPEED = 60;
  115962. //# sourceMappingURL=picker-options.js.map
  115963. /***/ }),
  115964. /* 240 */
  115965. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115966. "use strict";
  115967. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PickerSlideIn; });
  115968. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return PickerSlideOut; });
  115969. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__animations_animation__ = __webpack_require__(11);
  115970. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__transitions_transition__ = __webpack_require__(27);
  115971. var __extends = (this && this.__extends) || (function () {
  115972. var extendStatics = Object.setPrototypeOf ||
  115973. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  115974. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  115975. return function (d, b) {
  115976. extendStatics(d, b);
  115977. function __() { this.constructor = d; }
  115978. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  115979. };
  115980. })();
  115981. /**
  115982. * Animations for pickers
  115983. */
  115984. var PickerSlideIn = (function (_super) {
  115985. __extends(PickerSlideIn, _super);
  115986. function PickerSlideIn() {
  115987. return _super !== null && _super.apply(this, arguments) || this;
  115988. }
  115989. PickerSlideIn.prototype.init = function () {
  115990. var ele = this.enteringView.pageRef().nativeElement;
  115991. var backdrop = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('ion-backdrop'));
  115992. var wrapper = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('.picker-wrapper'));
  115993. backdrop.fromTo('opacity', 0.01, 0.26);
  115994. wrapper.fromTo('translateY', '100%', '0%');
  115995. this.easing('cubic-bezier(.36,.66,.04,1)').duration(400).add(backdrop).add(wrapper);
  115996. };
  115997. return PickerSlideIn;
  115998. }(__WEBPACK_IMPORTED_MODULE_1__transitions_transition__["a" /* Transition */]));
  115999. var PickerSlideOut = (function (_super) {
  116000. __extends(PickerSlideOut, _super);
  116001. function PickerSlideOut() {
  116002. return _super !== null && _super.apply(this, arguments) || this;
  116003. }
  116004. PickerSlideOut.prototype.init = function () {
  116005. var ele = this.leavingView.pageRef().nativeElement;
  116006. var backdrop = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('ion-backdrop'));
  116007. var wrapper = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('.picker-wrapper'));
  116008. backdrop.fromTo('opacity', 0.26, 0);
  116009. wrapper.fromTo('translateY', '0%', '100%');
  116010. this.easing('cubic-bezier(.36,.66,.04,1)').duration(450).add(backdrop).add(wrapper);
  116011. };
  116012. return PickerSlideOut;
  116013. }(__WEBPACK_IMPORTED_MODULE_1__transitions_transition__["a" /* Transition */]));
  116014. //# sourceMappingURL=picker-transitions.js.map
  116015. /***/ }),
  116016. /* 241 */
  116017. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116018. "use strict";
  116019. /* harmony export (immutable) */ __webpack_exports__["k"] = renderDateTime;
  116020. /* harmony export (immutable) */ __webpack_exports__["l"] = renderTextFormat;
  116021. /* harmony export (immutable) */ __webpack_exports__["f"] = dateValueRange;
  116022. /* harmony export (immutable) */ __webpack_exports__["e"] = dateSortValue;
  116023. /* harmony export (immutable) */ __webpack_exports__["d"] = dateDataSortValue;
  116024. /* harmony export (immutable) */ __webpack_exports__["g"] = daysInMonth;
  116025. /* unused harmony export isLeapYear */
  116026. /* harmony export (immutable) */ __webpack_exports__["i"] = parseDate;
  116027. /* harmony export (immutable) */ __webpack_exports__["a"] = compareDates;
  116028. /* harmony export (immutable) */ __webpack_exports__["m"] = updateDate;
  116029. /* harmony export (immutable) */ __webpack_exports__["j"] = parseTemplate;
  116030. /* harmony export (immutable) */ __webpack_exports__["h"] = getValueFromFormat;
  116031. /* harmony export (immutable) */ __webpack_exports__["c"] = convertFormatToKey;
  116032. /* harmony export (immutable) */ __webpack_exports__["b"] = convertDataToISO;
  116033. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util__ = __webpack_require__(2);
  116034. function renderDateTime(template, value, locale) {
  116035. if (Object(__WEBPACK_IMPORTED_MODULE_0__util__["f" /* isBlank */])(value)) {
  116036. return '';
  116037. }
  116038. var tokens = [];
  116039. var hasText = false;
  116040. FORMAT_KEYS.forEach(function (format, index) {
  116041. if (template.indexOf(format.f) > -1) {
  116042. var token = '{' + index + '}';
  116043. var text = renderTextFormat(format.f, value[format.k], value, locale);
  116044. if (!hasText && text && Object(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isPresent */])(value[format.k])) {
  116045. hasText = true;
  116046. }
  116047. tokens.push(token, text);
  116048. template = template.replace(format.f, token);
  116049. }
  116050. });
  116051. if (!hasText) {
  116052. return '';
  116053. }
  116054. for (var i = 0; i < tokens.length; i += 2) {
  116055. template = template.replace(tokens[i], tokens[i + 1]);
  116056. }
  116057. return template;
  116058. }
  116059. function renderTextFormat(format, value, date, locale) {
  116060. if (format === FORMAT_DDDD || format === FORMAT_DDD) {
  116061. try {
  116062. value = (new Date(date.year, date.month - 1, date.day)).getDay();
  116063. if (format === FORMAT_DDDD) {
  116064. return (Object(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isPresent */])(locale.dayNames) ? locale.dayNames : DAY_NAMES)[value];
  116065. }
  116066. return (Object(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isPresent */])(locale.dayShortNames) ? locale.dayShortNames : DAY_SHORT_NAMES)[value];
  116067. }
  116068. catch (e) { }
  116069. return '';
  116070. }
  116071. if (format === FORMAT_A) {
  116072. return date ? date.hour < 12 ? 'AM' : 'PM' : Object(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isPresent */])(value) ? value.toUpperCase() : '';
  116073. }
  116074. if (format === FORMAT_a) {
  116075. return date ? date.hour < 12 ? 'am' : 'pm' : Object(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isPresent */])(value) ? value : '';
  116076. }
  116077. if (Object(__WEBPACK_IMPORTED_MODULE_0__util__["f" /* isBlank */])(value)) {
  116078. return '';
  116079. }
  116080. if (format === FORMAT_YY || format === FORMAT_MM ||
  116081. format === FORMAT_DD || format === FORMAT_HH ||
  116082. format === FORMAT_mm || format === FORMAT_ss) {
  116083. return twoDigit(value);
  116084. }
  116085. if (format === FORMAT_YYYY) {
  116086. return fourDigit(value);
  116087. }
  116088. if (format === FORMAT_MMMM) {
  116089. return (Object(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isPresent */])(locale.monthNames) ? locale.monthNames : MONTH_NAMES)[value - 1];
  116090. }
  116091. if (format === FORMAT_MMM) {
  116092. return (Object(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isPresent */])(locale.monthShortNames) ? locale.monthShortNames : MONTH_SHORT_NAMES)[value - 1];
  116093. }
  116094. if (format === FORMAT_hh || format === FORMAT_h) {
  116095. if (value === 0) {
  116096. return '12';
  116097. }
  116098. if (value > 12) {
  116099. value -= 12;
  116100. }
  116101. if (format === FORMAT_hh && value < 10) {
  116102. return ('0' + value);
  116103. }
  116104. }
  116105. return value.toString();
  116106. }
  116107. function dateValueRange(format, min, max) {
  116108. var opts = [];
  116109. var i;
  116110. if (format === FORMAT_YYYY || format === FORMAT_YY) {
  116111. // year
  116112. i = max.year;
  116113. while (i >= min.year) {
  116114. opts.push(i--);
  116115. }
  116116. }
  116117. else if (format === FORMAT_MMMM || format === FORMAT_MMM ||
  116118. format === FORMAT_MM || format === FORMAT_M ||
  116119. format === FORMAT_hh || format === FORMAT_h) {
  116120. // month or 12-hour
  116121. for (i = 1; i < 13; i++) {
  116122. opts.push(i);
  116123. }
  116124. }
  116125. else if (format === FORMAT_DDDD || format === FORMAT_DDD ||
  116126. format === FORMAT_DD || format === FORMAT_D) {
  116127. // day
  116128. for (i = 1; i < 32; i++) {
  116129. opts.push(i);
  116130. }
  116131. }
  116132. else if (format === FORMAT_HH || format === FORMAT_H) {
  116133. // 24-hour
  116134. for (i = 0; i < 24; i++) {
  116135. opts.push(i);
  116136. }
  116137. }
  116138. else if (format === FORMAT_mm || format === FORMAT_m) {
  116139. // minutes
  116140. for (i = 0; i < 60; i++) {
  116141. opts.push(i);
  116142. }
  116143. }
  116144. else if (format === FORMAT_ss || format === FORMAT_s) {
  116145. // seconds
  116146. for (i = 0; i < 60; i++) {
  116147. opts.push(i);
  116148. }
  116149. }
  116150. else if (format === FORMAT_A || format === FORMAT_a) {
  116151. // AM/PM
  116152. opts.push('am', 'pm');
  116153. }
  116154. return opts;
  116155. }
  116156. function dateSortValue(year, month, day, hour, minute) {
  116157. if (hour === void 0) { hour = 0; }
  116158. if (minute === void 0) { minute = 0; }
  116159. return parseInt("1" + fourDigit(year) + twoDigit(month) + twoDigit(day) + twoDigit(hour) + twoDigit(minute), 10);
  116160. }
  116161. function dateDataSortValue(data) {
  116162. if (data) {
  116163. return dateSortValue(data.year, data.month, data.day, data.hour, data.minute);
  116164. }
  116165. return -1;
  116166. }
  116167. function daysInMonth(month, year) {
  116168. return (month === 4 || month === 6 || month === 9 || month === 11) ? 30 : (month === 2) ? isLeapYear(year) ? 29 : 28 : 31;
  116169. }
  116170. function isLeapYear(year) {
  116171. return (year % 4 === 0 && year % 100 !== 0) || (year % 400 === 0);
  116172. }
  116173. var ISO_8601_REGEXP = /^(\d{4}|[+\-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/;
  116174. var TIME_REGEXP = /^((\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/;
  116175. function parseDate(val) {
  116176. // manually parse IS0 cuz Date.parse cannot be trusted
  116177. // ISO 8601 format: 1994-12-15T13:47:20Z
  116178. var parse;
  116179. if (Object(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isPresent */])(val) && val !== '') {
  116180. // try parsing for just time first, HH:MM
  116181. parse = TIME_REGEXP.exec(val);
  116182. if (Object(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isPresent */])(parse)) {
  116183. // adjust the array so it fits nicely with the datetime parse
  116184. parse.unshift(undefined, undefined);
  116185. parse[2] = parse[3] = undefined;
  116186. }
  116187. else {
  116188. // try parsing for full ISO datetime
  116189. parse = ISO_8601_REGEXP.exec(val);
  116190. }
  116191. }
  116192. if (Object(__WEBPACK_IMPORTED_MODULE_0__util__["f" /* isBlank */])(parse)) {
  116193. // wasn't able to parse the ISO datetime
  116194. return null;
  116195. }
  116196. // ensure all the parse values exist with at least 0
  116197. for (var i = 1; i < 8; i++) {
  116198. parse[i] = (parse[i] !== undefined ? parseInt(parse[i], 10) : null);
  116199. }
  116200. var tzOffset = 0;
  116201. if (Object(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isPresent */])(parse[9]) && Object(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isPresent */])(parse[10])) {
  116202. // hours
  116203. tzOffset = parseInt(parse[10], 10) * 60;
  116204. if (Object(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isPresent */])(parse[11])) {
  116205. // minutes
  116206. tzOffset += parseInt(parse[11], 10);
  116207. }
  116208. if (parse[9] === '-') {
  116209. // + or -
  116210. tzOffset *= -1;
  116211. }
  116212. }
  116213. return {
  116214. year: parse[1],
  116215. month: parse[2],
  116216. day: parse[3],
  116217. hour: parse[4],
  116218. minute: parse[5],
  116219. second: parse[6],
  116220. millisecond: parse[7],
  116221. tzOffset: tzOffset,
  116222. };
  116223. }
  116224. function compareDates(d1, d2) {
  116225. var date1 = new Date(d1.year, d1.month, d1.day, d1.hour, d1.minute, d1.second);
  116226. var date2 = new Date(d2.year, d2.month, d2.day, d2.hour, d2.minute, d2.second);
  116227. return date1.getTime() - date2.getTime();
  116228. }
  116229. function updateDate(existingData, newData) {
  116230. if (Object(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isPresent */])(newData) && newData !== '') {
  116231. if (Object(__WEBPACK_IMPORTED_MODULE_0__util__["n" /* isString */])(newData)) {
  116232. // new date is a string, and hopefully in the ISO format
  116233. // convert it to our DateTimeData if a valid ISO
  116234. newData = parseDate(newData);
  116235. if (newData) {
  116236. // successfully parsed the ISO string to our DateTimeData
  116237. Object.assign(existingData, newData);
  116238. return true;
  116239. }
  116240. }
  116241. else if ((Object(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isPresent */])(newData.year) || Object(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isPresent */])(newData.hour) || Object(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isPresent */])(newData.month) || Object(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isPresent */])(newData.day) || Object(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isPresent */])(newData.minute) || Object(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isPresent */])(newData.second))) {
  116242. // newData is from of a datetime picker's selected values
  116243. // update the existing DateTimeData data with the new values
  116244. // do some magic for 12-hour values
  116245. if (Object(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isPresent */])(newData.ampm) && Object(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isPresent */])(newData.hour)) {
  116246. if (newData.ampm.value === 'pm') {
  116247. newData.hour.value = (newData.hour.value === 12 ? 12 : newData.hour.value + 12);
  116248. }
  116249. else {
  116250. newData.hour.value = (newData.hour.value === 12 ? 0 : newData.hour.value);
  116251. }
  116252. }
  116253. // merge new values from the picker's selection
  116254. // to the existing DateTimeData values
  116255. for (var k in newData) {
  116256. existingData[k] = newData[k].value;
  116257. }
  116258. return true;
  116259. }
  116260. // eww, invalid data
  116261. console.warn("Error parsing date: \"" + newData + "\". Please provide a valid ISO 8601 datetime format: https://www.w3.org/TR/NOTE-datetime");
  116262. }
  116263. else {
  116264. // blank data, clear everything out
  116265. for (var k in existingData) {
  116266. delete existingData[k];
  116267. }
  116268. }
  116269. return false;
  116270. }
  116271. function parseTemplate(template) {
  116272. var formats = [];
  116273. template = template.replace(/[^\w\s]/gi, ' ');
  116274. FORMAT_KEYS.forEach(function (format) {
  116275. if (format.f.length > 1 && template.indexOf(format.f) > -1 && template.indexOf(format.f + format.f.charAt(0)) < 0) {
  116276. template = template.replace(format.f, ' ' + format.f + ' ');
  116277. }
  116278. });
  116279. var words = template.split(' ').filter(function (w) { return w.length > 0; });
  116280. words.forEach(function (word, i) {
  116281. FORMAT_KEYS.forEach(function (format) {
  116282. if (word === format.f) {
  116283. if (word === FORMAT_A || word === FORMAT_a) {
  116284. // this format is an am/pm format, so it's an "a" or "A"
  116285. if ((formats.indexOf(FORMAT_h) < 0 && formats.indexOf(FORMAT_hh) < 0) ||
  116286. VALID_AMPM_PREFIX.indexOf(words[i - 1]) === -1) {
  116287. // template does not already have a 12-hour format
  116288. // or this am/pm format doesn't have a hour, minute, or second format immediately before it
  116289. // so do not treat this word "a" or "A" as the am/pm format
  116290. return;
  116291. }
  116292. }
  116293. formats.push(word);
  116294. }
  116295. });
  116296. });
  116297. return formats;
  116298. }
  116299. function getValueFromFormat(date, format) {
  116300. if (format === FORMAT_A || format === FORMAT_a) {
  116301. return (date.hour < 12 ? 'am' : 'pm');
  116302. }
  116303. if (format === FORMAT_hh || format === FORMAT_h) {
  116304. return (date.hour > 12 ? date.hour - 12 : date.hour);
  116305. }
  116306. return date[convertFormatToKey(format)];
  116307. }
  116308. function convertFormatToKey(format) {
  116309. for (var k in FORMAT_KEYS) {
  116310. if (FORMAT_KEYS[k].f === format) {
  116311. return FORMAT_KEYS[k].k;
  116312. }
  116313. }
  116314. return null;
  116315. }
  116316. function convertDataToISO(data) {
  116317. // https://www.w3.org/TR/NOTE-datetime
  116318. var rtn = '';
  116319. if (Object(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isPresent */])(data)) {
  116320. if (Object(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isPresent */])(data.year)) {
  116321. // YYYY
  116322. rtn = fourDigit(data.year);
  116323. if (Object(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isPresent */])(data.month)) {
  116324. // YYYY-MM
  116325. rtn += '-' + twoDigit(data.month);
  116326. if (Object(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isPresent */])(data.day)) {
  116327. // YYYY-MM-DD
  116328. rtn += '-' + twoDigit(data.day);
  116329. if (Object(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isPresent */])(data.hour)) {
  116330. // YYYY-MM-DDTHH:mm:SS
  116331. rtn += "T" + twoDigit(data.hour) + ":" + twoDigit(data.minute) + ":" + twoDigit(data.second);
  116332. if (data.millisecond > 0) {
  116333. // YYYY-MM-DDTHH:mm:SS.SSS
  116334. rtn += '.' + threeDigit(data.millisecond);
  116335. }
  116336. if (Object(__WEBPACK_IMPORTED_MODULE_0__util__["f" /* isBlank */])(data.tzOffset) || data.tzOffset === 0) {
  116337. // YYYY-MM-DDTHH:mm:SSZ
  116338. rtn += 'Z';
  116339. }
  116340. else {
  116341. // YYYY-MM-DDTHH:mm:SS+/-HH:mm
  116342. rtn += (data.tzOffset > 0 ? '+' : '-') + twoDigit(Math.floor(data.tzOffset / 60)) + ':' + twoDigit(data.tzOffset % 60);
  116343. }
  116344. }
  116345. }
  116346. }
  116347. }
  116348. else if (Object(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isPresent */])(data.hour)) {
  116349. // HH:mm
  116350. rtn = twoDigit(data.hour) + ':' + twoDigit(data.minute);
  116351. if (Object(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isPresent */])(data.second)) {
  116352. // HH:mm:SS
  116353. rtn += ':' + twoDigit(data.second);
  116354. if (Object(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isPresent */])(data.millisecond)) {
  116355. // HH:mm:SS.SSS
  116356. rtn += '.' + threeDigit(data.millisecond);
  116357. }
  116358. }
  116359. }
  116360. }
  116361. return rtn;
  116362. }
  116363. function twoDigit(val) {
  116364. return ('0' + (Object(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isPresent */])(val) ? Math.abs(val) : '0')).slice(-2);
  116365. }
  116366. function threeDigit(val) {
  116367. return ('00' + (Object(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isPresent */])(val) ? Math.abs(val) : '0')).slice(-3);
  116368. }
  116369. function fourDigit(val) {
  116370. return ('000' + (Object(__WEBPACK_IMPORTED_MODULE_0__util__["l" /* isPresent */])(val) ? Math.abs(val) : '0')).slice(-4);
  116371. }
  116372. var FORMAT_YYYY = 'YYYY';
  116373. var FORMAT_YY = 'YY';
  116374. var FORMAT_MMMM = 'MMMM';
  116375. var FORMAT_MMM = 'MMM';
  116376. var FORMAT_MM = 'MM';
  116377. var FORMAT_M = 'M';
  116378. var FORMAT_DDDD = 'DDDD';
  116379. var FORMAT_DDD = 'DDD';
  116380. var FORMAT_DD = 'DD';
  116381. var FORMAT_D = 'D';
  116382. var FORMAT_HH = 'HH';
  116383. var FORMAT_H = 'H';
  116384. var FORMAT_hh = 'hh';
  116385. var FORMAT_h = 'h';
  116386. var FORMAT_mm = 'mm';
  116387. var FORMAT_m = 'm';
  116388. var FORMAT_ss = 'ss';
  116389. var FORMAT_s = 's';
  116390. var FORMAT_A = 'A';
  116391. var FORMAT_a = 'a';
  116392. var FORMAT_KEYS = [
  116393. { f: FORMAT_YYYY, k: 'year' },
  116394. { f: FORMAT_MMMM, k: 'month' },
  116395. { f: FORMAT_DDDD, k: 'day' },
  116396. { f: FORMAT_MMM, k: 'month' },
  116397. { f: FORMAT_DDD, k: 'day' },
  116398. { f: FORMAT_YY, k: 'year' },
  116399. { f: FORMAT_MM, k: 'month' },
  116400. { f: FORMAT_DD, k: 'day' },
  116401. { f: FORMAT_HH, k: 'hour' },
  116402. { f: FORMAT_hh, k: 'hour' },
  116403. { f: FORMAT_mm, k: 'minute' },
  116404. { f: FORMAT_ss, k: 'second' },
  116405. { f: FORMAT_M, k: 'month' },
  116406. { f: FORMAT_D, k: 'day' },
  116407. { f: FORMAT_H, k: 'hour' },
  116408. { f: FORMAT_h, k: 'hour' },
  116409. { f: FORMAT_m, k: 'minute' },
  116410. { f: FORMAT_s, k: 'second' },
  116411. { f: FORMAT_A, k: 'ampm' },
  116412. { f: FORMAT_a, k: 'ampm' },
  116413. ];
  116414. var DAY_NAMES = [
  116415. 'Sunday',
  116416. 'Monday',
  116417. 'Tuesday',
  116418. 'Wednesday',
  116419. 'Thursday',
  116420. 'Friday',
  116421. 'Saturday',
  116422. ];
  116423. var DAY_SHORT_NAMES = [
  116424. 'Sun',
  116425. 'Mon',
  116426. 'Tue',
  116427. 'Wed',
  116428. 'Thu',
  116429. 'Fri',
  116430. 'Sat',
  116431. ];
  116432. var MONTH_NAMES = [
  116433. 'January',
  116434. 'February',
  116435. 'March',
  116436. 'April',
  116437. 'May',
  116438. 'June',
  116439. 'July',
  116440. 'August',
  116441. 'September',
  116442. 'October',
  116443. 'November',
  116444. 'December',
  116445. ];
  116446. var MONTH_SHORT_NAMES = [
  116447. 'Jan',
  116448. 'Feb',
  116449. 'Mar',
  116450. 'Apr',
  116451. 'May',
  116452. 'Jun',
  116453. 'Jul',
  116454. 'Aug',
  116455. 'Sep',
  116456. 'Oct',
  116457. 'Nov',
  116458. 'Dec',
  116459. ];
  116460. var VALID_AMPM_PREFIX = [
  116461. FORMAT_hh, FORMAT_h, FORMAT_mm, FORMAT_m, FORMAT_ss, FORMAT_s
  116462. ];
  116463. //# sourceMappingURL=datetime-util.js.map
  116464. /***/ }),
  116465. /* 242 */
  116466. /***/ (function(module, exports, __webpack_require__) {
  116467. "use strict";
  116468. var takeUntil_1 = __webpack_require__(243);
  116469. /**
  116470. * Emits the values emitted by the source Observable until a `notifier`
  116471. * Observable emits a value.
  116472. *
  116473. * <span class="informal">Lets values pass until a second Observable,
  116474. * `notifier`, emits something. Then, it completes.</span>
  116475. *
  116476. * <img src="./img/takeUntil.png" width="100%">
  116477. *
  116478. * `takeUntil` subscribes and begins mirroring the source Observable. It also
  116479. * monitors a second Observable, `notifier` that you provide. If the `notifier`
  116480. * emits a value, the output Observable stops mirroring the source Observable
  116481. * and completes.
  116482. *
  116483. * @example <caption>Tick every second until the first click happens</caption>
  116484. * var interval = Rx.Observable.interval(1000);
  116485. * var clicks = Rx.Observable.fromEvent(document, 'click');
  116486. * var result = interval.takeUntil(clicks);
  116487. * result.subscribe(x => console.log(x));
  116488. *
  116489. * @see {@link take}
  116490. * @see {@link takeLast}
  116491. * @see {@link takeWhile}
  116492. * @see {@link skip}
  116493. *
  116494. * @param {Observable} notifier The Observable whose first emitted value will
  116495. * cause the output Observable of `takeUntil` to stop emitting values from the
  116496. * source Observable.
  116497. * @return {Observable<T>} An Observable that emits the values from the source
  116498. * Observable until such time as `notifier` emits its first value.
  116499. * @method takeUntil
  116500. * @owner Observable
  116501. */
  116502. function takeUntil(notifier) {
  116503. return takeUntil_1.takeUntil(notifier)(this);
  116504. }
  116505. exports.takeUntil = takeUntil;
  116506. //# sourceMappingURL=takeUntil.js.map
  116507. /***/ }),
  116508. /* 243 */
  116509. /***/ (function(module, exports, __webpack_require__) {
  116510. "use strict";
  116511. var __extends = (this && this.__extends) || function (d, b) {
  116512. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  116513. function __() { this.constructor = d; }
  116514. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  116515. };
  116516. var OuterSubscriber_1 = __webpack_require__(54);
  116517. var subscribeToResult_1 = __webpack_require__(53);
  116518. /**
  116519. * Emits the values emitted by the source Observable until a `notifier`
  116520. * Observable emits a value.
  116521. *
  116522. * <span class="informal">Lets values pass until a second Observable,
  116523. * `notifier`, emits something. Then, it completes.</span>
  116524. *
  116525. * <img src="./img/takeUntil.png" width="100%">
  116526. *
  116527. * `takeUntil` subscribes and begins mirroring the source Observable. It also
  116528. * monitors a second Observable, `notifier` that you provide. If the `notifier`
  116529. * emits a value or a complete notification, the output Observable stops
  116530. * mirroring the source Observable and completes.
  116531. *
  116532. * @example <caption>Tick every second until the first click happens</caption>
  116533. * var interval = Rx.Observable.interval(1000);
  116534. * var clicks = Rx.Observable.fromEvent(document, 'click');
  116535. * var result = interval.takeUntil(clicks);
  116536. * result.subscribe(x => console.log(x));
  116537. *
  116538. * @see {@link take}
  116539. * @see {@link takeLast}
  116540. * @see {@link takeWhile}
  116541. * @see {@link skip}
  116542. *
  116543. * @param {Observable} notifier The Observable whose first emitted value will
  116544. * cause the output Observable of `takeUntil` to stop emitting values from the
  116545. * source Observable.
  116546. * @return {Observable<T>} An Observable that emits the values from the source
  116547. * Observable until such time as `notifier` emits its first value.
  116548. * @method takeUntil
  116549. * @owner Observable
  116550. */
  116551. function takeUntil(notifier) {
  116552. return function (source) { return source.lift(new TakeUntilOperator(notifier)); };
  116553. }
  116554. exports.takeUntil = takeUntil;
  116555. var TakeUntilOperator = (function () {
  116556. function TakeUntilOperator(notifier) {
  116557. this.notifier = notifier;
  116558. }
  116559. TakeUntilOperator.prototype.call = function (subscriber, source) {
  116560. return source.subscribe(new TakeUntilSubscriber(subscriber, this.notifier));
  116561. };
  116562. return TakeUntilOperator;
  116563. }());
  116564. /**
  116565. * We need this JSDoc comment for affecting ESDoc.
  116566. * @ignore
  116567. * @extends {Ignored}
  116568. */
  116569. var TakeUntilSubscriber = (function (_super) {
  116570. __extends(TakeUntilSubscriber, _super);
  116571. function TakeUntilSubscriber(destination, notifier) {
  116572. _super.call(this, destination);
  116573. this.notifier = notifier;
  116574. this.add(subscribeToResult_1.subscribeToResult(this, notifier));
  116575. }
  116576. TakeUntilSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  116577. this.complete();
  116578. };
  116579. TakeUntilSubscriber.prototype.notifyComplete = function () {
  116580. // noop
  116581. };
  116582. return TakeUntilSubscriber;
  116583. }(OuterSubscriber_1.OuterSubscriber));
  116584. //# sourceMappingURL=takeUntil.js.map
  116585. /***/ }),
  116586. /* 244 */
  116587. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116588. "use strict";
  116589. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ItemSlidingGesture; });
  116590. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__gestures_gesture_controller__ = __webpack_require__(7);
  116591. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__gestures_pan_gesture__ = __webpack_require__(43);
  116592. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_dom__ = __webpack_require__(10);
  116593. var __extends = (this && this.__extends) || (function () {
  116594. var extendStatics = Object.setPrototypeOf ||
  116595. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  116596. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  116597. return function (d, b) {
  116598. extendStatics(d, b);
  116599. function __() { this.constructor = d; }
  116600. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  116601. };
  116602. })();
  116603. /**
  116604. * @hidden
  116605. */
  116606. var ItemSlidingGesture = (function (_super) {
  116607. __extends(ItemSlidingGesture, _super);
  116608. function ItemSlidingGesture(plt, list, gestureCtrl, domCtrl) {
  116609. var _this = _super.call(this, plt, list.getNativeElement(), {
  116610. maxAngle: 20,
  116611. threshold: 5,
  116612. zone: false,
  116613. domController: domCtrl,
  116614. gesture: gestureCtrl.createGesture({
  116615. name: __WEBPACK_IMPORTED_MODULE_0__gestures_gesture_controller__["c" /* GESTURE_ITEM_SWIPE */],
  116616. priority: __WEBPACK_IMPORTED_MODULE_0__gestures_gesture_controller__["h" /* GESTURE_PRIORITY_SLIDING_ITEM */],
  116617. disableScroll: true
  116618. })
  116619. }) || this;
  116620. _this.list = list;
  116621. _this.preSelectedContainer = null;
  116622. _this.selectedContainer = null;
  116623. _this.openContainer = null;
  116624. return _this;
  116625. }
  116626. ItemSlidingGesture.prototype.canStart = function (ev) {
  116627. if (this.selectedContainer) {
  116628. return false;
  116629. }
  116630. // Get swiped sliding container
  116631. var container = getContainer(ev);
  116632. if (!container) {
  116633. this.closeOpened();
  116634. return false;
  116635. }
  116636. // Close open container if it is not the selected one.
  116637. if (container !== this.openContainer) {
  116638. this.closeOpened();
  116639. }
  116640. var coord = Object(__WEBPACK_IMPORTED_MODULE_2__util_dom__["f" /* pointerCoord */])(ev);
  116641. this.preSelectedContainer = container;
  116642. this.firstCoordX = coord.x;
  116643. this.firstTimestamp = Date.now();
  116644. return true;
  116645. };
  116646. ItemSlidingGesture.prototype.onDragStart = function (ev) {
  116647. ev.preventDefault();
  116648. var coord = Object(__WEBPACK_IMPORTED_MODULE_2__util_dom__["f" /* pointerCoord */])(ev);
  116649. this.selectedContainer = this.openContainer = this.preSelectedContainer;
  116650. this.selectedContainer.startSliding(coord.x);
  116651. };
  116652. ItemSlidingGesture.prototype.onDragMove = function (ev) {
  116653. ev.preventDefault();
  116654. this.selectedContainer.moveSliding(Object(__WEBPACK_IMPORTED_MODULE_2__util_dom__["f" /* pointerCoord */])(ev).x);
  116655. };
  116656. ItemSlidingGesture.prototype.onDragEnd = function (ev) {
  116657. ev.preventDefault();
  116658. var coordX = Object(__WEBPACK_IMPORTED_MODULE_2__util_dom__["f" /* pointerCoord */])(ev).x;
  116659. var deltaX = (coordX - this.firstCoordX);
  116660. var deltaT = (Date.now() - this.firstTimestamp);
  116661. this.selectedContainer.endSliding(deltaX / deltaT);
  116662. this.selectedContainer = null;
  116663. this.preSelectedContainer = null;
  116664. };
  116665. ItemSlidingGesture.prototype.notCaptured = function (ev) {
  116666. if (!clickedOptionButton(ev)) {
  116667. this.closeOpened();
  116668. }
  116669. };
  116670. ItemSlidingGesture.prototype.closeOpened = function () {
  116671. this.selectedContainer = null;
  116672. if (this.openContainer) {
  116673. this.openContainer.close();
  116674. this.openContainer = null;
  116675. return true;
  116676. }
  116677. return false;
  116678. };
  116679. ItemSlidingGesture.prototype.destroy = function () {
  116680. _super.prototype.destroy.call(this);
  116681. this.closeOpened();
  116682. this.list = null;
  116683. this.preSelectedContainer = null;
  116684. this.selectedContainer = null;
  116685. this.openContainer = null;
  116686. };
  116687. return ItemSlidingGesture;
  116688. }(__WEBPACK_IMPORTED_MODULE_1__gestures_pan_gesture__["a" /* PanGesture */]));
  116689. function getContainer(ev) {
  116690. var ele = ev.target.closest('ion-item-sliding');
  116691. if (ele) {
  116692. return ele['$ionComponent'];
  116693. }
  116694. return null;
  116695. }
  116696. function clickedOptionButton(ev) {
  116697. var ele = ev.target.closest('ion-item-options>button');
  116698. return !!ele;
  116699. }
  116700. //# sourceMappingURL=item-sliding-gesture.js.map
  116701. /***/ }),
  116702. /* 245 */
  116703. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116704. "use strict";
  116705. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return LoadingPopIn; });
  116706. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return LoadingPopOut; });
  116707. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return LoadingMdPopIn; });
  116708. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return LoadingMdPopOut; });
  116709. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return LoadingWpPopIn; });
  116710. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return LoadingWpPopOut; });
  116711. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__animations_animation__ = __webpack_require__(11);
  116712. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__transitions_transition__ = __webpack_require__(27);
  116713. var __extends = (this && this.__extends) || (function () {
  116714. var extendStatics = Object.setPrototypeOf ||
  116715. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  116716. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  116717. return function (d, b) {
  116718. extendStatics(d, b);
  116719. function __() { this.constructor = d; }
  116720. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  116721. };
  116722. })();
  116723. /**
  116724. * Animations for loading
  116725. */
  116726. var LoadingPopIn = (function (_super) {
  116727. __extends(LoadingPopIn, _super);
  116728. function LoadingPopIn() {
  116729. return _super !== null && _super.apply(this, arguments) || this;
  116730. }
  116731. LoadingPopIn.prototype.init = function () {
  116732. var ele = this.enteringView.pageRef().nativeElement;
  116733. var backdrop = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('ion-backdrop'));
  116734. var wrapper = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('.loading-wrapper'));
  116735. wrapper.fromTo('opacity', 0.01, 1).fromTo('scale', 1.1, 1);
  116736. backdrop.fromTo('opacity', 0.01, 0.3);
  116737. this
  116738. .easing('ease-in-out')
  116739. .duration(200)
  116740. .add(backdrop)
  116741. .add(wrapper);
  116742. };
  116743. return LoadingPopIn;
  116744. }(__WEBPACK_IMPORTED_MODULE_1__transitions_transition__["a" /* Transition */]));
  116745. var LoadingPopOut = (function (_super) {
  116746. __extends(LoadingPopOut, _super);
  116747. function LoadingPopOut() {
  116748. return _super !== null && _super.apply(this, arguments) || this;
  116749. }
  116750. LoadingPopOut.prototype.init = function () {
  116751. var ele = this.leavingView.pageRef().nativeElement;
  116752. var backdrop = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('ion-backdrop'));
  116753. var wrapper = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('.loading-wrapper'));
  116754. wrapper.fromTo('opacity', 0.99, 0).fromTo('scale', 1, 0.9);
  116755. backdrop.fromTo('opacity', 0.3, 0);
  116756. this
  116757. .easing('ease-in-out')
  116758. .duration(200)
  116759. .add(backdrop)
  116760. .add(wrapper);
  116761. };
  116762. return LoadingPopOut;
  116763. }(__WEBPACK_IMPORTED_MODULE_1__transitions_transition__["a" /* Transition */]));
  116764. var LoadingMdPopIn = (function (_super) {
  116765. __extends(LoadingMdPopIn, _super);
  116766. function LoadingMdPopIn() {
  116767. return _super !== null && _super.apply(this, arguments) || this;
  116768. }
  116769. LoadingMdPopIn.prototype.init = function () {
  116770. var ele = this.enteringView.pageRef().nativeElement;
  116771. var backdrop = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('ion-backdrop'));
  116772. var wrapper = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('.loading-wrapper'));
  116773. wrapper.fromTo('opacity', 0.01, 1).fromTo('scale', 1.1, 1);
  116774. backdrop.fromTo('opacity', 0.01, 0.5);
  116775. this
  116776. .easing('ease-in-out')
  116777. .duration(200)
  116778. .add(backdrop)
  116779. .add(wrapper);
  116780. };
  116781. return LoadingMdPopIn;
  116782. }(__WEBPACK_IMPORTED_MODULE_1__transitions_transition__["a" /* Transition */]));
  116783. var LoadingMdPopOut = (function (_super) {
  116784. __extends(LoadingMdPopOut, _super);
  116785. function LoadingMdPopOut() {
  116786. return _super !== null && _super.apply(this, arguments) || this;
  116787. }
  116788. LoadingMdPopOut.prototype.init = function () {
  116789. var ele = this.leavingView.pageRef().nativeElement;
  116790. var backdrop = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('ion-backdrop'));
  116791. var wrapper = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('.loading-wrapper'));
  116792. wrapper.fromTo('opacity', 0.99, 0).fromTo('scale', 1, 0.9);
  116793. backdrop.fromTo('opacity', 0.5, 0);
  116794. this
  116795. .easing('ease-in-out')
  116796. .duration(200)
  116797. .add(backdrop)
  116798. .add(wrapper);
  116799. };
  116800. return LoadingMdPopOut;
  116801. }(__WEBPACK_IMPORTED_MODULE_1__transitions_transition__["a" /* Transition */]));
  116802. var LoadingWpPopIn = (function (_super) {
  116803. __extends(LoadingWpPopIn, _super);
  116804. function LoadingWpPopIn() {
  116805. return _super !== null && _super.apply(this, arguments) || this;
  116806. }
  116807. LoadingWpPopIn.prototype.init = function () {
  116808. var ele = this.enteringView.pageRef().nativeElement;
  116809. var backdrop = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('ion-backdrop'));
  116810. var wrapper = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('.loading-wrapper'));
  116811. wrapper.fromTo('opacity', 0.01, 1).fromTo('scale', 1.3, 1);
  116812. backdrop.fromTo('opacity', 0.01, 0.16);
  116813. this
  116814. .easing('cubic-bezier(0,0,0.05,1)')
  116815. .duration(200)
  116816. .add(backdrop)
  116817. .add(wrapper);
  116818. };
  116819. return LoadingWpPopIn;
  116820. }(__WEBPACK_IMPORTED_MODULE_1__transitions_transition__["a" /* Transition */]));
  116821. var LoadingWpPopOut = (function (_super) {
  116822. __extends(LoadingWpPopOut, _super);
  116823. function LoadingWpPopOut() {
  116824. return _super !== null && _super.apply(this, arguments) || this;
  116825. }
  116826. LoadingWpPopOut.prototype.init = function () {
  116827. var ele = this.leavingView.pageRef().nativeElement;
  116828. var backdrop = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('ion-backdrop'));
  116829. var wrapper = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('.loading-wrapper'));
  116830. wrapper.fromTo('opacity', 0.99, 0).fromTo('scale', 1, 1.3);
  116831. backdrop.fromTo('opacity', 0.16, 0);
  116832. this
  116833. .easing('ease-out')
  116834. .duration(150)
  116835. .add(backdrop)
  116836. .add(wrapper);
  116837. };
  116838. return LoadingWpPopOut;
  116839. }(__WEBPACK_IMPORTED_MODULE_1__transitions_transition__["a" /* Transition */]));
  116840. //# sourceMappingURL=loading-transitions.js.map
  116841. /***/ }),
  116842. /* 246 */
  116843. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116844. "use strict";
  116845. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MenuContentGesture; });
  116846. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__gestures_gesture_controller__ = __webpack_require__(7);
  116847. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__gestures_slide_edge_gesture__ = __webpack_require__(56);
  116848. var __extends = (this && this.__extends) || (function () {
  116849. var extendStatics = Object.setPrototypeOf ||
  116850. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  116851. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  116852. return function (d, b) {
  116853. extendStatics(d, b);
  116854. function __() { this.constructor = d; }
  116855. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  116856. };
  116857. })();
  116858. /**
  116859. * Gesture attached to the content which the menu is assigned to
  116860. */
  116861. var MenuContentGesture = (function (_super) {
  116862. __extends(MenuContentGesture, _super);
  116863. function MenuContentGesture(plt, menu, gestureCtrl, domCtrl) {
  116864. var _this = _super.call(this, plt, plt.doc().body, {
  116865. direction: 'x',
  116866. edge: menu.side,
  116867. threshold: 5,
  116868. maxEdgeStart: menu.maxEdgeStart || 50,
  116869. zone: false,
  116870. passive: true,
  116871. domController: domCtrl,
  116872. gesture: gestureCtrl.createGesture({
  116873. name: __WEBPACK_IMPORTED_MODULE_0__gestures_gesture_controller__["d" /* GESTURE_MENU_SWIPE */],
  116874. priority: __WEBPACK_IMPORTED_MODULE_0__gestures_gesture_controller__["f" /* GESTURE_PRIORITY_MENU_SWIPE */],
  116875. disableScroll: true
  116876. })
  116877. }) || this;
  116878. _this.menu = menu;
  116879. return _this;
  116880. }
  116881. MenuContentGesture.prototype.canStart = function (ev) {
  116882. var menu = this.menu;
  116883. if (!menu.canSwipe()) {
  116884. return false;
  116885. }
  116886. if (menu.isOpen) {
  116887. return true;
  116888. }
  116889. else if (menu.getMenuController().getOpen()) {
  116890. return false;
  116891. }
  116892. return _super.prototype.canStart.call(this, ev);
  116893. };
  116894. // Set CSS, then wait one frame for it to apply before sliding starts
  116895. MenuContentGesture.prototype.onSlideBeforeStart = function () {
  116896. (void 0) /* console.debug */;
  116897. this.menu._swipeBeforeStart();
  116898. };
  116899. MenuContentGesture.prototype.onSlideStart = function () {
  116900. (void 0) /* console.debug */;
  116901. this.menu._swipeStart();
  116902. };
  116903. MenuContentGesture.prototype.onSlide = function (slide) {
  116904. var z = (this.menu.isRightSide !== this.plt.isRTL ? slide.min : slide.max);
  116905. var stepValue = (slide.distance / z);
  116906. this.menu._swipeProgress(stepValue);
  116907. };
  116908. MenuContentGesture.prototype.onSlideEnd = function (slide) {
  116909. var z = (this.menu.isRightSide !== this.plt.isRTL ? slide.min : slide.max);
  116910. var currentStepValue = (slide.distance / z);
  116911. var velocity = slide.velocity;
  116912. z = Math.abs(z * 0.5);
  116913. var shouldCompleteRight = (velocity >= 0)
  116914. && (velocity > 0.2 || slide.delta > z);
  116915. var shouldCompleteLeft = (velocity <= 0)
  116916. && (velocity < -0.2 || slide.delta < -z);
  116917. (void 0) /* console.debug */;
  116918. this.menu._swipeEnd(shouldCompleteLeft, shouldCompleteRight, currentStepValue, velocity);
  116919. };
  116920. MenuContentGesture.prototype.getElementStartPos = function (slide) {
  116921. var menu = this.menu;
  116922. if (menu.isRightSide !== this.plt.isRTL) {
  116923. return menu.isOpen ? slide.min : slide.max;
  116924. }
  116925. // left menu
  116926. return menu.isOpen ? slide.max : slide.min;
  116927. };
  116928. MenuContentGesture.prototype.getSlideBoundaries = function () {
  116929. var menu = this.menu;
  116930. if (menu.isRightSide !== this.plt.isRTL) {
  116931. return {
  116932. min: -menu.width(),
  116933. max: 0
  116934. };
  116935. }
  116936. // left menu
  116937. return {
  116938. min: 0,
  116939. max: menu.width()
  116940. };
  116941. };
  116942. return MenuContentGesture;
  116943. }(__WEBPACK_IMPORTED_MODULE_1__gestures_slide_edge_gesture__["a" /* SlideEdgeGesture */]));
  116944. //# sourceMappingURL=menu-gestures.js.map
  116945. /***/ }),
  116946. /* 247 */
  116947. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116948. "use strict";
  116949. /* unused harmony export MenuType */
  116950. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__animations_animation__ = __webpack_require__(11);
  116951. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__app_menu_controller__ = __webpack_require__(26);
  116952. var __extends = (this && this.__extends) || (function () {
  116953. var extendStatics = Object.setPrototypeOf ||
  116954. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  116955. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  116956. return function (d, b) {
  116957. extendStatics(d, b);
  116958. function __() { this.constructor = d; }
  116959. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  116960. };
  116961. })();
  116962. /**
  116963. * @hidden
  116964. * Menu Type
  116965. * Base class which is extended by the various types. Each
  116966. * type will provide their own animations for open and close
  116967. * and registers itself with Menu.
  116968. */
  116969. var MenuType = (function () {
  116970. function MenuType(plt) {
  116971. this.ani = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](plt);
  116972. this.ani
  116973. .easing('cubic-bezier(0.0, 0.0, 0.2, 1)')
  116974. .easingReverse('cubic-bezier(0.4, 0.0, 0.6, 1)')
  116975. .duration(280);
  116976. }
  116977. MenuType.prototype.setOpen = function (shouldOpen, animated, done) {
  116978. var ani = this.ani
  116979. .onFinish(done, true, true)
  116980. .reverse(!shouldOpen);
  116981. if (animated) {
  116982. ani.play();
  116983. }
  116984. else {
  116985. ani.syncPlay();
  116986. }
  116987. };
  116988. MenuType.prototype.setProgressStart = function (isOpen) {
  116989. this.isOpening = !isOpen;
  116990. // the cloned animation should not use an easing curve during seek
  116991. this.ani
  116992. .reverse(isOpen)
  116993. .progressStart();
  116994. };
  116995. MenuType.prototype.setProgessStep = function (stepValue) {
  116996. // adjust progress value depending if it opening or closing
  116997. this.ani.progressStep(stepValue);
  116998. };
  116999. MenuType.prototype.setProgressEnd = function (shouldComplete, currentStepValue, velocity, done) {
  117000. var _this = this;
  117001. var isOpen = (this.isOpening && shouldComplete);
  117002. if (!this.isOpening && !shouldComplete) {
  117003. isOpen = true;
  117004. }
  117005. var ani = this.ani;
  117006. ani.onFinish(function () {
  117007. _this.isOpening = false;
  117008. done(isOpen);
  117009. }, true);
  117010. var factor = 1 - Math.min(Math.abs(velocity) / 4, 0.7);
  117011. var dur = ani.getDuration() * factor;
  117012. ani.progressEnd(shouldComplete, currentStepValue, dur);
  117013. };
  117014. MenuType.prototype.destroy = function () {
  117015. this.ani.destroy();
  117016. this.ani = null;
  117017. };
  117018. return MenuType;
  117019. }());
  117020. /**
  117021. * @hidden
  117022. * Menu Reveal Type
  117023. * The content slides over to reveal the menu underneath.
  117024. * The menu itself, which is under the content, does not move.
  117025. */
  117026. var MenuRevealType = (function (_super) {
  117027. __extends(MenuRevealType, _super);
  117028. function MenuRevealType(menu, plt) {
  117029. var _this = _super.call(this, plt) || this;
  117030. var openedX = (menu.width() * (menu.isRightSide ? -1 : 1)) + 'px';
  117031. var contentOpen = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](plt, menu.getContentElement());
  117032. contentOpen.fromTo('translateX', '0px', openedX);
  117033. _this.ani.add(contentOpen);
  117034. return _this;
  117035. }
  117036. return MenuRevealType;
  117037. }(MenuType));
  117038. __WEBPACK_IMPORTED_MODULE_1__app_menu_controller__["a" /* MenuController */].registerType('reveal', MenuRevealType);
  117039. /**
  117040. * @hidden
  117041. * Menu Push Type
  117042. * The content slides over to reveal the menu underneath.
  117043. * The menu itself also slides over to reveal its bad self.
  117044. */
  117045. var MenuPushType = (function (_super) {
  117046. __extends(MenuPushType, _super);
  117047. function MenuPushType(menu, plt) {
  117048. var _this = _super.call(this, plt) || this;
  117049. var contentOpenedX, menuClosedX, menuOpenedX;
  117050. var width = menu.width();
  117051. if (menu.isRightSide) {
  117052. // right side
  117053. contentOpenedX = -width + 'px';
  117054. menuClosedX = width + 'px';
  117055. menuOpenedX = '0px';
  117056. }
  117057. else {
  117058. contentOpenedX = width + 'px';
  117059. menuOpenedX = '0px';
  117060. menuClosedX = -width + 'px';
  117061. }
  117062. var menuAni = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](plt, menu.getMenuElement());
  117063. menuAni.fromTo('translateX', menuClosedX, menuOpenedX);
  117064. _this.ani.add(menuAni);
  117065. var contentApi = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](plt, menu.getContentElement());
  117066. contentApi.fromTo('translateX', '0px', contentOpenedX);
  117067. _this.ani.add(contentApi);
  117068. return _this;
  117069. }
  117070. return MenuPushType;
  117071. }(MenuType));
  117072. __WEBPACK_IMPORTED_MODULE_1__app_menu_controller__["a" /* MenuController */].registerType('push', MenuPushType);
  117073. /**
  117074. * @hidden
  117075. * Menu Overlay Type
  117076. * The menu slides over the content. The content
  117077. * itself, which is under the menu, does not move.
  117078. */
  117079. var MenuOverlayType = (function (_super) {
  117080. __extends(MenuOverlayType, _super);
  117081. function MenuOverlayType(menu, plt) {
  117082. var _this = _super.call(this, plt) || this;
  117083. var closedX, openedX;
  117084. var width = menu.width();
  117085. if (menu.isRightSide) {
  117086. // right side
  117087. closedX = 8 + width + 'px';
  117088. openedX = '0px';
  117089. }
  117090. else {
  117091. // left side
  117092. closedX = -(8 + width) + 'px';
  117093. openedX = '0px';
  117094. }
  117095. var menuAni = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](plt, menu.getMenuElement());
  117096. menuAni.fromTo('translateX', closedX, openedX);
  117097. _this.ani.add(menuAni);
  117098. var backdropApi = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](plt, menu.getBackdropElement());
  117099. backdropApi.fromTo('opacity', 0.01, 0.35);
  117100. _this.ani.add(backdropApi);
  117101. return _this;
  117102. }
  117103. return MenuOverlayType;
  117104. }(MenuType));
  117105. __WEBPACK_IMPORTED_MODULE_1__app_menu_controller__["a" /* MenuController */].registerType('overlay', MenuOverlayType);
  117106. //# sourceMappingURL=menu-types.js.map
  117107. /***/ }),
  117108. /* 248 */
  117109. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117110. "use strict";
  117111. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ModalImpl; });
  117112. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_util__ = __webpack_require__(2);
  117113. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__app_app_constants__ = __webpack_require__(35);
  117114. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__modal_component__ = __webpack_require__(75);
  117115. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__modal_transitions__ = __webpack_require__(254);
  117116. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__navigation_view_controller__ = __webpack_require__(5);
  117117. var __extends = (this && this.__extends) || (function () {
  117118. var extendStatics = Object.setPrototypeOf ||
  117119. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  117120. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  117121. return function (d, b) {
  117122. extendStatics(d, b);
  117123. function __() { this.constructor = d; }
  117124. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  117125. };
  117126. })();
  117127. /**
  117128. * @hidden
  117129. */
  117130. var ModalImpl = (function (_super) {
  117131. __extends(ModalImpl, _super);
  117132. function ModalImpl(app, component, data, opts, config) {
  117133. if (opts === void 0) { opts = {}; }
  117134. var _this = this;
  117135. data = data || {};
  117136. data.component = component;
  117137. opts.showBackdrop = Object(__WEBPACK_IMPORTED_MODULE_0__util_util__["l" /* isPresent */])(opts.showBackdrop) ? !!opts.showBackdrop : true;
  117138. opts.enableBackdropDismiss = Object(__WEBPACK_IMPORTED_MODULE_0__util_util__["l" /* isPresent */])(opts.enableBackdropDismiss) ? !!opts.enableBackdropDismiss : true;
  117139. data.opts = opts;
  117140. _this = _super.call(this, __WEBPACK_IMPORTED_MODULE_2__modal_component__["a" /* ModalCmp */], data, null) || this;
  117141. _this._app = app;
  117142. _this._enterAnimation = opts.enterAnimation;
  117143. _this._leaveAnimation = opts.leaveAnimation;
  117144. _this.isOverlay = true;
  117145. config.setTransition('modal-slide-in', __WEBPACK_IMPORTED_MODULE_3__modal_transitions__["c" /* ModalSlideIn */]);
  117146. config.setTransition('modal-slide-out', __WEBPACK_IMPORTED_MODULE_3__modal_transitions__["d" /* ModalSlideOut */]);
  117147. config.setTransition('modal-md-slide-in', __WEBPACK_IMPORTED_MODULE_3__modal_transitions__["a" /* ModalMDSlideIn */]);
  117148. config.setTransition('modal-md-slide-out', __WEBPACK_IMPORTED_MODULE_3__modal_transitions__["b" /* ModalMDSlideOut */]);
  117149. return _this;
  117150. }
  117151. /**
  117152. * @hidden
  117153. */
  117154. ModalImpl.prototype.getTransitionName = function (direction) {
  117155. var key;
  117156. if (direction === 'back') {
  117157. if (this._leaveAnimation) {
  117158. return this._leaveAnimation;
  117159. }
  117160. key = 'modalLeave';
  117161. }
  117162. else {
  117163. if (this._enterAnimation) {
  117164. return this._enterAnimation;
  117165. }
  117166. key = 'modalEnter';
  117167. }
  117168. return this._nav && this._nav.config.get(key);
  117169. };
  117170. /**
  117171. * Present the action sheet instance.
  117172. *
  117173. * @param {NavOptions} [navOptions={}] Nav options to go with this transition.
  117174. * @returns {Promise} Returns a promise which is resolved when the transition has completed.
  117175. */
  117176. ModalImpl.prototype.present = function (navOptions) {
  117177. if (navOptions === void 0) { navOptions = {}; }
  117178. navOptions.minClickBlockDuration = navOptions.minClickBlockDuration || 400;
  117179. return this._app.present(this, navOptions, __WEBPACK_IMPORTED_MODULE_1__app_app_constants__["c" /* PORTAL_MODAL */]);
  117180. };
  117181. return ModalImpl;
  117182. }(__WEBPACK_IMPORTED_MODULE_4__navigation_view_controller__["a" /* ViewController */]));
  117183. //# sourceMappingURL=modal-impl.js.map
  117184. /***/ }),
  117185. /* 249 */
  117186. /***/ (function(module, exports, __webpack_require__) {
  117187. "use strict";
  117188. var ArrayObservable_1 = __webpack_require__(109);
  117189. exports.of = ArrayObservable_1.ArrayObservable.of;
  117190. //# sourceMappingURL=of.js.map
  117191. /***/ }),
  117192. /* 250 */
  117193. /***/ (function(module, exports, __webpack_require__) {
  117194. "use strict";
  117195. var concatMap_1 = __webpack_require__(251);
  117196. /* tslint:enable:max-line-length */
  117197. /**
  117198. * Projects each source value to an Observable which is merged in the output
  117199. * Observable, in a serialized fashion waiting for each one to complete before
  117200. * merging the next.
  117201. *
  117202. * <span class="informal">Maps each value to an Observable, then flattens all of
  117203. * these inner Observables using {@link concatAll}.</span>
  117204. *
  117205. * <img src="./img/concatMap.png" width="100%">
  117206. *
  117207. * Returns an Observable that emits items based on applying a function that you
  117208. * supply to each item emitted by the source Observable, where that function
  117209. * returns an (so-called "inner") Observable. Each new inner Observable is
  117210. * concatenated with the previous inner Observable.
  117211. *
  117212. * __Warning:__ if source values arrive endlessly and faster than their
  117213. * corresponding inner Observables can complete, it will result in memory issues
  117214. * as inner Observables amass in an unbounded buffer waiting for their turn to
  117215. * be subscribed to.
  117216. *
  117217. * Note: `concatMap` is equivalent to `mergeMap` with concurrency parameter set
  117218. * to `1`.
  117219. *
  117220. * @example <caption>For each click event, tick every second from 0 to 3, with no concurrency</caption>
  117221. * var clicks = Rx.Observable.fromEvent(document, 'click');
  117222. * var result = clicks.concatMap(ev => Rx.Observable.interval(1000).take(4));
  117223. * result.subscribe(x => console.log(x));
  117224. *
  117225. * // Results in the following:
  117226. * // (results are not concurrent)
  117227. * // For every click on the "document" it will emit values 0 to 3 spaced
  117228. * // on a 1000ms interval
  117229. * // one click = 1000ms-> 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3
  117230. *
  117231. * @see {@link concat}
  117232. * @see {@link concatAll}
  117233. * @see {@link concatMapTo}
  117234. * @see {@link exhaustMap}
  117235. * @see {@link mergeMap}
  117236. * @see {@link switchMap}
  117237. *
  117238. * @param {function(value: T, ?index: number): ObservableInput} project A function
  117239. * that, when applied to an item emitted by the source Observable, returns an
  117240. * Observable.
  117241. * @param {function(outerValue: T, innerValue: I, outerIndex: number, innerIndex: number): any} [resultSelector]
  117242. * A function to produce the value on the output Observable based on the values
  117243. * and the indices of the source (outer) emission and the inner Observable
  117244. * emission. The arguments passed to this function are:
  117245. * - `outerValue`: the value that came from the source
  117246. * - `innerValue`: the value that came from the projected Observable
  117247. * - `outerIndex`: the "index" of the value that came from the source
  117248. * - `innerIndex`: the "index" of the value from the projected Observable
  117249. * @return {Observable} An Observable that emits the result of applying the
  117250. * projection function (and the optional `resultSelector`) to each item emitted
  117251. * by the source Observable and taking values from each projected inner
  117252. * Observable sequentially.
  117253. * @method concatMap
  117254. * @owner Observable
  117255. */
  117256. function concatMap(project, resultSelector) {
  117257. return concatMap_1.concatMap(project, resultSelector)(this);
  117258. }
  117259. exports.concatMap = concatMap;
  117260. //# sourceMappingURL=concatMap.js.map
  117261. /***/ }),
  117262. /* 251 */
  117263. /***/ (function(module, exports, __webpack_require__) {
  117264. "use strict";
  117265. var mergeMap_1 = __webpack_require__(112);
  117266. /* tslint:enable:max-line-length */
  117267. /**
  117268. * Projects each source value to an Observable which is merged in the output
  117269. * Observable, in a serialized fashion waiting for each one to complete before
  117270. * merging the next.
  117271. *
  117272. * <span class="informal">Maps each value to an Observable, then flattens all of
  117273. * these inner Observables using {@link concatAll}.</span>
  117274. *
  117275. * <img src="./img/concatMap.png" width="100%">
  117276. *
  117277. * Returns an Observable that emits items based on applying a function that you
  117278. * supply to each item emitted by the source Observable, where that function
  117279. * returns an (so-called "inner") Observable. Each new inner Observable is
  117280. * concatenated with the previous inner Observable.
  117281. *
  117282. * __Warning:__ if source values arrive endlessly and faster than their
  117283. * corresponding inner Observables can complete, it will result in memory issues
  117284. * as inner Observables amass in an unbounded buffer waiting for their turn to
  117285. * be subscribed to.
  117286. *
  117287. * Note: `concatMap` is equivalent to `mergeMap` with concurrency parameter set
  117288. * to `1`.
  117289. *
  117290. * @example <caption>For each click event, tick every second from 0 to 3, with no concurrency</caption>
  117291. * var clicks = Rx.Observable.fromEvent(document, 'click');
  117292. * var result = clicks.concatMap(ev => Rx.Observable.interval(1000).take(4));
  117293. * result.subscribe(x => console.log(x));
  117294. *
  117295. * // Results in the following:
  117296. * // (results are not concurrent)
  117297. * // For every click on the "document" it will emit values 0 to 3 spaced
  117298. * // on a 1000ms interval
  117299. * // one click = 1000ms-> 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3
  117300. *
  117301. * @see {@link concat}
  117302. * @see {@link concatAll}
  117303. * @see {@link concatMapTo}
  117304. * @see {@link exhaustMap}
  117305. * @see {@link mergeMap}
  117306. * @see {@link switchMap}
  117307. *
  117308. * @param {function(value: T, ?index: number): ObservableInput} project A function
  117309. * that, when applied to an item emitted by the source Observable, returns an
  117310. * Observable.
  117311. * @param {function(outerValue: T, innerValue: I, outerIndex: number, innerIndex: number): any} [resultSelector]
  117312. * A function to produce the value on the output Observable based on the values
  117313. * and the indices of the source (outer) emission and the inner Observable
  117314. * emission. The arguments passed to this function are:
  117315. * - `outerValue`: the value that came from the source
  117316. * - `innerValue`: the value that came from the projected Observable
  117317. * - `outerIndex`: the "index" of the value that came from the source
  117318. * - `innerIndex`: the "index" of the value from the projected Observable
  117319. * @return {Observable} An Observable that emits the result of applying the
  117320. * projection function (and the optional `resultSelector`) to each item emitted
  117321. * by the source Observable and taking values from each projected inner
  117322. * Observable sequentially.
  117323. * @method concatMap
  117324. * @owner Observable
  117325. */
  117326. function concatMap(project, resultSelector) {
  117327. return mergeMap_1.mergeMap(project, resultSelector, 1);
  117328. }
  117329. exports.concatMap = concatMap;
  117330. //# sourceMappingURL=concatMap.js.map
  117331. /***/ }),
  117332. /* 252 */
  117333. /***/ (function(module, exports, __webpack_require__) {
  117334. "use strict";
  117335. var filter_1 = __webpack_require__(253);
  117336. /* tslint:enable:max-line-length */
  117337. /**
  117338. * Filter items emitted by the source Observable by only emitting those that
  117339. * satisfy a specified predicate.
  117340. *
  117341. * <span class="informal">Like
  117342. * [Array.prototype.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter),
  117343. * it only emits a value from the source if it passes a criterion function.</span>
  117344. *
  117345. * <img src="./img/filter.png" width="100%">
  117346. *
  117347. * Similar to the well-known `Array.prototype.filter` method, this operator
  117348. * takes values from the source Observable, passes them through a `predicate`
  117349. * function and only emits those values that yielded `true`.
  117350. *
  117351. * @example <caption>Emit only click events whose target was a DIV element</caption>
  117352. * var clicks = Rx.Observable.fromEvent(document, 'click');
  117353. * var clicksOnDivs = clicks.filter(ev => ev.target.tagName === 'DIV');
  117354. * clicksOnDivs.subscribe(x => console.log(x));
  117355. *
  117356. * @see {@link distinct}
  117357. * @see {@link distinctUntilChanged}
  117358. * @see {@link distinctUntilKeyChanged}
  117359. * @see {@link ignoreElements}
  117360. * @see {@link partition}
  117361. * @see {@link skip}
  117362. *
  117363. * @param {function(value: T, index: number): boolean} predicate A function that
  117364. * evaluates each value emitted by the source Observable. If it returns `true`,
  117365. * the value is emitted, if `false` the value is not passed to the output
  117366. * Observable. The `index` parameter is the number `i` for the i-th source
  117367. * emission that has happened since the subscription, starting from the number
  117368. * `0`.
  117369. * @param {any} [thisArg] An optional argument to determine the value of `this`
  117370. * in the `predicate` function.
  117371. * @return {Observable} An Observable of values from the source that were
  117372. * allowed by the `predicate` function.
  117373. * @method filter
  117374. * @owner Observable
  117375. */
  117376. function filter(predicate, thisArg) {
  117377. return filter_1.filter(predicate, thisArg)(this);
  117378. }
  117379. exports.filter = filter;
  117380. //# sourceMappingURL=filter.js.map
  117381. /***/ }),
  117382. /* 253 */
  117383. /***/ (function(module, exports, __webpack_require__) {
  117384. "use strict";
  117385. var __extends = (this && this.__extends) || function (d, b) {
  117386. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  117387. function __() { this.constructor = d; }
  117388. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  117389. };
  117390. var Subscriber_1 = __webpack_require__(20);
  117391. /* tslint:enable:max-line-length */
  117392. /**
  117393. * Filter items emitted by the source Observable by only emitting those that
  117394. * satisfy a specified predicate.
  117395. *
  117396. * <span class="informal">Like
  117397. * [Array.prototype.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter),
  117398. * it only emits a value from the source if it passes a criterion function.</span>
  117399. *
  117400. * <img src="./img/filter.png" width="100%">
  117401. *
  117402. * Similar to the well-known `Array.prototype.filter` method, this operator
  117403. * takes values from the source Observable, passes them through a `predicate`
  117404. * function and only emits those values that yielded `true`.
  117405. *
  117406. * @example <caption>Emit only click events whose target was a DIV element</caption>
  117407. * var clicks = Rx.Observable.fromEvent(document, 'click');
  117408. * var clicksOnDivs = clicks.filter(ev => ev.target.tagName === 'DIV');
  117409. * clicksOnDivs.subscribe(x => console.log(x));
  117410. *
  117411. * @see {@link distinct}
  117412. * @see {@link distinctUntilChanged}
  117413. * @see {@link distinctUntilKeyChanged}
  117414. * @see {@link ignoreElements}
  117415. * @see {@link partition}
  117416. * @see {@link skip}
  117417. *
  117418. * @param {function(value: T, index: number): boolean} predicate A function that
  117419. * evaluates each value emitted by the source Observable. If it returns `true`,
  117420. * the value is emitted, if `false` the value is not passed to the output
  117421. * Observable. The `index` parameter is the number `i` for the i-th source
  117422. * emission that has happened since the subscription, starting from the number
  117423. * `0`.
  117424. * @param {any} [thisArg] An optional argument to determine the value of `this`
  117425. * in the `predicate` function.
  117426. * @return {Observable} An Observable of values from the source that were
  117427. * allowed by the `predicate` function.
  117428. * @method filter
  117429. * @owner Observable
  117430. */
  117431. function filter(predicate, thisArg) {
  117432. return function filterOperatorFunction(source) {
  117433. return source.lift(new FilterOperator(predicate, thisArg));
  117434. };
  117435. }
  117436. exports.filter = filter;
  117437. var FilterOperator = (function () {
  117438. function FilterOperator(predicate, thisArg) {
  117439. this.predicate = predicate;
  117440. this.thisArg = thisArg;
  117441. }
  117442. FilterOperator.prototype.call = function (subscriber, source) {
  117443. return source.subscribe(new FilterSubscriber(subscriber, this.predicate, this.thisArg));
  117444. };
  117445. return FilterOperator;
  117446. }());
  117447. /**
  117448. * We need this JSDoc comment for affecting ESDoc.
  117449. * @ignore
  117450. * @extends {Ignored}
  117451. */
  117452. var FilterSubscriber = (function (_super) {
  117453. __extends(FilterSubscriber, _super);
  117454. function FilterSubscriber(destination, predicate, thisArg) {
  117455. _super.call(this, destination);
  117456. this.predicate = predicate;
  117457. this.thisArg = thisArg;
  117458. this.count = 0;
  117459. }
  117460. // the try catch block below is left specifically for
  117461. // optimization and perf reasons. a tryCatcher is not necessary here.
  117462. FilterSubscriber.prototype._next = function (value) {
  117463. var result;
  117464. try {
  117465. result = this.predicate.call(this.thisArg, value, this.count++);
  117466. }
  117467. catch (err) {
  117468. this.destination.error(err);
  117469. return;
  117470. }
  117471. if (result) {
  117472. this.destination.next(value);
  117473. }
  117474. };
  117475. return FilterSubscriber;
  117476. }(Subscriber_1.Subscriber));
  117477. //# sourceMappingURL=filter.js.map
  117478. /***/ }),
  117479. /* 254 */
  117480. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117481. "use strict";
  117482. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return ModalSlideIn; });
  117483. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return ModalSlideOut; });
  117484. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ModalMDSlideIn; });
  117485. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return ModalMDSlideOut; });
  117486. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__animations_animation__ = __webpack_require__(11);
  117487. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__transitions_page_transition__ = __webpack_require__(32);
  117488. var __extends = (this && this.__extends) || (function () {
  117489. var extendStatics = Object.setPrototypeOf ||
  117490. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  117491. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  117492. return function (d, b) {
  117493. extendStatics(d, b);
  117494. function __() { this.constructor = d; }
  117495. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  117496. };
  117497. })();
  117498. /**
  117499. * Animations for modals
  117500. */
  117501. var ModalSlideIn = (function (_super) {
  117502. __extends(ModalSlideIn, _super);
  117503. function ModalSlideIn() {
  117504. return _super !== null && _super.apply(this, arguments) || this;
  117505. }
  117506. ModalSlideIn.prototype.init = function () {
  117507. _super.prototype.init.call(this);
  117508. var ele = this.enteringView.pageRef().nativeElement;
  117509. var backdropEle = ele.querySelector('ion-backdrop');
  117510. var backdrop = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, backdropEle);
  117511. var wrapper = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('.modal-wrapper'));
  117512. wrapper.beforeStyles({ 'opacity': 1 });
  117513. wrapper.fromTo('translateY', '100%', '0%');
  117514. backdrop.fromTo('opacity', 0.01, 0.4);
  117515. this
  117516. .element(this.enteringView.pageRef())
  117517. .easing('cubic-bezier(0.36,0.66,0.04,1)')
  117518. .duration(400)
  117519. .add(backdrop)
  117520. .add(wrapper);
  117521. };
  117522. return ModalSlideIn;
  117523. }(__WEBPACK_IMPORTED_MODULE_1__transitions_page_transition__["a" /* PageTransition */]));
  117524. var ModalSlideOut = (function (_super) {
  117525. __extends(ModalSlideOut, _super);
  117526. function ModalSlideOut() {
  117527. return _super !== null && _super.apply(this, arguments) || this;
  117528. }
  117529. ModalSlideOut.prototype.init = function () {
  117530. _super.prototype.init.call(this);
  117531. var ele = this.leavingView.pageRef().nativeElement;
  117532. var backdrop = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('ion-backdrop'));
  117533. var wrapperEle = ele.querySelector('.modal-wrapper');
  117534. var wrapperEleRect = wrapperEle.getBoundingClientRect();
  117535. var wrapper = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, wrapperEle);
  117536. // height of the screen - top of the container tells us how much to scoot it down
  117537. // so it's off-screen
  117538. wrapper.fromTo('translateY', '0px', this.plt.height() - wrapperEleRect.top + "px");
  117539. backdrop.fromTo('opacity', 0.4, 0.0);
  117540. this
  117541. .element(this.leavingView.pageRef())
  117542. .easing('ease-out')
  117543. .duration(250)
  117544. .add(backdrop)
  117545. .add(wrapper);
  117546. };
  117547. return ModalSlideOut;
  117548. }(__WEBPACK_IMPORTED_MODULE_1__transitions_page_transition__["a" /* PageTransition */]));
  117549. var ModalMDSlideIn = (function (_super) {
  117550. __extends(ModalMDSlideIn, _super);
  117551. function ModalMDSlideIn() {
  117552. return _super !== null && _super.apply(this, arguments) || this;
  117553. }
  117554. ModalMDSlideIn.prototype.init = function () {
  117555. _super.prototype.init.call(this);
  117556. var ele = this.enteringView.pageRef().nativeElement;
  117557. var backdrop = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('ion-backdrop'));
  117558. var wrapper = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('.modal-wrapper'));
  117559. backdrop.fromTo('opacity', 0.01, 0.4);
  117560. wrapper.fromTo('translateY', '40px', '0px');
  117561. wrapper.fromTo('opacity', 0.01, 1);
  117562. var DURATION = 280;
  117563. var EASING = 'cubic-bezier(0.36,0.66,0.04,1)';
  117564. this.element(this.enteringView.pageRef()).easing(EASING).duration(DURATION)
  117565. .add(backdrop)
  117566. .add(wrapper);
  117567. };
  117568. return ModalMDSlideIn;
  117569. }(__WEBPACK_IMPORTED_MODULE_1__transitions_page_transition__["a" /* PageTransition */]));
  117570. var ModalMDSlideOut = (function (_super) {
  117571. __extends(ModalMDSlideOut, _super);
  117572. function ModalMDSlideOut() {
  117573. return _super !== null && _super.apply(this, arguments) || this;
  117574. }
  117575. ModalMDSlideOut.prototype.init = function () {
  117576. _super.prototype.init.call(this);
  117577. var ele = this.leavingView.pageRef().nativeElement;
  117578. var backdrop = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('ion-backdrop'));
  117579. var wrapper = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('.modal-wrapper'));
  117580. backdrop.fromTo('opacity', 0.4, 0.0);
  117581. wrapper.fromTo('translateY', '0px', '40px');
  117582. wrapper.fromTo('opacity', 0.99, 0);
  117583. this
  117584. .element(this.leavingView.pageRef())
  117585. .duration(200)
  117586. .easing('cubic-bezier(0.47,0,0.745,0.715)')
  117587. .add(wrapper)
  117588. .add(backdrop);
  117589. };
  117590. return ModalMDSlideOut;
  117591. }(__WEBPACK_IMPORTED_MODULE_1__transitions_page_transition__["a" /* PageTransition */]));
  117592. //# sourceMappingURL=modal-transitions.js.map
  117593. /***/ }),
  117594. /* 255 */
  117595. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117596. "use strict";
  117597. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PopoverImpl; });
  117598. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_util__ = __webpack_require__(2);
  117599. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__popover_component__ = __webpack_require__(81);
  117600. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__popover_transitions__ = __webpack_require__(256);
  117601. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__navigation_view_controller__ = __webpack_require__(5);
  117602. var __extends = (this && this.__extends) || (function () {
  117603. var extendStatics = Object.setPrototypeOf ||
  117604. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  117605. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  117606. return function (d, b) {
  117607. extendStatics(d, b);
  117608. function __() { this.constructor = d; }
  117609. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  117610. };
  117611. })();
  117612. /**
  117613. * @hidden
  117614. */
  117615. var PopoverImpl = (function (_super) {
  117616. __extends(PopoverImpl, _super);
  117617. function PopoverImpl(app, component, data, opts, config) {
  117618. if (data === void 0) { data = {}; }
  117619. if (opts === void 0) { opts = {}; }
  117620. var _this = this;
  117621. opts.showBackdrop = Object(__WEBPACK_IMPORTED_MODULE_0__util_util__["l" /* isPresent */])(opts.showBackdrop) ? !!opts.showBackdrop : true;
  117622. opts.enableBackdropDismiss = Object(__WEBPACK_IMPORTED_MODULE_0__util_util__["l" /* isPresent */])(opts.enableBackdropDismiss) ? !!opts.enableBackdropDismiss : true;
  117623. data.component = component;
  117624. data.opts = opts;
  117625. _this = _super.call(this, __WEBPACK_IMPORTED_MODULE_1__popover_component__["a" /* PopoverCmp */], data, null) || this;
  117626. _this._app = app;
  117627. _this.isOverlay = true;
  117628. config.setTransition('popover-pop-in', __WEBPACK_IMPORTED_MODULE_2__popover_transitions__["c" /* PopoverPopIn */]);
  117629. config.setTransition('popover-pop-out', __WEBPACK_IMPORTED_MODULE_2__popover_transitions__["d" /* PopoverPopOut */]);
  117630. config.setTransition('popover-md-pop-in', __WEBPACK_IMPORTED_MODULE_2__popover_transitions__["a" /* PopoverMdPopIn */]);
  117631. config.setTransition('popover-md-pop-out', __WEBPACK_IMPORTED_MODULE_2__popover_transitions__["b" /* PopoverMdPopOut */]);
  117632. return _this;
  117633. }
  117634. /**
  117635. * @hidden
  117636. */
  117637. PopoverImpl.prototype.getTransitionName = function (direction) {
  117638. var key = (direction === 'back' ? 'popoverLeave' : 'popoverEnter');
  117639. return this._nav && this._nav.config.get(key);
  117640. };
  117641. /**
  117642. * Present the popover instance.
  117643. *
  117644. * @param {NavOptions} [navOptions={}] Nav options to go with this transition.
  117645. * @returns {Promise} Returns a promise which is resolved when the transition has completed.
  117646. */
  117647. PopoverImpl.prototype.present = function (navOptions) {
  117648. if (navOptions === void 0) { navOptions = {}; }
  117649. return this._app.present(this, navOptions);
  117650. };
  117651. return PopoverImpl;
  117652. }(__WEBPACK_IMPORTED_MODULE_3__navigation_view_controller__["a" /* ViewController */]));
  117653. //# sourceMappingURL=popover-impl.js.map
  117654. /***/ }),
  117655. /* 256 */
  117656. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117657. "use strict";
  117658. /* unused harmony export PopoverTransition */
  117659. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return PopoverPopIn; });
  117660. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return PopoverPopOut; });
  117661. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PopoverMdPopIn; });
  117662. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return PopoverMdPopOut; });
  117663. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__animations_animation__ = __webpack_require__(11);
  117664. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__transitions_page_transition__ = __webpack_require__(32);
  117665. var __extends = (this && this.__extends) || (function () {
  117666. var extendStatics = Object.setPrototypeOf ||
  117667. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  117668. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  117669. return function (d, b) {
  117670. extendStatics(d, b);
  117671. function __() { this.constructor = d; }
  117672. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  117673. };
  117674. })();
  117675. /**
  117676. * Animations for popover
  117677. */
  117678. var PopoverTransition = (function (_super) {
  117679. __extends(PopoverTransition, _super);
  117680. function PopoverTransition() {
  117681. return _super !== null && _super.apply(this, arguments) || this;
  117682. }
  117683. PopoverTransition.prototype.mdPositionView = function (nativeEle, ev) {
  117684. var originY = 'top';
  117685. var originX = 'left';
  117686. var popoverWrapperEle = nativeEle.querySelector('.popover-wrapper');
  117687. // Popover content width and height
  117688. var popoverEle = nativeEle.querySelector('.popover-content');
  117689. var popoverDim = popoverEle.getBoundingClientRect();
  117690. var popoverWidth = popoverDim.width;
  117691. var popoverHeight = popoverDim.height;
  117692. // Window body width and height
  117693. var bodyWidth = this.plt.width();
  117694. var bodyHeight = this.plt.height();
  117695. // If ev was passed, use that for target element
  117696. var targetDim = ev && ev.target && ev.target.getBoundingClientRect();
  117697. var targetTop = (targetDim && 'top' in targetDim) ? targetDim.top : (bodyHeight / 2) - (popoverHeight / 2);
  117698. var targetLeft = (targetDim && 'left' in targetDim) ? targetDim.left : (bodyWidth / 2) - (popoverWidth / 2);
  117699. var targetHeight = targetDim && targetDim.height || 0;
  117700. var popoverCSS = {
  117701. top: targetTop,
  117702. left: targetLeft
  117703. };
  117704. // If the popover left is less than the padding it is off screen
  117705. // to the left so adjust it, else if the width of the popover
  117706. // exceeds the body width it is off screen to the right so adjust
  117707. if (popoverCSS.left < POPOVER_MD_BODY_PADDING) {
  117708. popoverCSS.left = POPOVER_MD_BODY_PADDING;
  117709. }
  117710. else if (popoverWidth + POPOVER_MD_BODY_PADDING + popoverCSS.left > bodyWidth) {
  117711. popoverCSS.left = bodyWidth - popoverWidth - POPOVER_MD_BODY_PADDING;
  117712. originX = 'right';
  117713. }
  117714. // If the popover when popped down stretches past bottom of screen,
  117715. // make it pop up if there's room above
  117716. if (targetTop + targetHeight + popoverHeight > bodyHeight && targetTop - popoverHeight > 0) {
  117717. popoverCSS.top = targetTop - popoverHeight;
  117718. nativeEle.className = nativeEle.className + ' popover-bottom';
  117719. originY = 'bottom';
  117720. // If there isn't room for it to pop up above the target cut it off
  117721. }
  117722. else if (targetTop + targetHeight + popoverHeight > bodyHeight) {
  117723. popoverEle.style.bottom = POPOVER_MD_BODY_PADDING + 'px';
  117724. }
  117725. popoverEle.style.top = popoverCSS.top + 'px';
  117726. popoverEle.style.left = popoverCSS.left + 'px';
  117727. popoverEle.style[this.plt.Css.transformOrigin] = originY + ' ' + originX;
  117728. // Since the transition starts before styling is done we
  117729. // want to wait for the styles to apply before showing the wrapper
  117730. popoverWrapperEle.style.opacity = '1';
  117731. };
  117732. PopoverTransition.prototype.iosPositionView = function (nativeEle, ev) {
  117733. var originY = 'top';
  117734. var originX = 'left';
  117735. var popoverWrapperEle = nativeEle.querySelector('.popover-wrapper');
  117736. // Popover content width and height
  117737. var popoverEle = nativeEle.querySelector('.popover-content');
  117738. var popoverDim = popoverEle.getBoundingClientRect();
  117739. var popoverWidth = popoverDim.width;
  117740. var popoverHeight = popoverDim.height;
  117741. // Window body width and height
  117742. var bodyWidth = this.plt.width();
  117743. var bodyHeight = this.plt.height();
  117744. // If ev was passed, use that for target element
  117745. var targetDim = ev && ev.target && ev.target.getBoundingClientRect();
  117746. var targetTop = (targetDim && 'top' in targetDim) ? targetDim.top : (bodyHeight / 2) - (popoverHeight / 2);
  117747. var targetLeft = (targetDim && 'left' in targetDim) ? targetDim.left : (bodyWidth / 2);
  117748. var targetWidth = targetDim && targetDim.width || 0;
  117749. var targetHeight = targetDim && targetDim.height || 0;
  117750. // The arrow that shows above the popover on iOS
  117751. var arrowEle = nativeEle.querySelector('.popover-arrow');
  117752. var arrowDim = arrowEle.getBoundingClientRect();
  117753. var arrowWidth = arrowDim.width;
  117754. var arrowHeight = arrowDim.height;
  117755. // If no ev was passed, hide the arrow
  117756. if (!targetDim) {
  117757. arrowEle.style.display = 'none';
  117758. }
  117759. var arrowCSS = {
  117760. top: targetTop + targetHeight,
  117761. left: targetLeft + (targetWidth / 2) - (arrowWidth / 2)
  117762. };
  117763. var popoverCSS = {
  117764. top: targetTop + targetHeight + (arrowHeight - 1),
  117765. left: targetLeft + (targetWidth / 2) - (popoverWidth / 2)
  117766. };
  117767. // If the popover left is less than the padding it is off screen
  117768. // to the left so adjust it, else if the width of the popover
  117769. // exceeds the body width it is off screen to the right so adjust
  117770. //
  117771. var checkSafeAreaLeft = false;
  117772. var checkSafeAreaRight = false;
  117773. // If the popover left is less than the padding it is off screen
  117774. // to the left so adjust it, else if the width of the popover
  117775. // exceeds the body width it is off screen to the right so adjust
  117776. // 25 is a random/arbitrary number. It seems to work fine for ios11
  117777. // and iPhoneX. Is it perfect? No. Does it work? Yes.
  117778. if (popoverCSS.left < (POPOVER_IOS_BODY_PADDING + 25)) {
  117779. checkSafeAreaLeft = true;
  117780. popoverCSS.left = POPOVER_IOS_BODY_PADDING;
  117781. }
  117782. else if ((popoverWidth + POPOVER_IOS_BODY_PADDING + popoverCSS.left + 25) > bodyWidth) {
  117783. // Ok, so we're on the right side of the screen,
  117784. // but now we need to make sure we're still a bit further right
  117785. // cus....notchurally... Again, 25 is random. It works tho
  117786. checkSafeAreaRight = true;
  117787. popoverCSS.left = bodyWidth - popoverWidth - POPOVER_IOS_BODY_PADDING;
  117788. originX = 'right';
  117789. }
  117790. // make it pop up if there's room above
  117791. if (targetTop + targetHeight + popoverHeight > bodyHeight && targetTop - popoverHeight > 0) {
  117792. arrowCSS.top = targetTop - (arrowHeight + 1);
  117793. popoverCSS.top = targetTop - popoverHeight - (arrowHeight - 1);
  117794. nativeEle.className = nativeEle.className + ' popover-bottom';
  117795. originY = 'bottom';
  117796. // If there isn't room for it to pop up above the target cut it off
  117797. }
  117798. else if (targetTop + targetHeight + popoverHeight > bodyHeight) {
  117799. popoverEle.style.bottom = POPOVER_IOS_BODY_PADDING + '%';
  117800. }
  117801. arrowEle.style.top = arrowCSS.top + 'px';
  117802. arrowEle.style.left = arrowCSS.left + 'px';
  117803. popoverEle.style.top = popoverCSS.top + 'px';
  117804. popoverEle.style.left = popoverCSS.left + 'px';
  117805. if (checkSafeAreaLeft) {
  117806. if (CSS.supports('left', 'constant(safe-area-inset-left)')) {
  117807. popoverEle.style.left = "calc(" + popoverCSS.left + "px + constant(safe-area-inset-left)";
  117808. }
  117809. else if (CSS.supports('left', 'env(safe-area-inset-left)')) {
  117810. popoverEle.style.left = "calc(" + popoverCSS.left + "px + env(safe-area-inset-left)";
  117811. }
  117812. }
  117813. if (checkSafeAreaRight) {
  117814. if (CSS.supports('right', 'constant(safe-area-inset-right)')) {
  117815. popoverEle.style.left = "calc(" + popoverCSS.left + "px - constant(safe-area-inset-right)";
  117816. }
  117817. else if (CSS.supports('right', 'env(safe-area-inset-right)')) {
  117818. popoverEle.style.left = "calc(" + popoverCSS.left + "px - env(safe-area-inset-right)";
  117819. }
  117820. }
  117821. popoverEle.style[this.plt.Css.transformOrigin] = originY + ' ' + originX;
  117822. // Since the transition starts before styling is done we
  117823. // want to wait for the styles to apply before showing the wrapper
  117824. popoverWrapperEle.style.opacity = '1';
  117825. };
  117826. return PopoverTransition;
  117827. }(__WEBPACK_IMPORTED_MODULE_1__transitions_page_transition__["a" /* PageTransition */]));
  117828. var PopoverPopIn = (function (_super) {
  117829. __extends(PopoverPopIn, _super);
  117830. function PopoverPopIn() {
  117831. return _super !== null && _super.apply(this, arguments) || this;
  117832. }
  117833. PopoverPopIn.prototype.init = function () {
  117834. var ele = this.enteringView.pageRef().nativeElement;
  117835. var backdrop = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('ion-backdrop'));
  117836. var wrapper = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('.popover-wrapper'));
  117837. wrapper.fromTo('opacity', 0.01, 1);
  117838. backdrop.fromTo('opacity', 0.01, 0.08);
  117839. this
  117840. .easing('ease')
  117841. .duration(100)
  117842. .add(backdrop)
  117843. .add(wrapper);
  117844. };
  117845. PopoverPopIn.prototype.play = function () {
  117846. var _this = this;
  117847. this.plt.raf(function () {
  117848. _this.iosPositionView(_this.enteringView.pageRef().nativeElement, _this.opts.ev);
  117849. _super.prototype.play.call(_this);
  117850. });
  117851. };
  117852. return PopoverPopIn;
  117853. }(PopoverTransition));
  117854. var PopoverPopOut = (function (_super) {
  117855. __extends(PopoverPopOut, _super);
  117856. function PopoverPopOut() {
  117857. return _super !== null && _super.apply(this, arguments) || this;
  117858. }
  117859. PopoverPopOut.prototype.init = function () {
  117860. var ele = this.leavingView.pageRef().nativeElement;
  117861. var backdrop = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('ion-backdrop'));
  117862. var wrapper = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('.popover-wrapper'));
  117863. wrapper.fromTo('opacity', 0.99, 0);
  117864. backdrop.fromTo('opacity', 0.08, 0);
  117865. this
  117866. .easing('ease')
  117867. .duration(500)
  117868. .add(backdrop)
  117869. .add(wrapper);
  117870. };
  117871. return PopoverPopOut;
  117872. }(PopoverTransition));
  117873. var PopoverMdPopIn = (function (_super) {
  117874. __extends(PopoverMdPopIn, _super);
  117875. function PopoverMdPopIn() {
  117876. return _super !== null && _super.apply(this, arguments) || this;
  117877. }
  117878. PopoverMdPopIn.prototype.init = function () {
  117879. var ele = this.enteringView.pageRef().nativeElement;
  117880. var content = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('.popover-content'));
  117881. var viewport = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('.popover-viewport'));
  117882. content.fromTo('scale', 0.001, 1);
  117883. viewport.fromTo('opacity', 0.01, 1);
  117884. this
  117885. .easing('cubic-bezier(0.36,0.66,0.04,1)')
  117886. .duration(300)
  117887. .add(content)
  117888. .add(viewport);
  117889. };
  117890. PopoverMdPopIn.prototype.play = function () {
  117891. var _this = this;
  117892. this.plt.raf(function () {
  117893. _this.mdPositionView(_this.enteringView.pageRef().nativeElement, _this.opts.ev);
  117894. _super.prototype.play.call(_this);
  117895. });
  117896. };
  117897. return PopoverMdPopIn;
  117898. }(PopoverTransition));
  117899. var PopoverMdPopOut = (function (_super) {
  117900. __extends(PopoverMdPopOut, _super);
  117901. function PopoverMdPopOut() {
  117902. return _super !== null && _super.apply(this, arguments) || this;
  117903. }
  117904. PopoverMdPopOut.prototype.init = function () {
  117905. var ele = this.leavingView.pageRef().nativeElement;
  117906. var wrapper = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, ele.querySelector('.popover-wrapper'));
  117907. wrapper.fromTo('opacity', 0.99, 0);
  117908. this
  117909. .easing('ease')
  117910. .duration(500)
  117911. .fromTo('opacity', 0.01, 1)
  117912. .add(wrapper);
  117913. };
  117914. return PopoverMdPopOut;
  117915. }(PopoverTransition));
  117916. var POPOVER_IOS_BODY_PADDING = 2;
  117917. var POPOVER_MD_BODY_PADDING = 12;
  117918. //# sourceMappingURL=popover-transitions.js.map
  117919. /***/ }),
  117920. /* 257 */
  117921. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117922. "use strict";
  117923. /* harmony export (immutable) */ __webpack_exports__["a"] = enableKeyboardControl;
  117924. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__swiper_utils__ = __webpack_require__(12);
  117925. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__swiper__ = __webpack_require__(46);
  117926. /*=========================
  117927. Keyboard Control
  117928. ===========================*/
  117929. function handleKeyboard(s, plt, e) {
  117930. var win = plt.win();
  117931. var kc = e.keyCode || e.charCode;
  117932. // Directions locks
  117933. if (!s._allowSwipeToNext && (Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) && kc === 39 || !Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) && kc === 40)) {
  117934. return false;
  117935. }
  117936. if (!s._allowSwipeToPrev && (Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) && kc === 37 || !Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) && kc === 38)) {
  117937. return false;
  117938. }
  117939. if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) {
  117940. return;
  117941. }
  117942. var activeEle = plt.getActiveElement();
  117943. if (activeEle && activeEle.nodeName && (activeEle.nodeName.toLowerCase() === 'input' || activeEle.nodeName.toLowerCase() === 'textarea')) {
  117944. return;
  117945. }
  117946. if (kc === 37 || kc === 39 || kc === 38 || kc === 40) {
  117947. var inView = false;
  117948. // Check that swiper should be inside of visible area of window
  117949. if (s.container.closest('.' + __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].slide) && !s.container.closest('.' + __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].slideActive)) {
  117950. return;
  117951. }
  117952. var windowScroll = {
  117953. left: win.pageXOffset,
  117954. top: win.pageYOffset
  117955. };
  117956. var windowWidth = plt.width();
  117957. var windowHeight = plt.height();
  117958. var swiperOffset = Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["j" /* offset */])(s.container, plt);
  117959. if (s._rtl) {
  117960. swiperOffset.left = swiperOffset.left - s.container.scrollLeft;
  117961. }
  117962. var swiperCoord = [
  117963. [swiperOffset.left, swiperOffset.top],
  117964. [swiperOffset.left + s.renderedWidth, swiperOffset.top],
  117965. [swiperOffset.left, swiperOffset.top + s.renderedHeight],
  117966. [swiperOffset.left + s.renderedWidth, swiperOffset.top + s.renderedHeight]
  117967. ];
  117968. for (var i = 0; i < swiperCoord.length; i++) {
  117969. var point = swiperCoord[i];
  117970. if (point[0] >= windowScroll.left && point[0] <= windowScroll.left + windowWidth &&
  117971. point[1] >= windowScroll.top && point[1] <= windowScroll.top + windowHeight) {
  117972. inView = true;
  117973. }
  117974. }
  117975. if (!inView)
  117976. return;
  117977. }
  117978. if (Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s)) {
  117979. if (kc === 37 || kc === 39) {
  117980. if (e.preventDefault) {
  117981. e.preventDefault();
  117982. }
  117983. else {
  117984. e.returnValue = false;
  117985. }
  117986. }
  117987. if ((kc === 39 && !s._rtl) || (kc === 37 && s._rtl)) {
  117988. Object(__WEBPACK_IMPORTED_MODULE_1__swiper__["h" /* slideNext */])(s, plt);
  117989. }
  117990. if ((kc === 37 && !s._rtl) || (kc === 39 && s._rtl)) {
  117991. Object(__WEBPACK_IMPORTED_MODULE_1__swiper__["i" /* slidePrev */])(s, plt);
  117992. }
  117993. }
  117994. else {
  117995. if (kc === 38 || kc === 40) {
  117996. if (e.preventDefault) {
  117997. e.preventDefault();
  117998. }
  117999. else {
  118000. e.returnValue = false;
  118001. }
  118002. }
  118003. if (kc === 40) {
  118004. Object(__WEBPACK_IMPORTED_MODULE_1__swiper__["h" /* slideNext */])(s, plt);
  118005. }
  118006. if (kc === 38) {
  118007. Object(__WEBPACK_IMPORTED_MODULE_1__swiper__["i" /* slidePrev */])(s, plt);
  118008. }
  118009. }
  118010. }
  118011. function enableKeyboardControl(s, plt, shouldEnable) {
  118012. if (shouldEnable && !s._keyboardUnReg) {
  118013. s._keyboardUnReg = plt.registerListener(plt.doc(), 'keydown', function (ev) {
  118014. handleKeyboard(s, plt, ev);
  118015. }, { zone: false });
  118016. }
  118017. else if (!shouldEnable && s._keyboardUnReg) {
  118018. s._keyboardUnReg();
  118019. }
  118020. }
  118021. //# sourceMappingURL=swiper-keyboard.js.map
  118022. /***/ }),
  118023. /* 258 */
  118024. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118025. "use strict";
  118026. /* unused harmony export initA11y */
  118027. /* unused harmony export makeFocusable */
  118028. /* unused harmony export addRole */
  118029. /* unused harmony export addLabel */
  118030. /* harmony export (immutable) */ __webpack_exports__["a"] = ariaDisable;
  118031. /* harmony export (immutable) */ __webpack_exports__["b"] = ariaHidden;
  118032. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__swiper_utils__ = __webpack_require__(12);
  118033. function initA11y(s, plt) {
  118034. var unregs = [];
  118035. s._liveRegion = plt.doc().createElement('span');
  118036. s._liveRegion.className = __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].notification;
  118037. s._liveRegion.setAttribute('aria-live', 'assertive');
  118038. s._liveRegion.setAttribute('aria-atomic', 'true');
  118039. s.container.appendChild(s._liveRegion);
  118040. // Setup accessibility
  118041. if (s.nextButton) {
  118042. makeFocusable(s.nextButton);
  118043. addRole(s.nextButton, 'button');
  118044. addLabel(s.nextButton, s.nextSlideMessage);
  118045. plt.registerListener(s.nextButton, 'keydown', function (ev) {
  118046. onEnterKey(s, ev);
  118047. }, { zone: false }, unregs);
  118048. }
  118049. if (s.prevButton) {
  118050. makeFocusable(s.prevButton);
  118051. addRole(s.prevButton, 'button');
  118052. addLabel(s.prevButton, s.prevSlideMessage);
  118053. plt.registerListener(s.prevButton, 'keydown', function (ev) {
  118054. onEnterKey(s, ev);
  118055. }, { zone: false }, unregs);
  118056. }
  118057. return function () {
  118058. unregs.forEach(function (unreg) {
  118059. unreg();
  118060. });
  118061. unregs = null;
  118062. if (s._liveRegion) {
  118063. s._liveRegion.parentElement.removeChild(s._liveRegion);
  118064. }
  118065. };
  118066. }
  118067. function makeFocusable(ele) {
  118068. ele.setAttribute('tabIndex', '0');
  118069. }
  118070. function addRole(ele, role) {
  118071. ele.setAttribute('role', role);
  118072. }
  118073. function addLabel(ele, label) {
  118074. ele.setAttribute('aria-label', label);
  118075. }
  118076. function ariaDisable(ele, isDisabled) {
  118077. if (isDisabled) {
  118078. ele.setAttribute('aria-disabled', 'true');
  118079. }
  118080. else if (ele.hasAttribute('aria-disabled')) {
  118081. ele.removeAttribute('aria-disabled');
  118082. }
  118083. }
  118084. function ariaHidden(ele, isHidden) {
  118085. if (isHidden) {
  118086. ele.setAttribute('aria-hidden', 'true');
  118087. }
  118088. else if (ele.hasAttribute('aria-hidden')) {
  118089. ele.removeAttribute('aria-hidden');
  118090. }
  118091. }
  118092. function onEnterKey(_, __) {
  118093. // if (event.keyCode !== 13) return;
  118094. // const target: HTMLElement = <any>event.target;
  118095. // if (target.classList.contains(PARAMS.nextButtonClass)) {
  118096. // if (s.isEnd) {
  118097. // notify(s, PARAMS.lastSlideMessage);
  118098. // } else {
  118099. // notify(s, PARAMS.nextSlideMessage);
  118100. // }
  118101. // } else if (target.classList.contains(PARAMS.prevButtonClass)) {
  118102. // if (s.isBeginning) {
  118103. // notify(s, PARAMS.firstSlideMessage);
  118104. // } else {
  118105. // notify(s, PARAMS.prevSlideMessage);
  118106. // }
  118107. // }
  118108. }
  118109. // function notify(s: Slides, message: string) {
  118110. // var notification = s._liveRegion;
  118111. // if (notification) {
  118112. // notification.innerHTML = message || '';
  118113. // }
  118114. // }
  118115. //# sourceMappingURL=swiper-a11y.js.map
  118116. /***/ }),
  118117. /* 259 */
  118118. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118119. "use strict";
  118120. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SWIPER_CONTROLLER; });
  118121. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__swiper__ = __webpack_require__(46);
  118122. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__swiper_index__ = __webpack_require__(48);
  118123. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__swiper_utils__ = __webpack_require__(12);
  118124. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__swiper_progress__ = __webpack_require__(47);
  118125. /*=========================
  118126. Controller
  118127. ===========================*/
  118128. var SWIPER_CONTROLLER = {
  118129. LinearSpline: function (_s, _platform, x, y) {
  118130. this.x = x;
  118131. this.y = y;
  118132. this.lastIndex = x.length - 1;
  118133. // Given an x value (x2), return the expected y2 value:
  118134. // (x1,y1) is the known point before given value,
  118135. // (x3,y3) is the known point after given value.
  118136. var i1, i3;
  118137. this.interpolate = function (x2) {
  118138. if (!x2)
  118139. return 0;
  118140. // Get the indexes of x1 and x3 (the array indexes before and after given x2):
  118141. i3 = binarySearch(this.x, x2);
  118142. i1 = i3 - 1;
  118143. // We have our indexes i1 & i3, so we can calculate already:
  118144. // y2 := ((x2−x1) × (y3−y1)) ÷ (x3−x1) + y1
  118145. return ((x2 - this.x[i1]) * (this.y[i3] - this.y[i1])) / (this.x[i3] - this.x[i1]) + this.y[i1];
  118146. };
  118147. var binarySearch = (function () {
  118148. var maxIndex, minIndex, guess;
  118149. return function (array, val) {
  118150. minIndex = -1;
  118151. maxIndex = array.length;
  118152. while (maxIndex - minIndex > 1)
  118153. if (array[guess = maxIndex + minIndex >> 1] <= val) {
  118154. minIndex = guess;
  118155. }
  118156. else {
  118157. maxIndex = guess;
  118158. }
  118159. return maxIndex;
  118160. };
  118161. })();
  118162. },
  118163. // xxx: for now i will just save one spline function to to
  118164. getInterpolateFunction: function (s, plt, c) {
  118165. if (!s._spline)
  118166. s._spline = s.loop ?
  118167. new SWIPER_CONTROLLER.LinearSpline(s, plt, s._slidesGrid, c._slidesGrid) :
  118168. new SWIPER_CONTROLLER.LinearSpline(s, plt, s._snapGrid, c._snapGrid);
  118169. },
  118170. setTranslate: function (s, plt, translate, byController, setWrapperTranslate) {
  118171. var controlled = s.control;
  118172. var multiplier, controlledTranslate;
  118173. function setControlledTranslate(c) {
  118174. // this will create an Interpolate function based on the snapGrids
  118175. // x is the Grid of the scrolled scroller and y will be the controlled scroller
  118176. // it makes sense to create this only once and recall it for the interpolation
  118177. // the function does a lot of value caching for performance
  118178. translate = c._rtl && Object(__WEBPACK_IMPORTED_MODULE_2__swiper_utils__["g" /* isHorizontal */])(c) ? -s._translate : s._translate;
  118179. if (s.controlBy === 'slide') {
  118180. SWIPER_CONTROLLER.getInterpolateFunction(s, plt, c);
  118181. // i am not sure why the values have to be multiplicated this way, tried to invert the snapGrid
  118182. // but it did not work out
  118183. controlledTranslate = -s._spline.interpolate(-translate);
  118184. }
  118185. if (!controlledTranslate || s.controlBy === 'container') {
  118186. multiplier = (Object(__WEBPACK_IMPORTED_MODULE_2__swiper_utils__["h" /* maxTranslate */])(c) - Object(__WEBPACK_IMPORTED_MODULE_2__swiper_utils__["i" /* minTranslate */])(c)) / (Object(__WEBPACK_IMPORTED_MODULE_2__swiper_utils__["h" /* maxTranslate */])(s) - Object(__WEBPACK_IMPORTED_MODULE_2__swiper_utils__["i" /* minTranslate */])(s));
  118187. controlledTranslate = (translate - Object(__WEBPACK_IMPORTED_MODULE_2__swiper_utils__["i" /* minTranslate */])(s)) * multiplier + Object(__WEBPACK_IMPORTED_MODULE_2__swiper_utils__["i" /* minTranslate */])(c);
  118188. }
  118189. if (s.controlInverse) {
  118190. controlledTranslate = Object(__WEBPACK_IMPORTED_MODULE_2__swiper_utils__["h" /* maxTranslate */])(c) - controlledTranslate;
  118191. }
  118192. Object(__WEBPACK_IMPORTED_MODULE_3__swiper_progress__["a" /* updateProgress */])(c, controlledTranslate);
  118193. setWrapperTranslate(c, plt, controlledTranslate, false, s);
  118194. Object(__WEBPACK_IMPORTED_MODULE_1__swiper_index__["a" /* updateActiveIndex */])(c);
  118195. }
  118196. if (Array.isArray(controlled)) {
  118197. for (var i = 0; i < controlled.length; i++) {
  118198. if (controlled[i] !== byController) {
  118199. setControlledTranslate(controlled[i]);
  118200. }
  118201. }
  118202. }
  118203. else if (byController !== controlled) {
  118204. setControlledTranslate(controlled);
  118205. }
  118206. },
  118207. setTransition: function (s, plt, duration, byController, setWrapperTransition) {
  118208. var controlled = s.control;
  118209. var i;
  118210. function setControlledTransition(c) {
  118211. setWrapperTransition(c, plt, duration, s);
  118212. if (duration !== 0) {
  118213. Object(__WEBPACK_IMPORTED_MODULE_0__swiper__["f" /* onTransitionStart */])(c);
  118214. plt.transitionEnd(c._wrapper, function () {
  118215. if (!controlled)
  118216. return;
  118217. if (c.loop && s.controlBy === 'slide') {
  118218. Object(__WEBPACK_IMPORTED_MODULE_0__swiper__["c" /* fixLoop */])(c, plt);
  118219. }
  118220. Object(__WEBPACK_IMPORTED_MODULE_0__swiper__["e" /* onTransitionEnd */])(c, plt);
  118221. });
  118222. }
  118223. }
  118224. if (Array.isArray(controlled)) {
  118225. for (i = 0; i < controlled.length; i++) {
  118226. if (controlled[i] !== byController) {
  118227. setControlledTransition(controlled[i]);
  118228. }
  118229. }
  118230. }
  118231. else if (byController !== controlled) {
  118232. setControlledTransition(controlled);
  118233. }
  118234. }
  118235. };
  118236. //# sourceMappingURL=swiper-controller.js.map
  118237. /***/ }),
  118238. /* 260 */
  118239. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118240. "use strict";
  118241. /* harmony export (immutable) */ __webpack_exports__["a"] = initEvents;
  118242. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__swiper_utils__ = __webpack_require__(12);
  118243. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__swiper_transition__ = __webpack_require__(88);
  118244. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__swiper__ = __webpack_require__(46);
  118245. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__swiper_progress__ = __webpack_require__(47);
  118246. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__swiper_index__ = __webpack_require__(48);
  118247. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__swiper_pagination__ = __webpack_require__(90);
  118248. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__swiper_classes__ = __webpack_require__(89);
  118249. /*=========================
  118250. Events
  118251. ===========================*/
  118252. // Attach/detach events
  118253. function initEvents(s, plt) {
  118254. var win = plt.win();
  118255. var doc = plt.doc();
  118256. s._supportTouch = (function () {
  118257. return !!(('ontouchstart' in win) || win.DocumentTouch && doc instanceof win.DocumentTouch);
  118258. })();
  118259. // Define Touch Events
  118260. s._touchEventsDesktop = { start: 'mousedown', move: 'mousemove', end: 'mouseup' };
  118261. if (win.navigator.pointerEnabled) {
  118262. s._touchEventsDesktop = { start: 'pointerdown', move: 'pointermove', end: 'pointerup' };
  118263. }
  118264. else if (win.navigator.msPointerEnabled) {
  118265. s._touchEventsDesktop = { start: 'MSPointerDown', move: 'MSPointerMove', end: 'MSPointerUp' };
  118266. }
  118267. s._touchEvents = {
  118268. start: s._supportTouch || !s.simulateTouch ? 'touchstart' : s._touchEventsDesktop.start,
  118269. move: s._supportTouch || !s.simulateTouch ? 'touchmove' : s._touchEventsDesktop.move,
  118270. end: s._supportTouch || !s.simulateTouch ? 'touchend' : s._touchEventsDesktop.end
  118271. };
  118272. // WP8 Touch Events Fix
  118273. if (win.navigator.pointerEnabled || win.navigator.msPointerEnabled) {
  118274. (s.touchEventsTarget === 'container' ? s.container : s._wrapper).classList.add('swiper-wp8-' + s.direction);
  118275. }
  118276. var unregs = [];
  118277. var touchEventsTarget = s.touchEventsTarget === 'container' ? s.container : s._wrapper;
  118278. // Touch Events
  118279. if (s._supportTouch) {
  118280. // touchstart
  118281. plt.registerListener(touchEventsTarget, s._touchEvents.start, function (ev) {
  118282. onTouchStart(s, plt, ev);
  118283. }, { passive: true, zone: false }, unregs);
  118284. // touchmove
  118285. plt.registerListener(touchEventsTarget, s._touchEvents.move, function (ev) {
  118286. onTouchMove(s, plt, ev);
  118287. }, { zone: false }, unregs);
  118288. // touchend
  118289. plt.registerListener(touchEventsTarget, s._touchEvents.end, function (ev) {
  118290. onTouchEnd(s, plt, ev);
  118291. }, { passive: true, zone: false }, unregs);
  118292. }
  118293. if ((s.simulateTouch && !plt.is('ios') && !plt.is('android')) || (s.simulateTouch && !s._supportTouch && plt.is('ios')) || plt.getQueryParam('ionicPlatform')) {
  118294. // mousedown
  118295. plt.registerListener(touchEventsTarget, 'mousedown', function (ev) {
  118296. onTouchStart(s, plt, ev);
  118297. }, { zone: false }, unregs);
  118298. // mousemove
  118299. plt.registerListener(touchEventsTarget, 'mousemove', function (ev) {
  118300. onTouchMove(s, plt, ev);
  118301. }, { zone: false }, unregs);
  118302. // mouseup
  118303. plt.registerListener(touchEventsTarget, 'mouseup', function (ev) {
  118304. onTouchEnd(s, plt, ev);
  118305. }, { zone: false }, unregs);
  118306. }
  118307. // onresize
  118308. var resizeObs = plt.resize.subscribe(function () { return onResize(s, plt, false); });
  118309. // Next, Prev, Index
  118310. if (s.nextButton) {
  118311. plt.registerListener(s.nextButton, 'click', function (ev) {
  118312. onClickNext(s, plt, ev);
  118313. }, { zone: false }, unregs);
  118314. }
  118315. if (s.prevButton) {
  118316. plt.registerListener(s.prevButton, 'click', function (ev) {
  118317. onClickPrev(s, plt, ev);
  118318. }, { zone: false }, unregs);
  118319. }
  118320. if (s.paginationType) {
  118321. plt.registerListener(s._paginationContainer, 'click', function (ev) {
  118322. onClickIndex(s, plt, ev);
  118323. }, { zone: false }, unregs);
  118324. }
  118325. // Prevent Links Clicks
  118326. if (s.preventClicks || s.preventClicksPropagation) {
  118327. plt.registerListener(touchEventsTarget, 'click', function (ev) {
  118328. preventClicks(s, ev);
  118329. }, { zone: false, capture: true }, unregs);
  118330. }
  118331. // return a function that removes all of the added listeners
  118332. return function () {
  118333. resizeObs.unsubscribe();
  118334. unregs.forEach(function (unreg) {
  118335. unreg();
  118336. });
  118337. unregs = null;
  118338. };
  118339. }
  118340. /*=========================
  118341. Handle Clicks
  118342. ===========================*/
  118343. // Prevent Clicks
  118344. function preventClicks(s, e) {
  118345. if (!s._allowClick) {
  118346. if (s.preventClicks) {
  118347. e.preventDefault();
  118348. }
  118349. if (s.preventClicksPropagation && s._animating) {
  118350. e.stopPropagation();
  118351. e.stopImmediatePropagation();
  118352. }
  118353. }
  118354. }
  118355. // Clicks
  118356. function onClickNext(s, plt, e) {
  118357. e.preventDefault();
  118358. if (s._isEnd && !s.loop) {
  118359. return;
  118360. }
  118361. Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["h" /* slideNext */])(s, plt);
  118362. }
  118363. function onClickPrev(s, plt, e) {
  118364. e.preventDefault();
  118365. if (s._isBeginning && !s.loop) {
  118366. return;
  118367. }
  118368. Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["i" /* slidePrev */])(s, plt);
  118369. }
  118370. function onClickIndex(s, plt, e) {
  118371. var indexStr = e.target.getAttribute('data-slide-index');
  118372. if (indexStr) {
  118373. var index = parseInt(indexStr, 10);
  118374. e.preventDefault();
  118375. if (s.loop) {
  118376. index = index + s.loopedSlides;
  118377. }
  118378. Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["k" /* slideTo */])(s, plt, index);
  118379. }
  118380. }
  118381. /*=========================
  118382. Handle Touches
  118383. ===========================*/
  118384. function findElementInEvent(e, selector) {
  118385. var el = e.target;
  118386. if (!el.matches(selector)) {
  118387. if (typeof selector === 'string') {
  118388. el = el.closest(selector);
  118389. }
  118390. else if (selector.nodeType) {
  118391. var parentEl = el.parentElement;
  118392. while (parentEl) {
  118393. if (parentEl === selector) {
  118394. return selector;
  118395. }
  118396. }
  118397. return undefined;
  118398. }
  118399. }
  118400. return el;
  118401. }
  118402. function updateClickedSlide(s, plt, e) {
  118403. var slide = findElementInEvent(e, '.' + __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].slide);
  118404. var slideIndex = -1;
  118405. if (slide) {
  118406. for (var i = 0; i < s._slides.length; i++) {
  118407. if (s._slides[i] === slide) {
  118408. slideIndex = i;
  118409. break;
  118410. }
  118411. }
  118412. }
  118413. if (slide && slideIndex > -1) {
  118414. s.clickedSlide = slide;
  118415. s.clickedIndex = slideIndex;
  118416. }
  118417. else {
  118418. s.clickedSlide = undefined;
  118419. s.clickedIndex = undefined;
  118420. return;
  118421. }
  118422. if (s.slideToClickedSlide && s.clickedIndex !== undefined && s.clickedIndex !== s._activeIndex) {
  118423. var slideToIndex = s.clickedIndex;
  118424. var realIndex;
  118425. var slidesPerView = s.slidesPerView === 'auto' ? Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["a" /* currentSlidesPerView */])(s) : s.slidesPerView;
  118426. if (s.loop) {
  118427. if (s._animating)
  118428. return;
  118429. realIndex = parseInt(s.clickedSlide.getAttribute('data-swiper-slide-index'), 10);
  118430. if (s.centeredSlides) {
  118431. if ((slideToIndex < s.loopedSlides - slidesPerView / 2) || (slideToIndex > s._slides.length - s.loopedSlides + slidesPerView / 2)) {
  118432. Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["c" /* fixLoop */])(s, plt);
  118433. slideToIndex = Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["d" /* getElementIndex */])(s._wrapper.querySelector('.' + __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].slide + '[data-swiper-slide-index="' + realIndex + '"]:not(.' + __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].slideDuplicate + ')'));
  118434. plt.timeout(function () {
  118435. Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["k" /* slideTo */])(s, plt, slideToIndex);
  118436. });
  118437. }
  118438. else {
  118439. Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["k" /* slideTo */])(s, plt, slideToIndex);
  118440. }
  118441. }
  118442. else {
  118443. if (slideToIndex > s._slides.length - slidesPerView) {
  118444. Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["c" /* fixLoop */])(s, plt);
  118445. slideToIndex = Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["d" /* getElementIndex */])(s._wrapper.querySelector('.' + __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].slide + '[data-swiper-slide-index="' + realIndex + '"]:not(.' + __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].slideDuplicate + ')'));
  118446. plt.timeout(function () {
  118447. Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["k" /* slideTo */])(s, plt, slideToIndex);
  118448. });
  118449. }
  118450. else {
  118451. Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["k" /* slideTo */])(s, plt, slideToIndex);
  118452. }
  118453. }
  118454. }
  118455. else {
  118456. Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["k" /* slideTo */])(s, plt, slideToIndex);
  118457. }
  118458. }
  118459. }
  118460. var isTouched;
  118461. var isMoved;
  118462. var allowTouchCallbacks;
  118463. var touchStartTime;
  118464. var isScrolling;
  118465. var currentTranslate;
  118466. var startTranslate;
  118467. var allowThresholdMove;
  118468. // Last click time
  118469. var lastClickTime = Date.now();
  118470. var clickTimeout;
  118471. // Velocities
  118472. var velocities = [];
  118473. var allowMomentumBounce;
  118474. // Touch handlers
  118475. var isTouchEvent;
  118476. var startMoving;
  118477. function onTouchStart(s, plt, ev) {
  118478. (void 0) /* console.debug */;
  118479. if (ev.originalEvent) {
  118480. ev = ev.originalEvent;
  118481. }
  118482. s.originalEvent = ev;
  118483. isTouchEvent = ev.type === 'touchstart';
  118484. if (!isTouchEvent && 'which' in ev && ev.which === 3) {
  118485. return;
  118486. }
  118487. if (s.noSwiping && findElementInEvent(ev, '.' + __WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].noSwiping)) {
  118488. s._allowClick = true;
  118489. return;
  118490. }
  118491. if (s.swipeHandler) {
  118492. if (!findElementInEvent(ev, s.swipeHandler))
  118493. return;
  118494. }
  118495. var startX = s._touches.currentX = ev.type === 'touchstart' ? ev.targetTouches[0].pageX : ev.pageX;
  118496. var startY = s._touches.currentY = ev.type === 'touchstart' ? ev.targetTouches[0].pageY : ev.pageY;
  118497. // Do NOT start if iOS edge swipe is detected. Otherwise iOS app (UIWebView) cannot swipe-to-go-back anymore
  118498. if (plt.is('ios') && s.iOSEdgeSwipeDetection && startX <= s.iOSEdgeSwipeThreshold) {
  118499. return;
  118500. }
  118501. isTouched = true;
  118502. isMoved = false;
  118503. allowTouchCallbacks = true;
  118504. isScrolling = undefined;
  118505. startMoving = undefined;
  118506. s._touches.startX = startX;
  118507. s._touches.startY = startY;
  118508. touchStartTime = Date.now();
  118509. s._allowClick = true;
  118510. Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["p" /* updateContainerSize */])(s, plt);
  118511. s.swipeDirection = undefined;
  118512. if (s.threshold > 0) {
  118513. allowThresholdMove = false;
  118514. }
  118515. if (ev.type !== 'touchstart') {
  118516. var preventDefault = true;
  118517. if (Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["f" /* isFormElement */])(ev.target)) {
  118518. preventDefault = false;
  118519. }
  118520. plt.focusOutActiveElement();
  118521. if (preventDefault) {
  118522. ev.preventDefault();
  118523. }
  118524. }
  118525. s.ionSlideTouchStart.emit(ev);
  118526. }
  118527. function onTouchMove(s, plt, ev) {
  118528. (void 0) /* console.debug */;
  118529. if (ev.originalEvent) {
  118530. ev = ev.originalEvent;
  118531. }
  118532. s.originalEvent = ev;
  118533. if (isTouchEvent && ev.type === 'mousemove')
  118534. return;
  118535. if (ev.preventedByNestedSwiper) {
  118536. s._touches.startX = ev.type === 'touchmove' ? ev.targetTouches[0].pageX : ev.pageX;
  118537. s._touches.startY = ev.type === 'touchmove' ? ev.targetTouches[0].pageY : ev.pageY;
  118538. return;
  118539. }
  118540. if (s.onlyExternal) {
  118541. // isMoved = true;
  118542. s._allowClick = false;
  118543. if (isTouched) {
  118544. s._touches.startX = s._touches.currentX = ev.type === 'touchmove' ? ev.targetTouches[0].pageX : ev.pageX;
  118545. s._touches.startY = s._touches.currentY = ev.type === 'touchmove' ? ev.targetTouches[0].pageY : ev.pageY;
  118546. touchStartTime = Date.now();
  118547. }
  118548. return;
  118549. }
  118550. if (isTouchEvent && s.touchReleaseOnEdges && !s.loop) {
  118551. if (!Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s)) {
  118552. // Vertical
  118553. if ((s._touches.currentY < s._touches.startY && s._translate <= Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["h" /* maxTranslate */])(s)) ||
  118554. (s._touches.currentY > s._touches.startY && s._translate >= Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["i" /* minTranslate */])(s))) {
  118555. return;
  118556. }
  118557. }
  118558. else {
  118559. if ((s._touches.currentX < s._touches.startX && s._translate <= Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["h" /* maxTranslate */])(s)) ||
  118560. (s._touches.currentX > s._touches.startX && s._translate >= Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["i" /* minTranslate */])(s))) {
  118561. return;
  118562. }
  118563. }
  118564. }
  118565. var activeEle = plt.getActiveElement();
  118566. if (isTouchEvent && activeEle) {
  118567. if (ev.target === activeEle && Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["f" /* isFormElement */])(ev.target)) {
  118568. isMoved = true;
  118569. s._allowClick = false;
  118570. return;
  118571. }
  118572. }
  118573. if (ev.targetTouches && ev.targetTouches.length > 1)
  118574. return;
  118575. s._touches.currentX = ev.type === 'touchmove' ? ev.targetTouches[0].pageX : ev.pageX;
  118576. s._touches.currentY = ev.type === 'touchmove' ? ev.targetTouches[0].pageY : ev.pageY;
  118577. if (typeof isScrolling === 'undefined') {
  118578. var touchAngle;
  118579. if (Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) && s._touches.currentY === s._touches.startY || !Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) && s._touches.currentX === s._touches.startX) {
  118580. isScrolling = false;
  118581. }
  118582. else {
  118583. touchAngle = Math.atan2(Math.abs(s._touches.currentY - s._touches.startY), Math.abs(s._touches.currentX - s._touches.startX)) * 180 / Math.PI;
  118584. isScrolling = Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) ? touchAngle > s.touchAngle : (90 - touchAngle > s.touchAngle);
  118585. }
  118586. }
  118587. if (!isTouched)
  118588. return;
  118589. if (isScrolling) {
  118590. isTouched = false;
  118591. return;
  118592. }
  118593. s._allowClick = false;
  118594. s.ionSlideDrag.emit(s);
  118595. ev.preventDefault();
  118596. if (s.touchMoveStopPropagation) {
  118597. ev.stopPropagation();
  118598. }
  118599. if (!isMoved) {
  118600. if (s.loop) {
  118601. Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["c" /* fixLoop */])(s, plt);
  118602. }
  118603. startTranslate = Object(__WEBPACK_IMPORTED_MODULE_1__swiper_transition__["b" /* getWrapperTranslate */])(s, plt);
  118604. Object(__WEBPACK_IMPORTED_MODULE_1__swiper_transition__["c" /* setWrapperTransition */])(s, plt, 0);
  118605. if (s._animating) {
  118606. Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["p" /* triggerTransitionEnd */])(plt, s._wrapper);
  118607. }
  118608. if (s.autoplay && s._autoplaying) {
  118609. if (s.autoplayDisableOnInteraction) {
  118610. Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["m" /* stopAutoplay */])(s);
  118611. }
  118612. else {
  118613. Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["g" /* pauseAutoplay */])(s, plt);
  118614. }
  118615. }
  118616. allowMomentumBounce = false;
  118617. }
  118618. isMoved = true;
  118619. var diff = s._touches.diff = Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) ? s._touches.currentX - s._touches.startX : s._touches.currentY - s._touches.startY;
  118620. diff = diff * s.touchRatio;
  118621. if (s._rtl)
  118622. diff = -diff;
  118623. s.swipeDirection = diff > 0 ? 'prev' : 'next';
  118624. currentTranslate = diff + startTranslate;
  118625. var disableParentSwiper = true;
  118626. if ((diff > 0 && currentTranslate > Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["i" /* minTranslate */])(s))) {
  118627. disableParentSwiper = false;
  118628. if (s.resistance) {
  118629. currentTranslate = Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["i" /* minTranslate */])(s) - 1 + Math.pow(-Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["i" /* minTranslate */])(s) + startTranslate + diff, s.resistanceRatio);
  118630. }
  118631. }
  118632. else if (diff < 0 && currentTranslate < Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["h" /* maxTranslate */])(s)) {
  118633. disableParentSwiper = false;
  118634. if (s.resistance)
  118635. currentTranslate = Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["h" /* maxTranslate */])(s) + 1 - Math.pow(Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["h" /* maxTranslate */])(s) - startTranslate - diff, s.resistanceRatio);
  118636. }
  118637. if (disableParentSwiper) {
  118638. ev.preventedByNestedSwiper = true;
  118639. }
  118640. // Directions locks
  118641. if (!s._allowSwipeToNext && s.swipeDirection === 'next' && currentTranslate < startTranslate) {
  118642. currentTranslate = startTranslate;
  118643. }
  118644. if (!s._allowSwipeToPrev && s.swipeDirection === 'prev' && currentTranslate > startTranslate) {
  118645. currentTranslate = startTranslate;
  118646. }
  118647. // Threshold
  118648. if (s.threshold > 0) {
  118649. if (Math.abs(diff) > s.threshold || allowThresholdMove) {
  118650. if (!allowThresholdMove) {
  118651. allowThresholdMove = true;
  118652. s._touches.startX = s._touches.currentX;
  118653. s._touches.startY = s._touches.currentY;
  118654. currentTranslate = startTranslate;
  118655. s._touches.diff = Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) ? s._touches.currentX - s._touches.startX : s._touches.currentY - s._touches.startY;
  118656. return;
  118657. }
  118658. }
  118659. else {
  118660. currentTranslate = startTranslate;
  118661. return;
  118662. }
  118663. }
  118664. if (!s.followFinger)
  118665. return;
  118666. // Update active index in free mode
  118667. if (s.freeMode || s.watchSlidesProgress) {
  118668. Object(__WEBPACK_IMPORTED_MODULE_4__swiper_index__["a" /* updateActiveIndex */])(s);
  118669. }
  118670. if (s.freeMode) {
  118671. // Velocity
  118672. if (velocities.length === 0) {
  118673. velocities.push({
  118674. position: s._touches[Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) ? 'startX' : 'startY'],
  118675. time: touchStartTime
  118676. });
  118677. }
  118678. velocities.push({
  118679. position: s._touches[Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["g" /* isHorizontal */])(s) ? 'currentX' : 'currentY'],
  118680. time: (new Date()).getTime()
  118681. });
  118682. }
  118683. // Update progress
  118684. Object(__WEBPACK_IMPORTED_MODULE_3__swiper_progress__["a" /* updateProgress */])(s, currentTranslate);
  118685. // Update translate
  118686. Object(__WEBPACK_IMPORTED_MODULE_1__swiper_transition__["d" /* setWrapperTranslate */])(s, plt, currentTranslate);
  118687. }
  118688. function onTouchEnd(s, plt, ev) {
  118689. (void 0) /* console.debug */;
  118690. if (ev.originalEvent) {
  118691. ev = ev.originalEvent;
  118692. }
  118693. s.originalEvent = ev;
  118694. if (allowTouchCallbacks) {
  118695. s.ionSlideTouchEnd.emit(ev);
  118696. }
  118697. allowTouchCallbacks = false;
  118698. if (!isTouched)
  118699. return;
  118700. // Time diff
  118701. var touchEndTime = Date.now();
  118702. var timeDiff = touchEndTime - touchStartTime;
  118703. // Tap, doubleTap, Click
  118704. if (s._allowClick) {
  118705. updateClickedSlide(s, plt, ev);
  118706. s._zone.run(function () {
  118707. s.ionSlideTap.emit(s);
  118708. if (timeDiff < 300 && (touchEndTime - lastClickTime) > 300) {
  118709. if (clickTimeout) {
  118710. plt.cancelTimeout(clickTimeout);
  118711. }
  118712. clickTimeout = plt.timeout(function () {
  118713. if (!s)
  118714. return;
  118715. if (s.paginationHide && s._paginationContainer && !ev.target.classList.contains(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].bullet)) {
  118716. s._paginationContainer.classList.toggle(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["a" /* CLS */].paginationHidden);
  118717. }
  118718. }, 300);
  118719. }
  118720. if (timeDiff < 300 && (touchEndTime - lastClickTime) < 300) {
  118721. if (clickTimeout)
  118722. clearTimeout(clickTimeout);
  118723. s.ionSlideDoubleTap.emit(s);
  118724. }
  118725. });
  118726. }
  118727. lastClickTime = Date.now();
  118728. plt.timeout(function () {
  118729. if (s) {
  118730. s._allowClick = true;
  118731. }
  118732. });
  118733. if (!isTouched || !isMoved || !s.swipeDirection || s._touches.diff === 0 || currentTranslate === startTranslate) {
  118734. isTouched = isMoved = false;
  118735. return;
  118736. }
  118737. isTouched = isMoved = false;
  118738. var currentPos;
  118739. if (s.followFinger) {
  118740. currentPos = s._rtl ? s._translate : -s._translate;
  118741. }
  118742. else {
  118743. currentPos = -currentTranslate;
  118744. }
  118745. if (s.freeMode) {
  118746. if (currentPos < -Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["i" /* minTranslate */])(s)) {
  118747. Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["k" /* slideTo */])(s, plt, s._activeIndex);
  118748. return;
  118749. }
  118750. else if (currentPos > -Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["h" /* maxTranslate */])(s)) {
  118751. if (s._slides.length < s._snapGrid.length) {
  118752. Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["k" /* slideTo */])(s, plt, s._snapGrid.length - 1);
  118753. }
  118754. else {
  118755. Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["k" /* slideTo */])(s, plt, s._slides.length - 1);
  118756. }
  118757. return;
  118758. }
  118759. if (s.freeModeMomentum) {
  118760. if (velocities.length > 1) {
  118761. var lastMoveEvent = velocities.pop(), velocityEvent = velocities.pop();
  118762. var distance = lastMoveEvent.position - velocityEvent.position;
  118763. var time = lastMoveEvent.time - velocityEvent.time;
  118764. s.velocity = distance / time;
  118765. s.velocity = s.velocity / 2;
  118766. if (Math.abs(s.velocity) < s.freeModeMinimumVelocity) {
  118767. s.velocity = 0;
  118768. }
  118769. // this implies that the user stopped moving a finger then released.
  118770. // There would be no events with distance zero, so the last event is stale.
  118771. if (time > 150 || (new Date().getTime() - lastMoveEvent.time) > 300) {
  118772. s.velocity = 0;
  118773. }
  118774. }
  118775. else {
  118776. s.velocity = 0;
  118777. }
  118778. s.velocity = s.velocity * s.freeModeMomentumVelocityRatio;
  118779. velocities.length = 0;
  118780. var momentumDuration = 1000 * s.freeModeMomentumRatio;
  118781. var momentumDistance = s.velocity * momentumDuration;
  118782. var newPosition = s._translate + momentumDistance;
  118783. if (s._rtl)
  118784. newPosition = -newPosition;
  118785. var doBounce = false;
  118786. var afterBouncePosition;
  118787. var bounceAmount = Math.abs(s.velocity) * 20 * s.freeModeMomentumBounceRatio;
  118788. if (newPosition < Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["h" /* maxTranslate */])(s)) {
  118789. if (s.freeModeMomentumBounce) {
  118790. if (newPosition + Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["h" /* maxTranslate */])(s) < -bounceAmount) {
  118791. newPosition = Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["h" /* maxTranslate */])(s) - bounceAmount;
  118792. }
  118793. afterBouncePosition = Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["h" /* maxTranslate */])(s);
  118794. doBounce = true;
  118795. allowMomentumBounce = true;
  118796. }
  118797. else {
  118798. newPosition = Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["h" /* maxTranslate */])(s);
  118799. }
  118800. }
  118801. else if (newPosition > Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["i" /* minTranslate */])(s)) {
  118802. if (s.freeModeMomentumBounce) {
  118803. if (newPosition - Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["i" /* minTranslate */])(s) > bounceAmount) {
  118804. newPosition = Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["i" /* minTranslate */])(s) + bounceAmount;
  118805. }
  118806. afterBouncePosition = Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["i" /* minTranslate */])(s);
  118807. doBounce = true;
  118808. allowMomentumBounce = true;
  118809. }
  118810. else {
  118811. newPosition = Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["i" /* minTranslate */])(s);
  118812. }
  118813. }
  118814. else if (s.freeModeSticky) {
  118815. var j = 0;
  118816. var nextSlide;
  118817. for (j = 0; j < s._snapGrid.length; j += 1) {
  118818. if (s._snapGrid[j] > -newPosition) {
  118819. nextSlide = j;
  118820. break;
  118821. }
  118822. }
  118823. if (Math.abs(s._snapGrid[nextSlide] - newPosition) < Math.abs(s._snapGrid[nextSlide - 1] - newPosition) || s.swipeDirection === 'next') {
  118824. newPosition = s._snapGrid[nextSlide];
  118825. }
  118826. else {
  118827. newPosition = s._snapGrid[nextSlide - 1];
  118828. }
  118829. if (!s._rtl)
  118830. newPosition = -newPosition;
  118831. }
  118832. // Fix duration
  118833. if (s.velocity !== 0) {
  118834. if (s._rtl) {
  118835. momentumDuration = Math.abs((-newPosition - s._translate) / s.velocity);
  118836. }
  118837. else {
  118838. momentumDuration = Math.abs((newPosition - s._translate) / s.velocity);
  118839. }
  118840. }
  118841. else if (s.freeModeSticky) {
  118842. Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["j" /* slideReset */])(s, plt);
  118843. return;
  118844. }
  118845. if (s.freeModeMomentumBounce && doBounce) {
  118846. Object(__WEBPACK_IMPORTED_MODULE_3__swiper_progress__["a" /* updateProgress */])(s, afterBouncePosition);
  118847. Object(__WEBPACK_IMPORTED_MODULE_1__swiper_transition__["c" /* setWrapperTransition */])(s, plt, momentumDuration);
  118848. Object(__WEBPACK_IMPORTED_MODULE_1__swiper_transition__["d" /* setWrapperTranslate */])(s, plt, newPosition);
  118849. Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["f" /* onTransitionStart */])(s);
  118850. s._animating = true;
  118851. plt.transitionEnd(s._wrapper, function () {
  118852. if (!s || !allowMomentumBounce)
  118853. return;
  118854. Object(__WEBPACK_IMPORTED_MODULE_1__swiper_transition__["c" /* setWrapperTransition */])(s, plt, s.speed);
  118855. Object(__WEBPACK_IMPORTED_MODULE_1__swiper_transition__["d" /* setWrapperTranslate */])(s, plt, afterBouncePosition);
  118856. plt.transitionEnd(s._wrapper, function () {
  118857. if (!s)
  118858. return;
  118859. Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["e" /* onTransitionEnd */])(s, plt);
  118860. });
  118861. });
  118862. }
  118863. else if (s.velocity) {
  118864. Object(__WEBPACK_IMPORTED_MODULE_3__swiper_progress__["a" /* updateProgress */])(s, newPosition);
  118865. Object(__WEBPACK_IMPORTED_MODULE_1__swiper_transition__["c" /* setWrapperTransition */])(s, plt, momentumDuration);
  118866. Object(__WEBPACK_IMPORTED_MODULE_1__swiper_transition__["d" /* setWrapperTranslate */])(s, plt, newPosition);
  118867. Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["f" /* onTransitionStart */])(s);
  118868. if (!s._animating) {
  118869. s._animating = true;
  118870. plt.transitionEnd(s._wrapper, function () {
  118871. if (!s)
  118872. return;
  118873. Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["e" /* onTransitionEnd */])(s, plt);
  118874. });
  118875. }
  118876. }
  118877. else {
  118878. Object(__WEBPACK_IMPORTED_MODULE_3__swiper_progress__["a" /* updateProgress */])(s, newPosition);
  118879. }
  118880. Object(__WEBPACK_IMPORTED_MODULE_4__swiper_index__["a" /* updateActiveIndex */])(s);
  118881. }
  118882. if (!s.freeModeMomentum || timeDiff >= s.longSwipesMs) {
  118883. Object(__WEBPACK_IMPORTED_MODULE_3__swiper_progress__["a" /* updateProgress */])(s);
  118884. Object(__WEBPACK_IMPORTED_MODULE_4__swiper_index__["a" /* updateActiveIndex */])(s);
  118885. }
  118886. return;
  118887. }
  118888. // Find current slide
  118889. var stopIndex = 0;
  118890. var groupSize = s._slidesSizesGrid[0];
  118891. for (var i = 0; i < s._slidesGrid.length; i += s.slidesPerGroup) {
  118892. if (typeof s._slidesGrid[i + s.slidesPerGroup] !== 'undefined') {
  118893. if (currentPos >= s._slidesGrid[i] && currentPos < s._slidesGrid[i + s.slidesPerGroup]) {
  118894. stopIndex = i;
  118895. groupSize = s._slidesGrid[i + s.slidesPerGroup] - s._slidesGrid[i];
  118896. }
  118897. }
  118898. else {
  118899. if (currentPos >= s._slidesGrid[i]) {
  118900. stopIndex = i;
  118901. groupSize = s._slidesGrid[s._slidesGrid.length - 1] - s._slidesGrid[s._slidesGrid.length - 2];
  118902. }
  118903. }
  118904. }
  118905. // Find current slide size
  118906. var ratio = (currentPos - s._slidesGrid[stopIndex]) / groupSize;
  118907. if (timeDiff > s.longSwipesMs) {
  118908. // Long touches
  118909. if (!s.longSwipes) {
  118910. Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["k" /* slideTo */])(s, plt, s._activeIndex);
  118911. return;
  118912. }
  118913. if (s.swipeDirection === 'next') {
  118914. if (ratio >= s.longSwipesRatio) {
  118915. Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["k" /* slideTo */])(s, plt, stopIndex + s.slidesPerGroup);
  118916. }
  118917. else {
  118918. Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["k" /* slideTo */])(s, plt, stopIndex);
  118919. }
  118920. }
  118921. if (s.swipeDirection === 'prev') {
  118922. if (ratio > (1 - s.longSwipesRatio)) {
  118923. Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["k" /* slideTo */])(s, plt, stopIndex + s.slidesPerGroup);
  118924. }
  118925. else {
  118926. Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["k" /* slideTo */])(s, plt, stopIndex);
  118927. }
  118928. }
  118929. }
  118930. else {
  118931. // Short swipes
  118932. if (!s.shortSwipes) {
  118933. Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["k" /* slideTo */])(s, plt, s._activeIndex);
  118934. return;
  118935. }
  118936. if (s.swipeDirection === 'next') {
  118937. Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["k" /* slideTo */])(s, plt, stopIndex + s.slidesPerGroup);
  118938. }
  118939. if (s.swipeDirection === 'prev') {
  118940. Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["k" /* slideTo */])(s, plt, stopIndex);
  118941. }
  118942. }
  118943. }
  118944. /*=========================
  118945. Resize Handler
  118946. ===========================*/
  118947. var resizeId;
  118948. function onResize(s, plt, forceUpdatePagination) {
  118949. // TODO: hacky, we should use Resize Observer in the future
  118950. if (resizeId) {
  118951. plt.cancelTimeout(resizeId);
  118952. resizeId = null;
  118953. }
  118954. resizeId = plt.timeout(function () { return doResize(s, plt, forceUpdatePagination); }, 200);
  118955. }
  118956. function doResize(s, plt, forceUpdatePagination) {
  118957. resizeId = null;
  118958. // Disable locks on resize
  118959. var allowSwipeToPrev = s._allowSwipeToPrev;
  118960. var allowSwipeToNext = s._allowSwipeToNext;
  118961. s._allowSwipeToPrev = s._allowSwipeToNext = true;
  118962. Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["p" /* updateContainerSize */])(s, plt);
  118963. Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["q" /* updateSlidesSize */])(s, plt);
  118964. if (s.slidesPerView === 'auto' || s.freeMode || forceUpdatePagination) {
  118965. Object(__WEBPACK_IMPORTED_MODULE_5__swiper_pagination__["a" /* updatePagination */])(s);
  118966. }
  118967. if (s._spline) {
  118968. s._spline = undefined;
  118969. }
  118970. var slideChangedBySlideTo = false;
  118971. if (s.freeMode) {
  118972. var newTranslate = Math.min(Math.max(s._translate, Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["h" /* maxTranslate */])(s)), Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__["i" /* minTranslate */])(s));
  118973. Object(__WEBPACK_IMPORTED_MODULE_1__swiper_transition__["d" /* setWrapperTranslate */])(s, plt, newTranslate);
  118974. Object(__WEBPACK_IMPORTED_MODULE_4__swiper_index__["a" /* updateActiveIndex */])(s);
  118975. Object(__WEBPACK_IMPORTED_MODULE_6__swiper_classes__["a" /* updateClasses */])(s);
  118976. if (s.autoHeight) {
  118977. Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["o" /* updateAutoHeight */])(s);
  118978. }
  118979. }
  118980. else {
  118981. Object(__WEBPACK_IMPORTED_MODULE_6__swiper_classes__["a" /* updateClasses */])(s);
  118982. if ((s.slidesPerView === 'auto' || s.slidesPerView > 1) && s._isEnd && !s.centeredSlides) {
  118983. slideChangedBySlideTo = Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["k" /* slideTo */])(s, plt, s._slides.length - 1, 0, false, true);
  118984. }
  118985. else {
  118986. slideChangedBySlideTo = Object(__WEBPACK_IMPORTED_MODULE_2__swiper__["k" /* slideTo */])(s, plt, s._activeIndex, 0, false, true);
  118987. }
  118988. }
  118989. // Return locks after resize
  118990. s._allowSwipeToPrev = allowSwipeToPrev;
  118991. s._allowSwipeToNext = allowSwipeToNext;
  118992. }
  118993. //# sourceMappingURL=swiper-events.js.map
  118994. /***/ }),
  118995. /* 261 */
  118996. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118997. "use strict";
  118998. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return ToastSlideIn; });
  118999. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return ToastSlideOut; });
  119000. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ToastMdSlideIn; });
  119001. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return ToastMdSlideOut; });
  119002. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return ToastWpPopIn; });
  119003. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return ToastWpPopOut; });
  119004. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__animations_animation__ = __webpack_require__(11);
  119005. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__transitions_transition__ = __webpack_require__(27);
  119006. var __extends = (this && this.__extends) || (function () {
  119007. var extendStatics = Object.setPrototypeOf ||
  119008. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  119009. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  119010. return function (d, b) {
  119011. extendStatics(d, b);
  119012. function __() { this.constructor = d; }
  119013. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  119014. };
  119015. })();
  119016. var ToastSlideIn = (function (_super) {
  119017. __extends(ToastSlideIn, _super);
  119018. function ToastSlideIn() {
  119019. return _super !== null && _super.apply(this, arguments) || this;
  119020. }
  119021. ToastSlideIn.prototype.init = function () {
  119022. // DOM READS
  119023. var ele = this.enteringView.pageRef().nativeElement;
  119024. var wrapperEle = ele.querySelector('.toast-wrapper');
  119025. var wrapper = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, wrapperEle);
  119026. if (this.enteringView.data && this.enteringView.data.position === TOAST_POSITION_TOP) {
  119027. // top
  119028. // by default, it is -100% hidden (above the screen)
  119029. // so move from that to 10px below top: 0px;
  119030. wrapper.fromTo('translateY', '-100%', 10 + "px");
  119031. }
  119032. else if (this.enteringView.data && this.enteringView.data.position === TOAST_POSITION_MIDDLE) {
  119033. // Middle
  119034. // just center it and fade it in
  119035. var topPosition = Math.floor(ele.clientHeight / 2 - wrapperEle.clientHeight / 2);
  119036. // DOM WRITE
  119037. wrapperEle.style.top = topPosition + "px";
  119038. wrapper.fromTo('opacity', 0.01, 1);
  119039. }
  119040. else {
  119041. // bottom
  119042. // by default, it is 100% hidden (below the screen),
  119043. // so move from that to 10 px above bottom: 0px
  119044. wrapper.fromTo('translateY', '100%', 0 - 10 + "px");
  119045. }
  119046. this.easing('cubic-bezier(.36,.66,.04,1)').duration(400).add(wrapper);
  119047. };
  119048. return ToastSlideIn;
  119049. }(__WEBPACK_IMPORTED_MODULE_1__transitions_transition__["a" /* Transition */]));
  119050. var ToastSlideOut = (function (_super) {
  119051. __extends(ToastSlideOut, _super);
  119052. function ToastSlideOut() {
  119053. return _super !== null && _super.apply(this, arguments) || this;
  119054. }
  119055. ToastSlideOut.prototype.init = function () {
  119056. var ele = this.leavingView.pageRef().nativeElement;
  119057. var wrapperEle = ele.querySelector('.toast-wrapper');
  119058. var wrapper = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, wrapperEle);
  119059. if (this.leavingView.data && this.leavingView.data.position === TOAST_POSITION_TOP) {
  119060. // top
  119061. // reverse arguments from enter transition
  119062. wrapper.fromTo('translateY', 10 + "px", '-100%');
  119063. }
  119064. else if (this.leavingView.data && this.leavingView.data.position === TOAST_POSITION_MIDDLE) {
  119065. // Middle
  119066. // just fade it out
  119067. wrapper.fromTo('opacity', 0.99, 0);
  119068. }
  119069. else {
  119070. // bottom
  119071. // reverse arguments from enter transition
  119072. wrapper.fromTo('translateY', 0 - 10 + "px", '100%');
  119073. }
  119074. this.easing('cubic-bezier(.36,.66,.04,1)').duration(300).add(wrapper);
  119075. };
  119076. return ToastSlideOut;
  119077. }(__WEBPACK_IMPORTED_MODULE_1__transitions_transition__["a" /* Transition */]));
  119078. var ToastMdSlideIn = (function (_super) {
  119079. __extends(ToastMdSlideIn, _super);
  119080. function ToastMdSlideIn() {
  119081. return _super !== null && _super.apply(this, arguments) || this;
  119082. }
  119083. ToastMdSlideIn.prototype.init = function () {
  119084. // DOM reads
  119085. var ele = this.enteringView.pageRef().nativeElement;
  119086. var wrapperEle = ele.querySelector('.toast-wrapper');
  119087. var wrapper = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, wrapperEle);
  119088. if (this.enteringView.data && this.enteringView.data.position === TOAST_POSITION_TOP) {
  119089. // top
  119090. // by default, it is -100% hidden (above the screen)
  119091. // so move from that to top: 0px;
  119092. wrapper.fromTo('translateY', '-100%', "0%");
  119093. }
  119094. else if (this.enteringView.data && this.enteringView.data.position === TOAST_POSITION_MIDDLE) {
  119095. // Middle
  119096. // just center it and fade it in
  119097. var topPosition = Math.floor(ele.clientHeight / 2 - wrapperEle.clientHeight / 2);
  119098. // DOM WRITE
  119099. wrapperEle.style.top = topPosition + "px";
  119100. wrapper.fromTo('opacity', 0.01, 1);
  119101. }
  119102. else {
  119103. // bottom
  119104. // by default, it is 100% hidden (below the screen),
  119105. // so move from that to bottom: 0px
  119106. wrapper.fromTo('translateY', '100%', "0%");
  119107. }
  119108. this.easing('cubic-bezier(.36,.66,.04,1)').duration(400).add(wrapper);
  119109. };
  119110. return ToastMdSlideIn;
  119111. }(__WEBPACK_IMPORTED_MODULE_1__transitions_transition__["a" /* Transition */]));
  119112. var ToastMdSlideOut = (function (_super) {
  119113. __extends(ToastMdSlideOut, _super);
  119114. function ToastMdSlideOut() {
  119115. return _super !== null && _super.apply(this, arguments) || this;
  119116. }
  119117. ToastMdSlideOut.prototype.init = function () {
  119118. var ele = this.leavingView.pageRef().nativeElement;
  119119. var wrapperEle = ele.querySelector('.toast-wrapper');
  119120. var wrapper = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, wrapperEle);
  119121. if (this.leavingView.data && this.leavingView.data.position === TOAST_POSITION_TOP) {
  119122. // top
  119123. // reverse arguments from enter transition
  119124. wrapper.fromTo('translateY', 0 + "%", '-100%');
  119125. }
  119126. else if (this.leavingView.data && this.leavingView.data.position === TOAST_POSITION_MIDDLE) {
  119127. // Middle
  119128. // just fade it out
  119129. wrapper.fromTo('opacity', 0.99, 0);
  119130. }
  119131. else {
  119132. // bottom
  119133. // reverse arguments from enter transition
  119134. wrapper.fromTo('translateY', 0 + "%", '100%');
  119135. }
  119136. this.easing('cubic-bezier(.36,.66,.04,1)').duration(450).add(wrapper);
  119137. };
  119138. return ToastMdSlideOut;
  119139. }(__WEBPACK_IMPORTED_MODULE_1__transitions_transition__["a" /* Transition */]));
  119140. var ToastWpPopIn = (function (_super) {
  119141. __extends(ToastWpPopIn, _super);
  119142. function ToastWpPopIn() {
  119143. return _super !== null && _super.apply(this, arguments) || this;
  119144. }
  119145. ToastWpPopIn.prototype.init = function () {
  119146. var ele = this.enteringView.pageRef().nativeElement;
  119147. var wrapperEle = ele.querySelector('.toast-wrapper');
  119148. var wrapper = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, wrapperEle);
  119149. if (this.enteringView.data && this.enteringView.data.position === TOAST_POSITION_TOP) {
  119150. // top
  119151. wrapper.fromTo('opacity', 0.01, 1);
  119152. wrapper.fromTo('scale', 1.3, 1);
  119153. }
  119154. else if (this.enteringView.data && this.enteringView.data.position === TOAST_POSITION_MIDDLE) {
  119155. // Middle
  119156. // just center it and fade it in
  119157. var topPosition = Math.floor(ele.clientHeight / 2 - wrapperEle.clientHeight / 2);
  119158. // DOM WRITE
  119159. wrapperEle.style.top = topPosition + "px";
  119160. wrapper.fromTo('opacity', 0.01, 1);
  119161. wrapper.fromTo('scale', 1.3, 1);
  119162. }
  119163. else {
  119164. // bottom
  119165. wrapper.fromTo('opacity', 0.01, 1);
  119166. wrapper.fromTo('scale', 1.3, 1);
  119167. }
  119168. this.easing('cubic-bezier(0,0,0.05,1)').duration(200).add(wrapper);
  119169. };
  119170. return ToastWpPopIn;
  119171. }(__WEBPACK_IMPORTED_MODULE_1__transitions_transition__["a" /* Transition */]));
  119172. var ToastWpPopOut = (function (_super) {
  119173. __extends(ToastWpPopOut, _super);
  119174. function ToastWpPopOut() {
  119175. return _super !== null && _super.apply(this, arguments) || this;
  119176. }
  119177. ToastWpPopOut.prototype.init = function () {
  119178. // DOM reads
  119179. var ele = this.leavingView.pageRef().nativeElement;
  119180. var wrapperEle = ele.querySelector('.toast-wrapper');
  119181. var wrapper = new __WEBPACK_IMPORTED_MODULE_0__animations_animation__["a" /* Animation */](this.plt, wrapperEle);
  119182. if (this.leavingView.data && this.leavingView.data.position === TOAST_POSITION_TOP) {
  119183. // top
  119184. // reverse arguments from enter transition
  119185. wrapper.fromTo('opacity', 0.99, 0);
  119186. wrapper.fromTo('scale', 1, 1.3);
  119187. }
  119188. else if (this.leavingView.data && this.leavingView.data.position === TOAST_POSITION_MIDDLE) {
  119189. // Middle
  119190. // just fade it out
  119191. wrapper.fromTo('opacity', 0.99, 0);
  119192. wrapper.fromTo('scale', 1, 1.3);
  119193. }
  119194. else {
  119195. // bottom
  119196. // reverse arguments from enter transition
  119197. wrapper.fromTo('opacity', 0.99, 0);
  119198. wrapper.fromTo('scale', 1, 1.3);
  119199. }
  119200. // DOM writes
  119201. var EASE = 'ease-out';
  119202. var DURATION = 150;
  119203. this.easing(EASE).duration(DURATION).add(wrapper);
  119204. };
  119205. return ToastWpPopOut;
  119206. }(__WEBPACK_IMPORTED_MODULE_1__transitions_transition__["a" /* Transition */]));
  119207. var TOAST_POSITION_TOP = 'top';
  119208. var TOAST_POSITION_MIDDLE = 'middle';
  119209. //# sourceMappingURL=toast-transitions.js.map
  119210. /***/ }),
  119211. /* 262 */
  119212. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119213. "use strict";
  119214. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ToggleGesture; });
  119215. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__gestures_gesture_controller__ = __webpack_require__(7);
  119216. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__gestures_pan_gesture__ = __webpack_require__(43);
  119217. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_dom__ = __webpack_require__(10);
  119218. var __extends = (this && this.__extends) || (function () {
  119219. var extendStatics = Object.setPrototypeOf ||
  119220. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  119221. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  119222. return function (d, b) {
  119223. extendStatics(d, b);
  119224. function __() { this.constructor = d; }
  119225. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  119226. };
  119227. })();
  119228. /**
  119229. * @hidden
  119230. */
  119231. var ToggleGesture = (function (_super) {
  119232. __extends(ToggleGesture, _super);
  119233. function ToggleGesture(plt, toggle, gestureCtrl, domCtrl) {
  119234. var _this = _super.call(this, plt, toggle.getNativeElement(), {
  119235. threshold: 0,
  119236. zone: false,
  119237. domController: domCtrl,
  119238. gesture: gestureCtrl.createGesture({
  119239. name: __WEBPACK_IMPORTED_MODULE_0__gestures_gesture_controller__["k" /* GESTURE_TOGGLE */],
  119240. priority: __WEBPACK_IMPORTED_MODULE_0__gestures_gesture_controller__["i" /* GESTURE_PRIORITY_TOGGLE */]
  119241. })
  119242. }) || this;
  119243. _this.toggle = toggle;
  119244. return _this;
  119245. }
  119246. ToggleGesture.prototype.canStart = function () {
  119247. return true;
  119248. };
  119249. ToggleGesture.prototype.onDragStart = function (ev) {
  119250. ev.preventDefault();
  119251. this.toggle._onDragStart(Object(__WEBPACK_IMPORTED_MODULE_2__util_dom__["f" /* pointerCoord */])(ev).x);
  119252. };
  119253. ToggleGesture.prototype.onDragMove = function (ev) {
  119254. ev.preventDefault();
  119255. this.toggle._onDragMove(Object(__WEBPACK_IMPORTED_MODULE_2__util_dom__["f" /* pointerCoord */])(ev).x);
  119256. };
  119257. ToggleGesture.prototype.onDragEnd = function (ev) {
  119258. ev.preventDefault();
  119259. this.toggle._onDragEnd(Object(__WEBPACK_IMPORTED_MODULE_2__util_dom__["f" /* pointerCoord */])(ev).x);
  119260. };
  119261. return ToggleGesture;
  119262. }(__WEBPACK_IMPORTED_MODULE_1__gestures_pan_gesture__["a" /* PanGesture */]));
  119263. //# sourceMappingURL=toggle-gesture.js.map
  119264. /***/ }),
  119265. /* 263 */
  119266. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119267. "use strict";
  119268. /* harmony export (immutable) */ __webpack_exports__["f"] = processRecords;
  119269. /* harmony export (immutable) */ __webpack_exports__["e"] = populateNodeData;
  119270. /* harmony export (immutable) */ __webpack_exports__["d"] = initReadNodes;
  119271. /* harmony export (immutable) */ __webpack_exports__["g"] = updateDimensions;
  119272. /* harmony export (immutable) */ __webpack_exports__["h"] = updateNodeContext;
  119273. /* harmony export (immutable) */ __webpack_exports__["i"] = writeToNodes;
  119274. /* harmony export (immutable) */ __webpack_exports__["a"] = adjustRendered;
  119275. /* unused harmony export getVirtualHeight */
  119276. /* harmony export (immutable) */ __webpack_exports__["c"] = estimateHeight;
  119277. /* harmony export (immutable) */ __webpack_exports__["b"] = calcDimensions;
  119278. /* unused harmony export VirtualContext */
  119279. var PREVIOUS_CELL = {
  119280. row: 0,
  119281. width: 0,
  119282. height: 0,
  119283. top: 0,
  119284. left: 0,
  119285. tmpl: -1
  119286. };
  119287. /**
  119288. * NO DOM
  119289. */
  119290. function processRecords(stopAtHeight, records, cells, headerFn, footerFn, data) {
  119291. var record;
  119292. var startRecordIndex;
  119293. var previousCell;
  119294. var tmpData;
  119295. var lastRecordIndex = records ? (records.length - 1) : -1;
  119296. if (cells.length) {
  119297. // we already have cells
  119298. previousCell = cells[cells.length - 1];
  119299. if (previousCell.top + previousCell.height > stopAtHeight) {
  119300. return;
  119301. }
  119302. startRecordIndex = (previousCell.record + 1);
  119303. }
  119304. else {
  119305. // no cells have been created yet
  119306. previousCell = PREVIOUS_CELL;
  119307. startRecordIndex = 0;
  119308. }
  119309. var processedTotal = 0;
  119310. for (var recordIndex = startRecordIndex; recordIndex <= lastRecordIndex; recordIndex++) {
  119311. record = records[recordIndex];
  119312. if (headerFn) {
  119313. tmpData = headerFn(record, recordIndex, records);
  119314. if (tmpData !== null) {
  119315. // add header data
  119316. previousCell = addCell(previousCell, recordIndex, 1 /* Header */, tmpData, data.hdrWidth, data.hdrHeight, data.viewWidth);
  119317. cells.push(previousCell);
  119318. }
  119319. }
  119320. // add item data
  119321. previousCell = addCell(previousCell, recordIndex, 0 /* Item */, null, data.itmWidth, data.itmHeight, data.viewWidth);
  119322. cells.push(previousCell);
  119323. if (footerFn) {
  119324. tmpData = footerFn(record, recordIndex, records);
  119325. if (tmpData !== null) {
  119326. // add footer data
  119327. previousCell = addCell(previousCell, recordIndex, 2 /* Footer */, tmpData, data.ftrWidth, data.ftrHeight, data.viewWidth);
  119328. cells.push(previousCell);
  119329. }
  119330. }
  119331. if (previousCell.record === lastRecordIndex) {
  119332. previousCell.isLast = true;
  119333. }
  119334. // should always process at least 3 records
  119335. processedTotal++;
  119336. if (previousCell.top + previousCell.height + data.itmHeight > stopAtHeight && processedTotal > 3) {
  119337. return;
  119338. }
  119339. }
  119340. }
  119341. function addCell(previousCell, recordIndex, tmpl, tmplData, cellWidth, cellHeight, viewportWidth) {
  119342. var newCell = {
  119343. record: recordIndex,
  119344. tmpl: tmpl,
  119345. width: cellWidth,
  119346. height: cellHeight,
  119347. reads: 0
  119348. };
  119349. if (previousCell.left + previousCell.width + cellWidth > viewportWidth) {
  119350. // add a new cell in a new row
  119351. newCell.row = (previousCell.row + 1);
  119352. newCell.top = (previousCell.top + previousCell.height);
  119353. newCell.left = 0;
  119354. }
  119355. else {
  119356. // add a new cell in the same row
  119357. newCell.row = previousCell.row;
  119358. newCell.top = previousCell.top;
  119359. newCell.left = (previousCell.left + previousCell.width);
  119360. }
  119361. if (tmplData) {
  119362. newCell.data = tmplData;
  119363. }
  119364. return newCell;
  119365. }
  119366. /**
  119367. * NO DOM
  119368. */
  119369. function populateNodeData(startCellIndex, endCellIndex, scrollingDown, cells, records, nodes, viewContainer, itmTmp, hdrTmp, ftrTmp) {
  119370. if (!records || records.length === 0) {
  119371. nodes.length = 0;
  119372. viewContainer.clear();
  119373. return true;
  119374. }
  119375. var recordsLength = records.length;
  119376. var hasChanges = false;
  119377. // let node: VirtualNode;
  119378. var availableNode;
  119379. var cell;
  119380. var viewInsertIndex = null;
  119381. var totalNodes = nodes.length;
  119382. var templateRef;
  119383. startCellIndex = Math.max(startCellIndex, 0);
  119384. endCellIndex = Math.min(endCellIndex, cells.length - 1);
  119385. var usedNodes = [];
  119386. for (var cellIndex = startCellIndex; cellIndex <= endCellIndex; cellIndex++) {
  119387. cell = cells[cellIndex];
  119388. availableNode = null;
  119389. // find the first one that's available
  119390. var existingNode = nodes.find(function (n) { return n.cell === cellIndex && n.tmpl === cell.tmpl; });
  119391. if (existingNode) {
  119392. if (existingNode.view.context.$implicit === records[cell.record]) {
  119393. usedNodes.push(existingNode);
  119394. continue; // optimization: node data is the same no need to update
  119395. }
  119396. (void 0) /* console.debug */;
  119397. availableNode = existingNode; // update existing node
  119398. }
  119399. else {
  119400. (void 0) /* console.debug */;
  119401. for (var i = 0; i < totalNodes; i++) {
  119402. var node = nodes[i];
  119403. if (cell.tmpl !== node.tmpl || i === 0 && cellIndex !== 0) {
  119404. // the cell must use the correct template
  119405. // first node can only be used by the first cell (css :first-child reasons)
  119406. // this node is never available to be reused
  119407. continue;
  119408. }
  119409. if (node.cell < startCellIndex || node.cell > endCellIndex) {
  119410. if (!availableNode) {
  119411. // havent gotten an available node yet
  119412. availableNode = node;
  119413. (void 0) /* console.debug */;
  119414. }
  119415. else if (scrollingDown) {
  119416. // scrolling down
  119417. if (node.cell < availableNode.cell) {
  119418. availableNode = node;
  119419. (void 0) /* console.debug */;
  119420. }
  119421. }
  119422. else {
  119423. // scrolling up
  119424. if (node.cell > availableNode.cell) {
  119425. availableNode = node;
  119426. (void 0) /* console.debug */;
  119427. }
  119428. }
  119429. }
  119430. }
  119431. }
  119432. if (!availableNode) {
  119433. // did not find an available node to put the cell data into
  119434. // insert a new node after existing ones
  119435. if (viewInsertIndex === null) {
  119436. viewInsertIndex = -1;
  119437. for (var j = totalNodes - 1; j >= 0; j--) {
  119438. var node = nodes[j];
  119439. if (node) {
  119440. viewInsertIndex = viewContainer.indexOf(node.view);
  119441. break;
  119442. }
  119443. }
  119444. }
  119445. // select which templateRef should be used for this cell
  119446. templateRef = cell.tmpl === 1 /* Header */ ? hdrTmp : cell.tmpl === 2 /* Footer */ ? ftrTmp : itmTmp;
  119447. if (!templateRef) {
  119448. console.error("virtual" + (cell.tmpl === 1 /* Header */ ? 'Header' : cell.tmpl === 2 /* Footer */ ? 'Footer' : 'Item') + " template required");
  119449. continue;
  119450. }
  119451. availableNode = {
  119452. tmpl: cell.tmpl,
  119453. view: viewContainer.createEmbeddedView(templateRef, new VirtualContext(null, null, null), viewInsertIndex)
  119454. };
  119455. totalNodes = nodes.push(availableNode);
  119456. }
  119457. // assign who's the new cell index for this node
  119458. availableNode.cell = cellIndex;
  119459. // apply the cell's data to this node
  119460. var context = availableNode.view.context;
  119461. context.$implicit = cell.data || records[cell.record];
  119462. context.index = cellIndex;
  119463. context.count = recordsLength;
  119464. availableNode.hasChanges = true;
  119465. availableNode.lastTransform = null;
  119466. hasChanges = true;
  119467. usedNodes.push(availableNode);
  119468. }
  119469. var unusedNodes = nodes.filter(function (n) { return usedNodes.indexOf(n) < 0; });
  119470. unusedNodes.forEach(function (node) {
  119471. var index = viewContainer.indexOf(node.view);
  119472. viewContainer.remove(index);
  119473. var removeIndex = nodes.findIndex(function (n) { return n === node; });
  119474. nodes.splice(removeIndex, 1);
  119475. });
  119476. usedNodes.length = 0;
  119477. unusedNodes.length = 0;
  119478. return hasChanges;
  119479. }
  119480. /**
  119481. * DOM READ
  119482. */
  119483. function initReadNodes(plt, nodes, cells, data) {
  119484. if (nodes.length && cells.length) {
  119485. // first node
  119486. // ******** DOM READ ****************
  119487. var ele = getElement(nodes[0]);
  119488. var firstCell = cells[0];
  119489. firstCell.top = ele.clientTop;
  119490. firstCell.left = ele.clientLeft;
  119491. firstCell.row = 0;
  119492. // ******** DOM READ ****************
  119493. updateDimensions(plt, nodes, cells, data, true);
  119494. }
  119495. }
  119496. /**
  119497. * DOM READ
  119498. */
  119499. function updateDimensions(plt, nodes, cells, data, initialUpdate) {
  119500. var node;
  119501. var element;
  119502. var cell;
  119503. var previousCell;
  119504. var totalCells = cells.length;
  119505. for (var i = 0; i < nodes.length; i++) {
  119506. node = nodes[i];
  119507. cell = cells[node.cell];
  119508. // read element dimensions if they haven't been checked enough times
  119509. if (cell && cell.reads < REQUIRED_DOM_READS) {
  119510. element = getElement(node);
  119511. // ******** DOM READ ****************
  119512. readElements(plt, cell, element);
  119513. if (initialUpdate) {
  119514. // update estimated dimensions with more accurate dimensions
  119515. if (cell.tmpl === 1 /* Header */) {
  119516. data.hdrHeight = cell.height;
  119517. if (cell.left === 0) {
  119518. data.hdrWidth = cell.width;
  119519. }
  119520. }
  119521. else if (cell.tmpl === 2 /* Footer */) {
  119522. data.ftrHeight = cell.height;
  119523. if (cell.left === 0) {
  119524. data.ftrWidth = cell.width;
  119525. }
  119526. }
  119527. else {
  119528. data.itmHeight = cell.height;
  119529. if (cell.left === 0) {
  119530. data.itmWidth = cell.width;
  119531. }
  119532. }
  119533. }
  119534. cell.reads++;
  119535. }
  119536. }
  119537. // figure out which cells are currently viewable within the viewport
  119538. var viewableBottom = (data.scrollTop + data.viewHeight);
  119539. data.topViewCell = totalCells;
  119540. data.bottomViewCell = 0;
  119541. if (totalCells > 0) {
  119542. // completely realign position to ensure they're all accurately placed
  119543. cell = cells[0];
  119544. previousCell = {
  119545. row: 0,
  119546. width: 0,
  119547. height: 0,
  119548. top: cell.top,
  119549. left: 0,
  119550. tmpl: -1
  119551. };
  119552. for (var i_1 = 0; i_1 < totalCells; i_1++) {
  119553. cell = cells[i_1];
  119554. if (previousCell.left + previousCell.width + cell.width > data.viewWidth) {
  119555. // new row
  119556. cell.row++;
  119557. cell.top = (previousCell.top + previousCell.height);
  119558. cell.left = 0;
  119559. }
  119560. else {
  119561. // same row
  119562. cell.row = previousCell.row;
  119563. cell.top = previousCell.top;
  119564. cell.left = (previousCell.left + previousCell.width);
  119565. }
  119566. // figure out which cells are viewable within the viewport
  119567. if (cell.top + cell.height > data.scrollTop && i_1 < data.topViewCell) {
  119568. data.topViewCell = i_1;
  119569. }
  119570. else if (cell.top < viewableBottom && i_1 > data.bottomViewCell) {
  119571. data.bottomViewCell = i_1;
  119572. }
  119573. previousCell = cell;
  119574. }
  119575. }
  119576. }
  119577. function updateNodeContext(nodes, cells, data) {
  119578. // ensure each node has the correct bounds in its context
  119579. var node;
  119580. var cell;
  119581. var bounds;
  119582. for (var i = 0, ilen = nodes.length; i < ilen; i++) {
  119583. node = nodes[i];
  119584. cell = cells[node.cell];
  119585. if (node && cell) {
  119586. bounds = node.view.context.bounds;
  119587. bounds.top = cell.top + data.viewTop;
  119588. bounds.bottom = bounds.top + cell.height;
  119589. bounds.left = cell.left + data.viewLeft;
  119590. bounds.right = bounds.left + cell.width;
  119591. bounds.width = cell.width;
  119592. bounds.height = cell.height;
  119593. }
  119594. }
  119595. }
  119596. /**
  119597. * DOM READ
  119598. */
  119599. function readElements(plt, cell, element) {
  119600. // ******** DOM READ ****************
  119601. var styles = plt.getElementComputedStyle(element);
  119602. // ******** DOM READ ****************
  119603. cell.left = (element.clientLeft - parseFloat(styles.marginLeft));
  119604. // ******** DOM READ ****************
  119605. cell.width = (element.offsetWidth + parseFloat(styles.marginLeft) + parseFloat(styles.marginRight));
  119606. // ******** DOM READ ****************
  119607. cell.height = (element.offsetHeight + parseFloat(styles.marginTop) + parseFloat(styles.marginBottom));
  119608. }
  119609. /**
  119610. * DOM WRITE
  119611. */
  119612. function writeToNodes(plt, nodes, cells, totalRecords) {
  119613. var node;
  119614. var element;
  119615. var cell;
  119616. var transform;
  119617. var totalCells = Math.max(totalRecords, cells.length);
  119618. for (var i = 0, ilen = nodes.length; i < ilen; i++) {
  119619. node = nodes[i];
  119620. cell = cells[node.cell];
  119621. transform = "translate3d(" + cell.left + "px," + cell.top + "px,0px)";
  119622. if (node.lastTransform !== transform) {
  119623. element = getElement(node);
  119624. if (element) {
  119625. // ******** DOM WRITE ****************
  119626. element.style[plt.Css.transform] = node.lastTransform = transform;
  119627. // ******** DOM WRITE ****************
  119628. element.classList.add('virtual-position');
  119629. // https://www.w3.org/TR/wai-aria/states_and_properties#aria-posinset
  119630. // ******** DOM WRITE ****************
  119631. element.setAttribute('aria-posinset', node.cell + 1);
  119632. // https://www.w3.org/TR/wai-aria/states_and_properties#aria-setsize
  119633. // ******** DOM WRITE ****************
  119634. element.setAttribute('aria-setsize', totalCells);
  119635. }
  119636. }
  119637. }
  119638. }
  119639. /**
  119640. * NO DOM
  119641. */
  119642. function adjustRendered(cells, data) {
  119643. var maxRenderHeight = (data.renderHeight - data.itmHeight);
  119644. var totalCells = cells.length;
  119645. var viewableRenderedPadding = (data.itmHeight < 90 ? VIEWABLE_RENDERED_PADDING : 0);
  119646. if (data.scrollDiff > 0) {
  119647. // scrolling down
  119648. data.topCell = Math.max(data.topViewCell - viewableRenderedPadding, 0);
  119649. data.bottomCell = data.topCell;
  119650. var cellsRenderHeight = 0;
  119651. for (var i = data.topCell; i < totalCells; i++) {
  119652. cellsRenderHeight += cells[i].height;
  119653. if (i > data.bottomCell)
  119654. data.bottomCell = i;
  119655. if (cellsRenderHeight >= maxRenderHeight)
  119656. break;
  119657. }
  119658. if (cellsRenderHeight < maxRenderHeight) {
  119659. // there are no more cells at the bottom, so move topCell to a smaller index
  119660. for (var i = data.topCell - 1; i >= 0; i--) {
  119661. cellsRenderHeight += cells[i].height;
  119662. data.topCell = i;
  119663. if (cellsRenderHeight >= maxRenderHeight)
  119664. break;
  119665. }
  119666. }
  119667. }
  119668. else {
  119669. // scroll up
  119670. data.bottomCell = Math.min(data.bottomViewCell + viewableRenderedPadding, totalCells - 1);
  119671. data.topCell = data.bottomCell;
  119672. var cellsRenderHeight = 0;
  119673. (void 0) /* assert */;
  119674. for (var i = data.bottomCell; i >= 0; i--) {
  119675. cellsRenderHeight += cells[i].height;
  119676. if (i < data.topCell)
  119677. data.topCell = i;
  119678. if (cellsRenderHeight >= maxRenderHeight)
  119679. break;
  119680. }
  119681. if (cellsRenderHeight < maxRenderHeight) {
  119682. // there are no more cells at the top, so move bottomCell to a higher index
  119683. for (var i = data.bottomCell; i < totalCells; i++) {
  119684. cellsRenderHeight += cells[i].height;
  119685. data.bottomCell = i;
  119686. if (cellsRenderHeight >= maxRenderHeight)
  119687. break;
  119688. }
  119689. }
  119690. }
  119691. }
  119692. /**
  119693. * NO DOM
  119694. */
  119695. function getVirtualHeight(totalRecords, lastCell) {
  119696. if (lastCell.record >= totalRecords - 1) {
  119697. return (lastCell.top + lastCell.height);
  119698. }
  119699. var unknownRecords = (totalRecords - lastCell.record - 1);
  119700. var knownHeight = (lastCell.top + lastCell.height);
  119701. return Math.ceil(knownHeight + ((knownHeight / (totalRecords - unknownRecords)) * unknownRecords));
  119702. }
  119703. /**
  119704. * NO DOM
  119705. */
  119706. function estimateHeight(totalRecords, lastCell, existingHeight, difference) {
  119707. if (!totalRecords || !lastCell) {
  119708. return 0;
  119709. }
  119710. var newHeight = getVirtualHeight(totalRecords, lastCell);
  119711. var percentToBottom = (lastCell.record / (totalRecords - 1));
  119712. var diff = Math.abs(existingHeight - newHeight);
  119713. if ((diff > (newHeight * difference)) ||
  119714. (percentToBottom > .995)) {
  119715. return newHeight;
  119716. }
  119717. return existingHeight;
  119718. }
  119719. /**
  119720. * DOM READ
  119721. */
  119722. function calcDimensions(data, virtualScrollElement, approxItemWidth, approxItemHeight, appoxHeaderWidth, approxHeaderHeight, approxFooterWidth, approxFooterHeight, bufferRatio) {
  119723. // get the parent container's viewport bounds
  119724. var viewportElement = virtualScrollElement.parentElement;
  119725. // ******** DOM READ ****************
  119726. data.viewWidth = viewportElement.offsetWidth;
  119727. // ******** DOM READ ****************
  119728. data.viewHeight = viewportElement.offsetHeight;
  119729. // get the virtual scroll element's offset data
  119730. // ******** DOM READ ****************
  119731. data.viewTop = virtualScrollElement.offsetTop;
  119732. // ******** DOM READ ****************
  119733. data.viewLeft = virtualScrollElement.offsetLeft;
  119734. // the height we'd like to render, which is larger than viewable
  119735. data.renderHeight = (data.viewHeight * bufferRatio);
  119736. if (data.viewWidth > 0 && data.viewHeight > 0) {
  119737. data.itmWidth = calcWidth(data.viewWidth, approxItemWidth);
  119738. data.itmHeight = calcHeight(data.viewHeight, approxItemHeight);
  119739. data.hdrWidth = calcWidth(data.viewWidth, appoxHeaderWidth);
  119740. data.hdrHeight = calcHeight(data.viewHeight, approxHeaderHeight);
  119741. data.ftrWidth = calcWidth(data.viewWidth, approxFooterWidth);
  119742. data.ftrHeight = calcHeight(data.viewHeight, approxFooterHeight);
  119743. data.valid = true;
  119744. }
  119745. }
  119746. /**
  119747. * NO DOM
  119748. */
  119749. function calcWidth(viewportWidth, approxWidth) {
  119750. if (approxWidth.indexOf('%') > 0) {
  119751. return (viewportWidth * (parseFloat(approxWidth) / 100));
  119752. }
  119753. else if (approxWidth.indexOf('px') > 0) {
  119754. return parseFloat(approxWidth);
  119755. }
  119756. throw new Error('virtual scroll width can only use "%" or "px" units');
  119757. }
  119758. /**
  119759. * NO DOM
  119760. */
  119761. function calcHeight(_viewportHeight, approxHeight) {
  119762. if (approxHeight.indexOf('px') > 0) {
  119763. return parseFloat(approxHeight);
  119764. }
  119765. throw new Error('virtual scroll height must use "px" units');
  119766. }
  119767. /**
  119768. * NO DOM
  119769. */
  119770. function getElement(node) {
  119771. var rootNodes = node.view.rootNodes;
  119772. for (var i = 0; i < rootNodes.length; i++) {
  119773. if (rootNodes[i].nodeType === 1) {
  119774. return rootNodes[i];
  119775. }
  119776. }
  119777. return null;
  119778. }
  119779. var VirtualContext = (function () {
  119780. function VirtualContext($implicit, index, count) {
  119781. this.$implicit = $implicit;
  119782. this.index = index;
  119783. this.count = count;
  119784. this.bounds = {};
  119785. }
  119786. Object.defineProperty(VirtualContext.prototype, "first", {
  119787. get: function () { return this.index === 0; },
  119788. enumerable: true,
  119789. configurable: true
  119790. });
  119791. Object.defineProperty(VirtualContext.prototype, "last", {
  119792. get: function () { return this.index === this.count - 1; },
  119793. enumerable: true,
  119794. configurable: true
  119795. });
  119796. Object.defineProperty(VirtualContext.prototype, "even", {
  119797. get: function () { return this.index % 2 === 0; },
  119798. enumerable: true,
  119799. configurable: true
  119800. });
  119801. Object.defineProperty(VirtualContext.prototype, "odd", {
  119802. get: function () { return !this.even; },
  119803. enumerable: true,
  119804. configurable: true
  119805. });
  119806. return VirtualContext;
  119807. }());
  119808. var VIEWABLE_RENDERED_PADDING = 3;
  119809. var REQUIRED_DOM_READS = 2;
  119810. //# sourceMappingURL=virtual-util.js.map
  119811. /***/ }),
  119812. /* 264 */
  119813. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119814. "use strict";
  119815. /* unused harmony export IonicPage */
  119816. /**
  119817. * @name IonicPage
  119818. * @description
  119819. * The Ionic Page handles registering and displaying specific pages based on URLs. It's used
  119820. * underneath `NavController` so it will never have to be interacted with directly. When a new
  119821. * page is pushed with `NavController`, the URL is updated to match the path to this page.
  119822. *
  119823. * Unlike traditional web apps, URLs don't dictate navigation in Ionic apps.
  119824. * Instead, URLs help us link to specific pieces of content as a breadcrumb.
  119825. * The current URL gets updated as we navigate, but we use the `NavController`
  119826. * push and pop, or `NavPush` and `NavPop` to move around. This makes it much easier
  119827. * to handle complicated nested navigation.
  119828. *
  119829. * We refer to our URL system as a deep link system instead of a router to encourage
  119830. * Ionic developers to think of URLs as a breadcrumb rather than as the source of
  119831. * truth in navigation. This encourages flexible navigation design and happy apps all
  119832. * over the world.
  119833. *
  119834. *
  119835. * @usage
  119836. *
  119837. * The first step to setting up deep links is to add the page that should be
  119838. * a deep link in the `IonicPageModule.forChild` import of the page's module.
  119839. * For our examples, this will be `MyPage`:
  119840. *
  119841. * ```ts
  119842. * @NgModule({
  119843. * declarations: [
  119844. * MyPage
  119845. * ],
  119846. * imports: [
  119847. * IonicPageModule.forChild(MyPage)
  119848. * ],
  119849. * entryComponents: [
  119850. * MyPage
  119851. * ]
  119852. * })
  119853. * export class MyPageModule {}
  119854. * ```
  119855. *
  119856. * Then, add the `@IonicPage` decorator to the component. The most simple usage is adding an
  119857. * empty decorator:
  119858. *
  119859. * ```ts
  119860. * @IonicPage()
  119861. * @Component({
  119862. * templateUrl: 'main.html'
  119863. * })
  119864. * export class MyPage {}
  119865. * ```
  119866. *
  119867. * This will automatically create a link to the `MyPage` component using the same name as the class,
  119868. * `name`: `'MyPage'`. The page can now be navigated to by using this name. For example:
  119869. *
  119870. * ```ts
  119871. * @Component({
  119872. * templateUrl: 'another-page.html'
  119873. * })
  119874. * export class AnotherPage {
  119875. * constructor(public navCtrl: NavController) {}
  119876. *
  119877. * goToMyPage() {
  119878. * // go to the MyPage component
  119879. * this.navCtrl.push('MyPage');
  119880. * }
  119881. * }
  119882. * ```
  119883. *
  119884. * The `@IonicPage` decorator accepts a `DeepLinkMetadataType` object. This object accepts
  119885. * the following properties: `name`, `segment`, `defaultHistory`, and `priority`. All of them
  119886. * are optional but can be used to create complex navigation links.
  119887. *
  119888. *
  119889. * ### Changing Name
  119890. *
  119891. * As mentioned previously, the `name` property will be set to the class name if it isn't provided.
  119892. * Changing the name of the link is extremely simple. To change the name used to link to the
  119893. * component, simply pass it in the decorator like so:
  119894. *
  119895. * ```ts
  119896. * @IonicPage({
  119897. * name: 'my-page'
  119898. * })
  119899. * ```
  119900. *
  119901. * This will create a link to the `MyPage` component using the name `'my-page'`. Similar to the previous
  119902. * example, the page can be navigated to by using the name:
  119903. *
  119904. * ```ts
  119905. * goToMyPage() {
  119906. * // go to the MyPage component
  119907. * this.navCtrl.push('my-page');
  119908. * }
  119909. * ```
  119910. *
  119911. *
  119912. * ### Setting URL Path
  119913. *
  119914. * The `segment` property is used to set the URL to the page. If this property isn't provided, the
  119915. * `segment` will use the value of `name`. Since components can be loaded anywhere in the app, the
  119916. * `segment` doesn't require a full URL path. When a page becomes the active page, the `segment` is
  119917. * appended to the URL.
  119918. *
  119919. * The `segment` can be changed to anything and doesn't have to match the `name`. For example, passing
  119920. * a value for `name` and `segment`:
  119921. *
  119922. * ```ts
  119923. * @IonicPage({
  119924. * name: 'my-page',
  119925. * segment: 'some-path'
  119926. * })
  119927. * ```
  119928. *
  119929. * When navigating to this page as the first page in the app, the URL will look something like:
  119930. *
  119931. * ```
  119932. * http://localhost:8101/#/some-path
  119933. * ```
  119934. *
  119935. * However, navigating to the page will still use the `name` like the previous examples do.
  119936. *
  119937. *
  119938. * ### Dynamic Links
  119939. *
  119940. * The `segment` property is useful for creating dynamic links. Sometimes the URL isn't known ahead
  119941. * of time, so it can be passed as a variable.
  119942. *
  119943. * Since passing data around is common practice in an app, it can be reflected in the app's URL by
  119944. * using the `:param` syntax. For example, set the `segment` in the `@IonicPage` decorator:
  119945. *
  119946. * ```ts
  119947. * @IonicPage({
  119948. * name: 'detail-page',
  119949. * segment: 'detail/:id'
  119950. * })
  119951. * ```
  119952. *
  119953. * In this case, when we `push` to a new instance of `'detail-page'`, the value of `id` will
  119954. * in the `detailInfo` data being passed to `push` will replace `:id` in the URL.
  119955. *
  119956. * Important: The property needs to be something that can be converted into a string, objects
  119957. * are not supported.
  119958. *
  119959. * For example, to push the `'detail-page'` in the `ListPage` component, the following code could
  119960. * be used:
  119961. *
  119962. * ```ts
  119963. * @IonicPage({
  119964. * name: 'list'
  119965. * })
  119966. * export class ListPage {
  119967. * constructor(public navCtrl: NavController) {}
  119968. *
  119969. * pushPage(detailInfo) {
  119970. * // Push an `id` to the `'detail-page'`
  119971. * this.navCtrl.push('detail-page', {
  119972. * 'id': detailInfo.id
  119973. * })
  119974. * }
  119975. * }
  119976. * ```
  119977. *
  119978. * If the value of `detailInfo.id` is `12`, for example, the URL would end up looking like this:
  119979. *
  119980. * ```
  119981. * http://localhost:8101/#/list/detail/12
  119982. * ```
  119983. *
  119984. * Since this `id` will be used to pull in the data of the specific detail page, it's Important
  119985. * that the `id` is unique.
  119986. *
  119987. * Note: Even though the `name` is `detail-page`, the `segment` uses `detail/:id`, and the URL
  119988. * will use the `segment`.
  119989. *
  119990. *
  119991. * ### Default History
  119992. *
  119993. * Pages can be navigated to using deep links from anywhere in the app, but sometimes the app is
  119994. * launched from a URL and the page needs to have the same history as if it were navigated to from
  119995. * inside of the app.
  119996. *
  119997. * By default, the page would be navigated to as the first page in the stack with no prior history.
  119998. * A good example is the App Store on iOS. Clicking on a URL to an application in the App Store will
  119999. * load the details of the application with no back button, as if it were the first page ever viewed.
  120000. *
  120001. * The default history of any page can be set in the `defaultHistory` property. This history will only
  120002. * be used if the history doesn't already exist, meaning if you navigate to the page the history will
  120003. * be the pages that were navigated from.
  120004. *
  120005. * The `defaultHistory` property takes an array of page names. The page names are specified as statically
  120006. * analyzable strings (which means you must use strings and not variables or delared constants). If the
  120007. * parent page does not have a `name` specified in its `IonicPage` decorator its name is its class name.
  120008. *
  120009. * For example, setting the history of the detail page to the list page where the `name` is `list`:
  120010. *
  120011. * ```ts
  120012. * @IonicPage({
  120013. * name: 'detail-page',
  120014. * segment: 'detail/:id',
  120015. * defaultHistory: ['list']
  120016. * })
  120017. * ```
  120018. *
  120019. * In this example, if the app is launched at `http://localhost:8101/#/detail/my-detail` the displayed page
  120020. * will be the `'detail-page'` with an id of `my-detail` and it will show a back button that goes back to
  120021. * the `'list'` page.
  120022. *
  120023. * For a deeper example:
  120024. *
  120025. * ```ts
  120026. * @IonicPage({
  120027. * segment: 'contact-more-info',
  120028. * defaultHistory: ['ContactDetailPage', 'Contact']
  120029. * })
  120030. * ...
  120031. * export class ContactMoreInfoPage {
  120032. * ...
  120033. * }
  120034. * ```
  120035. *
  120036. * In this example, if the app is launched at `http://localhost:8101/#/contact/contact-more-info` the displayed page
  120037. * will be the `'ContactMoreInfoPage'`. It will show a back button that will go to the `'ContactDetailPage'` which
  120038. * will also show a back button which will go to the `'Constact'` page.
  120039. *
  120040. * An example of an application with a set history stack is the Instagram application. Opening a link
  120041. * to an image on Instagram will show the details for that image with a back button to the user's profile
  120042. * page. There is no "right" way of setting the history for a page, it is up to the application.
  120043. *
  120044. * ### Priority
  120045. *
  120046. * The `priority` property is only used during preloading. By default, preloading is turned off so setting
  120047. * this property would do nothing. Preloading eagerly loads all deep links after the application boots
  120048. * instead of on demand as needed. To enable preloading, set `preloadModules` in the main application module
  120049. * config to `true`:
  120050. *
  120051. * ```ts
  120052. * @NgModule({
  120053. * declarations: [
  120054. * MyApp
  120055. * ],
  120056. * imports: [
  120057. * BrowserModule,
  120058. * IonicModule.forRoot(MyApp, {
  120059. * preloadModules: true
  120060. * })
  120061. * ],
  120062. * bootstrap: [IonicApp],
  120063. * entryComponents: [
  120064. * MyApp
  120065. * ]
  120066. * })
  120067. * export class AppModule { }
  120068. * ```
  120069. *
  120070. * If preloading is turned on, it will load the modules based on the value of `priority`. The following
  120071. * values are possible for `priority`: `"high"`, `"low"`, and `"off"`. When there is no `priority`, it
  120072. * will be set to `"low"`.
  120073. *
  120074. * All deep links with their priority set to `"high"` will be loaded first. Upon completion of loading the
  120075. * `"high"` priority modules, all deep links with a priority of `"low"` (or no priority) will be loaded. If
  120076. * the priority is set to `"off"` the link will not be preloaded. Setting the `priority` is as simple as
  120077. * passing it to the `@IonicPage` decorator:
  120078. *
  120079. * ```ts
  120080. * @IonicPage({
  120081. * name: 'my-page',
  120082. * priority: 'high'
  120083. * })
  120084. * ```
  120085. *
  120086. * We recommend setting the `priority` to `"high"` on the pages that will be viewed first when launching
  120087. * the application.
  120088. *
  120089. */
  120090. function IonicPage(_config) {
  120091. return function (clazz) {
  120092. return clazz;
  120093. };
  120094. }
  120095. //# sourceMappingURL=ionic-page.js.map
  120096. /***/ }),
  120097. /* 265 */
  120098. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120099. "use strict";
  120100. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return RippleActivator; });
  120101. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__activator_base__ = __webpack_require__(194);
  120102. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__activator__ = __webpack_require__(193);
  120103. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_dom__ = __webpack_require__(10);
  120104. /**
  120105. * @hidden
  120106. */
  120107. var RippleActivator = (function () {
  120108. function RippleActivator(app, config, dom) {
  120109. this.dom = dom;
  120110. this.highlight = new __WEBPACK_IMPORTED_MODULE_1__activator__["a" /* Activator */](app, config, dom);
  120111. }
  120112. RippleActivator.prototype.clickAction = function (ev, activatableEle, startCoord) {
  120113. // Highlight
  120114. this.highlight && this.highlight.clickAction(ev, activatableEle, startCoord);
  120115. // Ripple
  120116. this._clickAction(ev, activatableEle, startCoord);
  120117. };
  120118. RippleActivator.prototype.downAction = function (ev, activatableEle, startCoord) {
  120119. // Highlight
  120120. this.highlight && this.highlight.downAction(ev, activatableEle, startCoord);
  120121. // Ripple
  120122. this._downAction(ev, activatableEle, startCoord);
  120123. };
  120124. RippleActivator.prototype.upAction = function (ev, activatableEle, startCoord) {
  120125. // Highlight
  120126. this.highlight && this.highlight.upAction(ev, activatableEle, startCoord);
  120127. // Ripple
  120128. this._upAction(ev, activatableEle, startCoord);
  120129. };
  120130. RippleActivator.prototype.clearState = function (animated) {
  120131. // Highlight
  120132. this.highlight && this.highlight.clearState(animated);
  120133. };
  120134. RippleActivator.prototype._downAction = function (ev, activatableEle, _startCoord) {
  120135. if (Object(__WEBPACK_IMPORTED_MODULE_0__activator_base__["a" /* isActivatedDisabled */])(ev, activatableEle)) {
  120136. return;
  120137. }
  120138. var j = activatableEle.childElementCount;
  120139. while (j--) {
  120140. var rippleEle = activatableEle.children[j];
  120141. if (rippleEle.classList.contains('button-effect')) {
  120142. // DOM READ
  120143. var clientRect = activatableEle.getBoundingClientRect();
  120144. rippleEle.$top = clientRect.top;
  120145. rippleEle.$left = clientRect.left;
  120146. rippleEle.$width = clientRect.width;
  120147. rippleEle.$height = clientRect.height;
  120148. break;
  120149. }
  120150. }
  120151. };
  120152. RippleActivator.prototype._upAction = function (ev, activatableEle, startCoord) {
  120153. if (!Object(__WEBPACK_IMPORTED_MODULE_2__util_dom__["d" /* hasPointerMoved */])(6, startCoord, Object(__WEBPACK_IMPORTED_MODULE_2__util_dom__["f" /* pointerCoord */])(ev))) {
  120154. var i = activatableEle.childElementCount;
  120155. while (i--) {
  120156. var rippleEle = activatableEle.children[i];
  120157. if (rippleEle.classList.contains('button-effect')) {
  120158. // DOM WRITE
  120159. this.startRippleEffect(rippleEle, activatableEle, startCoord);
  120160. break;
  120161. }
  120162. }
  120163. }
  120164. };
  120165. RippleActivator.prototype._clickAction = function (_ev, _activatableEle, _startCoord) {
  120166. // NOTHING
  120167. };
  120168. RippleActivator.prototype.startRippleEffect = function (rippleEle, activatableEle, startCoord) {
  120169. if (!startCoord) {
  120170. return;
  120171. }
  120172. var clientPointerX = (startCoord.x - rippleEle.$left);
  120173. var clientPointerY = (startCoord.y - rippleEle.$top);
  120174. var x = Math.max(Math.abs(rippleEle.$width - clientPointerX), clientPointerX) * 2;
  120175. var y = Math.max(Math.abs(rippleEle.$height - clientPointerY), clientPointerY) * 2;
  120176. var diameter = Math.min(Math.max(Math.hypot(x, y), 64), 240);
  120177. if (activatableEle.hasAttribute('ion-item')) {
  120178. diameter = Math.min(diameter, 140);
  120179. }
  120180. clientPointerX -= diameter / 2;
  120181. clientPointerY -= diameter / 2;
  120182. clientPointerX = Math.round(clientPointerX);
  120183. clientPointerY = Math.round(clientPointerY);
  120184. diameter = Math.round(diameter);
  120185. // Reset ripple
  120186. // DOM WRITE
  120187. var Css = this.dom.plt.Css;
  120188. rippleEle.style.opacity = '';
  120189. rippleEle.style[Css.transform] = "translate3d(" + clientPointerX + "px, " + clientPointerY + "px, 0px) scale(0.001)";
  120190. rippleEle.style[Css.transition] = '';
  120191. // Start ripple animation
  120192. var radius = Math.sqrt(rippleEle.$width + rippleEle.$height);
  120193. var scaleTransitionDuration = Math.max(1600 * Math.sqrt(radius / TOUCH_DOWN_ACCEL) + 0.5, 260);
  120194. var opacityTransitionDuration = Math.round(scaleTransitionDuration * 0.7);
  120195. var opacityTransitionDelay = Math.round(scaleTransitionDuration - opacityTransitionDuration);
  120196. scaleTransitionDuration = Math.round(scaleTransitionDuration);
  120197. var transform = "translate3d(" + clientPointerX + "px, " + clientPointerY + "px, 0px) scale(1)";
  120198. var transition = "transform " + scaleTransitionDuration + "ms,opacity " + opacityTransitionDuration + "ms " + opacityTransitionDelay + "ms";
  120199. this.dom.write(function () {
  120200. // DOM WRITE
  120201. rippleEle.style.width = rippleEle.style.height = diameter + 'px';
  120202. rippleEle.style.opacity = '0';
  120203. rippleEle.style[Css.transform] = transform;
  120204. rippleEle.style[Css.transition] = transition;
  120205. }, 16);
  120206. };
  120207. return RippleActivator;
  120208. }());
  120209. var TOUCH_DOWN_ACCEL = 300;
  120210. //# sourceMappingURL=ripple.js.map
  120211. /***/ }),
  120212. /* 266 */
  120213. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120214. "use strict";
  120215. /* unused harmony export Gesture */
  120216. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_util__ = __webpack_require__(2);
  120217. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__hammer__ = __webpack_require__(267);
  120218. /**
  120219. * @hidden
  120220. * A gesture recognizer class.
  120221. *
  120222. * TODO(mlynch): Re-enable the DOM event simulation that was causing issues (or verify hammer does this already, it might);
  120223. */
  120224. var Gesture = (function () {
  120225. function Gesture(element, opts) {
  120226. if (opts === void 0) { opts = {}; }
  120227. this._callbacks = {};
  120228. this.isListening = false;
  120229. Object(__WEBPACK_IMPORTED_MODULE_0__util_util__["d" /* defaults */])(opts, {
  120230. domEvents: true
  120231. });
  120232. this.element = element;
  120233. // Map 'x' or 'y' string to hammerjs opts
  120234. this.direction = opts.direction || 'x';
  120235. opts.direction = this.direction === 'x' ?
  120236. __WEBPACK_IMPORTED_MODULE_1__hammer__["a" /* DIRECTION_HORIZONTAL */] :
  120237. __WEBPACK_IMPORTED_MODULE_1__hammer__["b" /* DIRECTION_VERTICAL */];
  120238. this._options = opts;
  120239. }
  120240. Gesture.prototype.options = function (opts) {
  120241. Object.assign(this._options, opts);
  120242. };
  120243. Gesture.prototype.on = function (type, cb) {
  120244. if (type === 'pinch' || type === 'rotate') {
  120245. this._hammer.get(type).set({ enable: true });
  120246. }
  120247. this._hammer.on(type, cb);
  120248. (this._callbacks[type] || (this._callbacks[type] = [])).push(cb);
  120249. };
  120250. Gesture.prototype.off = function (type, cb) {
  120251. this._hammer.off(type, this._callbacks[type] ? cb : null);
  120252. };
  120253. Gesture.prototype.listen = function () {
  120254. if (!this.isListening) {
  120255. this._hammer = Object(__WEBPACK_IMPORTED_MODULE_1__hammer__["c" /* Hammer */])(this.element, this._options);
  120256. }
  120257. this.isListening = true;
  120258. };
  120259. Gesture.prototype.unlisten = function () {
  120260. var eventType;
  120261. var i;
  120262. if (this._hammer && this.isListening) {
  120263. for (eventType in this._callbacks) {
  120264. for (i = 0; i < this._callbacks[eventType].length; i++) {
  120265. this._hammer.off(eventType, this._callbacks[eventType]);
  120266. }
  120267. }
  120268. this._hammer.destroy();
  120269. }
  120270. this._callbacks = {};
  120271. this._hammer = null;
  120272. this.isListening = false;
  120273. };
  120274. Gesture.prototype.destroy = function () {
  120275. this.unlisten();
  120276. this.element = this._options = null;
  120277. };
  120278. return Gesture;
  120279. }());
  120280. //# sourceMappingURL=gesture.js.map
  120281. /***/ }),
  120282. /* 267 */
  120283. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120284. "use strict";
  120285. /* unused harmony export DIRECTION_LEFT */
  120286. /* unused harmony export DIRECTION_RIGHT */
  120287. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DIRECTION_HORIZONTAL; });
  120288. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return DIRECTION_VERTICAL; });
  120289. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return Hammer; });
  120290. /* tslint:disable */
  120291. var win = window;
  120292. var doc = document;
  120293. /*! Hammer.JS - v2.0.6 - 2015-12-23
  120294. * http://hammerjs.github.io/
  120295. *
  120296. * Copyright (c) 2015 Jorik Tangelder;
  120297. * Licensed under the license */
  120298. var VENDOR_PREFIXES = ['', 'webkit', 'Moz', 'MS', 'ms', 'o'];
  120299. var TEST_ELEMENT = doc.createElement('div');
  120300. var TYPE_FUNCTION = 'function';
  120301. var round = Math.round;
  120302. var abs = Math.abs;
  120303. var now = Date.now;
  120304. /**
  120305. * set a timeout with a given scope
  120306. * @param {Function} fn
  120307. * @param {Number} timeout
  120308. * @param {Object} context
  120309. * @returns {number}
  120310. */
  120311. function setTimeoutContext(fn, timeout, context) {
  120312. return setTimeout(bindFn(fn, context), timeout);
  120313. }
  120314. /**
  120315. * if the argument is an array, we want to execute the fn on each entry
  120316. * if it aint an array we don't want to do a thing.
  120317. * this is used by all the methods that accept a single and array argument.
  120318. * @param {*|Array} arg
  120319. * @param {String} fn
  120320. * @param {Object} [context]
  120321. * @returns {Boolean}
  120322. */
  120323. function invokeArrayArg(arg, fn, context) {
  120324. if (Array.isArray(arg)) {
  120325. each(arg, context[fn], context);
  120326. return true;
  120327. }
  120328. return false;
  120329. }
  120330. /**
  120331. * walk objects and arrays
  120332. * @param {Object} obj
  120333. * @param {Function} iterator
  120334. * @param {Object} context
  120335. */
  120336. function each(obj, iterator, context) {
  120337. var i;
  120338. if (!obj) {
  120339. return;
  120340. }
  120341. if (obj.forEach) {
  120342. obj.forEach(iterator, context);
  120343. }
  120344. else if (obj.length !== undefined) {
  120345. i = 0;
  120346. while (i < obj.length) {
  120347. iterator.call(context, obj[i], i, obj);
  120348. i++;
  120349. }
  120350. }
  120351. else {
  120352. for (i in obj) {
  120353. obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj);
  120354. }
  120355. }
  120356. }
  120357. /**
  120358. * simple class inheritance
  120359. * @param {Function} child
  120360. * @param {Function} base
  120361. * @param {Object} [properties]
  120362. */
  120363. function inherit(child, base, properties) {
  120364. var baseP = base.prototype, childP;
  120365. childP = child.prototype = Object.create(baseP);
  120366. childP.constructor = child;
  120367. childP._super = baseP;
  120368. if (properties) {
  120369. Object.assign(childP, properties);
  120370. }
  120371. }
  120372. /**
  120373. * simple function bind
  120374. * @param {Function} fn
  120375. * @param {Object} context
  120376. * @returns {Function}
  120377. */
  120378. function bindFn(fn, context) {
  120379. return function boundFn() {
  120380. return fn.apply(context, arguments);
  120381. };
  120382. }
  120383. /**
  120384. * let a boolean value also be a function that must return a boolean
  120385. * this first item in args will be used as the context
  120386. * @param {Boolean|Function} val
  120387. * @param {Array} [args]
  120388. * @returns {Boolean}
  120389. */
  120390. function boolOrFn(val, args) {
  120391. if (typeof val == TYPE_FUNCTION) {
  120392. return val.apply(args ? args[0] || undefined : undefined, args);
  120393. }
  120394. return val;
  120395. }
  120396. /**
  120397. * use the val2 when val1 is undefined
  120398. * @param {*} val1
  120399. * @param {*} val2
  120400. * @returns {*}
  120401. */
  120402. function ifUndefined(val1, val2) {
  120403. return (val1 === undefined) ? val2 : val1;
  120404. }
  120405. /**
  120406. * addEventListener with multiple events at once
  120407. * @param {EventTarget} target
  120408. * @param {String} types
  120409. * @param {Function} handler
  120410. */
  120411. function addEventListeners(target, types, handler) {
  120412. each(splitStr(types), function (type) {
  120413. target.addEventListener(type, handler, false);
  120414. });
  120415. }
  120416. /**
  120417. * removeEventListener with multiple events at once
  120418. * @param {EventTarget} target
  120419. * @param {String} types
  120420. * @param {Function} handler
  120421. */
  120422. function removeEventListeners(target, types, handler) {
  120423. each(splitStr(types), function (type) {
  120424. target.removeEventListener(type, handler, false);
  120425. });
  120426. }
  120427. /**
  120428. * find if a node is in the given parent
  120429. * @method hasParent
  120430. * @param {HTMLElement} node
  120431. * @param {HTMLElement} parent
  120432. * @return {Boolean} found
  120433. */
  120434. function hasParent(node, parent) {
  120435. while (node) {
  120436. if (node == parent) {
  120437. return true;
  120438. }
  120439. node = node.parentNode;
  120440. }
  120441. return false;
  120442. }
  120443. /**
  120444. * small indexOf wrapper
  120445. * @param {String} str
  120446. * @param {String} find
  120447. * @returns {Boolean} found
  120448. */
  120449. function inStr(str, find) {
  120450. return str.indexOf(find) > -1;
  120451. }
  120452. /**
  120453. * split string on whitespace
  120454. * @param {String} str
  120455. * @returns {Array} words
  120456. */
  120457. function splitStr(str) {
  120458. return str.trim().split(/\s+/g);
  120459. }
  120460. /**
  120461. * find if a array contains the object using indexOf or a simple polyFill
  120462. * @param {Array} src
  120463. * @param {String} find
  120464. * @param {String} [findByKey]
  120465. * @return {Boolean|Number} false when not found, or the index
  120466. */
  120467. function inArray(src, find, findByKey) {
  120468. if (src.indexOf && !findByKey) {
  120469. return src.indexOf(find);
  120470. }
  120471. else {
  120472. var i = 0;
  120473. while (i < src.length) {
  120474. if ((findByKey && src[i][findByKey] == find) || (!findByKey && src[i] === find)) {
  120475. return i;
  120476. }
  120477. i++;
  120478. }
  120479. return -1;
  120480. }
  120481. }
  120482. /**
  120483. * convert array-like objects to real arrays
  120484. * @param {Object} obj
  120485. * @returns {Array}
  120486. */
  120487. function toArray(obj) {
  120488. return Array.prototype.slice.call(obj, 0);
  120489. }
  120490. /**
  120491. * unique array with objects based on a key (like 'id') or just by the array's value
  120492. * @param {Array} src [{id:1},{id:2},{id:1}]
  120493. * @param {String} [key]
  120494. * @param {Boolean} [sort=False]
  120495. * @returns {Array} [{id:1},{id:2}]
  120496. */
  120497. function uniqueArray(src, key, sort) {
  120498. var results = [];
  120499. var values = [];
  120500. var i = 0;
  120501. while (i < src.length) {
  120502. var val = key ? src[i][key] : src[i];
  120503. if (inArray(values, val) < 0) {
  120504. results.push(src[i]);
  120505. }
  120506. values[i] = val;
  120507. i++;
  120508. }
  120509. if (sort) {
  120510. if (!key) {
  120511. results = results.sort();
  120512. }
  120513. else {
  120514. results = results.sort(function sortUniqueArray(a, b) {
  120515. return a[key] > b[key] ? 1 : 0;
  120516. });
  120517. }
  120518. }
  120519. return results;
  120520. }
  120521. /**
  120522. * get the prefixed property
  120523. * @param {Object} obj
  120524. * @param {String} property
  120525. * @returns {String|Undefined} prefixed
  120526. */
  120527. function prefixed(obj, property) {
  120528. var prefix, prop;
  120529. var camelProp = property[0].toUpperCase() + property.slice(1);
  120530. var i = 0;
  120531. while (i < VENDOR_PREFIXES.length) {
  120532. prefix = VENDOR_PREFIXES[i];
  120533. prop = (prefix) ? prefix + camelProp : property;
  120534. if (prop in obj) {
  120535. return prop;
  120536. }
  120537. i++;
  120538. }
  120539. return undefined;
  120540. }
  120541. /**
  120542. * get a unique id
  120543. * @returns {number} uniqueId
  120544. */
  120545. var _uniqueId = 1;
  120546. function uniqueId() {
  120547. return _uniqueId++;
  120548. }
  120549. /**
  120550. * get the window object of an element
  120551. * @param {HTMLElement} element
  120552. * @returns {DocumentView|Window}
  120553. */
  120554. function getWindowForElement(element) {
  120555. var doc = element.ownerDocument || element;
  120556. return (doc.defaultView || doc.parentWindow || window);
  120557. }
  120558. var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;
  120559. var SUPPORT_TOUCH = ('ontouchstart' in window);
  120560. var SUPPORT_POINTER_EVENTS = prefixed(window, 'PointerEvent') !== undefined;
  120561. var SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);
  120562. var INPUT_TYPE_TOUCH = 'touch';
  120563. var INPUT_TYPE_PEN = 'pen';
  120564. var INPUT_TYPE_MOUSE = 'mouse';
  120565. var INPUT_TYPE_KINECT = 'kinect';
  120566. var COMPUTE_INTERVAL = 25;
  120567. var INPUT_START = 1;
  120568. var INPUT_MOVE = 2;
  120569. var INPUT_END = 4;
  120570. var INPUT_CANCEL = 8;
  120571. var DIRECTION_NONE = 1;
  120572. var DIRECTION_LEFT = 2;
  120573. var DIRECTION_RIGHT = 4;
  120574. var DIRECTION_UP = 8;
  120575. var DIRECTION_DOWN = 16;
  120576. var DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT;
  120577. var DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN;
  120578. var DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;
  120579. var PROPS_XY = ['x', 'y'];
  120580. var PROPS_CLIENT_XY = ['clientX', 'clientY'];
  120581. /**
  120582. * create new input type manager
  120583. * @param {Manager} manager
  120584. * @param {Function} callback
  120585. * @returns {Input}
  120586. * @constructor
  120587. */
  120588. function Input(manager, callback) {
  120589. var self = this;
  120590. this.manager = manager;
  120591. this.callback = callback;
  120592. this.element = manager.element;
  120593. this.target = manager.options.inputTarget;
  120594. // smaller wrapper around the handler, for the scope and the enabled state of the manager,
  120595. // so when disabled the input events are completely bypassed.
  120596. this.domHandler = function (ev) {
  120597. if (boolOrFn(manager.options.enable, [manager])) {
  120598. self.handler(ev);
  120599. }
  120600. };
  120601. this.init();
  120602. }
  120603. Input.prototype = {
  120604. /**
  120605. * should handle the inputEvent data and trigger the callback
  120606. * @virtual
  120607. */
  120608. handler: function () { },
  120609. /**
  120610. * bind the events
  120611. */
  120612. init: function () {
  120613. this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);
  120614. this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);
  120615. this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
  120616. },
  120617. /**
  120618. * unbind the events
  120619. */
  120620. destroy: function () {
  120621. this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);
  120622. this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);
  120623. this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
  120624. }
  120625. };
  120626. /**
  120627. * create new input type manager
  120628. * called by the Manager constructor
  120629. * @param {Hammer} manager
  120630. * @returns {Input}
  120631. */
  120632. function createInputInstance(manager) {
  120633. var Type;
  120634. var inputClass = manager.options.inputClass;
  120635. if (inputClass) {
  120636. Type = inputClass;
  120637. }
  120638. else if (SUPPORT_POINTER_EVENTS) {
  120639. Type = PointerEventInput;
  120640. }
  120641. else if (SUPPORT_ONLY_TOUCH) {
  120642. Type = TouchInput;
  120643. }
  120644. else if (!SUPPORT_TOUCH) {
  120645. Type = MouseInput;
  120646. }
  120647. else {
  120648. Type = TouchMouseInput;
  120649. }
  120650. return new (Type)(manager, inputHandler);
  120651. }
  120652. /**
  120653. * handle input events
  120654. * @param {Manager} manager
  120655. * @param {String} eventType
  120656. * @param {Object} input
  120657. */
  120658. function inputHandler(manager, eventType, input) {
  120659. var pointersLen = input.pointers.length;
  120660. var changedPointersLen = input.changedPointers.length;
  120661. var isFirst = (eventType & INPUT_START && (pointersLen - changedPointersLen === 0));
  120662. var isFinal = (eventType & (INPUT_END | INPUT_CANCEL) && (pointersLen - changedPointersLen === 0));
  120663. input.isFirst = !!isFirst;
  120664. input.isFinal = !!isFinal;
  120665. if (isFirst) {
  120666. manager.session = {};
  120667. }
  120668. // source event is the normalized value of the domEvents
  120669. // like 'touchstart, mouseup, pointerdown'
  120670. input.eventType = eventType;
  120671. // compute scale, rotation etc
  120672. computeInputData(manager, input);
  120673. // emit secret event
  120674. manager.emit('hammer.input', input);
  120675. manager.recognize(input);
  120676. manager.session.prevInput = input;
  120677. }
  120678. /**
  120679. * extend the data with some usable properties like scale, rotate, velocity etc
  120680. * @param {Object} manager
  120681. * @param {Object} input
  120682. */
  120683. function computeInputData(manager, input) {
  120684. var session = manager.session;
  120685. var pointers = input.pointers;
  120686. var pointersLength = pointers.length;
  120687. // store the first input to calculate the distance and direction
  120688. if (!session.firstInput) {
  120689. session.firstInput = simpleCloneInputData(input);
  120690. }
  120691. // to compute scale and rotation we need to store the multiple touches
  120692. if (pointersLength > 1 && !session.firstMultiple) {
  120693. session.firstMultiple = simpleCloneInputData(input);
  120694. }
  120695. else if (pointersLength === 1) {
  120696. session.firstMultiple = false;
  120697. }
  120698. var firstInput = session.firstInput;
  120699. var firstMultiple = session.firstMultiple;
  120700. var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;
  120701. var center = input.center = getCenter(pointers);
  120702. input.timeStamp = now();
  120703. input.deltaTime = input.timeStamp - firstInput.timeStamp;
  120704. input.angle = getAngle(offsetCenter, center);
  120705. input.distance = getDistance(offsetCenter, center);
  120706. computeDeltaXY(session, input);
  120707. input.offsetDirection = getDirection(input.deltaX, input.deltaY);
  120708. var overallVelocity = getVelocity(input.deltaTime, input.deltaX, input.deltaY);
  120709. input.overallVelocityX = overallVelocity.x;
  120710. input.overallVelocityY = overallVelocity.y;
  120711. input.overallVelocity = (abs(overallVelocity.x) > abs(overallVelocity.y)) ? overallVelocity.x : overallVelocity.y;
  120712. input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;
  120713. input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;
  120714. input.maxPointers = !session.prevInput ? input.pointers.length : ((input.pointers.length >
  120715. session.prevInput.maxPointers) ? input.pointers.length : session.prevInput.maxPointers);
  120716. computeIntervalInputData(session, input);
  120717. // find the correct target
  120718. var target = manager.element;
  120719. if (hasParent(input.srcEvent.target, target)) {
  120720. target = input.srcEvent.target;
  120721. }
  120722. input.target = target;
  120723. }
  120724. function computeDeltaXY(session, input) {
  120725. var center = input.center;
  120726. var offset = session.offsetDelta || {};
  120727. var prevDelta = session.prevDelta || {};
  120728. var prevInput = session.prevInput || {};
  120729. if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) {
  120730. prevDelta = session.prevDelta = {
  120731. x: prevInput.deltaX || 0,
  120732. y: prevInput.deltaY || 0
  120733. };
  120734. offset = session.offsetDelta = {
  120735. x: center.x,
  120736. y: center.y
  120737. };
  120738. }
  120739. input.deltaX = prevDelta.x + (center.x - offset.x);
  120740. input.deltaY = prevDelta.y + (center.y - offset.y);
  120741. }
  120742. /**
  120743. * velocity is calculated every x ms
  120744. * @param {Object} session
  120745. * @param {Object} input
  120746. */
  120747. function computeIntervalInputData(session, input) {
  120748. var last = session.lastInterval || input, deltaTime = input.timeStamp - last.timeStamp, velocity, velocityX, velocityY, direction;
  120749. if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) {
  120750. var deltaX = input.deltaX - last.deltaX;
  120751. var deltaY = input.deltaY - last.deltaY;
  120752. var v = getVelocity(deltaTime, deltaX, deltaY);
  120753. velocityX = v.x;
  120754. velocityY = v.y;
  120755. velocity = (abs(v.x) > abs(v.y)) ? v.x : v.y;
  120756. direction = getDirection(deltaX, deltaY);
  120757. session.lastInterval = input;
  120758. }
  120759. else {
  120760. // use latest velocity info if it doesn't overtake a minimum period
  120761. velocity = last.velocity;
  120762. velocityX = last.velocityX;
  120763. velocityY = last.velocityY;
  120764. direction = last.direction;
  120765. }
  120766. input.velocity = velocity;
  120767. input.velocityX = velocityX;
  120768. input.velocityY = velocityY;
  120769. input.direction = direction;
  120770. }
  120771. /**
  120772. * create a simple clone from the input used for storage of firstInput and firstMultiple
  120773. * @param {Object} input
  120774. * @returns {Object} clonedInputData
  120775. */
  120776. function simpleCloneInputData(input) {
  120777. // make a simple copy of the pointers because we will get a reference if we don't
  120778. // we only need clientXY for the calculations
  120779. var pointers = [];
  120780. var i = 0;
  120781. while (i < input.pointers.length) {
  120782. pointers[i] = {
  120783. clientX: round(input.pointers[i].clientX),
  120784. clientY: round(input.pointers[i].clientY)
  120785. };
  120786. i++;
  120787. }
  120788. return {
  120789. timeStamp: now(),
  120790. pointers: pointers,
  120791. center: getCenter(pointers),
  120792. deltaX: input.deltaX,
  120793. deltaY: input.deltaY
  120794. };
  120795. }
  120796. /**
  120797. * get the center of all the pointers
  120798. * @param {Array} pointers
  120799. * @return {Object} center contains `x` and `y` properties
  120800. */
  120801. function getCenter(pointers) {
  120802. var pointersLength = pointers.length;
  120803. // no need to loop when only one touch
  120804. if (pointersLength === 1) {
  120805. return {
  120806. x: round(pointers[0].clientX),
  120807. y: round(pointers[0].clientY)
  120808. };
  120809. }
  120810. var x = 0, y = 0, i = 0;
  120811. while (i < pointersLength) {
  120812. x += pointers[i].clientX;
  120813. y += pointers[i].clientY;
  120814. i++;
  120815. }
  120816. return {
  120817. x: round(x / pointersLength),
  120818. y: round(y / pointersLength)
  120819. };
  120820. }
  120821. /**
  120822. * calculate the velocity between two points. unit is in px per ms.
  120823. * @param {Number} deltaTime
  120824. * @param {Number} x
  120825. * @param {Number} y
  120826. * @return {Object} velocity `x` and `y`
  120827. */
  120828. function getVelocity(deltaTime, x, y) {
  120829. return {
  120830. x: x / deltaTime || 0,
  120831. y: y / deltaTime || 0
  120832. };
  120833. }
  120834. /**
  120835. * get the direction between two points
  120836. * @param {Number} x
  120837. * @param {Number} y
  120838. * @return {Number} direction
  120839. */
  120840. function getDirection(x, y) {
  120841. if (x === y) {
  120842. return DIRECTION_NONE;
  120843. }
  120844. if (abs(x) >= abs(y)) {
  120845. return x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
  120846. }
  120847. return y < 0 ? DIRECTION_UP : DIRECTION_DOWN;
  120848. }
  120849. /**
  120850. * calculate the absolute distance between two points
  120851. * @param {Object} p1 {x, y}
  120852. * @param {Object} p2 {x, y}
  120853. * @param {Array} [props] containing x and y keys
  120854. * @return {Number} distance
  120855. */
  120856. function getDistance(p1, p2, props) {
  120857. if (!props) {
  120858. props = PROPS_XY;
  120859. }
  120860. var x = p2[props[0]] - p1[props[0]], y = p2[props[1]] - p1[props[1]];
  120861. return Math.sqrt((x * x) + (y * y));
  120862. }
  120863. /**
  120864. * calculate the angle between two coordinates
  120865. * @param {Object} p1
  120866. * @param {Object} p2
  120867. * @param {Array} [props] containing x and y keys
  120868. * @return {Number} angle
  120869. */
  120870. function getAngle(p1, p2, props) {
  120871. if (!props) {
  120872. props = PROPS_XY;
  120873. }
  120874. var x = p2[props[0]] - p1[props[0]], y = p2[props[1]] - p1[props[1]];
  120875. return Math.atan2(y, x) * 180 / Math.PI;
  120876. }
  120877. /**
  120878. * calculate the rotation degrees between two pointersets
  120879. * @param {Array} start array of pointers
  120880. * @param {Array} end array of pointers
  120881. * @return {Number} rotation
  120882. */
  120883. function getRotation(start, end) {
  120884. return getAngle(end[1], end[0], PROPS_CLIENT_XY) + getAngle(start[1], start[0], PROPS_CLIENT_XY);
  120885. }
  120886. /**
  120887. * calculate the scale factor between two pointersets
  120888. * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out
  120889. * @param {Array} start array of pointers
  120890. * @param {Array} end array of pointers
  120891. * @return {Number} scale
  120892. */
  120893. function getScale(start, end) {
  120894. return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);
  120895. }
  120896. var MOUSE_INPUT_MAP = {
  120897. mousedown: INPUT_START,
  120898. mousemove: INPUT_MOVE,
  120899. mouseup: INPUT_END
  120900. };
  120901. var MOUSE_ELEMENT_EVENTS = 'mousedown';
  120902. var MOUSE_WINDOW_EVENTS = 'mousemove mouseup';
  120903. /**
  120904. * Mouse events input
  120905. * @constructor
  120906. * @extends Input
  120907. */
  120908. function MouseInput(_manager, _handler) {
  120909. this.evEl = MOUSE_ELEMENT_EVENTS;
  120910. this.evWin = MOUSE_WINDOW_EVENTS;
  120911. this.allow = true; // used by Input.TouchMouse to disable mouse events
  120912. this.pressed = false; // mousedown state
  120913. Input.apply(this, arguments);
  120914. }
  120915. inherit(MouseInput, Input, {
  120916. /**
  120917. * handle mouse events
  120918. * @param {Object} ev
  120919. */
  120920. handler: function MEhandler(ev) {
  120921. var eventType = MOUSE_INPUT_MAP[ev.type];
  120922. // on start we want to have the left mouse button down
  120923. if (eventType & INPUT_START && ev.button === 0) {
  120924. this.pressed = true;
  120925. }
  120926. if (eventType & INPUT_MOVE && ev.which !== 1) {
  120927. eventType = INPUT_END;
  120928. }
  120929. // mouse must be down, and mouse events are allowed (see the TouchMouse input)
  120930. if (!this.pressed || !this.allow) {
  120931. return;
  120932. }
  120933. if (eventType & INPUT_END) {
  120934. this.pressed = false;
  120935. }
  120936. this.callback(this.manager, eventType, {
  120937. pointers: [ev],
  120938. changedPointers: [ev],
  120939. pointerType: INPUT_TYPE_MOUSE,
  120940. srcEvent: ev
  120941. });
  120942. }
  120943. });
  120944. var POINTER_INPUT_MAP = {
  120945. pointerdown: INPUT_START,
  120946. pointermove: INPUT_MOVE,
  120947. pointerup: INPUT_END,
  120948. pointercancel: INPUT_CANCEL,
  120949. pointerout: INPUT_CANCEL
  120950. };
  120951. // in IE10 the pointer types is defined as an enum
  120952. var IE10_POINTER_TYPE_ENUM = {
  120953. 2: INPUT_TYPE_TOUCH,
  120954. 3: INPUT_TYPE_PEN,
  120955. 4: INPUT_TYPE_MOUSE,
  120956. 5: INPUT_TYPE_KINECT // see https://twitter.com/jacobrossi/status/480596438489890816
  120957. };
  120958. var POINTER_ELEMENT_EVENTS = 'pointerdown';
  120959. var POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel';
  120960. // IE10 has prefixed support, and case-sensitive
  120961. if (win.MSPointerEvent && !win.PointerEvent) {
  120962. POINTER_ELEMENT_EVENTS = 'MSPointerDown';
  120963. POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';
  120964. }
  120965. /**
  120966. * Pointer events input
  120967. * @constructor
  120968. * @extends Input
  120969. */
  120970. function PointerEventInput() {
  120971. this.evEl = POINTER_ELEMENT_EVENTS;
  120972. this.evWin = POINTER_WINDOW_EVENTS;
  120973. Input.apply(this, arguments);
  120974. this.store = (this.manager.session.pointerEvents = []);
  120975. }
  120976. inherit(PointerEventInput, Input, {
  120977. /**
  120978. * handle mouse events
  120979. * @param {Object} ev
  120980. */
  120981. handler: function PEhandler(ev) {
  120982. var store = this.store;
  120983. var removePointer = false;
  120984. var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');
  120985. var eventType = POINTER_INPUT_MAP[eventTypeNormalized];
  120986. var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;
  120987. var isTouch = (pointerType == INPUT_TYPE_TOUCH);
  120988. // get index of the event in the store
  120989. var storeIndex = inArray(store, ev.pointerId, 'pointerId');
  120990. // start and mouse must be down
  120991. if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {
  120992. if (storeIndex < 0) {
  120993. store.push(ev);
  120994. storeIndex = store.length - 1;
  120995. }
  120996. }
  120997. else if (eventType & (INPUT_END | INPUT_CANCEL)) {
  120998. removePointer = true;
  120999. }
  121000. // it not found, so the pointer hasn't been down (so it's probably a hover)
  121001. if (storeIndex < 0) {
  121002. return;
  121003. }
  121004. // update the event in the store
  121005. store[storeIndex] = ev;
  121006. this.callback(this.manager, eventType, {
  121007. pointers: store,
  121008. changedPointers: [ev],
  121009. pointerType: pointerType,
  121010. srcEvent: ev
  121011. });
  121012. if (removePointer) {
  121013. // remove from the store
  121014. store.splice(storeIndex, 1);
  121015. }
  121016. }
  121017. });
  121018. var SINGLE_TOUCH_INPUT_MAP = {
  121019. touchstart: INPUT_START,
  121020. touchmove: INPUT_MOVE,
  121021. touchend: INPUT_END,
  121022. touchcancel: INPUT_CANCEL
  121023. };
  121024. var SINGLE_TOUCH_TARGET_EVENTS = 'touchstart';
  121025. var SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel';
  121026. /**
  121027. * Touch events input
  121028. * @constructor
  121029. * @extends Input
  121030. */
  121031. function SingleTouchInput() {
  121032. this.evTarget = SINGLE_TOUCH_TARGET_EVENTS;
  121033. this.evWin = SINGLE_TOUCH_WINDOW_EVENTS;
  121034. this.started = false;
  121035. Input.apply(this, arguments);
  121036. }
  121037. inherit(SingleTouchInput, Input, {
  121038. handler: function TEhandler(ev) {
  121039. var type = SINGLE_TOUCH_INPUT_MAP[ev.type];
  121040. // should we handle the touch events?
  121041. if (type === INPUT_START) {
  121042. this.started = true;
  121043. }
  121044. if (!this.started) {
  121045. return;
  121046. }
  121047. var touches = normalizeSingleTouches.call(this, ev, type);
  121048. // when done, reset the started state
  121049. if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) {
  121050. this.started = false;
  121051. }
  121052. this.callback(this.manager, type, {
  121053. pointers: touches[0],
  121054. changedPointers: touches[1],
  121055. pointerType: INPUT_TYPE_TOUCH,
  121056. srcEvent: ev
  121057. });
  121058. }
  121059. });
  121060. /**
  121061. * @this {TouchInput}
  121062. * @param {Object} ev
  121063. * @param {Number} type flag
  121064. * @returns {undefined|Array} [all, changed]
  121065. */
  121066. function normalizeSingleTouches(ev, type) {
  121067. var all = toArray(ev.touches);
  121068. var changed = toArray(ev.changedTouches);
  121069. if (type & (INPUT_END | INPUT_CANCEL)) {
  121070. all = uniqueArray(all.concat(changed), 'identifier', true);
  121071. }
  121072. return [all, changed];
  121073. }
  121074. var TOUCH_INPUT_MAP = {
  121075. touchstart: INPUT_START,
  121076. touchmove: INPUT_MOVE,
  121077. touchend: INPUT_END,
  121078. touchcancel: INPUT_CANCEL
  121079. };
  121080. var TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel';
  121081. /**
  121082. * Multi-user touch events input
  121083. * @constructor
  121084. * @extends Input
  121085. */
  121086. function TouchInput(_manager, _handler) {
  121087. this.evTarget = TOUCH_TARGET_EVENTS;
  121088. this.targetIds = {};
  121089. Input.apply(this, arguments);
  121090. }
  121091. inherit(TouchInput, Input, {
  121092. handler: function MTEhandler(ev) {
  121093. var type = TOUCH_INPUT_MAP[ev.type];
  121094. var touches = getTouches.call(this, ev, type);
  121095. if (!touches) {
  121096. return;
  121097. }
  121098. this.callback(this.manager, type, {
  121099. pointers: touches[0],
  121100. changedPointers: touches[1],
  121101. pointerType: INPUT_TYPE_TOUCH,
  121102. srcEvent: ev
  121103. });
  121104. }
  121105. });
  121106. /**
  121107. * @this {TouchInput}
  121108. * @param {Object} ev
  121109. * @param {Number} type flag
  121110. * @returns {undefined|Array} [all, changed]
  121111. */
  121112. function getTouches(ev, type) {
  121113. var allTouches = toArray(ev.touches);
  121114. var targetIds = this.targetIds;
  121115. // when there is only one touch, the process can be simplified
  121116. if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {
  121117. targetIds[allTouches[0].identifier] = true;
  121118. return [allTouches, allTouches];
  121119. }
  121120. var i, targetTouches, changedTouches = toArray(ev.changedTouches), changedTargetTouches = [], target = this.target;
  121121. // get target touches from touches
  121122. targetTouches = allTouches.filter(function (touch) {
  121123. return hasParent(touch.target, target);
  121124. });
  121125. // collect touches
  121126. if (type === INPUT_START) {
  121127. i = 0;
  121128. while (i < targetTouches.length) {
  121129. targetIds[targetTouches[i].identifier] = true;
  121130. i++;
  121131. }
  121132. }
  121133. // filter changed touches to only contain touches that exist in the collected target ids
  121134. i = 0;
  121135. while (i < changedTouches.length) {
  121136. if (targetIds[changedTouches[i].identifier]) {
  121137. changedTargetTouches.push(changedTouches[i]);
  121138. }
  121139. // cleanup removed touches
  121140. if (type & (INPUT_END | INPUT_CANCEL)) {
  121141. delete targetIds[changedTouches[i].identifier];
  121142. }
  121143. i++;
  121144. }
  121145. if (!changedTargetTouches.length) {
  121146. return;
  121147. }
  121148. return [
  121149. // merge targetTouches with changedTargetTouches so it contains ALL touches, including 'end' and 'cancel'
  121150. uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier', true),
  121151. changedTargetTouches
  121152. ];
  121153. }
  121154. /**
  121155. * Combined touch and mouse input
  121156. *
  121157. * Touch has a higher priority then mouse, and while touching no mouse events are allowed.
  121158. * This because touch devices also emit mouse events while doing a touch.
  121159. *
  121160. * @constructor
  121161. * @extends Input
  121162. */
  121163. function TouchMouseInput() {
  121164. Input.apply(this, arguments);
  121165. var handler = bindFn(this.handler, this);
  121166. this.touch = new TouchInput(this.manager, handler);
  121167. this.mouse = new MouseInput(this.manager, handler);
  121168. }
  121169. inherit(TouchMouseInput, Input, {
  121170. /**
  121171. * handle mouse and touch events
  121172. * @param {Hammer} manager
  121173. * @param {String} inputEvent
  121174. * @param {Object} inputData
  121175. */
  121176. handler: function TMEhandler(manager, inputEvent, inputData) {
  121177. var isTouch = (inputData.pointerType == INPUT_TYPE_TOUCH), isMouse = (inputData.pointerType == INPUT_TYPE_MOUSE);
  121178. // when we're in a touch event, so block all upcoming mouse events
  121179. // most mobile browser also emit mouseevents, right after touchstart
  121180. if (isTouch) {
  121181. this.mouse.allow = false;
  121182. }
  121183. else if (isMouse && !this.mouse.allow) {
  121184. return;
  121185. }
  121186. // reset the allowMouse when we're done
  121187. if (inputEvent & (INPUT_END | INPUT_CANCEL)) {
  121188. this.mouse.allow = true;
  121189. }
  121190. this.callback(manager, inputEvent, inputData);
  121191. },
  121192. /**
  121193. * remove the event listeners
  121194. */
  121195. destroy: function destroy() {
  121196. this.touch.destroy();
  121197. this.mouse.destroy();
  121198. }
  121199. });
  121200. var PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');
  121201. var NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined;
  121202. // magical touchAction value
  121203. var TOUCH_ACTION_COMPUTE = 'compute';
  121204. var TOUCH_ACTION_AUTO = 'auto';
  121205. var TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented
  121206. var TOUCH_ACTION_NONE = 'none';
  121207. var TOUCH_ACTION_PAN_X = 'pan-x';
  121208. var TOUCH_ACTION_PAN_Y = 'pan-y';
  121209. /**
  121210. * Touch Action
  121211. * sets the touchAction property or uses the js alternative
  121212. * @param {Manager} manager
  121213. * @param {String} value
  121214. * @constructor
  121215. */
  121216. function TouchAction(manager, value) {
  121217. this.manager = manager;
  121218. this.set(value);
  121219. }
  121220. TouchAction.prototype = {
  121221. /**
  121222. * set the touchAction value on the element or enable the polyfill
  121223. * @param {String} value
  121224. */
  121225. set: function (value) {
  121226. // find out the touch-action by the event handlers
  121227. if (value == TOUCH_ACTION_COMPUTE) {
  121228. value = this.compute();
  121229. }
  121230. if (NATIVE_TOUCH_ACTION && this.manager.element.style) {
  121231. this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;
  121232. }
  121233. this.actions = value.toLowerCase().trim();
  121234. },
  121235. /**
  121236. * just re-set the touchAction value
  121237. */
  121238. update: function () {
  121239. this.set(this.manager.options.touchAction);
  121240. },
  121241. /**
  121242. * compute the value for the touchAction property based on the recognizer's settings
  121243. * @returns {String} value
  121244. */
  121245. compute: function () {
  121246. var actions = [];
  121247. each(this.manager.recognizers, function (recognizer) {
  121248. if (boolOrFn(recognizer.options.enable, [recognizer])) {
  121249. actions = actions.concat(recognizer.getTouchAction());
  121250. }
  121251. });
  121252. return cleanTouchActions(actions.join(' '));
  121253. },
  121254. /**
  121255. * this method is called on each input cycle and provides the preventing of the browser behavior
  121256. * @param {Object} input
  121257. */
  121258. preventDefaults: function (input) {
  121259. // not needed with native support for the touchAction property
  121260. if (NATIVE_TOUCH_ACTION) {
  121261. return;
  121262. }
  121263. var srcEvent = input.srcEvent;
  121264. var direction = input.offsetDirection;
  121265. // if the touch action did prevented once this session
  121266. if (this.manager.session.prevented) {
  121267. srcEvent.preventDefault();
  121268. return;
  121269. }
  121270. var actions = this.actions;
  121271. var hasNone = inStr(actions, TOUCH_ACTION_NONE);
  121272. var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);
  121273. var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
  121274. if (hasNone) {
  121275. //do not prevent defaults if this is a tap gesture
  121276. var isTapPointer = input.pointers.length === 1;
  121277. var isTapMovement = input.distance < 2;
  121278. var isTapTouchTime = input.deltaTime < 250;
  121279. if (isTapPointer && isTapMovement && isTapTouchTime) {
  121280. return;
  121281. }
  121282. }
  121283. if (hasPanX && hasPanY) {
  121284. // `pan-x pan-y` means browser handles all scrolling/panning, do not prevent
  121285. return;
  121286. }
  121287. if (hasNone ||
  121288. (hasPanY && direction & DIRECTION_HORIZONTAL) ||
  121289. (hasPanX && direction & DIRECTION_VERTICAL)) {
  121290. return this.preventSrc(srcEvent);
  121291. }
  121292. },
  121293. /**
  121294. * call preventDefault to prevent the browser's default behavior (scrolling in most cases)
  121295. * @param {Object} srcEvent
  121296. */
  121297. preventSrc: function (srcEvent) {
  121298. this.manager.session.prevented = true;
  121299. srcEvent.preventDefault();
  121300. }
  121301. };
  121302. /**
  121303. * when the touchActions are collected they are not a valid value, so we need to clean things up. *
  121304. * @param {String} actions
  121305. * @returns {*}
  121306. */
  121307. function cleanTouchActions(actions) {
  121308. // none
  121309. if (inStr(actions, TOUCH_ACTION_NONE)) {
  121310. return TOUCH_ACTION_NONE;
  121311. }
  121312. var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
  121313. var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);
  121314. // if both pan-x and pan-y are set (different recognizers
  121315. // for different directions, e.g. horizontal pan but vertical swipe?)
  121316. // we need none (as otherwise with pan-x pan-y combined none of these
  121317. // recognizers will work, since the browser would handle all panning
  121318. if (hasPanX && hasPanY) {
  121319. return TOUCH_ACTION_NONE;
  121320. }
  121321. // pan-x OR pan-y
  121322. if (hasPanX || hasPanY) {
  121323. return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y;
  121324. }
  121325. // manipulation
  121326. if (inStr(actions, TOUCH_ACTION_MANIPULATION)) {
  121327. return TOUCH_ACTION_MANIPULATION;
  121328. }
  121329. return TOUCH_ACTION_AUTO;
  121330. }
  121331. /**
  121332. * Recognizer flow explained; *
  121333. * All recognizers have the initial state of POSSIBLE when a input session starts.
  121334. * The definition of a input session is from the first input until the last input, with all it's movement in it. *
  121335. * Example session for mouse-input: mousedown -> mousemove -> mouseup
  121336. *
  121337. * On each recognizing cycle (see Manager.recognize) the .recognize() method is executed
  121338. * which determines with state it should be.
  121339. *
  121340. * If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals ENDED), it is reset to
  121341. * POSSIBLE to give it another change on the next cycle.
  121342. *
  121343. * Possible
  121344. * |
  121345. * +-----+---------------+
  121346. * | |
  121347. * +-----+-----+ |
  121348. * | | |
  121349. * Failed Cancelled |
  121350. * +-------+------+
  121351. * | |
  121352. * Recognized Began
  121353. * |
  121354. * Changed
  121355. * |
  121356. * Ended/Recognized
  121357. */
  121358. var STATE_POSSIBLE = 1;
  121359. var STATE_BEGAN = 2;
  121360. var STATE_CHANGED = 4;
  121361. var STATE_ENDED = 8;
  121362. var STATE_RECOGNIZED = STATE_ENDED;
  121363. var STATE_CANCELLED = 16;
  121364. var STATE_FAILED = 32;
  121365. /**
  121366. * Recognizer
  121367. * Every recognizer needs to extend from this class.
  121368. * @constructor
  121369. * @param {Object} options
  121370. */
  121371. function Recognizer(options) {
  121372. this.options = Object.assign({}, this.defaults, options || {});
  121373. this.id = uniqueId();
  121374. this.manager = null;
  121375. // default is enable true
  121376. this.options.enable = ifUndefined(this.options.enable, true);
  121377. this.state = STATE_POSSIBLE;
  121378. this.simultaneous = {};
  121379. this.requireFail = [];
  121380. }
  121381. Recognizer.prototype = {
  121382. /**
  121383. * @virtual
  121384. * @type {Object}
  121385. */
  121386. defaults: {},
  121387. /**
  121388. * set options
  121389. * @param {Object} options
  121390. * @return {Recognizer}
  121391. */
  121392. set: function (options) {
  121393. Object.assign(this.options, options);
  121394. // also update the touchAction, in case something changed about the directions/enabled state
  121395. this.manager && this.manager.touchAction.update();
  121396. return this;
  121397. },
  121398. /**
  121399. * recognize simultaneous with an other recognizer.
  121400. * @param {Recognizer} otherRecognizer
  121401. * @returns {Recognizer} this
  121402. */
  121403. recognizeWith: function (otherRecognizer) {
  121404. if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) {
  121405. return this;
  121406. }
  121407. var simultaneous = this.simultaneous;
  121408. otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
  121409. if (!simultaneous[otherRecognizer.id]) {
  121410. simultaneous[otherRecognizer.id] = otherRecognizer;
  121411. otherRecognizer.recognizeWith(this);
  121412. }
  121413. return this;
  121414. },
  121415. /**
  121416. * drop the simultaneous link. it doesnt remove the link on the other recognizer.
  121417. * @param {Recognizer} otherRecognizer
  121418. * @returns {Recognizer} this
  121419. */
  121420. dropRecognizeWith: function (otherRecognizer) {
  121421. if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) {
  121422. return this;
  121423. }
  121424. otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
  121425. delete this.simultaneous[otherRecognizer.id];
  121426. return this;
  121427. },
  121428. /**
  121429. * recognizer can only run when an other is failing
  121430. * @param {Recognizer} otherRecognizer
  121431. * @returns {Recognizer} this
  121432. */
  121433. requireFailure: function (otherRecognizer) {
  121434. if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) {
  121435. return this;
  121436. }
  121437. var requireFail = this.requireFail;
  121438. otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
  121439. if (inArray(requireFail, otherRecognizer) === -1) {
  121440. requireFail.push(otherRecognizer);
  121441. otherRecognizer.requireFailure(this);
  121442. }
  121443. return this;
  121444. },
  121445. /**
  121446. * drop the requireFailure link. it does not remove the link on the other recognizer.
  121447. * @param {Recognizer} otherRecognizer
  121448. * @returns {Recognizer} this
  121449. */
  121450. dropRequireFailure: function (otherRecognizer) {
  121451. if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) {
  121452. return this;
  121453. }
  121454. otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
  121455. var index = inArray(this.requireFail, otherRecognizer);
  121456. if (index > -1) {
  121457. this.requireFail.splice(index, 1);
  121458. }
  121459. return this;
  121460. },
  121461. /**
  121462. * has require failures boolean
  121463. * @returns {boolean}
  121464. */
  121465. hasRequireFailures: function () {
  121466. return this.requireFail.length > 0;
  121467. },
  121468. /**
  121469. * if the recognizer can recognize simultaneous with an other recognizer
  121470. * @param {Recognizer} otherRecognizer
  121471. * @returns {Boolean}
  121472. */
  121473. canRecognizeWith: function (otherRecognizer) {
  121474. return !!this.simultaneous[otherRecognizer.id];
  121475. },
  121476. /**
  121477. * You should use `tryEmit` instead of `emit` directly to check
  121478. * that all the needed recognizers has failed before emitting.
  121479. * @param {Object} input
  121480. */
  121481. emit: function (input) {
  121482. var self = this;
  121483. var state = this.state;
  121484. function emit(event) {
  121485. self.manager.emit(event, input);
  121486. }
  121487. // 'panstart' and 'panmove'
  121488. if (state < STATE_ENDED) {
  121489. emit(self.options.event + stateStr(state));
  121490. }
  121491. emit(self.options.event); // simple 'eventName' events
  121492. if (input.additionalEvent) {
  121493. emit(input.additionalEvent);
  121494. }
  121495. // panend and pancancel
  121496. if (state >= STATE_ENDED) {
  121497. emit(self.options.event + stateStr(state));
  121498. }
  121499. },
  121500. /**
  121501. * Check that all the require failure recognizers has failed,
  121502. * if true, it emits a gesture event,
  121503. * otherwise, setup the state to FAILED.
  121504. * @param {Object} input
  121505. */
  121506. tryEmit: function (input) {
  121507. if (this.canEmit()) {
  121508. return this.emit(input);
  121509. }
  121510. // it's failing anyway
  121511. this.state = STATE_FAILED;
  121512. },
  121513. /**
  121514. * can we emit?
  121515. * @returns {boolean}
  121516. */
  121517. canEmit: function () {
  121518. var i = 0;
  121519. while (i < this.requireFail.length) {
  121520. if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) {
  121521. return false;
  121522. }
  121523. i++;
  121524. }
  121525. return true;
  121526. },
  121527. /**
  121528. * update the recognizer
  121529. * @param {Object} inputData
  121530. */
  121531. recognize: function (inputData) {
  121532. // make a new copy of the inputData
  121533. // so we can change the inputData without messing up the other recognizers
  121534. var inputDataClone = Object.assign({}, inputData);
  121535. // is is enabled and allow recognizing?
  121536. if (!boolOrFn(this.options.enable, [this, inputDataClone])) {
  121537. this.reset();
  121538. this.state = STATE_FAILED;
  121539. return;
  121540. }
  121541. // reset when we've reached the end
  121542. if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) {
  121543. this.state = STATE_POSSIBLE;
  121544. }
  121545. this.state = this.process(inputDataClone);
  121546. // the recognizer has recognized a gesture
  121547. // so trigger an event
  121548. if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) {
  121549. this.tryEmit(inputDataClone);
  121550. }
  121551. },
  121552. /**
  121553. * return the state of the recognizer
  121554. * the actual recognizing happens in this method
  121555. * @virtual
  121556. * @param {Object} inputData
  121557. * @returns {Const} STATE
  121558. */
  121559. process: function (_inputData) { },
  121560. /**
  121561. * return the preferred touch-action
  121562. * @virtual
  121563. * @returns {Array}
  121564. */
  121565. getTouchAction: function () { },
  121566. /**
  121567. * called when the gesture isn't allowed to recognize
  121568. * like when another is being recognized or it is disabled
  121569. * @virtual
  121570. */
  121571. reset: function () { }
  121572. };
  121573. /**
  121574. * get a usable string, used as event postfix
  121575. * @param {Const} state
  121576. * @returns {String} state
  121577. */
  121578. function stateStr(state) {
  121579. if (state & STATE_CANCELLED) {
  121580. return 'cancel';
  121581. }
  121582. else if (state & STATE_ENDED) {
  121583. return 'end';
  121584. }
  121585. else if (state & STATE_CHANGED) {
  121586. return 'move';
  121587. }
  121588. else if (state & STATE_BEGAN) {
  121589. return 'start';
  121590. }
  121591. return '';
  121592. }
  121593. /**
  121594. * direction cons to string
  121595. * @param {Const} direction
  121596. * @returns {String}
  121597. */
  121598. function directionStr(direction) {
  121599. if (direction == DIRECTION_DOWN) {
  121600. return 'down';
  121601. }
  121602. else if (direction == DIRECTION_UP) {
  121603. return 'up';
  121604. }
  121605. else if (direction == DIRECTION_LEFT) {
  121606. return 'left';
  121607. }
  121608. else if (direction == DIRECTION_RIGHT) {
  121609. return 'right';
  121610. }
  121611. return '';
  121612. }
  121613. /**
  121614. * get a recognizer by name if it is bound to a manager
  121615. * @param {Recognizer|String} otherRecognizer
  121616. * @param {Recognizer} recognizer
  121617. * @returns {Recognizer}
  121618. */
  121619. function getRecognizerByNameIfManager(otherRecognizer, recognizer) {
  121620. var manager = recognizer.manager;
  121621. if (manager) {
  121622. return manager.get(otherRecognizer);
  121623. }
  121624. return otherRecognizer;
  121625. }
  121626. /**
  121627. * This recognizer is just used as a base for the simple attribute recognizers.
  121628. * @constructor
  121629. * @extends Recognizer
  121630. */
  121631. function AttrRecognizer() {
  121632. Recognizer.apply(this, arguments);
  121633. }
  121634. inherit(AttrRecognizer, Recognizer, {
  121635. /**
  121636. * @namespace
  121637. * @memberof AttrRecognizer
  121638. */
  121639. defaults: {
  121640. /**
  121641. * @type {Number}
  121642. * @default 1
  121643. */
  121644. pointers: 1
  121645. },
  121646. /**
  121647. * Used to check if it the recognizer receives valid input, like input.distance > 10.
  121648. * @memberof AttrRecognizer
  121649. * @param {Object} input
  121650. * @returns {Boolean} recognized
  121651. */
  121652. attrTest: function (input) {
  121653. var optionPointers = this.options.pointers;
  121654. return optionPointers === 0 || input.pointers.length === optionPointers;
  121655. },
  121656. /**
  121657. * Process the input and return the state for the recognizer
  121658. * @memberof AttrRecognizer
  121659. * @param {Object} input
  121660. * @returns {*} State
  121661. */
  121662. process: function (input) {
  121663. var state = this.state;
  121664. var eventType = input.eventType;
  121665. var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);
  121666. var isValid = this.attrTest(input);
  121667. // on cancel input and we've recognized before, return STATE_CANCELLED
  121668. if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {
  121669. return state | STATE_CANCELLED;
  121670. }
  121671. else if (isRecognized || isValid) {
  121672. if (eventType & INPUT_END) {
  121673. return state | STATE_ENDED;
  121674. }
  121675. else if (!(state & STATE_BEGAN)) {
  121676. return STATE_BEGAN;
  121677. }
  121678. return state | STATE_CHANGED;
  121679. }
  121680. return STATE_FAILED;
  121681. }
  121682. });
  121683. /**
  121684. * Pan
  121685. * Recognized when the pointer is down and moved in the allowed direction.
  121686. * @constructor
  121687. * @extends AttrRecognizer
  121688. */
  121689. function PanRecognizer() {
  121690. AttrRecognizer.apply(this, arguments);
  121691. this.pX = null;
  121692. this.pY = null;
  121693. }
  121694. inherit(PanRecognizer, AttrRecognizer, {
  121695. /**
  121696. * @namespace
  121697. * @memberof PanRecognizer
  121698. */
  121699. defaults: {
  121700. event: 'pan',
  121701. threshold: 10,
  121702. pointers: 1,
  121703. direction: DIRECTION_ALL
  121704. },
  121705. getTouchAction: function () {
  121706. var direction = this.options.direction;
  121707. var actions = [];
  121708. if (direction & DIRECTION_HORIZONTAL) {
  121709. actions.push(TOUCH_ACTION_PAN_Y);
  121710. }
  121711. if (direction & DIRECTION_VERTICAL) {
  121712. actions.push(TOUCH_ACTION_PAN_X);
  121713. }
  121714. return actions;
  121715. },
  121716. directionTest: function (input) {
  121717. var options = this.options;
  121718. var hasMoved = true;
  121719. var distance = input.distance;
  121720. var direction = input.direction;
  121721. var x = input.deltaX;
  121722. var y = input.deltaY;
  121723. // lock to axis?
  121724. if (!(direction & options.direction)) {
  121725. if (options.direction & DIRECTION_HORIZONTAL) {
  121726. direction = (x === 0) ? DIRECTION_NONE : (x < 0) ? DIRECTION_LEFT : DIRECTION_RIGHT;
  121727. hasMoved = x != this.pX;
  121728. distance = Math.abs(input.deltaX);
  121729. }
  121730. else {
  121731. direction = (y === 0) ? DIRECTION_NONE : (y < 0) ? DIRECTION_UP : DIRECTION_DOWN;
  121732. hasMoved = y != this.pY;
  121733. distance = Math.abs(input.deltaY);
  121734. }
  121735. }
  121736. input.direction = direction;
  121737. return hasMoved && distance > options.threshold && direction & options.direction;
  121738. },
  121739. attrTest: function (input) {
  121740. return AttrRecognizer.prototype.attrTest.call(this, input) &&
  121741. (this.state & STATE_BEGAN || (!(this.state & STATE_BEGAN) && this.directionTest(input)));
  121742. },
  121743. emit: function (input) {
  121744. this.pX = input.deltaX;
  121745. this.pY = input.deltaY;
  121746. var direction = directionStr(input.direction);
  121747. if (direction) {
  121748. input.additionalEvent = this.options.event + direction;
  121749. }
  121750. this._super.emit.call(this, input);
  121751. }
  121752. });
  121753. /**
  121754. * Pinch
  121755. * Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-out).
  121756. * @constructor
  121757. * @extends AttrRecognizer
  121758. */
  121759. function PinchRecognizer() {
  121760. AttrRecognizer.apply(this, arguments);
  121761. }
  121762. inherit(PinchRecognizer, AttrRecognizer, {
  121763. /**
  121764. * @namespace
  121765. * @memberof PinchRecognizer
  121766. */
  121767. defaults: {
  121768. event: 'pinch',
  121769. threshold: 0,
  121770. pointers: 2
  121771. },
  121772. getTouchAction: function () {
  121773. return [TOUCH_ACTION_NONE];
  121774. },
  121775. attrTest: function (input) {
  121776. return this._super.attrTest.call(this, input) &&
  121777. (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);
  121778. },
  121779. emit: function (input) {
  121780. if (input.scale !== 1) {
  121781. var inOut = input.scale < 1 ? 'in' : 'out';
  121782. input.additionalEvent = this.options.event + inOut;
  121783. }
  121784. this._super.emit.call(this, input);
  121785. }
  121786. });
  121787. /**
  121788. * Press
  121789. * Recognized when the pointer is down for x ms without any movement.
  121790. * @constructor
  121791. * @extends Recognizer
  121792. */
  121793. function PressRecognizer() {
  121794. Recognizer.apply(this, arguments);
  121795. this._timer = null;
  121796. this._input = null;
  121797. }
  121798. inherit(PressRecognizer, Recognizer, {
  121799. /**
  121800. * @namespace
  121801. * @memberof PressRecognizer
  121802. */
  121803. defaults: {
  121804. event: 'press',
  121805. pointers: 1,
  121806. time: 251,
  121807. threshold: 9 // a minimal movement is ok, but keep it low
  121808. },
  121809. getTouchAction: function () {
  121810. return [TOUCH_ACTION_AUTO];
  121811. },
  121812. process: function (input) {
  121813. var options = this.options;
  121814. var validPointers = input.pointers.length === options.pointers;
  121815. var validMovement = input.distance < options.threshold;
  121816. var validTime = input.deltaTime > options.time;
  121817. this._input = input;
  121818. // we only allow little movement
  121819. // and we've reached an end event, so a tap is possible
  121820. if (!validMovement || !validPointers || (input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime)) {
  121821. this.reset();
  121822. }
  121823. else if (input.eventType & INPUT_START) {
  121824. this.reset();
  121825. this._timer = setTimeoutContext(function () {
  121826. this.state = STATE_RECOGNIZED;
  121827. this.tryEmit();
  121828. }, options.time, this);
  121829. }
  121830. else if (input.eventType & INPUT_END) {
  121831. return STATE_RECOGNIZED;
  121832. }
  121833. return STATE_FAILED;
  121834. },
  121835. reset: function () {
  121836. clearTimeout(this._timer);
  121837. },
  121838. emit: function (input) {
  121839. if (this.state !== STATE_RECOGNIZED) {
  121840. return;
  121841. }
  121842. if (input && (input.eventType & INPUT_END)) {
  121843. this.manager.emit(this.options.event + 'up', input);
  121844. }
  121845. else {
  121846. this._input.timeStamp = now();
  121847. this.manager.emit(this.options.event, this._input);
  121848. }
  121849. }
  121850. });
  121851. /**
  121852. * Rotate
  121853. * Recognized when two or more pointer are moving in a circular motion.
  121854. * @constructor
  121855. * @extends AttrRecognizer
  121856. */
  121857. function RotateRecognizer() {
  121858. AttrRecognizer.apply(this, arguments);
  121859. }
  121860. inherit(RotateRecognizer, AttrRecognizer, {
  121861. /**
  121862. * @namespace
  121863. * @memberof RotateRecognizer
  121864. */
  121865. defaults: {
  121866. event: 'rotate',
  121867. threshold: 0,
  121868. pointers: 2
  121869. },
  121870. getTouchAction: function () {
  121871. return [TOUCH_ACTION_NONE];
  121872. },
  121873. attrTest: function (input) {
  121874. return this._super.attrTest.call(this, input) &&
  121875. (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN);
  121876. }
  121877. });
  121878. /**
  121879. * Swipe
  121880. * Recognized when the pointer is moving fast (velocity), with enough distance in the allowed direction.
  121881. * @constructor
  121882. * @extends AttrRecognizer
  121883. */
  121884. function SwipeRecognizer() {
  121885. AttrRecognizer.apply(this, arguments);
  121886. }
  121887. inherit(SwipeRecognizer, AttrRecognizer, {
  121888. /**
  121889. * @namespace
  121890. * @memberof SwipeRecognizer
  121891. */
  121892. defaults: {
  121893. event: 'swipe',
  121894. threshold: 10,
  121895. velocity: 0.3,
  121896. direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,
  121897. pointers: 1
  121898. },
  121899. getTouchAction: function () {
  121900. return PanRecognizer.prototype.getTouchAction.call(this);
  121901. },
  121902. attrTest: function (input) {
  121903. var direction = this.options.direction;
  121904. var velocity;
  121905. if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {
  121906. velocity = input.overallVelocity;
  121907. }
  121908. else if (direction & DIRECTION_HORIZONTAL) {
  121909. velocity = input.overallVelocityX;
  121910. }
  121911. else if (direction & DIRECTION_VERTICAL) {
  121912. velocity = input.overallVelocityY;
  121913. }
  121914. return this._super.attrTest.call(this, input) &&
  121915. direction & input.offsetDirection &&
  121916. input.distance > this.options.threshold &&
  121917. input.maxPointers == this.options.pointers &&
  121918. abs(velocity) > this.options.velocity && input.eventType & INPUT_END;
  121919. },
  121920. emit: function (input) {
  121921. var direction = directionStr(input.offsetDirection);
  121922. if (direction) {
  121923. this.manager.emit(this.options.event + direction, input);
  121924. }
  121925. this.manager.emit(this.options.event, input);
  121926. }
  121927. });
  121928. /**
  121929. * A tap is ecognized when the pointer is doing a small tap/click. Multiple taps are recognized if they occur
  121930. * between the given interval and position. The delay option can be used to recognize multi-taps without firing
  121931. * a single tap.
  121932. *
  121933. * The eventData from the emitted event contains the property `tapCount`, which contains the amount of
  121934. * multi-taps being recognized.
  121935. * @constructor
  121936. * @extends Recognizer
  121937. */
  121938. function TapRecognizer() {
  121939. Recognizer.apply(this, arguments);
  121940. // previous time and center,
  121941. // used for tap counting
  121942. this.pTime = false;
  121943. this.pCenter = false;
  121944. this._timer = null;
  121945. this._input = null;
  121946. this.count = 0;
  121947. }
  121948. inherit(TapRecognizer, Recognizer, {
  121949. /**
  121950. * @namespace
  121951. * @memberof PinchRecognizer
  121952. */
  121953. defaults: {
  121954. event: 'tap',
  121955. pointers: 1,
  121956. taps: 1,
  121957. interval: 300,
  121958. time: 250,
  121959. threshold: 9,
  121960. posThreshold: 10 // a multi-tap can be a bit off the initial position
  121961. },
  121962. getTouchAction: function () {
  121963. return [TOUCH_ACTION_MANIPULATION];
  121964. },
  121965. process: function (input) {
  121966. var options = this.options;
  121967. var validPointers = input.pointers.length === options.pointers;
  121968. var validMovement = input.distance < options.threshold;
  121969. var validTouchTime = input.deltaTime < options.time;
  121970. this.reset();
  121971. if ((input.eventType & INPUT_START) && (this.count === 0)) {
  121972. return this.failTimeout();
  121973. }
  121974. // we only allow little movement
  121975. // and we've reached an end event, so a tap is possible
  121976. if (validMovement && validTouchTime && validPointers) {
  121977. if (input.eventType != INPUT_END) {
  121978. return this.failTimeout();
  121979. }
  121980. var validInterval = this.pTime ? (input.timeStamp - this.pTime < options.interval) : true;
  121981. var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold;
  121982. this.pTime = input.timeStamp;
  121983. this.pCenter = input.center;
  121984. if (!validMultiTap || !validInterval) {
  121985. this.count = 1;
  121986. }
  121987. else {
  121988. this.count += 1;
  121989. }
  121990. this._input = input;
  121991. // if tap count matches we have recognized it,
  121992. // else it has began recognizing...
  121993. var tapCount = this.count % options.taps;
  121994. if (tapCount === 0) {
  121995. // no failing requirements, immediately trigger the tap event
  121996. // or wait as long as the multitap interval to trigger
  121997. if (!this.hasRequireFailures()) {
  121998. return STATE_RECOGNIZED;
  121999. }
  122000. else {
  122001. this._timer = setTimeoutContext(function () {
  122002. this.state = STATE_RECOGNIZED;
  122003. this.tryEmit();
  122004. }, options.interval, this);
  122005. return STATE_BEGAN;
  122006. }
  122007. }
  122008. }
  122009. return STATE_FAILED;
  122010. },
  122011. failTimeout: function () {
  122012. this._timer = setTimeoutContext(function () {
  122013. this.state = STATE_FAILED;
  122014. }, this.options.interval, this);
  122015. return STATE_FAILED;
  122016. },
  122017. reset: function () {
  122018. clearTimeout(this._timer);
  122019. },
  122020. emit: function () {
  122021. if (this.state == STATE_RECOGNIZED) {
  122022. this._input.tapCount = this.count;
  122023. this.manager.emit(this.options.event, this._input);
  122024. }
  122025. }
  122026. });
  122027. /**
  122028. * Simple way to create a manager with a default set of recognizers.
  122029. * @param {HTMLElement} element
  122030. * @param {Object} [options]
  122031. * @constructor
  122032. */
  122033. function Hammer(element, options) {
  122034. options = options || {};
  122035. options.recognizers = ifUndefined(options.recognizers, _defaults.preset);
  122036. return new Manager(element, options);
  122037. }
  122038. /**
  122039. * default settings
  122040. * @namespace
  122041. */
  122042. var _defaults = {
  122043. /**
  122044. * set if DOM events are being triggered.
  122045. * But this is slower and unused by simple implementations, so disabled by default.
  122046. * @type {Boolean}
  122047. * @default false
  122048. */
  122049. domEvents: false,
  122050. /**
  122051. * The value for the touchAction property/fallback.
  122052. * When set to `compute` it will magically set the correct value based on the added recognizers.
  122053. * @type {String}
  122054. * @default compute
  122055. */
  122056. touchAction: TOUCH_ACTION_COMPUTE,
  122057. /**
  122058. * @type {Boolean}
  122059. * @default true
  122060. */
  122061. enable: true,
  122062. /**
  122063. * EXPERIMENTAL FEATURE -- can be removed/changed
  122064. * Change the parent input target element.
  122065. * If Null, then it is being set the to main element.
  122066. * @type {Null|EventTarget}
  122067. * @default null
  122068. */
  122069. inputTarget: null,
  122070. /**
  122071. * force an input class
  122072. * @type {Null|Function}
  122073. * @default null
  122074. */
  122075. inputClass: null,
  122076. /**
  122077. * Default recognizer setup when calling `Hammer()`
  122078. * When creating a new Manager these will be skipped.
  122079. * @type {Array}
  122080. */
  122081. preset: [
  122082. // RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...]
  122083. [RotateRecognizer, { enable: false }],
  122084. [PinchRecognizer, { enable: false }, ['rotate']],
  122085. [SwipeRecognizer, { direction: DIRECTION_HORIZONTAL }],
  122086. [PanRecognizer, { direction: DIRECTION_HORIZONTAL }, ['swipe']],
  122087. [TapRecognizer],
  122088. [TapRecognizer, { event: 'doubletap', taps: 2 }, ['tap']],
  122089. [PressRecognizer]
  122090. ],
  122091. /**
  122092. * Some CSS properties can be used to improve the working of Hammer.
  122093. * Add them to this method and they will be set when creating a new Manager.
  122094. * @namespace
  122095. */
  122096. cssProps: {
  122097. /**
  122098. * Disables text selection to improve the dragging gesture. Mainly for desktop browsers.
  122099. * @type {String}
  122100. * @default 'none'
  122101. */
  122102. userSelect: 'none',
  122103. /**
  122104. * Disable the Windows Phone grippers when pressing an element.
  122105. * @type {String}
  122106. * @default 'none'
  122107. */
  122108. touchSelect: 'none',
  122109. /**
  122110. * Disables the default callout shown when you touch and hold a touch target.
  122111. * On iOS, when you touch and hold a touch target such as a link, Safari displays
  122112. * a callout containing information about the link. This property allows you to disable that callout.
  122113. * @type {String}
  122114. * @default 'none'
  122115. */
  122116. touchCallout: 'none',
  122117. /**
  122118. * Specifies whether zooming is enabled. Used by IE10>
  122119. * @type {String}
  122120. * @default 'none'
  122121. */
  122122. contentZooming: 'none',
  122123. /**
  122124. * Specifies that an entire element should be draggable instead of its contents. Mainly for desktop browsers.
  122125. * @type {String}
  122126. * @default 'none'
  122127. */
  122128. userDrag: 'none',
  122129. /**
  122130. * Overrides the highlight color shown when the user taps a link or a JavaScript
  122131. * clickable element in iOS. This property obeys the alpha value, if specified.
  122132. * @type {String}
  122133. * @default 'rgba(0,0,0,0)'
  122134. */
  122135. tapHighlightColor: 'rgba(0,0,0,0)'
  122136. }
  122137. };
  122138. var STOP = 1;
  122139. var FORCED_STOP = 2;
  122140. /**
  122141. * Manager
  122142. * @param {HTMLElement} element
  122143. * @param {Object} [options]
  122144. * @constructor
  122145. */
  122146. function Manager(element, options) {
  122147. this.options = Object.assign({}, _defaults, options || {});
  122148. this.options.inputTarget = this.options.inputTarget || element;
  122149. this.handlers = {};
  122150. this.session = {};
  122151. this.recognizers = [];
  122152. this.element = element;
  122153. this.input = createInputInstance(this);
  122154. this.touchAction = new TouchAction(this, this.options.touchAction);
  122155. toggleCssProps(this, true);
  122156. each(this.options.recognizers, function (item) {
  122157. var recognizer = this.add(new (item[0])(item[1]));
  122158. item[2] && recognizer.recognizeWith(item[2]);
  122159. item[3] && recognizer.requireFailure(item[3]);
  122160. }, this);
  122161. }
  122162. Manager.prototype = {
  122163. /**
  122164. * set options
  122165. * @param {Object} options
  122166. * @returns {Manager}
  122167. */
  122168. set: function (options) {
  122169. Object.assign(this.options, options);
  122170. // Options that need a little more setup
  122171. if (options.touchAction) {
  122172. this.touchAction.update();
  122173. }
  122174. if (options.inputTarget) {
  122175. // Clean up existing event listeners and reinitialize
  122176. this.input.destroy();
  122177. this.input.target = options.inputTarget;
  122178. this.input.init();
  122179. }
  122180. return this;
  122181. },
  122182. /**
  122183. * stop recognizing for this session.
  122184. * This session will be discarded, when a new [input]start event is fired.
  122185. * When forced, the recognizer cycle is stopped immediately.
  122186. * @param {Boolean} [force]
  122187. */
  122188. stop: function (force) {
  122189. this.session.stopped = force ? FORCED_STOP : STOP;
  122190. },
  122191. /**
  122192. * run the recognizers!
  122193. * called by the inputHandler function on every movement of the pointers (touches)
  122194. * it walks through all the recognizers and tries to detect the gesture that is being made
  122195. * @param {Object} inputData
  122196. */
  122197. recognize: function (inputData) {
  122198. var session = this.session;
  122199. if (session.stopped) {
  122200. return;
  122201. }
  122202. // run the touch-action polyfill
  122203. this.touchAction.preventDefaults(inputData);
  122204. var recognizer;
  122205. var recognizers = this.recognizers;
  122206. // this holds the recognizer that is being recognized.
  122207. // so the recognizer's state needs to be BEGAN, CHANGED, ENDED or RECOGNIZED
  122208. // if no recognizer is detecting a thing, it is set to `null`
  122209. var curRecognizer = session.curRecognizer;
  122210. // reset when the last recognizer is recognized
  122211. // or when we're in a new session
  122212. if (!curRecognizer || (curRecognizer && curRecognizer.state & STATE_RECOGNIZED)) {
  122213. curRecognizer = session.curRecognizer = null;
  122214. }
  122215. var i = 0;
  122216. while (i < recognizers.length) {
  122217. recognizer = recognizers[i];
  122218. // find out if we are allowed try to recognize the input for this one.
  122219. // 1. allow if the session is NOT forced stopped (see the .stop() method)
  122220. // 2. allow if we still haven't recognized a gesture in this session, or the this recognizer is the one
  122221. // that is being recognized.
  122222. // 3. allow if the recognizer is allowed to run simultaneous with the current recognized recognizer.
  122223. // this can be setup with the `recognizeWith()` method on the recognizer.
  122224. if (session.stopped !== FORCED_STOP && (!curRecognizer || recognizer == curRecognizer ||
  122225. recognizer.canRecognizeWith(curRecognizer))) {
  122226. recognizer.recognize(inputData);
  122227. }
  122228. else {
  122229. recognizer.reset();
  122230. }
  122231. // if the recognizer has been recognizing the input as a valid gesture, we want to store this one as the
  122232. // current active recognizer. but only if we don't already have an active recognizer
  122233. if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) {
  122234. curRecognizer = session.curRecognizer = recognizer;
  122235. }
  122236. i++;
  122237. }
  122238. },
  122239. /**
  122240. * get a recognizer by its event name.
  122241. * @param {Recognizer|String} recognizer
  122242. * @returns {Recognizer|Null}
  122243. */
  122244. get: function (recognizer) {
  122245. if (recognizer instanceof Recognizer) {
  122246. return recognizer;
  122247. }
  122248. var recognizers = this.recognizers;
  122249. for (var i = 0; i < recognizers.length; i++) {
  122250. if (recognizers[i].options.event == recognizer) {
  122251. return recognizers[i];
  122252. }
  122253. }
  122254. return null;
  122255. },
  122256. /**
  122257. * add a recognizer to the manager
  122258. * existing recognizers with the same event name will be removed
  122259. * @param {Recognizer} recognizer
  122260. * @returns {Recognizer|Manager}
  122261. */
  122262. add: function (recognizer) {
  122263. if (invokeArrayArg(recognizer, 'add', this)) {
  122264. return this;
  122265. }
  122266. // remove existing
  122267. var existing = this.get(recognizer.options.event);
  122268. if (existing) {
  122269. this.remove(existing);
  122270. }
  122271. this.recognizers.push(recognizer);
  122272. recognizer.manager = this;
  122273. this.touchAction.update();
  122274. return recognizer;
  122275. },
  122276. /**
  122277. * remove a recognizer by name or instance
  122278. * @param {Recognizer|String} recognizer
  122279. * @returns {Manager}
  122280. */
  122281. remove: function (recognizer) {
  122282. if (invokeArrayArg(recognizer, 'remove', this)) {
  122283. return this;
  122284. }
  122285. recognizer = this.get(recognizer);
  122286. // let's make sure this recognizer exists
  122287. if (recognizer) {
  122288. var recognizers = this.recognizers;
  122289. var index = inArray(recognizers, recognizer);
  122290. if (index !== -1) {
  122291. recognizers.splice(index, 1);
  122292. this.touchAction.update();
  122293. }
  122294. }
  122295. return this;
  122296. },
  122297. /**
  122298. * bind event
  122299. * @param {String} events
  122300. * @param {Function} handler
  122301. * @returns {EventEmitter} this
  122302. */
  122303. on: function (events, handler) {
  122304. var handlers = this.handlers;
  122305. each(splitStr(events), function (event) {
  122306. handlers[event] = handlers[event] || [];
  122307. handlers[event].push(handler);
  122308. });
  122309. return this;
  122310. },
  122311. /**
  122312. * unbind event, leave emit blank to remove all handlers
  122313. * @param {String} events
  122314. * @param {Function} [handler]
  122315. * @returns {EventEmitter} this
  122316. */
  122317. off: function (events, handler) {
  122318. var handlers = this.handlers;
  122319. each(splitStr(events), function (event) {
  122320. if (!handler) {
  122321. delete handlers[event];
  122322. }
  122323. else {
  122324. handlers[event] && handlers[event].splice(inArray(handlers[event], handler), 1);
  122325. }
  122326. });
  122327. return this;
  122328. },
  122329. /**
  122330. * emit event to the listeners
  122331. * @param {String} event
  122332. * @param {Object} data
  122333. */
  122334. emit: function (event, data) {
  122335. // we also want to trigger dom events
  122336. if (this.options.domEvents) {
  122337. triggerDomEvent(event, data);
  122338. }
  122339. // no handlers, so skip it all
  122340. var handlers = this.handlers[event] && this.handlers[event].slice();
  122341. if (!handlers || !handlers.length) {
  122342. return;
  122343. }
  122344. data.type = event;
  122345. data.preventDefault = function () {
  122346. data.srcEvent.preventDefault();
  122347. };
  122348. var i = 0;
  122349. while (i < handlers.length) {
  122350. handlers[i](data);
  122351. i++;
  122352. }
  122353. },
  122354. /**
  122355. * destroy the manager and unbinds all events
  122356. * it doesn't unbind dom events, that is the user own responsibility
  122357. */
  122358. destroy: function () {
  122359. this.element && toggleCssProps(this, false);
  122360. this.handlers = {};
  122361. this.session = {};
  122362. this.input.destroy();
  122363. this.element = null;
  122364. }
  122365. };
  122366. /**
  122367. * add/remove the css properties as defined in manager.options.cssProps
  122368. * @param {Manager} manager
  122369. * @param {Boolean} add
  122370. */
  122371. function toggleCssProps(manager, add) {
  122372. var element = manager.element;
  122373. if (!element.style) {
  122374. return;
  122375. }
  122376. each(manager.options.cssProps, function (value, name) {
  122377. element.style[prefixed(element.style, name)] = add ? value : '';
  122378. });
  122379. }
  122380. /**
  122381. * trigger dom event
  122382. * @param {String} event
  122383. * @param {Object} data
  122384. */
  122385. function triggerDomEvent(event, data) {
  122386. var gestureEvent = doc.createEvent('Event');
  122387. gestureEvent.initEvent(event, true, true);
  122388. gestureEvent.gesture = data;
  122389. data.target.dispatchEvent(gestureEvent);
  122390. }
  122391. Object.assign(Hammer, {
  122392. INPUT_START: INPUT_START,
  122393. INPUT_MOVE: INPUT_MOVE,
  122394. INPUT_END: INPUT_END,
  122395. INPUT_CANCEL: INPUT_CANCEL,
  122396. STATE_POSSIBLE: STATE_POSSIBLE,
  122397. STATE_BEGAN: STATE_BEGAN,
  122398. STATE_CHANGED: STATE_CHANGED,
  122399. STATE_ENDED: STATE_ENDED,
  122400. STATE_RECOGNIZED: STATE_RECOGNIZED,
  122401. STATE_CANCELLED: STATE_CANCELLED,
  122402. STATE_FAILED: STATE_FAILED,
  122403. DIRECTION_NONE: DIRECTION_NONE,
  122404. DIRECTION_LEFT: DIRECTION_LEFT,
  122405. DIRECTION_RIGHT: DIRECTION_RIGHT,
  122406. DIRECTION_UP: DIRECTION_UP,
  122407. DIRECTION_DOWN: DIRECTION_DOWN,
  122408. DIRECTION_HORIZONTAL: DIRECTION_HORIZONTAL,
  122409. DIRECTION_VERTICAL: DIRECTION_VERTICAL,
  122410. DIRECTION_ALL: DIRECTION_ALL,
  122411. Manager: Manager,
  122412. Input: Input,
  122413. TouchAction: TouchAction,
  122414. TouchInput: TouchInput,
  122415. MouseInput: MouseInput,
  122416. PointerEventInput: PointerEventInput,
  122417. TouchMouseInput: TouchMouseInput,
  122418. SingleTouchInput: SingleTouchInput,
  122419. Recognizer: Recognizer,
  122420. AttrRecognizer: AttrRecognizer,
  122421. Tap: TapRecognizer,
  122422. Pan: PanRecognizer,
  122423. Swipe: SwipeRecognizer,
  122424. Pinch: PinchRecognizer,
  122425. Rotate: RotateRecognizer,
  122426. Press: PressRecognizer,
  122427. on: addEventListeners,
  122428. off: removeEventListeners,
  122429. each: each,
  122430. inherit: inherit,
  122431. bindFn: bindFn,
  122432. prefixed: prefixed
  122433. });
  122434. win.Hammer = Hammer;
  122435. //# sourceMappingURL=hammer.js.map
  122436. /***/ }),
  122437. /* 268 */
  122438. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122439. "use strict";
  122440. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return IonicErrorHandler; });
  122441. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  122442. var __extends = (this && this.__extends) || (function () {
  122443. var extendStatics = Object.setPrototypeOf ||
  122444. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  122445. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  122446. return function (d, b) {
  122447. extendStatics(d, b);
  122448. function __() { this.constructor = d; }
  122449. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  122450. };
  122451. })();
  122452. /**
  122453. * @name IonicErrorHandler
  122454. * @description
  122455. * The `IonicErrorHandler` intercepts the default `Console` error handling
  122456. * and displays runtime errors as an overlay when using Ionic's Dev Build Server.
  122457. *
  122458. *
  122459. * ### IonicErrorHandler Example
  122460. *
  122461. * ```typescript
  122462. * import { ErrorHandler, NgModule } from '@angular/core';
  122463. * import { IonicErrorHandler } from 'ionic-angular';
  122464. *
  122465. * @NgModule({
  122466. * providers: [{ provide: ErrorHandler, useClass: IonicErrorHandler }]
  122467. * })
  122468. * class AppModule { }
  122469. * ```
  122470. *
  122471. *
  122472. * ### Custom Error Handlers
  122473. *
  122474. * Custom error handlers can be built to replace the default, or extend Ionic's
  122475. * error handler.
  122476. *
  122477. * ```typescript
  122478. * class MyErrorHandler implements ErrorHandler {
  122479. * handleError(err: any): void {
  122480. * // do something with the error
  122481. * }
  122482. * }
  122483. *
  122484. * @NgModule({
  122485. * providers: [{ provide: ErrorHandler, useClass: MyErrorHandler }]
  122486. * })
  122487. * class AppModule { }
  122488. * ```
  122489. *
  122490. * More information about Angular's [`ErrorHandler`](https://angular.io/docs/ts/latest/api/core/index/ErrorHandler-class.html).
  122491. */
  122492. var IonicErrorHandler = (function (_super) {
  122493. __extends(IonicErrorHandler, _super);
  122494. function IonicErrorHandler() {
  122495. return _super.call(this) || this;
  122496. }
  122497. /**
  122498. * @internal
  122499. */
  122500. IonicErrorHandler.prototype.handleError = function (err) {
  122501. _super.prototype.handleError.call(this, err);
  122502. try {
  122503. var win = window;
  122504. var monitor = void 0;
  122505. monitor = win['IonicDevServer'];
  122506. monitor && monitor.handleError && monitor.handleError(err);
  122507. monitor = (win['Ionic'] = win['Ionic'] || {}).Monitor;
  122508. monitor && monitor.handleError && monitor.handleError(err);
  122509. }
  122510. catch (e) { }
  122511. };
  122512. return IonicErrorHandler;
  122513. }(__WEBPACK_IMPORTED_MODULE_0__angular_core__["u" /* ErrorHandler */]));
  122514. //# sourceMappingURL=ionic-error-handler.js.map
  122515. /***/ }),
  122516. /* 269 */
  122517. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122518. "use strict";
  122519. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return IonicModule; });
  122520. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return IonicPageModule; });
  122521. /* unused harmony export provideLocationStrategy */
  122522. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  122523. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(34);
  122524. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_platform_browser__ = __webpack_require__(31);
  122525. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__angular_forms__ = __webpack_require__(15);
  122526. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__components_app_app__ = __webpack_require__(6);
  122527. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__components_app_app_root__ = __webpack_require__(55);
  122528. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__config_config__ = __webpack_require__(1);
  122529. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__navigation_deep_linker__ = __webpack_require__(14);
  122530. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__platform_dom_controller__ = __webpack_require__(8);
  122531. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__util_events__ = __webpack_require__(195);
  122532. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__util_form__ = __webpack_require__(16);
  122533. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__gestures_gesture_controller__ = __webpack_require__(7);
  122534. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__gestures_gesture_config__ = __webpack_require__(198);
  122535. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__tap_click_haptic__ = __webpack_require__(38);
  122536. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__platform_keyboard__ = __webpack_require__(37);
  122537. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__util_module_loader__ = __webpack_require__(76);
  122538. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__util_ng_module_loader__ = __webpack_require__(155);
  122539. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__platform_platform__ = __webpack_require__(3);
  122540. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__platform_platform_registry__ = __webpack_require__(196);
  122541. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__tap_click_tap_click__ = __webpack_require__(192);
  122542. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__config_mode_registry__ = __webpack_require__(197);
  122543. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__transitions_transition_controller__ = __webpack_require__(44);
  122544. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__navigation_url_serializer__ = __webpack_require__(41);
  122545. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__components_action_sheet_action_sheet_component__ = __webpack_require__(58);
  122546. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__components_action_sheet_action_sheet_controller__ = __webpack_require__(118);
  122547. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__components_alert_alert_component__ = __webpack_require__(60);
  122548. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__components_alert_alert_controller__ = __webpack_require__(119);
  122549. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__components_app_click_block__ = __webpack_require__(270);
  122550. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__components_app_overlay_portal__ = __webpack_require__(115);
  122551. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__components_avatar_avatar__ = __webpack_require__(120);
  122552. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__components_backdrop_backdrop__ = __webpack_require__(61);
  122553. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_31__components_badge_badge__ = __webpack_require__(121);
  122554. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_32__components_button_button__ = __webpack_require__(36);
  122555. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_33__components_card_card__ = __webpack_require__(122);
  122556. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_34__components_card_card_content__ = __webpack_require__(123);
  122557. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_35__components_card_card_header__ = __webpack_require__(124);
  122558. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_36__components_card_card_title__ = __webpack_require__(125);
  122559. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_37__components_checkbox_checkbox__ = __webpack_require__(126);
  122560. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_38__components_chip_chip__ = __webpack_require__(131);
  122561. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_39__components_content_content__ = __webpack_require__(19);
  122562. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_40__components_datetime_datetime__ = __webpack_require__(132);
  122563. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_41__components_fab_fab__ = __webpack_require__(45);
  122564. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_42__components_fab_fab_container__ = __webpack_require__(134);
  122565. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_43__components_fab_fab_list__ = __webpack_require__(68);
  122566. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_44__components_grid_col__ = __webpack_require__(135);
  122567. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_45__components_grid_grid__ = __webpack_require__(136);
  122568. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_46__components_grid_row__ = __webpack_require__(137);
  122569. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_47__components_icon_icon__ = __webpack_require__(62);
  122570. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_48__components_img_img__ = __webpack_require__(138);
  122571. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_49__components_infinite_scroll_infinite_scroll__ = __webpack_require__(69);
  122572. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_50__components_infinite_scroll_infinite_scroll_content__ = __webpack_require__(139);
  122573. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_51__components_input_input__ = __webpack_require__(140);
  122574. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_52__components_item_item__ = __webpack_require__(17);
  122575. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_53__components_item_item_content__ = __webpack_require__(142);
  122576. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_54__components_item_item_divider__ = __webpack_require__(143);
  122577. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_55__components_item_item_group__ = __webpack_require__(144);
  122578. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_56__components_item_item_options__ = __webpack_require__(70);
  122579. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_57__components_item_item_reorder__ = __webpack_require__(64);
  122580. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_58__components_item_item_sliding__ = __webpack_require__(145);
  122581. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_59__components_item_reorder__ = __webpack_require__(146);
  122582. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_60__components_label_label__ = __webpack_require__(63);
  122583. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_61__components_list_list__ = __webpack_require__(71);
  122584. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_62__components_list_list_header__ = __webpack_require__(72);
  122585. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_63__components_loading_loading_component__ = __webpack_require__(73);
  122586. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_64__components_loading_loading_controller__ = __webpack_require__(148);
  122587. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_65__components_menu_menu__ = __webpack_require__(149);
  122588. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_66__components_menu_menu_close__ = __webpack_require__(150);
  122589. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_67__components_app_menu_controller__ = __webpack_require__(26);
  122590. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_68__components_menu_menu_toggle__ = __webpack_require__(151);
  122591. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_69__components_modal_modal_component__ = __webpack_require__(75);
  122592. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_70__components_modal_modal_controller__ = __webpack_require__(160);
  122593. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_71__components_nav_nav__ = __webpack_require__(74);
  122594. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_72__components_nav_nav_pop__ = __webpack_require__(77);
  122595. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_73__components_nav_nav_pop_anchor__ = __webpack_require__(161);
  122596. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_74__components_nav_nav_push__ = __webpack_require__(78);
  122597. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_75__components_nav_nav_push_anchor__ = __webpack_require__(162);
  122598. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_76__components_note_note__ = __webpack_require__(163);
  122599. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_77__components_option_option__ = __webpack_require__(79);
  122600. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_78__components_picker_picker_component__ = __webpack_require__(66);
  122601. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_79__components_picker_picker_column__ = __webpack_require__(67);
  122602. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_80__components_picker_picker_controller__ = __webpack_require__(65);
  122603. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_81__components_popover_popover_component__ = __webpack_require__(81);
  122604. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_82__components_popover_popover_controller__ = __webpack_require__(164);
  122605. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_83__components_radio_radio_button__ = __webpack_require__(165);
  122606. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_84__components_radio_radio_group__ = __webpack_require__(82);
  122607. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_85__components_range_range__ = __webpack_require__(166);
  122608. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_86__components_range_range_knob__ = __webpack_require__(167);
  122609. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_87__components_refresher_refresher__ = __webpack_require__(83);
  122610. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_88__components_refresher_refresher_content__ = __webpack_require__(168);
  122611. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_89__components_scroll_scroll__ = __webpack_require__(169);
  122612. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_90__components_searchbar_searchbar__ = __webpack_require__(170);
  122613. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_91__components_segment_segment__ = __webpack_require__(171);
  122614. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_92__components_select_select__ = __webpack_require__(172);
  122615. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_93__components_select_select_popover_component__ = __webpack_require__(85);
  122616. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_94__components_segment_segment_button__ = __webpack_require__(84);
  122617. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_95__components_show_hide_when_show_when__ = __webpack_require__(173);
  122618. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_96__components_show_hide_when_hide_when__ = __webpack_require__(174);
  122619. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_97__components_slides_slide__ = __webpack_require__(175);
  122620. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_98__components_slides_slides__ = __webpack_require__(87);
  122621. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_99__components_spinner_spinner__ = __webpack_require__(179);
  122622. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_100__components_split_pane_split_pane__ = __webpack_require__(39);
  122623. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_101__components_tabs_tab__ = __webpack_require__(180);
  122624. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_102__components_tabs_tab_button__ = __webpack_require__(181);
  122625. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_103__components_tabs_tab_highlight__ = __webpack_require__(93);
  122626. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_104__components_tabs_tabs__ = __webpack_require__(92);
  122627. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_105__components_thumbnail_thumbnail__ = __webpack_require__(189);
  122628. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_106__components_toast_toast_component__ = __webpack_require__(94);
  122629. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_107__components_toast_toast_controller__ = __webpack_require__(183);
  122630. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_108__components_toggle_toggle__ = __webpack_require__(184);
  122631. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_109__components_toolbar_toolbar_footer__ = __webpack_require__(185);
  122632. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_110__components_toolbar_toolbar_header__ = __webpack_require__(186);
  122633. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_111__components_toolbar_toolbar__ = __webpack_require__(49);
  122634. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_112__components_toolbar_toolbar_item__ = __webpack_require__(187);
  122635. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_113__components_toolbar_toolbar_title__ = __webpack_require__(188);
  122636. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_114__components_toolbar_navbar__ = __webpack_require__(40);
  122637. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_115__components_typography_typography__ = __webpack_require__(190);
  122638. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_116__components_virtual_scroll_virtual_footer__ = __webpack_require__(95);
  122639. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_117__components_virtual_scroll_virtual_header__ = __webpack_require__(96);
  122640. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_118__components_virtual_scroll_virtual_item__ = __webpack_require__(97);
  122641. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_119__components_virtual_scroll_virtual_scroll__ = __webpack_require__(191);
  122642. /**
  122643. * Import Angular
  122644. */
  122645. /**
  122646. * Global Providers
  122647. */
  122648. /**
  122649. * Import Components/Directives/Etc
  122650. */
  122651. /**
  122652. * @name IonicModule
  122653. * @description
  122654. * IonicModule is an [NgModule](https://angular.io/docs/ts/latest/guide/ngmodule.html) that bootstraps
  122655. * an Ionic App. By passing a root component, IonicModule will make sure that all of the components,
  122656. * directives, and providers from the framework are imported.
  122657. *
  122658. * Any configuration for the app can be passed as the second argument to `forRoot`. This can be any
  122659. * valid property from the [Config](/docs/api/config/Config/).
  122660. *
  122661. * @usage
  122662. * ```ts
  122663. * import { NgModule } from '@angular/core';
  122664. *
  122665. * import { IonicApp, IonicModule } from 'ionic-angular';
  122666. *
  122667. * import { MyApp } from './app.component';
  122668. * import { HomePage } from '../pages/home/home';
  122669. *
  122670. * @NgModule({
  122671. * declarations: [
  122672. * MyApp,
  122673. * HomePage
  122674. * ],
  122675. * imports: [
  122676. * BrowserModule,
  122677. * IonicModule.forRoot(MyApp, {
  122678. *
  122679. * })
  122680. * ],
  122681. * bootstrap: [IonicApp],
  122682. * entryComponents: [
  122683. * MyApp,
  122684. * HomePage
  122685. * ],
  122686. * providers: []
  122687. * })
  122688. * export class AppModule {}
  122689. * ```
  122690. */
  122691. var IonicModule = (function () {
  122692. function IonicModule() {
  122693. }
  122694. /**
  122695. * Set the root app component for you IonicModule
  122696. * @param {any} appRoot The root AppComponent for this app.
  122697. * @param {any} config Config Options for the app. Accepts any config property.
  122698. * @param {any} deepLinkConfig Any configuration needed for the Ionic Deeplinker.
  122699. */
  122700. IonicModule.forRoot = function (appRoot, config, deepLinkConfig) {
  122701. if (config === void 0) { config = null; }
  122702. if (deepLinkConfig === void 0) { deepLinkConfig = null; }
  122703. return {
  122704. ngModule: IonicModule,
  122705. providers: [
  122706. // useValue: bootstrap values
  122707. { provide: __WEBPACK_IMPORTED_MODULE_5__components_app_app_root__["a" /* AppRootToken */], useValue: appRoot },
  122708. { provide: __WEBPACK_IMPORTED_MODULE_6__config_config__["b" /* ConfigToken */], useValue: config },
  122709. { provide: __WEBPACK_IMPORTED_MODULE_22__navigation_url_serializer__["a" /* DeepLinkConfigToken */], useValue: deepLinkConfig },
  122710. { provide: __WEBPACK_IMPORTED_MODULE_1__angular_common__["a" /* APP_BASE_HREF */], useValue: '/' },
  122711. // useFactory: user values
  122712. { provide: __WEBPACK_IMPORTED_MODULE_18__platform_platform_registry__["a" /* PlatformConfigToken */], useFactory: __WEBPACK_IMPORTED_MODULE_18__platform_platform_registry__["b" /* providePlatformConfigs */] },
  122713. // useFactory: ionic core providers
  122714. { provide: __WEBPACK_IMPORTED_MODULE_17__platform_platform__["a" /* Platform */], useFactory: __WEBPACK_IMPORTED_MODULE_17__platform_platform__["b" /* setupPlatform */], deps: [__WEBPACK_IMPORTED_MODULE_2__angular_platform_browser__["b" /* DOCUMENT */], __WEBPACK_IMPORTED_MODULE_18__platform_platform_registry__["a" /* PlatformConfigToken */], __WEBPACK_IMPORTED_MODULE_0__angular_core__["M" /* NgZone */]] },
  122715. { provide: __WEBPACK_IMPORTED_MODULE_6__config_config__["a" /* Config */], useFactory: __WEBPACK_IMPORTED_MODULE_6__config_config__["c" /* setupConfig */], deps: [__WEBPACK_IMPORTED_MODULE_6__config_config__["b" /* ConfigToken */], __WEBPACK_IMPORTED_MODULE_17__platform_platform__["a" /* Platform */]] },
  122716. // useFactory: ionic app initializers
  122717. { provide: __WEBPACK_IMPORTED_MODULE_0__angular_core__["c" /* APP_INITIALIZER */], useFactory: __WEBPACK_IMPORTED_MODULE_20__config_mode_registry__["a" /* registerModeConfigs */], deps: [__WEBPACK_IMPORTED_MODULE_6__config_config__["a" /* Config */]], multi: true },
  122718. { provide: __WEBPACK_IMPORTED_MODULE_0__angular_core__["c" /* APP_INITIALIZER */], useFactory: __WEBPACK_IMPORTED_MODULE_9__util_events__["b" /* setupProvideEvents */], deps: [__WEBPACK_IMPORTED_MODULE_17__platform_platform__["a" /* Platform */], __WEBPACK_IMPORTED_MODULE_8__platform_dom_controller__["a" /* DomController */]], multi: true },
  122719. { provide: __WEBPACK_IMPORTED_MODULE_0__angular_core__["c" /* APP_INITIALIZER */], useFactory: __WEBPACK_IMPORTED_MODULE_19__tap_click_tap_click__["b" /* setupTapClick */], deps: [__WEBPACK_IMPORTED_MODULE_6__config_config__["a" /* Config */], __WEBPACK_IMPORTED_MODULE_17__platform_platform__["a" /* Platform */], __WEBPACK_IMPORTED_MODULE_8__platform_dom_controller__["a" /* DomController */], __WEBPACK_IMPORTED_MODULE_4__components_app_app__["a" /* App */], __WEBPACK_IMPORTED_MODULE_11__gestures_gesture_controller__["l" /* GestureController */]], multi: true },
  122720. { provide: __WEBPACK_IMPORTED_MODULE_0__angular_core__["c" /* APP_INITIALIZER */], useFactory: __WEBPACK_IMPORTED_MODULE_15__util_module_loader__["d" /* setupPreloading */], deps: [__WEBPACK_IMPORTED_MODULE_6__config_config__["a" /* Config */], __WEBPACK_IMPORTED_MODULE_22__navigation_url_serializer__["a" /* DeepLinkConfigToken */], __WEBPACK_IMPORTED_MODULE_15__util_module_loader__["b" /* ModuleLoader */], __WEBPACK_IMPORTED_MODULE_0__angular_core__["M" /* NgZone */]], multi: true },
  122721. // useClass
  122722. { provide: __WEBPACK_IMPORTED_MODULE_2__angular_platform_browser__["c" /* HAMMER_GESTURE_CONFIG */], useClass: __WEBPACK_IMPORTED_MODULE_12__gestures_gesture_config__["a" /* IonicGestureConfig */] },
  122723. // useValue
  122724. { provide: __WEBPACK_IMPORTED_MODULE_0__angular_core__["a" /* ANALYZE_FOR_ENTRY_COMPONENTS */], useValue: appRoot, multi: true },
  122725. // ionic providers
  122726. __WEBPACK_IMPORTED_MODULE_24__components_action_sheet_action_sheet_controller__["a" /* ActionSheetController */],
  122727. __WEBPACK_IMPORTED_MODULE_26__components_alert_alert_controller__["a" /* AlertController */],
  122728. __WEBPACK_IMPORTED_MODULE_4__components_app_app__["a" /* App */],
  122729. __WEBPACK_IMPORTED_MODULE_8__platform_dom_controller__["a" /* DomController */],
  122730. __WEBPACK_IMPORTED_MODULE_9__util_events__["a" /* Events */],
  122731. __WEBPACK_IMPORTED_MODULE_10__util_form__["a" /* Form */],
  122732. __WEBPACK_IMPORTED_MODULE_11__gestures_gesture_controller__["l" /* GestureController */],
  122733. __WEBPACK_IMPORTED_MODULE_13__tap_click_haptic__["a" /* Haptic */],
  122734. __WEBPACK_IMPORTED_MODULE_14__platform_keyboard__["a" /* Keyboard */],
  122735. __WEBPACK_IMPORTED_MODULE_64__components_loading_loading_controller__["a" /* LoadingController */],
  122736. __WEBPACK_IMPORTED_MODULE_1__angular_common__["e" /* Location */],
  122737. __WEBPACK_IMPORTED_MODULE_67__components_app_menu_controller__["a" /* MenuController */],
  122738. __WEBPACK_IMPORTED_MODULE_70__components_modal_modal_controller__["a" /* ModalController */],
  122739. __WEBPACK_IMPORTED_MODULE_16__util_ng_module_loader__["a" /* NgModuleLoader */],
  122740. __WEBPACK_IMPORTED_MODULE_80__components_picker_picker_controller__["a" /* PickerController */],
  122741. __WEBPACK_IMPORTED_MODULE_82__components_popover_popover_controller__["a" /* PopoverController */],
  122742. __WEBPACK_IMPORTED_MODULE_19__tap_click_tap_click__["a" /* TapClick */],
  122743. __WEBPACK_IMPORTED_MODULE_107__components_toast_toast_controller__["a" /* ToastController */],
  122744. __WEBPACK_IMPORTED_MODULE_21__transitions_transition_controller__["a" /* TransitionController */],
  122745. { provide: __WEBPACK_IMPORTED_MODULE_15__util_module_loader__["b" /* ModuleLoader */], useFactory: __WEBPACK_IMPORTED_MODULE_15__util_module_loader__["c" /* provideModuleLoader */], deps: [__WEBPACK_IMPORTED_MODULE_16__util_ng_module_loader__["a" /* NgModuleLoader */], __WEBPACK_IMPORTED_MODULE_0__angular_core__["C" /* Injector */]] },
  122746. { provide: __WEBPACK_IMPORTED_MODULE_1__angular_common__["f" /* LocationStrategy */], useFactory: provideLocationStrategy, deps: [__WEBPACK_IMPORTED_MODULE_1__angular_common__["h" /* PlatformLocation */], [new __WEBPACK_IMPORTED_MODULE_0__angular_core__["z" /* Inject */](__WEBPACK_IMPORTED_MODULE_1__angular_common__["a" /* APP_BASE_HREF */]), new __WEBPACK_IMPORTED_MODULE_0__angular_core__["N" /* Optional */]()], __WEBPACK_IMPORTED_MODULE_6__config_config__["a" /* Config */]] },
  122747. { provide: __WEBPACK_IMPORTED_MODULE_22__navigation_url_serializer__["b" /* UrlSerializer */], useFactory: __WEBPACK_IMPORTED_MODULE_22__navigation_url_serializer__["d" /* setupUrlSerializer */], deps: [__WEBPACK_IMPORTED_MODULE_4__components_app_app__["a" /* App */], __WEBPACK_IMPORTED_MODULE_22__navigation_url_serializer__["a" /* DeepLinkConfigToken */]] },
  122748. { provide: __WEBPACK_IMPORTED_MODULE_7__navigation_deep_linker__["a" /* DeepLinker */], useFactory: __WEBPACK_IMPORTED_MODULE_7__navigation_deep_linker__["b" /* setupDeepLinker */], deps: [__WEBPACK_IMPORTED_MODULE_4__components_app_app__["a" /* App */], __WEBPACK_IMPORTED_MODULE_22__navigation_url_serializer__["b" /* UrlSerializer */], __WEBPACK_IMPORTED_MODULE_1__angular_common__["e" /* Location */], __WEBPACK_IMPORTED_MODULE_15__util_module_loader__["b" /* ModuleLoader */], __WEBPACK_IMPORTED_MODULE_0__angular_core__["o" /* ComponentFactoryResolver */]] },
  122749. ]
  122750. };
  122751. };
  122752. IonicModule.decorators = [
  122753. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["I" /* NgModule */], args: [{
  122754. declarations: [
  122755. __WEBPACK_IMPORTED_MODULE_23__components_action_sheet_action_sheet_component__["a" /* ActionSheetCmp */],
  122756. __WEBPACK_IMPORTED_MODULE_25__components_alert_alert_component__["a" /* AlertCmp */],
  122757. __WEBPACK_IMPORTED_MODULE_27__components_app_click_block__["a" /* ClickBlock */],
  122758. __WEBPACK_IMPORTED_MODULE_5__components_app_app_root__["b" /* IonicApp */],
  122759. __WEBPACK_IMPORTED_MODULE_28__components_app_overlay_portal__["a" /* OverlayPortal */],
  122760. __WEBPACK_IMPORTED_MODULE_29__components_avatar_avatar__["a" /* Avatar */],
  122761. __WEBPACK_IMPORTED_MODULE_30__components_backdrop_backdrop__["a" /* Backdrop */],
  122762. __WEBPACK_IMPORTED_MODULE_31__components_badge_badge__["a" /* Badge */],
  122763. __WEBPACK_IMPORTED_MODULE_32__components_button_button__["a" /* Button */],
  122764. __WEBPACK_IMPORTED_MODULE_33__components_card_card__["a" /* Card */],
  122765. __WEBPACK_IMPORTED_MODULE_34__components_card_card_content__["a" /* CardContent */],
  122766. __WEBPACK_IMPORTED_MODULE_35__components_card_card_header__["a" /* CardHeader */],
  122767. __WEBPACK_IMPORTED_MODULE_36__components_card_card_title__["a" /* CardTitle */],
  122768. __WEBPACK_IMPORTED_MODULE_37__components_checkbox_checkbox__["a" /* Checkbox */],
  122769. __WEBPACK_IMPORTED_MODULE_38__components_chip_chip__["a" /* Chip */],
  122770. __WEBPACK_IMPORTED_MODULE_44__components_grid_col__["a" /* Col */],
  122771. __WEBPACK_IMPORTED_MODULE_39__components_content_content__["a" /* Content */],
  122772. __WEBPACK_IMPORTED_MODULE_40__components_datetime_datetime__["a" /* DateTime */],
  122773. __WEBPACK_IMPORTED_MODULE_41__components_fab_fab__["a" /* FabButton */],
  122774. __WEBPACK_IMPORTED_MODULE_42__components_fab_fab_container__["a" /* FabContainer */],
  122775. __WEBPACK_IMPORTED_MODULE_43__components_fab_fab_list__["a" /* FabList */],
  122776. __WEBPACK_IMPORTED_MODULE_45__components_grid_grid__["a" /* Grid */],
  122777. __WEBPACK_IMPORTED_MODULE_48__components_img_img__["a" /* Img */],
  122778. __WEBPACK_IMPORTED_MODULE_47__components_icon_icon__["a" /* Icon */],
  122779. __WEBPACK_IMPORTED_MODULE_49__components_infinite_scroll_infinite_scroll__["a" /* InfiniteScroll */],
  122780. __WEBPACK_IMPORTED_MODULE_50__components_infinite_scroll_infinite_scroll_content__["a" /* InfiniteScrollContent */],
  122781. __WEBPACK_IMPORTED_MODULE_52__components_item_item__["a" /* Item */],
  122782. __WEBPACK_IMPORTED_MODULE_53__components_item_item_content__["a" /* ItemContent */],
  122783. __WEBPACK_IMPORTED_MODULE_54__components_item_item_divider__["a" /* ItemDivider */],
  122784. __WEBPACK_IMPORTED_MODULE_55__components_item_item_group__["a" /* ItemGroup */],
  122785. __WEBPACK_IMPORTED_MODULE_56__components_item_item_options__["a" /* ItemOptions */],
  122786. __WEBPACK_IMPORTED_MODULE_57__components_item_item_reorder__["a" /* ItemReorder */],
  122787. __WEBPACK_IMPORTED_MODULE_58__components_item_item_sliding__["a" /* ItemSliding */],
  122788. __WEBPACK_IMPORTED_MODULE_60__components_label_label__["a" /* Label */],
  122789. __WEBPACK_IMPORTED_MODULE_61__components_list_list__["a" /* List */],
  122790. __WEBPACK_IMPORTED_MODULE_62__components_list_list_header__["a" /* ListHeader */],
  122791. __WEBPACK_IMPORTED_MODULE_59__components_item_reorder__["a" /* Reorder */],
  122792. __WEBPACK_IMPORTED_MODULE_63__components_loading_loading_component__["a" /* LoadingCmp */],
  122793. __WEBPACK_IMPORTED_MODULE_65__components_menu_menu__["a" /* Menu */],
  122794. __WEBPACK_IMPORTED_MODULE_66__components_menu_menu_close__["a" /* MenuClose */],
  122795. __WEBPACK_IMPORTED_MODULE_68__components_menu_menu_toggle__["a" /* MenuToggle */],
  122796. __WEBPACK_IMPORTED_MODULE_69__components_modal_modal_component__["a" /* ModalCmp */],
  122797. __WEBPACK_IMPORTED_MODULE_71__components_nav_nav__["a" /* Nav */],
  122798. __WEBPACK_IMPORTED_MODULE_72__components_nav_nav_pop__["a" /* NavPop */],
  122799. __WEBPACK_IMPORTED_MODULE_73__components_nav_nav_pop_anchor__["a" /* NavPopAnchor */],
  122800. __WEBPACK_IMPORTED_MODULE_74__components_nav_nav_push__["a" /* NavPush */],
  122801. __WEBPACK_IMPORTED_MODULE_75__components_nav_nav_push_anchor__["a" /* NavPushAnchor */],
  122802. __WEBPACK_IMPORTED_MODULE_76__components_note_note__["a" /* Note */],
  122803. __WEBPACK_IMPORTED_MODULE_77__components_option_option__["a" /* Option */],
  122804. __WEBPACK_IMPORTED_MODULE_78__components_picker_picker_component__["a" /* PickerCmp */],
  122805. __WEBPACK_IMPORTED_MODULE_79__components_picker_picker_column__["a" /* PickerColumnCmp */],
  122806. __WEBPACK_IMPORTED_MODULE_81__components_popover_popover_component__["a" /* PopoverCmp */],
  122807. __WEBPACK_IMPORTED_MODULE_83__components_radio_radio_button__["a" /* RadioButton */],
  122808. __WEBPACK_IMPORTED_MODULE_84__components_radio_radio_group__["a" /* RadioGroup */],
  122809. __WEBPACK_IMPORTED_MODULE_85__components_range_range__["a" /* Range */],
  122810. __WEBPACK_IMPORTED_MODULE_86__components_range_range_knob__["a" /* RangeKnob */],
  122811. __WEBPACK_IMPORTED_MODULE_87__components_refresher_refresher__["a" /* Refresher */],
  122812. __WEBPACK_IMPORTED_MODULE_88__components_refresher_refresher_content__["a" /* RefresherContent */],
  122813. __WEBPACK_IMPORTED_MODULE_46__components_grid_row__["a" /* Row */],
  122814. __WEBPACK_IMPORTED_MODULE_89__components_scroll_scroll__["a" /* Scroll */],
  122815. __WEBPACK_IMPORTED_MODULE_90__components_searchbar_searchbar__["a" /* Searchbar */],
  122816. __WEBPACK_IMPORTED_MODULE_91__components_segment_segment__["a" /* Segment */],
  122817. __WEBPACK_IMPORTED_MODULE_94__components_segment_segment_button__["a" /* SegmentButton */],
  122818. __WEBPACK_IMPORTED_MODULE_92__components_select_select__["a" /* Select */],
  122819. __WEBPACK_IMPORTED_MODULE_93__components_select_select_popover_component__["a" /* SelectPopover */],
  122820. __WEBPACK_IMPORTED_MODULE_95__components_show_hide_when_show_when__["a" /* ShowWhen */],
  122821. __WEBPACK_IMPORTED_MODULE_96__components_show_hide_when_hide_when__["a" /* HideWhen */],
  122822. __WEBPACK_IMPORTED_MODULE_97__components_slides_slide__["a" /* Slide */],
  122823. __WEBPACK_IMPORTED_MODULE_98__components_slides_slides__["a" /* Slides */],
  122824. __WEBPACK_IMPORTED_MODULE_99__components_spinner_spinner__["a" /* Spinner */],
  122825. __WEBPACK_IMPORTED_MODULE_100__components_split_pane_split_pane__["b" /* SplitPane */],
  122826. __WEBPACK_IMPORTED_MODULE_101__components_tabs_tab__["a" /* Tab */],
  122827. __WEBPACK_IMPORTED_MODULE_102__components_tabs_tab_button__["a" /* TabButton */],
  122828. __WEBPACK_IMPORTED_MODULE_103__components_tabs_tab_highlight__["a" /* TabHighlight */],
  122829. __WEBPACK_IMPORTED_MODULE_104__components_tabs_tabs__["a" /* Tabs */],
  122830. __WEBPACK_IMPORTED_MODULE_51__components_input_input__["a" /* TextInput */],
  122831. __WEBPACK_IMPORTED_MODULE_105__components_thumbnail_thumbnail__["a" /* Thumbnail */],
  122832. __WEBPACK_IMPORTED_MODULE_106__components_toast_toast_component__["a" /* ToastCmp */],
  122833. __WEBPACK_IMPORTED_MODULE_108__components_toggle_toggle__["a" /* Toggle */],
  122834. __WEBPACK_IMPORTED_MODULE_109__components_toolbar_toolbar_footer__["a" /* Footer */],
  122835. __WEBPACK_IMPORTED_MODULE_110__components_toolbar_toolbar_header__["a" /* Header */],
  122836. __WEBPACK_IMPORTED_MODULE_111__components_toolbar_toolbar__["a" /* Toolbar */],
  122837. __WEBPACK_IMPORTED_MODULE_112__components_toolbar_toolbar_item__["a" /* ToolbarItem */],
  122838. __WEBPACK_IMPORTED_MODULE_113__components_toolbar_toolbar_title__["a" /* ToolbarTitle */],
  122839. __WEBPACK_IMPORTED_MODULE_114__components_toolbar_navbar__["a" /* Navbar */],
  122840. __WEBPACK_IMPORTED_MODULE_115__components_typography_typography__["a" /* Typography */],
  122841. __WEBPACK_IMPORTED_MODULE_116__components_virtual_scroll_virtual_footer__["a" /* VirtualFooter */],
  122842. __WEBPACK_IMPORTED_MODULE_117__components_virtual_scroll_virtual_header__["a" /* VirtualHeader */],
  122843. __WEBPACK_IMPORTED_MODULE_118__components_virtual_scroll_virtual_item__["a" /* VirtualItem */],
  122844. __WEBPACK_IMPORTED_MODULE_119__components_virtual_scroll_virtual_scroll__["a" /* VirtualScroll */]
  122845. ],
  122846. imports: [
  122847. __WEBPACK_IMPORTED_MODULE_1__angular_common__["b" /* CommonModule */],
  122848. __WEBPACK_IMPORTED_MODULE_3__angular_forms__["a" /* FormsModule */],
  122849. __WEBPACK_IMPORTED_MODULE_3__angular_forms__["d" /* ReactiveFormsModule */],
  122850. ],
  122851. exports: [
  122852. __WEBPACK_IMPORTED_MODULE_1__angular_common__["b" /* CommonModule */],
  122853. __WEBPACK_IMPORTED_MODULE_3__angular_forms__["a" /* FormsModule */],
  122854. __WEBPACK_IMPORTED_MODULE_3__angular_forms__["d" /* ReactiveFormsModule */],
  122855. __WEBPACK_IMPORTED_MODULE_23__components_action_sheet_action_sheet_component__["a" /* ActionSheetCmp */],
  122856. __WEBPACK_IMPORTED_MODULE_25__components_alert_alert_component__["a" /* AlertCmp */],
  122857. __WEBPACK_IMPORTED_MODULE_27__components_app_click_block__["a" /* ClickBlock */],
  122858. __WEBPACK_IMPORTED_MODULE_5__components_app_app_root__["b" /* IonicApp */],
  122859. __WEBPACK_IMPORTED_MODULE_28__components_app_overlay_portal__["a" /* OverlayPortal */],
  122860. __WEBPACK_IMPORTED_MODULE_29__components_avatar_avatar__["a" /* Avatar */],
  122861. __WEBPACK_IMPORTED_MODULE_30__components_backdrop_backdrop__["a" /* Backdrop */],
  122862. __WEBPACK_IMPORTED_MODULE_31__components_badge_badge__["a" /* Badge */],
  122863. __WEBPACK_IMPORTED_MODULE_32__components_button_button__["a" /* Button */],
  122864. __WEBPACK_IMPORTED_MODULE_33__components_card_card__["a" /* Card */],
  122865. __WEBPACK_IMPORTED_MODULE_34__components_card_card_content__["a" /* CardContent */],
  122866. __WEBPACK_IMPORTED_MODULE_35__components_card_card_header__["a" /* CardHeader */],
  122867. __WEBPACK_IMPORTED_MODULE_36__components_card_card_title__["a" /* CardTitle */],
  122868. __WEBPACK_IMPORTED_MODULE_37__components_checkbox_checkbox__["a" /* Checkbox */],
  122869. __WEBPACK_IMPORTED_MODULE_38__components_chip_chip__["a" /* Chip */],
  122870. __WEBPACK_IMPORTED_MODULE_44__components_grid_col__["a" /* Col */],
  122871. __WEBPACK_IMPORTED_MODULE_39__components_content_content__["a" /* Content */],
  122872. __WEBPACK_IMPORTED_MODULE_40__components_datetime_datetime__["a" /* DateTime */],
  122873. __WEBPACK_IMPORTED_MODULE_41__components_fab_fab__["a" /* FabButton */],
  122874. __WEBPACK_IMPORTED_MODULE_42__components_fab_fab_container__["a" /* FabContainer */],
  122875. __WEBPACK_IMPORTED_MODULE_43__components_fab_fab_list__["a" /* FabList */],
  122876. __WEBPACK_IMPORTED_MODULE_45__components_grid_grid__["a" /* Grid */],
  122877. __WEBPACK_IMPORTED_MODULE_48__components_img_img__["a" /* Img */],
  122878. __WEBPACK_IMPORTED_MODULE_47__components_icon_icon__["a" /* Icon */],
  122879. __WEBPACK_IMPORTED_MODULE_49__components_infinite_scroll_infinite_scroll__["a" /* InfiniteScroll */],
  122880. __WEBPACK_IMPORTED_MODULE_50__components_infinite_scroll_infinite_scroll_content__["a" /* InfiniteScrollContent */],
  122881. __WEBPACK_IMPORTED_MODULE_52__components_item_item__["a" /* Item */],
  122882. __WEBPACK_IMPORTED_MODULE_53__components_item_item_content__["a" /* ItemContent */],
  122883. __WEBPACK_IMPORTED_MODULE_54__components_item_item_divider__["a" /* ItemDivider */],
  122884. __WEBPACK_IMPORTED_MODULE_55__components_item_item_group__["a" /* ItemGroup */],
  122885. __WEBPACK_IMPORTED_MODULE_56__components_item_item_options__["a" /* ItemOptions */],
  122886. __WEBPACK_IMPORTED_MODULE_57__components_item_item_reorder__["a" /* ItemReorder */],
  122887. __WEBPACK_IMPORTED_MODULE_58__components_item_item_sliding__["a" /* ItemSliding */],
  122888. __WEBPACK_IMPORTED_MODULE_60__components_label_label__["a" /* Label */],
  122889. __WEBPACK_IMPORTED_MODULE_61__components_list_list__["a" /* List */],
  122890. __WEBPACK_IMPORTED_MODULE_62__components_list_list_header__["a" /* ListHeader */],
  122891. __WEBPACK_IMPORTED_MODULE_59__components_item_reorder__["a" /* Reorder */],
  122892. __WEBPACK_IMPORTED_MODULE_63__components_loading_loading_component__["a" /* LoadingCmp */],
  122893. __WEBPACK_IMPORTED_MODULE_65__components_menu_menu__["a" /* Menu */],
  122894. __WEBPACK_IMPORTED_MODULE_66__components_menu_menu_close__["a" /* MenuClose */],
  122895. __WEBPACK_IMPORTED_MODULE_68__components_menu_menu_toggle__["a" /* MenuToggle */],
  122896. __WEBPACK_IMPORTED_MODULE_69__components_modal_modal_component__["a" /* ModalCmp */],
  122897. __WEBPACK_IMPORTED_MODULE_71__components_nav_nav__["a" /* Nav */],
  122898. __WEBPACK_IMPORTED_MODULE_72__components_nav_nav_pop__["a" /* NavPop */],
  122899. __WEBPACK_IMPORTED_MODULE_73__components_nav_nav_pop_anchor__["a" /* NavPopAnchor */],
  122900. __WEBPACK_IMPORTED_MODULE_74__components_nav_nav_push__["a" /* NavPush */],
  122901. __WEBPACK_IMPORTED_MODULE_75__components_nav_nav_push_anchor__["a" /* NavPushAnchor */],
  122902. __WEBPACK_IMPORTED_MODULE_76__components_note_note__["a" /* Note */],
  122903. __WEBPACK_IMPORTED_MODULE_77__components_option_option__["a" /* Option */],
  122904. __WEBPACK_IMPORTED_MODULE_78__components_picker_picker_component__["a" /* PickerCmp */],
  122905. __WEBPACK_IMPORTED_MODULE_79__components_picker_picker_column__["a" /* PickerColumnCmp */],
  122906. __WEBPACK_IMPORTED_MODULE_81__components_popover_popover_component__["a" /* PopoverCmp */],
  122907. __WEBPACK_IMPORTED_MODULE_83__components_radio_radio_button__["a" /* RadioButton */],
  122908. __WEBPACK_IMPORTED_MODULE_84__components_radio_radio_group__["a" /* RadioGroup */],
  122909. __WEBPACK_IMPORTED_MODULE_85__components_range_range__["a" /* Range */],
  122910. __WEBPACK_IMPORTED_MODULE_86__components_range_range_knob__["a" /* RangeKnob */],
  122911. __WEBPACK_IMPORTED_MODULE_87__components_refresher_refresher__["a" /* Refresher */],
  122912. __WEBPACK_IMPORTED_MODULE_88__components_refresher_refresher_content__["a" /* RefresherContent */],
  122913. __WEBPACK_IMPORTED_MODULE_46__components_grid_row__["a" /* Row */],
  122914. __WEBPACK_IMPORTED_MODULE_89__components_scroll_scroll__["a" /* Scroll */],
  122915. __WEBPACK_IMPORTED_MODULE_90__components_searchbar_searchbar__["a" /* Searchbar */],
  122916. __WEBPACK_IMPORTED_MODULE_91__components_segment_segment__["a" /* Segment */],
  122917. __WEBPACK_IMPORTED_MODULE_94__components_segment_segment_button__["a" /* SegmentButton */],
  122918. __WEBPACK_IMPORTED_MODULE_92__components_select_select__["a" /* Select */],
  122919. __WEBPACK_IMPORTED_MODULE_93__components_select_select_popover_component__["a" /* SelectPopover */],
  122920. __WEBPACK_IMPORTED_MODULE_95__components_show_hide_when_show_when__["a" /* ShowWhen */],
  122921. __WEBPACK_IMPORTED_MODULE_96__components_show_hide_when_hide_when__["a" /* HideWhen */],
  122922. __WEBPACK_IMPORTED_MODULE_97__components_slides_slide__["a" /* Slide */],
  122923. __WEBPACK_IMPORTED_MODULE_98__components_slides_slides__["a" /* Slides */],
  122924. __WEBPACK_IMPORTED_MODULE_99__components_spinner_spinner__["a" /* Spinner */],
  122925. __WEBPACK_IMPORTED_MODULE_100__components_split_pane_split_pane__["b" /* SplitPane */],
  122926. __WEBPACK_IMPORTED_MODULE_101__components_tabs_tab__["a" /* Tab */],
  122927. __WEBPACK_IMPORTED_MODULE_102__components_tabs_tab_button__["a" /* TabButton */],
  122928. __WEBPACK_IMPORTED_MODULE_103__components_tabs_tab_highlight__["a" /* TabHighlight */],
  122929. __WEBPACK_IMPORTED_MODULE_104__components_tabs_tabs__["a" /* Tabs */],
  122930. __WEBPACK_IMPORTED_MODULE_51__components_input_input__["a" /* TextInput */],
  122931. __WEBPACK_IMPORTED_MODULE_105__components_thumbnail_thumbnail__["a" /* Thumbnail */],
  122932. __WEBPACK_IMPORTED_MODULE_106__components_toast_toast_component__["a" /* ToastCmp */],
  122933. __WEBPACK_IMPORTED_MODULE_108__components_toggle_toggle__["a" /* Toggle */],
  122934. __WEBPACK_IMPORTED_MODULE_109__components_toolbar_toolbar_footer__["a" /* Footer */],
  122935. __WEBPACK_IMPORTED_MODULE_110__components_toolbar_toolbar_header__["a" /* Header */],
  122936. __WEBPACK_IMPORTED_MODULE_111__components_toolbar_toolbar__["a" /* Toolbar */],
  122937. __WEBPACK_IMPORTED_MODULE_112__components_toolbar_toolbar_item__["a" /* ToolbarItem */],
  122938. __WEBPACK_IMPORTED_MODULE_113__components_toolbar_toolbar_title__["a" /* ToolbarTitle */],
  122939. __WEBPACK_IMPORTED_MODULE_114__components_toolbar_navbar__["a" /* Navbar */],
  122940. __WEBPACK_IMPORTED_MODULE_115__components_typography_typography__["a" /* Typography */],
  122941. __WEBPACK_IMPORTED_MODULE_116__components_virtual_scroll_virtual_footer__["a" /* VirtualFooter */],
  122942. __WEBPACK_IMPORTED_MODULE_117__components_virtual_scroll_virtual_header__["a" /* VirtualHeader */],
  122943. __WEBPACK_IMPORTED_MODULE_118__components_virtual_scroll_virtual_item__["a" /* VirtualItem */],
  122944. __WEBPACK_IMPORTED_MODULE_119__components_virtual_scroll_virtual_scroll__["a" /* VirtualScroll */]
  122945. ],
  122946. entryComponents: [
  122947. __WEBPACK_IMPORTED_MODULE_23__components_action_sheet_action_sheet_component__["a" /* ActionSheetCmp */],
  122948. __WEBPACK_IMPORTED_MODULE_25__components_alert_alert_component__["a" /* AlertCmp */],
  122949. __WEBPACK_IMPORTED_MODULE_5__components_app_app_root__["b" /* IonicApp */],
  122950. __WEBPACK_IMPORTED_MODULE_63__components_loading_loading_component__["a" /* LoadingCmp */],
  122951. __WEBPACK_IMPORTED_MODULE_69__components_modal_modal_component__["a" /* ModalCmp */],
  122952. __WEBPACK_IMPORTED_MODULE_78__components_picker_picker_component__["a" /* PickerCmp */],
  122953. __WEBPACK_IMPORTED_MODULE_81__components_popover_popover_component__["a" /* PopoverCmp */],
  122954. __WEBPACK_IMPORTED_MODULE_93__components_select_select_popover_component__["a" /* SelectPopover */],
  122955. __WEBPACK_IMPORTED_MODULE_106__components_toast_toast_component__["a" /* ToastCmp */]
  122956. ]
  122957. },] },
  122958. ];
  122959. /** @nocollapse */
  122960. IonicModule.ctorParameters = function () { return []; };
  122961. return IonicModule;
  122962. }());
  122963. /**
  122964. * @name IonicPageModule
  122965. * @description
  122966. * IonicPageModule is an [NgModule](https://angular.io/docs/ts/latest/guide/ngmodule.html) that
  122967. * bootstraps a child [IonicPage](../navigation/IonicPage/) in order to set up routing.
  122968. *
  122969. * @usage
  122970. * ```ts
  122971. * import { NgModule } from '@angular/core';
  122972. *
  122973. * import { IonicPageModule } from 'ionic-angular';
  122974. *
  122975. * import { HomePage } from './home';
  122976. *
  122977. * @NgModule({
  122978. * declarations: [
  122979. * HomePage
  122980. * ],
  122981. * imports: [
  122982. * IonicPageModule.forChild(HomePage)
  122983. * ],
  122984. * entryComponents: [
  122985. * HomePage
  122986. * ]
  122987. * })
  122988. * export class HomePageModule { }
  122989. * ```
  122990. */
  122991. var IonicPageModule = (function () {
  122992. function IonicPageModule() {
  122993. }
  122994. IonicPageModule.forChild = function (page) {
  122995. return {
  122996. ngModule: IonicPageModule,
  122997. providers: [
  122998. { provide: __WEBPACK_IMPORTED_MODULE_15__util_module_loader__["a" /* LAZY_LOADED_TOKEN */], useValue: page },
  122999. { provide: __WEBPACK_IMPORTED_MODULE_0__angular_core__["a" /* ANALYZE_FOR_ENTRY_COMPONENTS */], useValue: page, multi: true },
  123000. ]
  123001. };
  123002. };
  123003. IonicPageModule.decorators = [
  123004. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["I" /* NgModule */], args: [{
  123005. imports: [IonicModule],
  123006. exports: [IonicModule]
  123007. },] },
  123008. ];
  123009. /** @nocollapse */
  123010. IonicPageModule.ctorParameters = function () { return []; };
  123011. return IonicPageModule;
  123012. }());
  123013. /**
  123014. * @hidden
  123015. */
  123016. function provideLocationStrategy(platformLocationStrategy, baseHref, config) {
  123017. return config.get('locationStrategy') === 'path' ?
  123018. new __WEBPACK_IMPORTED_MODULE_1__angular_common__["g" /* PathLocationStrategy */](platformLocationStrategy, baseHref) :
  123019. new __WEBPACK_IMPORTED_MODULE_1__angular_common__["d" /* HashLocationStrategy */](platformLocationStrategy, baseHref);
  123020. }
  123021. //# sourceMappingURL=module.js.map
  123022. /***/ }),
  123023. /* 270 */
  123024. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123025. "use strict";
  123026. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ClickBlock; });
  123027. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
  123028. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__app_app__ = __webpack_require__(6);
  123029. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__config_config__ = __webpack_require__(1);
  123030. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__platform_platform__ = __webpack_require__(3);
  123031. /**
  123032. * @hidden
  123033. */
  123034. var ClickBlock = (function () {
  123035. function ClickBlock(app, config, plt, elementRef, renderer) {
  123036. this.plt = plt;
  123037. this.elementRef = elementRef;
  123038. this.renderer = renderer;
  123039. this._showing = false;
  123040. app._clickBlock = this;
  123041. var enabled = this.isEnabled = config.getBoolean('clickBlock', true);
  123042. if (enabled) {
  123043. this._setElementClass('click-block-enabled', true);
  123044. }
  123045. }
  123046. ClickBlock.prototype.activate = function (shouldShow, expire, minDuration) {
  123047. if (expire === void 0) { expire = 100; }
  123048. if (minDuration === void 0) { minDuration = 0; }
  123049. if (this.isEnabled) {
  123050. this.plt.cancelTimeout(this._tmr);
  123051. if (shouldShow) {
  123052. // remember when we started the click block
  123053. this._start = Date.now();
  123054. // figure out the minimum time it should be showing until
  123055. // this is useful for transitions that are less than 300ms
  123056. this._minEnd = this._start + (minDuration || 0);
  123057. this._activate(true);
  123058. }
  123059. this._tmr = this.plt.timeout(this._activate.bind(this, false), expire);
  123060. }
  123061. };
  123062. /** @internal */
  123063. ClickBlock.prototype._activate = function (shouldShow) {
  123064. if (this._showing !== shouldShow) {
  123065. if (!shouldShow) {
  123066. // check if it was enabled before the minimum duration
  123067. // this is useful for transitions that are less than 300ms
  123068. var now = Date.now();
  123069. if (now < this._minEnd) {
  123070. this._tmr = this.plt.timeout(this._activate.bind(this, false), this._minEnd - now);
  123071. return;
  123072. }
  123073. }
  123074. this._setElementClass('click-block-active', shouldShow);
  123075. this._showing = shouldShow;
  123076. }
  123077. };
  123078. ClickBlock.prototype._setElementClass = function (className, add) {
  123079. this.renderer.setElementClass(this.elementRef.nativeElement, className, add);
  123080. };
  123081. ClickBlock.decorators = [
  123082. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["s" /* Directive */], args: [{
  123083. selector: '.click-block'
  123084. },] },
  123085. ];
  123086. /** @nocollapse */
  123087. ClickBlock.ctorParameters = function () { return [
  123088. { type: __WEBPACK_IMPORTED_MODULE_1__app_app__["a" /* App */], decorators: [{ type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["z" /* Inject */], args: [Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_14" /* forwardRef */])(function () { return __WEBPACK_IMPORTED_MODULE_1__app_app__["a" /* App */]; }),] },] },
  123089. { type: __WEBPACK_IMPORTED_MODULE_2__config_config__["a" /* Config */], },
  123090. { type: __WEBPACK_IMPORTED_MODULE_3__platform_platform__["a" /* Platform */], },
  123091. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["t" /* ElementRef */], },
  123092. { type: __WEBPACK_IMPORTED_MODULE_0__angular_core__["V" /* Renderer */], },
  123093. ]; };
  123094. return ClickBlock;
  123095. }());
  123096. //# sourceMappingURL=click-block.js.map
  123097. /***/ }),
  123098. /* 271 */
  123099. /***/ (function(module, exports, __webpack_require__) {
  123100. "use strict";
  123101. var FromEventObservable_1 = __webpack_require__(272);
  123102. exports.fromEvent = FromEventObservable_1.FromEventObservable.create;
  123103. //# sourceMappingURL=fromEvent.js.map
  123104. /***/ }),
  123105. /* 272 */
  123106. /***/ (function(module, exports, __webpack_require__) {
  123107. "use strict";
  123108. var __extends = (this && this.__extends) || function (d, b) {
  123109. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  123110. function __() { this.constructor = d; }
  123111. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  123112. };
  123113. var Observable_1 = __webpack_require__(9);
  123114. var tryCatch_1 = __webpack_require__(106);
  123115. var isFunction_1 = __webpack_require__(50);
  123116. var errorObject_1 = __webpack_require__(51);
  123117. var Subscription_1 = __webpack_require__(30);
  123118. var toString = Object.prototype.toString;
  123119. function isNodeStyleEventEmitter(sourceObj) {
  123120. return !!sourceObj && typeof sourceObj.addListener === 'function' && typeof sourceObj.removeListener === 'function';
  123121. }
  123122. function isJQueryStyleEventEmitter(sourceObj) {
  123123. return !!sourceObj && typeof sourceObj.on === 'function' && typeof sourceObj.off === 'function';
  123124. }
  123125. function isNodeList(sourceObj) {
  123126. return !!sourceObj && toString.call(sourceObj) === '[object NodeList]';
  123127. }
  123128. function isHTMLCollection(sourceObj) {
  123129. return !!sourceObj && toString.call(sourceObj) === '[object HTMLCollection]';
  123130. }
  123131. function isEventTarget(sourceObj) {
  123132. return !!sourceObj && typeof sourceObj.addEventListener === 'function' && typeof sourceObj.removeEventListener === 'function';
  123133. }
  123134. /**
  123135. * We need this JSDoc comment for affecting ESDoc.
  123136. * @extends {Ignored}
  123137. * @hide true
  123138. */
  123139. var FromEventObservable = (function (_super) {
  123140. __extends(FromEventObservable, _super);
  123141. function FromEventObservable(sourceObj, eventName, selector, options) {
  123142. _super.call(this);
  123143. this.sourceObj = sourceObj;
  123144. this.eventName = eventName;
  123145. this.selector = selector;
  123146. this.options = options;
  123147. }
  123148. /* tslint:enable:max-line-length */
  123149. /**
  123150. * Creates an Observable that emits events of a specific type coming from the
  123151. * given event target.
  123152. *
  123153. * <span class="informal">Creates an Observable from DOM events, or Node.js
  123154. * EventEmitter events or others.</span>
  123155. *
  123156. * <img src="./img/fromEvent.png" width="100%">
  123157. *
  123158. * `fromEvent` accepts as a first argument event target, which is an object with methods
  123159. * for registering event handler functions. As a second argument it takes string that indicates
  123160. * type of event we want to listen for. `fromEvent` supports selected types of event targets,
  123161. * which are described in detail below. If your event target does not match any of the ones listed,
  123162. * you should use {@link fromEventPattern}, which can be used on arbitrary APIs.
  123163. * When it comes to APIs supported by `fromEvent`, their methods for adding and removing event
  123164. * handler functions have different names, but they all accept a string describing event type
  123165. * and function itself, which will be called whenever said event happens.
  123166. *
  123167. * Every time resulting Observable is subscribed, event handler function will be registered
  123168. * to event target on given event type. When that event fires, value
  123169. * passed as a first argument to registered function will be emitted by output Observable.
  123170. * When Observable is unsubscribed, function will be unregistered from event target.
  123171. *
  123172. * Note that if event target calls registered function with more than one argument, second
  123173. * and following arguments will not appear in resulting stream. In order to get access to them,
  123174. * you can pass to `fromEvent` optional project function, which will be called with all arguments
  123175. * passed to event handler. Output Observable will then emit value returned by project function,
  123176. * instead of the usual value.
  123177. *
  123178. * Remember that event targets listed below are checked via duck typing. It means that
  123179. * no matter what kind of object you have and no matter what environment you work in,
  123180. * you can safely use `fromEvent` on that object if it exposes described methods (provided
  123181. * of course they behave as was described above). So for example if Node.js library exposes
  123182. * event target which has the same method names as DOM EventTarget, `fromEvent` is still
  123183. * a good choice.
  123184. *
  123185. * If the API you use is more callback then event handler oriented (subscribed
  123186. * callback function fires only once and thus there is no need to manually
  123187. * unregister it), you should use {@link bindCallback} or {@link bindNodeCallback}
  123188. * instead.
  123189. *
  123190. * `fromEvent` supports following types of event targets:
  123191. *
  123192. * **DOM EventTarget**
  123193. *
  123194. * This is an object with `addEventListener` and `removeEventListener` methods.
  123195. *
  123196. * In the browser, `addEventListener` accepts - apart from event type string and event
  123197. * handler function arguments - optional third parameter, which is either an object or boolean,
  123198. * both used for additional configuration how and when passed function will be called. When
  123199. * `fromEvent` is used with event target of that type, you can provide this values
  123200. * as third parameter as well.
  123201. *
  123202. * **Node.js EventEmitter**
  123203. *
  123204. * An object with `addListener` and `removeListener` methods.
  123205. *
  123206. * **JQuery-style event target**
  123207. *
  123208. * An object with `on` and `off` methods
  123209. *
  123210. * **DOM NodeList**
  123211. *
  123212. * List of DOM Nodes, returned for example by `document.querySelectorAll` or `Node.childNodes`.
  123213. *
  123214. * Although this collection is not event target in itself, `fromEvent` will iterate over all Nodes
  123215. * it contains and install event handler function in every of them. When returned Observable
  123216. * is unsubscribed, function will be removed from all Nodes.
  123217. *
  123218. * **DOM HtmlCollection**
  123219. *
  123220. * Just as in case of NodeList it is a collection of DOM nodes. Here as well event handler function is
  123221. * installed and removed in each of elements.
  123222. *
  123223. *
  123224. * @example <caption>Emits clicks happening on the DOM document</caption>
  123225. * var clicks = Rx.Observable.fromEvent(document, 'click');
  123226. * clicks.subscribe(x => console.log(x));
  123227. *
  123228. * // Results in:
  123229. * // MouseEvent object logged to console every time a click
  123230. * // occurs on the document.
  123231. *
  123232. *
  123233. * @example <caption>Use addEventListener with capture option</caption>
  123234. * var clicksInDocument = Rx.Observable.fromEvent(document, 'click', true); // note optional configuration parameter
  123235. * // which will be passed to addEventListener
  123236. * var clicksInDiv = Rx.Observable.fromEvent(someDivInDocument, 'click');
  123237. *
  123238. * clicksInDocument.subscribe(() => console.log('document'));
  123239. * clicksInDiv.subscribe(() => console.log('div'));
  123240. *
  123241. * // By default events bubble UP in DOM tree, so normally
  123242. * // when we would click on div in document
  123243. * // "div" would be logged first and then "document".
  123244. * // Since we specified optional `capture` option, document
  123245. * // will catch event when it goes DOWN DOM tree, so console
  123246. * // will log "document" and then "div".
  123247. *
  123248. * @see {@link bindCallback}
  123249. * @see {@link bindNodeCallback}
  123250. * @see {@link fromEventPattern}
  123251. *
  123252. * @param {EventTargetLike} target The DOM EventTarget, Node.js
  123253. * EventEmitter, JQuery-like event target, NodeList or HTMLCollection to attach the event handler to.
  123254. * @param {string} eventName The event name of interest, being emitted by the
  123255. * `target`.
  123256. * @param {EventListenerOptions} [options] Options to pass through to addEventListener
  123257. * @param {SelectorMethodSignature<T>} [selector] An optional function to
  123258. * post-process results. It takes the arguments from the event handler and
  123259. * should return a single value.
  123260. * @return {Observable<T>}
  123261. * @static true
  123262. * @name fromEvent
  123263. * @owner Observable
  123264. */
  123265. FromEventObservable.create = function (target, eventName, options, selector) {
  123266. if (isFunction_1.isFunction(options)) {
  123267. selector = options;
  123268. options = undefined;
  123269. }
  123270. return new FromEventObservable(target, eventName, selector, options);
  123271. };
  123272. FromEventObservable.setupSubscription = function (sourceObj, eventName, handler, subscriber, options) {
  123273. var unsubscribe;
  123274. if (isNodeList(sourceObj) || isHTMLCollection(sourceObj)) {
  123275. for (var i = 0, len = sourceObj.length; i < len; i++) {
  123276. FromEventObservable.setupSubscription(sourceObj[i], eventName, handler, subscriber, options);
  123277. }
  123278. }
  123279. else if (isEventTarget(sourceObj)) {
  123280. var source_1 = sourceObj;
  123281. sourceObj.addEventListener(eventName, handler, options);
  123282. unsubscribe = function () { return source_1.removeEventListener(eventName, handler, options); };
  123283. }
  123284. else if (isJQueryStyleEventEmitter(sourceObj)) {
  123285. var source_2 = sourceObj;
  123286. sourceObj.on(eventName, handler);
  123287. unsubscribe = function () { return source_2.off(eventName, handler); };
  123288. }
  123289. else if (isNodeStyleEventEmitter(sourceObj)) {
  123290. var source_3 = sourceObj;
  123291. sourceObj.addListener(eventName, handler);
  123292. unsubscribe = function () { return source_3.removeListener(eventName, handler); };
  123293. }
  123294. else {
  123295. throw new TypeError('Invalid event target');
  123296. }
  123297. subscriber.add(new Subscription_1.Subscription(unsubscribe));
  123298. };
  123299. /** @deprecated internal use only */ FromEventObservable.prototype._subscribe = function (subscriber) {
  123300. var sourceObj = this.sourceObj;
  123301. var eventName = this.eventName;
  123302. var options = this.options;
  123303. var selector = this.selector;
  123304. var handler = selector ? function () {
  123305. var args = [];
  123306. for (var _i = 0; _i < arguments.length; _i++) {
  123307. args[_i - 0] = arguments[_i];
  123308. }
  123309. var result = tryCatch_1.tryCatch(selector).apply(void 0, args);
  123310. if (result === errorObject_1.errorObject) {
  123311. subscriber.error(errorObject_1.errorObject.e);
  123312. }
  123313. else {
  123314. subscriber.next(result);
  123315. }
  123316. } : function (e) { return subscriber.next(e); };
  123317. FromEventObservable.setupSubscription(sourceObj, eventName, handler, subscriber, options);
  123318. };
  123319. return FromEventObservable;
  123320. }(Observable_1.Observable));
  123321. exports.FromEventObservable = FromEventObservable;
  123322. //# sourceMappingURL=FromEventObservable.js.map
  123323. /***/ }),
  123324. /* 273 */
  123325. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123326. "use strict";
  123327. /* harmony export (immutable) */ __webpack_exports__["a"] = checkReady;
  123328. function checkReady() {
  123329. var DEVICE_READY_TIMEOUT = 5000;
  123330. // To help developers using cordova, we listen for the device ready event and
  123331. // log an error if it didn't fire in a reasonable amount of time. Generally,
  123332. // when this happens, developers should remove and reinstall plugins, since
  123333. // an inconsistent plugin is often the culprit.
  123334. var before = Date.now();
  123335. var didFireReady = false;
  123336. document.addEventListener('deviceready', function () {
  123337. console.log("Ionic Native: deviceready event fired after " + (Date.now() - before) + " ms");
  123338. didFireReady = true;
  123339. });
  123340. setTimeout(function () {
  123341. if (!didFireReady && !!window.cordova) {
  123342. console.warn("Ionic Native: deviceready did not fire within " + DEVICE_READY_TIMEOUT + "ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.");
  123343. }
  123344. }, DEVICE_READY_TIMEOUT);
  123345. }
  123346. //# sourceMappingURL=bootstrap.js.map
  123347. /***/ }),
  123348. /* 274 */
  123349. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123350. "use strict";
  123351. /* unused harmony export InstanceCheck */
  123352. /* unused harmony export CordovaCheck */
  123353. /* harmony export (immutable) */ __webpack_exports__["c"] = Plugin;
  123354. /* harmony export (immutable) */ __webpack_exports__["a"] = Cordova;
  123355. /* unused harmony export CordovaInstance */
  123356. /* harmony export (immutable) */ __webpack_exports__["b"] = CordovaProperty;
  123357. /* unused harmony export InstanceProperty */
  123358. /* unused harmony export CordovaFunctionOverride */
  123359. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_rxjs_observable_throw__ = __webpack_require__(275);
  123360. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_rxjs_observable_throw___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_rxjs_observable_throw__);
  123361. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__ = __webpack_require__(9);
  123362. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__);
  123363. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__plugin__ = __webpack_require__(201);
  123364. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(98);
  123365. /**
  123366. * @private
  123367. */
  123368. function InstanceCheck(opts) {
  123369. if (opts === void 0) { opts = {}; }
  123370. return function (pluginObj, methodName, descriptor) {
  123371. return {
  123372. value: function () {
  123373. var args = [];
  123374. for (var _i = 0; _i < arguments.length; _i++) {
  123375. args[_i] = arguments[_i];
  123376. }
  123377. if (Object(__WEBPACK_IMPORTED_MODULE_2__plugin__["b" /* instanceAvailability */])(this)) {
  123378. return descriptor.value.apply(this, args);
  123379. }
  123380. else {
  123381. if (opts.sync) {
  123382. return;
  123383. }
  123384. else if (opts.observable) {
  123385. return new __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__["Observable"](function () { });
  123386. }
  123387. return Object(__WEBPACK_IMPORTED_MODULE_3__util__["c" /* getPromise */])(function () { });
  123388. }
  123389. },
  123390. enumerable: true
  123391. };
  123392. };
  123393. }
  123394. /**
  123395. * Executes function only if plugin is available
  123396. * @private
  123397. */
  123398. function CordovaCheck(opts) {
  123399. if (opts === void 0) { opts = {}; }
  123400. return function (pluginObj, methodName, descriptor) {
  123401. return {
  123402. value: function () {
  123403. var args = [];
  123404. for (var _i = 0; _i < arguments.length; _i++) {
  123405. args[_i] = arguments[_i];
  123406. }
  123407. var check = Object(__WEBPACK_IMPORTED_MODULE_2__plugin__["a" /* checkAvailability */])(pluginObj);
  123408. if (check === true) {
  123409. return descriptor.value.apply(this, args);
  123410. }
  123411. else {
  123412. if (opts.sync) {
  123413. return null;
  123414. }
  123415. else if (opts.observable) {
  123416. return Object(__WEBPACK_IMPORTED_MODULE_0_rxjs_observable_throw__["_throw"])(new Error(check && check.error));
  123417. }
  123418. return Promise.reject(check && check.error);
  123419. }
  123420. },
  123421. enumerable: true
  123422. };
  123423. };
  123424. }
  123425. /**
  123426. * @private
  123427. *
  123428. * Class decorator specifying Plugin metadata. Required for all plugins.
  123429. *
  123430. * @usage
  123431. * ```typescript
  123432. * @Plugin({
  123433. * pluginName: 'MyPlugin',
  123434. * plugin: 'cordova-plugin-myplugin',
  123435. * pluginRef: 'window.myplugin'
  123436. * })
  123437. * export class MyPlugin {
  123438. *
  123439. * // Plugin wrappers, properties, and functions go here ...
  123440. *
  123441. * }
  123442. * ```
  123443. */
  123444. function Plugin(config) {
  123445. return function (cls) {
  123446. // Add these fields to the class
  123447. for (var prop in config) {
  123448. cls[prop] = config[prop];
  123449. }
  123450. cls['installed'] = function (printWarning) {
  123451. return !!Object(__WEBPACK_IMPORTED_MODULE_3__util__["b" /* getPlugin */])(config.pluginRef);
  123452. };
  123453. cls['getPlugin'] = function () {
  123454. return Object(__WEBPACK_IMPORTED_MODULE_3__util__["b" /* getPlugin */])(config.pluginRef);
  123455. };
  123456. cls['checkInstall'] = function () {
  123457. return Object(__WEBPACK_IMPORTED_MODULE_2__plugin__["a" /* checkAvailability */])(cls) === true;
  123458. };
  123459. cls['getPluginName'] = function () {
  123460. return config.pluginName;
  123461. };
  123462. cls['getPluginRef'] = function () {
  123463. return config.pluginRef;
  123464. };
  123465. cls['getPluginInstallName'] = function () {
  123466. return config.plugin;
  123467. };
  123468. cls['getPluginRepo'] = function () {
  123469. return config.repo;
  123470. };
  123471. cls['getSupportedPlatforms'] = function () {
  123472. return config.platforms;
  123473. };
  123474. return cls;
  123475. };
  123476. }
  123477. /**
  123478. * @private
  123479. *
  123480. * Wrap a stub function in a call to a Cordova plugin, checking if both Cordova
  123481. * and the required plugin are installed.
  123482. */
  123483. function Cordova(opts) {
  123484. if (opts === void 0) { opts = {}; }
  123485. return function (target, methodName, descriptor) {
  123486. return {
  123487. value: function () {
  123488. var args = [];
  123489. for (var _i = 0; _i < arguments.length; _i++) {
  123490. args[_i] = arguments[_i];
  123491. }
  123492. return Object(__WEBPACK_IMPORTED_MODULE_2__plugin__["d" /* wrap */])(this, methodName, opts).apply(this, args);
  123493. },
  123494. enumerable: true
  123495. };
  123496. };
  123497. }
  123498. /**
  123499. * @private
  123500. *
  123501. * Wrap an instance method
  123502. */
  123503. function CordovaInstance(opts) {
  123504. if (opts === void 0) { opts = {}; }
  123505. return function (target, methodName) {
  123506. return {
  123507. value: function () {
  123508. var args = [];
  123509. for (var _i = 0; _i < arguments.length; _i++) {
  123510. args[_i] = arguments[_i];
  123511. }
  123512. return Object(__WEBPACK_IMPORTED_MODULE_2__plugin__["e" /* wrapInstance */])(this, methodName, opts).apply(this, args);
  123513. },
  123514. enumerable: true
  123515. };
  123516. };
  123517. }
  123518. /**
  123519. * @private
  123520. *
  123521. *
  123522. * Before calling the original method, ensure Cordova and the plugin are installed.
  123523. */
  123524. function CordovaProperty(target, key) {
  123525. Object.defineProperty(target, key, {
  123526. enumerable: true,
  123527. get: function () {
  123528. if (Object(__WEBPACK_IMPORTED_MODULE_2__plugin__["a" /* checkAvailability */])(target, key) === true) {
  123529. return Object(__WEBPACK_IMPORTED_MODULE_3__util__["b" /* getPlugin */])(target.constructor.getPluginRef())[key];
  123530. }
  123531. else {
  123532. return null;
  123533. }
  123534. },
  123535. set: function (value) {
  123536. if (Object(__WEBPACK_IMPORTED_MODULE_2__plugin__["a" /* checkAvailability */])(target, key) === true) {
  123537. Object(__WEBPACK_IMPORTED_MODULE_3__util__["b" /* getPlugin */])(target.constructor.getPluginRef())[key] = value;
  123538. }
  123539. }
  123540. });
  123541. }
  123542. /**
  123543. * @private
  123544. * @param target
  123545. * @param key
  123546. * @constructor
  123547. */
  123548. function InstanceProperty(target, key) {
  123549. Object.defineProperty(target, key, {
  123550. enumerable: true,
  123551. get: function () {
  123552. return this._objectInstance[key];
  123553. },
  123554. set: function (value) {
  123555. this._objectInstance[key] = value;
  123556. }
  123557. });
  123558. }
  123559. /**
  123560. * @private
  123561. *
  123562. * Wrap a stub function in a call to a Cordova plugin, checking if both Cordova
  123563. * and the required plugin are installed.
  123564. */
  123565. function CordovaFunctionOverride(opts) {
  123566. if (opts === void 0) { opts = {}; }
  123567. return function (target, methodName, descriptor) {
  123568. return {
  123569. value: function () {
  123570. var args = [];
  123571. for (var _i = 0; _i < arguments.length; _i++) {
  123572. args[_i] = arguments[_i];
  123573. }
  123574. return Object(__WEBPACK_IMPORTED_MODULE_2__plugin__["c" /* overrideFunction */])(this, methodName, opts);
  123575. },
  123576. enumerable: true
  123577. };
  123578. };
  123579. }
  123580. //# sourceMappingURL=decorators.js.map
  123581. /***/ }),
  123582. /* 275 */
  123583. /***/ (function(module, exports, __webpack_require__) {
  123584. "use strict";
  123585. var ErrorObservable_1 = __webpack_require__(276);
  123586. exports._throw = ErrorObservable_1.ErrorObservable.create;
  123587. //# sourceMappingURL=throw.js.map
  123588. /***/ }),
  123589. /* 276 */
  123590. /***/ (function(module, exports, __webpack_require__) {
  123591. "use strict";
  123592. var __extends = (this && this.__extends) || function (d, b) {
  123593. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  123594. function __() { this.constructor = d; }
  123595. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  123596. };
  123597. var Observable_1 = __webpack_require__(9);
  123598. /**
  123599. * We need this JSDoc comment for affecting ESDoc.
  123600. * @extends {Ignored}
  123601. * @hide true
  123602. */
  123603. var ErrorObservable = (function (_super) {
  123604. __extends(ErrorObservable, _super);
  123605. function ErrorObservable(error, scheduler) {
  123606. _super.call(this);
  123607. this.error = error;
  123608. this.scheduler = scheduler;
  123609. }
  123610. /**
  123611. * Creates an Observable that emits no items to the Observer and immediately
  123612. * emits an error notification.
  123613. *
  123614. * <span class="informal">Just emits 'error', and nothing else.
  123615. * </span>
  123616. *
  123617. * <img src="./img/throw.png" width="100%">
  123618. *
  123619. * This static operator is useful for creating a simple Observable that only
  123620. * emits the error notification. It can be used for composing with other
  123621. * Observables, such as in a {@link mergeMap}.
  123622. *
  123623. * @example <caption>Emit the number 7, then emit an error.</caption>
  123624. * var result = Rx.Observable.throw(new Error('oops!')).startWith(7);
  123625. * result.subscribe(x => console.log(x), e => console.error(e));
  123626. *
  123627. * @example <caption>Map and flatten numbers to the sequence 'a', 'b', 'c', but throw an error for 13</caption>
  123628. * var interval = Rx.Observable.interval(1000);
  123629. * var result = interval.mergeMap(x =>
  123630. * x === 13 ?
  123631. * Rx.Observable.throw('Thirteens are bad') :
  123632. * Rx.Observable.of('a', 'b', 'c')
  123633. * );
  123634. * result.subscribe(x => console.log(x), e => console.error(e));
  123635. *
  123636. * @see {@link create}
  123637. * @see {@link empty}
  123638. * @see {@link never}
  123639. * @see {@link of}
  123640. *
  123641. * @param {any} error The particular Error to pass to the error notification.
  123642. * @param {Scheduler} [scheduler] A {@link IScheduler} to use for scheduling
  123643. * the emission of the error notification.
  123644. * @return {Observable} An error Observable: emits only the error notification
  123645. * using the given error argument.
  123646. * @static true
  123647. * @name throw
  123648. * @owner Observable
  123649. */
  123650. ErrorObservable.create = function (error, scheduler) {
  123651. return new ErrorObservable(error, scheduler);
  123652. };
  123653. ErrorObservable.dispatch = function (arg) {
  123654. var error = arg.error, subscriber = arg.subscriber;
  123655. subscriber.error(error);
  123656. };
  123657. /** @deprecated internal use only */ ErrorObservable.prototype._subscribe = function (subscriber) {
  123658. var error = this.error;
  123659. var scheduler = this.scheduler;
  123660. subscriber.syncErrorThrowable = true;
  123661. if (scheduler) {
  123662. return scheduler.schedule(ErrorObservable.dispatch, 0, {
  123663. error: error, subscriber: subscriber
  123664. });
  123665. }
  123666. else {
  123667. subscriber.error(error);
  123668. }
  123669. };
  123670. return ErrorObservable;
  123671. }(Observable_1.Observable));
  123672. exports.ErrorObservable = ErrorObservable;
  123673. //# sourceMappingURL=ErrorObservable.js.map
  123674. /***/ }),
  123675. /* 277 */
  123676. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123677. "use strict";
  123678. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return IonicNativePlugin; });
  123679. var IonicNativePlugin = (function () {
  123680. function IonicNativePlugin() {
  123681. }
  123682. /**
  123683. * Returns a boolean that indicates whether the plugin is installed
  123684. * @return {boolean}
  123685. */
  123686. IonicNativePlugin.installed = function () {
  123687. return false;
  123688. };
  123689. /**
  123690. * Returns the original plugin object
  123691. */
  123692. IonicNativePlugin.getPlugin = function () { };
  123693. /**
  123694. * Returns the plugin's name
  123695. */
  123696. IonicNativePlugin.getPluginName = function () {
  123697. return;
  123698. };
  123699. /**
  123700. * Returns the plugin's reference
  123701. */
  123702. IonicNativePlugin.getPluginRef = function () {
  123703. return;
  123704. };
  123705. /**
  123706. * Returns the plugin's install name
  123707. */
  123708. IonicNativePlugin.getPluginInstallName = function () {
  123709. return;
  123710. };
  123711. /**
  123712. * Returns the plugin's supported platforms
  123713. */
  123714. IonicNativePlugin.getSupportedPlatforms = function () {
  123715. return;
  123716. };
  123717. return IonicNativePlugin;
  123718. }());
  123719. //# sourceMappingURL=ionic-native-plugin.js.map
  123720. /***/ })
  123721. /******/ ]);
  123722. //# sourceMappingURL=vendor.js.map